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
9488ea26
Commit
9488ea26
authored
Feb 19, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make generic type TPacket nullable
parent
f6ab87f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt
.../mirai/qqandroid/network/protocol/packet/PacketFactory.kt
+4
-4
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt
View file @
9488ea26
...
@@ -33,7 +33,7 @@ import kotlin.contracts.contract
...
@@ -33,7 +33,7 @@ import kotlin.contracts.contract
import
kotlin.jvm.JvmName
import
kotlin.jvm.JvmName
internal
sealed
class
PacketFactory
<
TPacket
:
Packet
>
{
internal
sealed
class
PacketFactory
<
TPacket
:
Packet
?
>
{
/**
/**
* 筛选从服务器接收到的包时的 commandName
* 筛选从服务器接收到的包时的 commandName
*/
*/
...
@@ -49,7 +49,7 @@ internal sealed class PacketFactory<TPacket : Packet> {
...
@@ -49,7 +49,7 @@ internal sealed class PacketFactory<TPacket : Packet> {
* @param TPacket 服务器回复包解析结果
* @param TPacket 服务器回复包解析结果
*/
*/
@UseExperimental
(
ExperimentalUnsignedTypes
::
class
)
@UseExperimental
(
ExperimentalUnsignedTypes
::
class
)
internal
abstract
class
OutgoingPacketFactory
<
TPacket
:
Packet
>(
internal
abstract
class
OutgoingPacketFactory
<
TPacket
:
Packet
?
>(
/**
/**
* 命令名. 如 `wtlogin.login`, `ConfigPushSvc.PushDomain`
* 命令名. 如 `wtlogin.login`, `ConfigPushSvc.PushDomain`
*/
*/
...
@@ -73,7 +73,7 @@ internal abstract class OutgoingPacketFactory<TPacket : Packet>(
...
@@ -73,7 +73,7 @@ internal abstract class OutgoingPacketFactory<TPacket : Packet>(
* 这个工厂可以在 [handle] 时回复一个 commandId 为 [responseCommandName] 的包, 也可以不回复.
* 这个工厂可以在 [handle] 时回复一个 commandId 为 [responseCommandName] 的包, 也可以不回复.
* 必须先到 [KnownPacketFactories] 中注册工厂, 否则不能处理.
* 必须先到 [KnownPacketFactories] 中注册工厂, 否则不能处理.
*/
*/
internal
abstract
class
IncomingPacketFactory
<
TPacket
:
Packet
>(
internal
abstract
class
IncomingPacketFactory
<
TPacket
:
Packet
?
>(
/**
/**
* 接收自服务器的包的 commandName
* 接收自服务器的包的 commandName
*/
*/
...
@@ -263,7 +263,7 @@ internal object KnownPacketFactories {
...
@@ -263,7 +263,7 @@ internal object KnownPacketFactories {
private
inline
fun
<
R
>
inline
(
block
:
()
->
R
):
R
=
block
()
private
inline
fun
<
R
>
inline
(
block
:
()
->
R
):
R
=
block
()
class
IncomingPacket
<
T
:
Packet
>(
class
IncomingPacket
<
T
:
Packet
?
>(
val
packetFactory
:
PacketFactory
<
T
>?,
val
packetFactory
:
PacketFactory
<
T
>?,
val
sequenceId
:
Int
,
val
sequenceId
:
Int
,
val
data
:
ByteReadPacket
,
val
data
:
ByteReadPacket
,
...
...
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