Update doc

This commit is contained in:
Him188 2019-10-16 12:38:37 +08:00
parent 10aa950b63
commit ac9a445abf
3 changed files with 7 additions and 1 deletions

View File

@ -118,7 +118,7 @@ fun ByteReadPacket.readMessageChain(): MessageChain {
}
fun MessageChain.toPacket(): ByteReadPacket = buildPacket {
this@toPacket.list.forEach { message ->
this@toPacket.forEach { message ->
writePacket(with(message) {
when (this) {
is Face -> buildPacket {

View File

@ -5,6 +5,9 @@ package net.mamoe.mirai.network.protocol.tim.packet
import net.mamoe.mirai.utils.hexToUBytes
/**
* 数据包
*/
abstract class Packet {
open val idHex: String by lazy {
this::class.annotations.filterIsInstance<PacketId>().firstOrNull()?.value?.trim() ?: ""

View File

@ -9,6 +9,9 @@ import kotlinx.io.core.readBytes
import net.mamoe.mirai.utils.*
/**
* 来自服务器的数据包
*/
abstract class ServerPacket(val input: ByteReadPacket) : Packet(), Closeable {
override var idHex: String = EMPTY_ID_HEX
get() {