Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
552d596c
Commit
552d596c
authored
Nov 08, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Override toString
parent
ad04b0ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/TIMBotNetworkHandler.kt
....mamoe.mirai/network/protocol/tim/TIMBotNetworkHandler.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/PacketId.kt
...n/net.mamoe.mirai/network/protocol/tim/packet/PacketId.kt
+5
-1
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/TIMBotNetworkHandler.kt
View file @
552d596c
...
@@ -296,7 +296,7 @@ internal class TIMBotNetworkHandler internal constructor(override inline val bot
...
@@ -296,7 +296,7 @@ internal class TIMBotNetworkHandler internal constructor(override inline val bot
it
::
class
.
annotations
.
filterIsInstance
<
NoLog
>().
any
()
it
::
class
.
annotations
.
filterIsInstance
<
NoLog
>().
any
()
}
}
}
?.
let
{
}
?.
let
{
bot
.
logger
.
verbose
(
"Packet sent: ${it
::class.simpleName ?: "
[
OutgoingPacket
]
"
}"
)
bot
.
logger
.
verbose
(
"Packet sent: ${it
.packetId
}"
)
}
}
PacketSentEvent
(
bot
,
packet
).
broadcast
()
PacketSentEvent
(
bot
,
packet
).
broadcast
()
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/PacketId.kt
View file @
552d596c
...
@@ -6,6 +6,7 @@ import net.mamoe.mirai.network.protocol.tim.packet.action.*
...
@@ -6,6 +6,7 @@ import net.mamoe.mirai.network.protocol.tim.packet.action.*
import
net.mamoe.mirai.network.protocol.tim.packet.event.EventPacketFactory
import
net.mamoe.mirai.network.protocol.tim.packet.event.EventPacketFactory
import
net.mamoe.mirai.network.protocol.tim.packet.event.FriendOnlineStatusChangedPacket
import
net.mamoe.mirai.network.protocol.tim.packet.event.FriendOnlineStatusChangedPacket
import
net.mamoe.mirai.network.protocol.tim.packet.login.*
import
net.mamoe.mirai.network.protocol.tim.packet.login.*
import
net.mamoe.mirai.utils.io.toUHexString
/**
/**
...
@@ -29,6 +30,7 @@ interface PacketId {
...
@@ -29,6 +30,7 @@ interface PacketId {
object
NullPacketId
:
PacketId
{
object
NullPacketId
:
PacketId
{
override
val
factory
:
PacketFactory
<
*
,
*
>
get
()
=
error
(
"uninitialized"
)
override
val
factory
:
PacketFactory
<
*
,
*
>
get
()
=
error
(
"uninitialized"
)
override
val
value
:
UShort
get
()
=
error
(
"uninitialized"
)
override
val
value
:
UShort
get
()
=
error
(
"uninitialized"
)
override
fun
toString
():
String
=
"NullPacketId"
}
}
/**
/**
...
@@ -36,6 +38,7 @@ object NullPacketId : PacketId {
...
@@ -36,6 +38,7 @@ object NullPacketId : PacketId {
*/
*/
inline
class
UnknownPacketId
(
override
inline
val
value
:
UShort
)
:
PacketId
{
inline
class
UnknownPacketId
(
override
inline
val
value
:
UShort
)
:
PacketId
{
override
val
factory
:
PacketFactory
<
*
,
*
>
get
()
=
UnknownPacketFactory
override
val
factory
:
PacketFactory
<
*
,
*
>
get
()
=
UnknownPacketFactory
override
fun
toString
():
String
=
"UnknownPacketId(${value.toUHexString()})"
}
}
object
IgnoredPacketIds
:
List
<
IgnoredPacketId
>
by
{
object
IgnoredPacketIds
:
List
<
IgnoredPacketId
>
by
{
...
@@ -45,6 +48,7 @@ object IgnoredPacketIds : List<IgnoredPacketId> by {
...
@@ -45,6 +48,7 @@ object IgnoredPacketIds : List<IgnoredPacketId> by {
inline
class
IgnoredPacketId
constructor
(
override
val
value
:
UShort
)
:
PacketId
{
inline
class
IgnoredPacketId
constructor
(
override
val
value
:
UShort
)
:
PacketId
{
override
val
factory
:
PacketFactory
<
*
,
*
>
get
()
=
IgnoredPacketFactory
override
val
factory
:
PacketFactory
<
*
,
*
>
get
()
=
IgnoredPacketFactory
override
fun
toString
():
String
=
"IgnoredPacketId(${value.toUHexString()})"
}
}
/**
/**
...
@@ -78,5 +82,5 @@ enum class KnownPacketId(override inline val value: UShort, override inline val
...
@@ -78,5 +82,5 @@ enum class KnownPacketId(override inline val value: UShort, override inline val
;
;
override
fun
toString
():
String
=
factory
.
let
{
it
::
class
.
simpleName
}
?:
this
.
name
override
fun
toString
():
String
=
factory
::
class
.
simpleName
?:
this
.
name
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment