Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
b33e8757
Commit
b33e8757
authored
Sep 08, 2019
by
Him188moe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moduled project
parent
3ad2b4d6
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
96 additions
and
13 deletions
+96
-13
mirai-api/pom.xml
mirai-api/pom.xml
+37
-0
mirai-console/pom.xml
mirai-console/pom.xml
+37
-0
mirai-core/src/main/java/net/mamoe/mirai/MiraiServer.java
mirai-core/src/main/java/net/mamoe/mirai/MiraiServer.java
+1
-7
mirai-core/src/main/java/net/mamoe/mirai/Robot.java
mirai-core/src/main/java/net/mamoe/mirai/Robot.java
+7
-1
mirai-core/src/main/java/net/mamoe/mirai/contact/Contact.kt
mirai-core/src/main/java/net/mamoe/mirai/contact/Contact.kt
+1
-2
mirai-core/src/main/java/net/mamoe/mirai/message/Message.kt
mirai-core/src/main/java/net/mamoe/mirai/message/Message.kt
+1
-1
mirai-core/src/main/java/net/mamoe/mirai/network/RobotNetworkHandler.kt
.../main/java/net/mamoe/mirai/network/RobotNetworkHandler.kt
+8
-1
mirai-core/src/main/java/net/mamoe/mirai/network/packet/ServerPacket.kt
.../main/java/net/mamoe/mirai/network/packet/ServerPacket.kt
+2
-1
pom.xml
pom.xml
+2
-0
No files found.
mirai-api/pom.xml
0 → 100644
View file @
b33e8757
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
net.mamoe
</groupId>
<artifactId>
mirai
</artifactId>
<version>
1.0
</version>
</parent>
<artifactId>
mirai-api
</artifactId>
<version>
1.0
</version>
<dependencies>
</dependencies>
<build>
<resources>
<resource>
<directory>
/src/main/resources
</directory>
<includes>
<include>
**/*.*
</include>
</includes>
</resource>
</resources>
<plugins>
</plugins>
</build>
</project>
\ No newline at end of file
mirai-console/pom.xml
0 → 100644
View file @
b33e8757
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
net.mamoe
</groupId>
<artifactId>
mirai
</artifactId>
<version>
1.0
</version>
</parent>
<artifactId>
mirai-console
</artifactId>
<version>
1.0
</version>
<dependencies>
</dependencies>
<build>
<resources>
<resource>
<directory>
/src/main/resources
</directory>
<includes>
<include>
**/*.*
</include>
</includes>
</resource>
</resources>
<plugins>
</plugins>
</build>
</project>
\ No newline at end of file
mirai-core/src/main/java/net/mamoe/mirai/MiraiServer.java
View file @
b33e8757
...
@@ -178,13 +178,7 @@ public class MiraiServer {
...
@@ -178,13 +178,7 @@ public class MiraiServer {
getLogger
().
info
(
"Initializing [Robot]s"
);
getLogger
().
info
(
"Initializing [Robot]s"
);
try
{
getAvailableRobot
();
}
catch
(
ExecutionException
|
InterruptedException
e
)
{
e
.
printStackTrace
();
}
/*
this
.
qqs
.
keySet
().
stream
().
map
(
key
->
this
.
qqs
.
getSection
(
key
)).
forEach
(
section
->
{
this
.
qqs
.
keySet
().
stream
().
map
(
key
->
this
.
qqs
.
getSection
(
key
)).
forEach
(
section
->
{
getLogger
().
info
(
"Initializing [Robot] "
+
section
.
getString
(
"account"
));
getLogger
().
info
(
"Initializing [Robot] "
+
section
.
getString
(
"account"
));
try
{
try
{
...
@@ -205,7 +199,7 @@ public class MiraiServer {
...
@@ -205,7 +199,7 @@ public class MiraiServer {
getLogger
().
error
(
"Could not load QQ robots config!"
);
getLogger
().
error
(
"Could not load QQ robots config!"
);
System
.
exit
(
1
);
System
.
exit
(
1
);
}
}
});
*/
});
}
}
...
...
mirai-core/src/main/java/net/mamoe/mirai/Robot.java
View file @
b33e8757
...
@@ -36,7 +36,6 @@ public final class Robot implements Closeable {
...
@@ -36,7 +36,6 @@ public final class Robot implements Closeable {
public
static
final
List
<
Robot
>
instances
=
Collections
.
synchronizedList
(
new
LinkedList
<>());
public
static
final
List
<
Robot
>
instances
=
Collections
.
synchronizedList
(
new
LinkedList
<>());
public
final
int
id
=
_id
.
getAndAdd
(
1
);
public
final
int
id
=
_id
.
getAndAdd
(
1
);
private
static
final
AtomicInteger
_id
=
new
AtomicInteger
(
0
);
public
final
RobotAccount
account
;
public
final
RobotAccount
account
;
...
@@ -118,5 +117,12 @@ public final class Robot implements Closeable {
...
@@ -118,5 +117,12 @@ public final class Robot implements Closeable {
this
.
contacts
.
qqs
.
clear
();
this
.
contacts
.
qqs
.
clear
();
}
}
public
void
addFriend
(
long
qq
)
{
}
/* PRIVATE */
private
static
final
AtomicInteger
_id
=
new
AtomicInteger
(
0
);
}
}
mirai-core/src/main/java/net/mamoe/mirai/contact/Contact.kt
View file @
b33e8757
...
@@ -11,8 +11,7 @@ import net.mamoe.mirai.message.defaults.PlainText
...
@@ -11,8 +11,7 @@ import net.mamoe.mirai.message.defaults.PlainText
* @param robot Owner [Robot]
* @param robot Owner [Robot]
* @author Him188moe
* @author Him188moe
*/
*/
abstract
class
Contact
(
val
robot
:
Robot
,
val
number
:
Long
)
{
abstract
class
Contact
internal
constructor
(
val
robot
:
Robot
,
val
number
:
Long
)
{
/**
/**
* Async
* Async
*/
*/
...
...
mirai-core/src/main/java/net/mamoe/mirai/message/Message.kt
View file @
b33e8757
...
@@ -15,7 +15,7 @@ import java.util.*
...
@@ -15,7 +15,7 @@ import java.util.*
* 可发送的或从服务器接收的消息.
* 可发送的或从服务器接收的消息.
* 采用这样的消息模式是因为 QQ 的消息多元化, 一条消息中可包含 [纯文本][PlainText], [图片][Image] 等.
* 采用这样的消息模式是因为 QQ 的消息多元化, 一条消息中可包含 [纯文本][PlainText], [图片][Image] 等.
*
*
* 在 Kotlin, 使用 [Message] 与使用 [String] 几乎没有什么用法上的区别
.
* 在 Kotlin, 使用 [Message] 与使用 [String] 几乎没有什么用法上的区别
, 除了
*
*
* @author Him188moe
* @author Him188moe
* @see Contact.sendMessage
* @see Contact.sendMessage
...
...
mirai-core/src/main/java/net/mamoe/mirai/network/RobotNetworkHandler.kt
View file @
b33e8757
...
@@ -508,7 +508,10 @@ class RobotNetworkHandler(private val robot: Robot) : Closeable {
...
@@ -508,7 +508,10 @@ class RobotNetworkHandler(private val robot: Robot) : Closeable {
//GroupMessageEvent(this.robot, robot.contacts.getGroupByNumber(packet.groupNumber), robot.contacts.getQQ(packet.qq), packet.message)
//GroupMessageEvent(this.robot, robot.contacts.getGroupByNumber(packet.groupNumber), robot.contacts.getQQ(packet.qq), packet.message)
}
}
is
UnknownServerEventPacket
,
is
UnknownServerEventPacket
->
{
//todo
}
is
ServerSendFriendMessageResponsePacket
,
is
ServerSendFriendMessageResponsePacket
,
is
ServerSendGroupMessageResponsePacket
->
{
is
ServerSendGroupMessageResponsePacket
->
{
//ignored
//ignored
...
@@ -546,6 +549,10 @@ class RobotNetworkHandler(private val robot: Robot) : Closeable {
...
@@ -546,6 +549,10 @@ class RobotNetworkHandler(private val robot: Robot) : Closeable {
}
}
fun
addFriend
(
qqNumber
:
Long
):
Unit
{
}
override
fun
close
()
{
override
fun
close
()
{
}
}
...
...
mirai-core/src/main/java/net/mamoe/mirai/network/packet/ServerPacket.kt
View file @
b33e8757
...
@@ -62,8 +62,9 @@ abstract class ServerPacket(val input: DataInputStream) : Packet {
...
@@ -62,8 +62,9 @@ abstract class ServerPacket(val input: DataInputStream) : Packet {
return
ServerLoginResponseSuccessPacket
.
Encrypted
(
stream
).
apply
{
this
.
idHex
=
idHex
}
return
ServerLoginResponseSuccessPacket
.
Encrypted
(
stream
).
apply
{
this
.
idHex
=
idHex
}
}
}
println
(
bytes
.
size
)
return
ServerLoginResponseFailedPacket
(
when
(
bytes
.
size
)
{
return
ServerLoginResponseFailedPacket
(
when
(
bytes
.
size
)
{
63
,
319
,
135
,
351
->
LoginState
.
WRONG_PASSWORD
63
,
319
,
135
,
351
->
LoginState
.
WRONG_PASSWORD
//这四个其中一个也是被冻结
//135 -> LoginState.RETYPE_PASSWORD
//135 -> LoginState.RETYPE_PASSWORD
279
->
LoginState
.
BLOCKED
279
->
LoginState
.
BLOCKED
263
->
LoginState
.
UNKNOWN_QQ_NUMBER
263
->
LoginState
.
UNKNOWN_QQ_NUMBER
...
...
pom.xml
View file @
b33e8757
...
@@ -13,6 +13,8 @@
...
@@ -13,6 +13,8 @@
<module>
mirai-core
</module>
<module>
mirai-core
</module>
<module>
mirai-native
</module>
<module>
mirai-native
</module>
<module>
mirai-ui
</module>
<module>
mirai-ui
</module>
<module>
mirai-console
</module>
<module>
mirai-api
</module>
</modules>
</modules>
<repositories>
<repositories>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment