mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-31 19:40:24 +08:00
Message receiver is working!
This commit is contained in:
parent
6350638e40
commit
c5b01fbf5f
@ -73,6 +73,9 @@ abstract class ServerPacket(val input: DataInputStream) : Packet {
|
|||||||
"08 28 04 34" -> ServerSessionKeyResponsePacketEncrypted(stream)
|
"08 28 04 34" -> ServerSessionKeyResponsePacketEncrypted(stream)
|
||||||
|
|
||||||
|
|
||||||
|
"00 81 EC 78" -> UnknownPacket(stream)
|
||||||
|
"00 81 AD 7A" -> UnknownPacket(stream)
|
||||||
|
|
||||||
else -> when (idHex.substring(0, 5)) {
|
else -> when (idHex.substring(0, 5)) {
|
||||||
"00 EC" -> ServerLoginSuccessPacket(stream)
|
"00 EC" -> ServerLoginSuccessPacket(stream)
|
||||||
"00 1D" -> ServerSKeyResponsePacketEncrypted(stream)
|
"00 1D" -> ServerSKeyResponsePacketEncrypted(stream)
|
||||||
@ -85,7 +88,6 @@ abstract class ServerPacket(val input: DataInputStream) : Packet {
|
|||||||
|
|
||||||
"00 CE", "00 17" -> ServerMessageEventPacketRawEncoded(stream, idHex.hexToBytes())
|
"00 CE", "00 17" -> ServerMessageEventPacketRawEncoded(stream, idHex.hexToBytes())
|
||||||
|
|
||||||
|
|
||||||
else -> throw IllegalArgumentException(idHex)
|
else -> throw IllegalArgumentException(idHex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
package net.mamoe.mirai.network.packet.server
|
||||||
|
|
||||||
|
import java.io.DataInputStream
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Him188moe
|
||||||
|
*/
|
||||||
|
class UnknownPacket(input: DataInputStream) : ServerPacket(input) {
|
||||||
|
override fun decode() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -67,9 +67,9 @@ class ServerMessageEventPacketRaw(
|
|||||||
|
|
||||||
"00 A6" -> ServerFriendMessageEventPacket(this.input, packetId, eventIdentity)
|
"00 A6" -> ServerFriendMessageEventPacket(this.input, packetId, eventIdentity)
|
||||||
|
|
||||||
"02 10" -> ServerUnknownEventPacket(this.input, packetId, eventIdentity)
|
//"02 10", "00 12" -> ServerUnknownEventPacket(this.input, packetId, eventIdentity)
|
||||||
|
|
||||||
else -> throw IllegalArgumentException(typeHex)
|
else -> ServerUnknownEventPacket(this.input, packetId, eventIdentity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,6 @@ class ServerGroupMessageEventPacket(input: DataInputStream, packetId: ByteArray,
|
|||||||
group = this.input.goto(51).readInt()
|
group = this.input.goto(51).readInt()
|
||||||
qq = this.input.goto(56).readInt()
|
qq = this.input.goto(56).readInt()
|
||||||
val fontLength = this.input.goto(108).readShort()
|
val fontLength = this.input.goto(108).readShort()
|
||||||
println(this.toString())
|
|
||||||
messageType = when (val id = this.input.goto(110 + fontLength + 2).readByte().toInt()) {
|
messageType = when (val id = this.input.goto(110 + fontLength + 2).readByte().toInt()) {
|
||||||
19 -> MessageType.NORMAL
|
19 -> MessageType.NORMAL
|
||||||
14 -> MessageType.XML
|
14 -> MessageType.XML
|
||||||
@ -130,8 +129,10 @@ class ServerGroupMessageEventPacket(input: DataInputStream, packetId: ByteArray,
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ServerFriendMessageEventPacket(input: DataInputStream, packetId: ByteArray, eventIdentity: ByteArray) : ServerEventPacket(input, packetId, eventIdentity) {
|
class ServerFriendMessageEventPacket(input: DataInputStream, packetId: ByteArray, eventIdentity: ByteArray) : ServerEventPacket(input, packetId, eventIdentity) {
|
||||||
|
var qq: Int = 0
|
||||||
|
lateinit var message: String
|
||||||
|
|
||||||
override fun decode() {
|
override fun decode() {
|
||||||
|
TODO("FRIEND 解析")
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user