mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-07 02:39:28 +08:00
Moduled project
This commit is contained in:
parent
3ad2b4d606
commit
b33e8757e5
37
mirai-api/pom.xml
Normal file
37
mirai-api/pom.xml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?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>
|
37
mirai-console/pom.xml
Normal file
37
mirai-console/pom.xml
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?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>
|
@ -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 {
|
|||||||
getLogger().error("Could not load QQ robots config!");
|
getLogger().error("Could not load QQ robots config!");
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
});*/
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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 {
|
|||||||
this.contacts.qqs.clear();
|
this.contacts.qqs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addFriend(long qq) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* PRIVATE */
|
||||||
|
|
||||||
|
private static final AtomicInteger _id = new AtomicInteger(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
||||||
|
@ -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 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun addFriend(qqNumber: Long): Unit {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
2
pom.xml
2
pom.xml
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user