mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 07:30:14 +08:00
Replace object IgnoredEventPacket
with inline class IgnoredEventPacket
to identify each packet
This commit is contained in:
parent
0662dc839f
commit
bab2fce71b
@ -5,7 +5,9 @@ package net.mamoe.mirai.network.protocol.tim.packet.event
|
|||||||
import kotlinx.io.core.ByteReadPacket
|
import kotlinx.io.core.ByteReadPacket
|
||||||
import net.mamoe.mirai.Bot
|
import net.mamoe.mirai.Bot
|
||||||
|
|
||||||
object IgnoredEventPacket : EventPacket
|
inline class IgnoredEventPacket(val id: UShort) : EventPacket {
|
||||||
|
override fun toString(): String = "IgnoredEventPacket(id=$id)"
|
||||||
|
}
|
||||||
|
|
||||||
object IgnoredEventIds : List<IgnoredEventParserAndHandler> by {
|
object IgnoredEventIds : List<IgnoredEventParserAndHandler> by {
|
||||||
listOf(
|
listOf(
|
||||||
@ -15,5 +17,5 @@ object IgnoredEventIds : List<IgnoredEventParserAndHandler> by {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
inline class IgnoredEventParserAndHandler(override val id: UShort) : EventParserAndHandler<IgnoredEventPacket> {
|
inline class IgnoredEventParserAndHandler(override val id: UShort) : EventParserAndHandler<IgnoredEventPacket> {
|
||||||
override suspend fun ByteReadPacket.parse(bot: Bot, identity: EventPacketIdentity): IgnoredEventPacket = IgnoredEventPacket
|
override suspend fun ByteReadPacket.parse(bot: Bot, identity: EventPacketIdentity): IgnoredEventPacket = IgnoredEventPacket(id)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user