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
6a294c0c
Commit
6a294c0c
authored
Nov 28, 2019
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make all the KnownEventParserAndHandlers internal
parent
b5efba29
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
45 additions
and
11 deletions
+45
-11
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/AndroidOnlineStatusChange.kt
...rk/protocol/tim/packet/event/AndroidOnlineStatusChange.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/ConnectionOccupiedEvent.kt
...work/protocol/tim/packet/event/ConnectionOccupiedEvent.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/EventPacketFactory.kt
...i/network/protocol/tim/packet/event/EventPacketFactory.kt
+2
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/FriendAddRequestEventPacket.kt
.../protocol/tim/packet/event/FriendAddRequestEventPacket.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/FriendConversationIniliaze.kt
...k/protocol/tim/packet/event/FriendConversationIniliaze.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/GroupFileUpload.kt
...irai/network/protocol/tim/packet/event/GroupFileUpload.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/MemberJoin.kt
...moe.mirai/network/protocol/tim/packet/event/MemberJoin.kt
+34
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/MemberKickEvent.kt
...irai/network/protocol/tim/packet/event/MemberKickEvent.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/MemberPermission.kt
...rai/network/protocol/tim/packet/event/MemberPermission.kt
+1
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/Message.kt
....mamoe.mirai/network/protocol/tim/packet/event/Message.kt
+2
-2
No files found.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/AndroidOnlineStatusChange.kt
View file @
6a294c0c
...
...
@@ -22,7 +22,7 @@ data class AndroidDeviceStatusChangePacket(val kind: Kind) : Packet {
* Android 客户端在线状态改变
*/
@PacketVersion
(
date
=
"2019.10.31"
,
timVersion
=
"2.3.2 (21173)"
)
object
AndroidDeviceOnlineStatusChangedEventFactory
:
KnownEventParserAndHandler
<
AndroidDeviceStatusChangePacket
>(
0
x00C4u
)
{
internal
object
AndroidDeviceOnlineStatusChangedEventFactory
:
KnownEventParserAndHandler
<
AndroidDeviceStatusChangePacket
>(
0
x00C4u
)
{
override
suspend
fun
ByteReadPacket
.
parse
(
bot
:
Bot
,
identity
:
EventPacketIdentity
):
AndroidDeviceStatusChangePacket
{
discardExact
(
13
)
return
AndroidDeviceStatusChangePacket
(
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/ConnectionOccupiedEvent.kt
View file @
6a294c0c
...
...
@@ -15,7 +15,7 @@ inline class ConnectionOccupiedEvent(val message: String) : EventPacket {
override
fun
toString
():
String
=
"ConnectionOccupiedEvent(${message.replace("
\
n
", "")})"
}
internal
object
ConnectionOccupiedPacket
Factory
:
KnownEventParserAndHandler
<
ConnectionOccupiedEvent
>(
0
x0030u
)
{
internal
object
ConnectionOccupiedPacket
Handler
:
KnownEventParserAndHandler
<
ConnectionOccupiedEvent
>(
0
x0030u
)
{
override
suspend
fun
ByteReadPacket
.
parse
(
bot
:
Bot
,
identity
:
EventPacketIdentity
):
ConnectionOccupiedEvent
{
discardExact
(
6
)
return
ConnectionOccupiedEvent
(
readBytes
((
remaining
-
8
).
toInt
()).
encodeToString
())
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/EventPacketFactory.kt
View file @
6a294c0c
...
...
@@ -96,6 +96,7 @@ abstract class KnownEventParserAndHandler<TPacket : Packet>(override val id: USh
FriendMessageEventParserAndHandler
,
FriendAddRequestEventPacket
,
MemberGoneEventPacketHandler
,
ConnectionOccupiedPacketFactory
ConnectionOccupiedPacketHandler
,
MemberJoinPacketHandler
)
}
\ No newline at end of file
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/FriendAddRequestEventPacket.kt
View file @
6a294c0c
...
...
@@ -37,7 +37,7 @@ data class ReceiveFriendAddRequestEvent(
}
@PacketVersion
(
date
=
"2019.11.20"
,
timVersion
=
"2.3.2 (21173)"
)
object
FriendAddRequestEventPacket
:
KnownEventParserAndHandler
<
ReceiveFriendAddRequestEvent
>(
0
x02DFu
)
{
internal
object
FriendAddRequestEventPacket
:
KnownEventParserAndHandler
<
ReceiveFriendAddRequestEvent
>(
0
x02DFu
)
{
override
suspend
fun
ByteReadPacket
.
parse
(
bot
:
Bot
,
identity
:
EventPacketIdentity
):
ReceiveFriendAddRequestEvent
=
bot
.
withSession
{
// 00 00 00 08 00 0A 00 04 01 00
// 00 00 00 01
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/FriendConversationIniliaze.kt
View file @
6a294c0c
...
...
@@ -14,7 +14,7 @@ data class FriendConversationInitialize(
)
:
EventPacket
@PacketVersion
(
date
=
"2019.11.2"
,
timVersion
=
"2.3.2 (21173)"
)
object
FriendConversationInitializedEventParserAndHandler
:
KnownEventParserAndHandler
<
FriendConversationInitialize
>(
0
x0079u
)
{
internal
object
FriendConversationInitializedEventParserAndHandler
:
KnownEventParserAndHandler
<
FriendConversationInitialize
>(
0
x0079u
)
{
override
suspend
fun
ByteReadPacket
.
parse
(
bot
:
Bot
,
identity
:
EventPacketIdentity
):
FriendConversationInitialize
{
discardExact
(
4
)
// 00 00 00 00
return
FriendConversationInitialize
(
readUInt
())
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/GroupFileUpload.kt
View file @
6a294c0c
...
...
@@ -11,7 +11,7 @@ import net.mamoe.mirai.utils.io.debugPrint
data class
GroupFileUploadPacket
(
inline
val
xmlMessage
:
String
)
:
EventPacket
@PacketVersion
(
date
=
"2019.7.1"
,
timVersion
=
"2.3.2 (21173)"
)
object
GroupFileUploadEventFactory
:
KnownEventParserAndHandler
<
GroupFileUploadPacket
>(
0
x002Du
)
{
internal
object
GroupFileUploadEventFactory
:
KnownEventParserAndHandler
<
GroupFileUploadPacket
>(
0
x002Du
)
{
override
suspend
fun
ByteReadPacket
.
parse
(
bot
:
Bot
,
identity
:
EventPacketIdentity
):
GroupFileUploadPacket
{
this
.
debugPrint
(
"GroupFileUploadPacket"
)
return
GroupFileUploadPacket
(
""
)
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/MemberJoin.kt
View file @
6a294c0c
@
file
:
Suppress
(
"EXPERIMENTAL_UNSIGNED_LITERALS"
)
package
net.mamoe.mirai.network.protocol.tim.packet.event
import
kotlinx.io.core.ByteReadPacket
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.contact.Member
import
net.mamoe.mirai.event.events.BotEvent
import
net.mamoe.mirai.network.BotNetworkHandler
import
net.mamoe.mirai.network.protocol.tim.packet.Packet
import
net.mamoe.mirai.utils.MiraiInternalAPI
//群有新成员加入
//事件 id 00 21
//
//00 00 00 08 00 0A 00 04 01 00 00 00 32 DC FC C8 01 2D 5C 53 A6 03 3E 03 3F A2 06 B4 B4 BD A8 D5 DF 00 30 42 34 37 31 30 36 43 30 44 44 34 41 34 44 30 35 30 39 44 45 31 32 30 42 43 35 45 34 44 38 45 42 37 30 36 39 31 45 36 44 45 36 44 39 46 37 36 30
\ No newline at end of file
//00 00 00 08 00 0A 00 04 01 00 00 00 32 DC FC C8 01 2D 5C 53 A6 03 3E 03 3F A2 06 B4 B4 BD A8 D5 DF 00 30 42 34 37 31 30 36 43 30 44 44 34 41 34 44 30 35 30 39 44 45 31 32 30 42 43 35 45 34 44 38 45 42 37 30 36 39 31 45 36 44 45 36 44 39 46 37 36 30
/**
* 新成员加入. 此时这个人还没被添加到群列表
*/
internal
class
MemberJoinEventPacket
(
val
member
:
Member
)
:
Packet
class
MemberJoinEvent
:
BotEvent
()
{
}
@UseExperimental
(
MiraiInternalAPI
::
class
)
internal
object
MemberJoinPacketHandler
:
KnownEventParserAndHandler
<
MemberJoinEventPacket
>(
0
x0021u
)
{
override
suspend
fun
ByteReadPacket
.
parse
(
bot
:
Bot
,
identity
:
EventPacketIdentity
):
MemberJoinEventPacket
{
TODO
()
}
override
suspend
fun
BotNetworkHandler
<*>.
handlePacket
(
packet
:
MemberJoinEventPacket
)
{
}
}
\ No newline at end of file
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/MemberKickEvent.kt
View file @
6a294c0c
...
...
@@ -48,7 +48,7 @@ data class BeingKickEvent(val group: Group, val operator: Member) : MemberListCh
/**
* 成员退出. 可能是被踢出也可能是主动退出
*/
object
MemberGoneEventPacketHandler
:
KnownEventParserAndHandler
<
MemberListChangedEvent
>(
0
x0022u
)
{
internal
object
MemberGoneEventPacketHandler
:
KnownEventParserAndHandler
<
MemberListChangedEvent
>(
0
x0022u
)
{
override
suspend
fun
ByteReadPacket
.
parse
(
bot
:
Bot
,
identity
:
EventPacketIdentity
):
MemberListChangedEvent
{
discardExact
(
11
)
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/MemberPermission.kt
View file @
6a294c0c
...
...
@@ -28,7 +28,7 @@ data class MemberPermissionChangePacket(
}
@PacketVersion
(
date
=
"2019.11.1"
,
timVersion
=
"2.3.2 (21173)"
)
object
GroupMemberPermissionChangedEventFactory
:
KnownEventParserAndHandler
<
MemberPermissionChangePacket
>(
0
x002Cu
)
{
internal
object
GroupMemberPermissionChangedEventFactory
:
KnownEventParserAndHandler
<
MemberPermissionChangePacket
>(
0
x002Cu
)
{
override
suspend
fun
ByteReadPacket
.
parse
(
bot
:
Bot
,
identity
:
EventPacketIdentity
):
MemberPermissionChangePacket
{
// 群里一个人变成管理员:
// 00 00 00 08 00 0A 00 04 01 00 00 00 22 96 29 7B 01 01 76 E4 B8 DD 01
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/event/Message.kt
View file @
6a294c0c
...
...
@@ -113,7 +113,7 @@ data class GroupMessage(
}
@PacketVersion
(
date
=
"2019.11.2"
,
timVersion
=
"2.3.2 (21173)"
)
object
GroupMessageEventParserAndHandler
:
KnownEventParserAndHandler
<
GroupMessage
>(
0
x0052u
)
{
internal
object
GroupMessageEventParserAndHandler
:
KnownEventParserAndHandler
<
GroupMessage
>(
0
x0052u
)
{
override
suspend
fun
ByteReadPacket
.
parse
(
bot
:
Bot
,
identity
:
EventPacketIdentity
):
GroupMessage
{
discardExact
(
31
)
val
groupNumber
=
readUInt
()
...
...
@@ -183,7 +183,7 @@ data class FriendMessage(
@Suppress
(
"unused"
)
@PacketVersion
(
date
=
"2019.11.2"
,
timVersion
=
"2.3.2 (21173)"
)
object
FriendMessageEventParserAndHandler
:
KnownEventParserAndHandler
<
FriendMessage
>(
0
x00A6u
)
{
internal
object
FriendMessageEventParserAndHandler
:
KnownEventParserAndHandler
<
FriendMessage
>(
0
x00A6u
)
{
override
suspend
fun
ByteReadPacket
.
parse
(
bot
:
Bot
,
identity
:
EventPacketIdentity
):
FriendMessage
{
discardExact
(
2
)
val
l1
=
readShort
()
...
...
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