mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-13 03:16:05 +08:00
Update doc
This commit is contained in:
parent
10aa950b63
commit
ac9a445abf
@ -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 {
|
||||
|
@ -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() ?: ""
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user