Run spotless
This commit is contained in:
1 parent
8c0369be69
commit
f5e18d8540
25 files changed
+115
-160
No files matched your search
@@ -8,7 +8,8 @@ enum class Arch {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun from(ordinal: Int): Arch {
|
fun from(ordinal: Int): Arch {
|
||||||
return entries.firstOrNull { it.ordinal == ordinal } ?: throw IllegalArgumentException("Unknown arch: $ordinal")
|
return entries.firstOrNull { it.ordinal == ordinal }
|
||||||
|
?: throw IllegalArgumentException("Unknown arch: $ordinal")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,8 @@ enum class Bitness {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun from(ordinal: Int): Bitness {
|
fun from(ordinal: Int): Bitness {
|
||||||
return entries.firstOrNull { it.ordinal == ordinal } ?: throw IllegalArgumentException("Unknown bitness: $ordinal")
|
return entries.firstOrNull { it.ordinal == ordinal }
|
||||||
|
?: throw IllegalArgumentException("Unknown bitness: $ordinal")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,5 +24,5 @@ enum class LoginState(val id: Int) {
|
|||||||
WRONG_CODE_2FA(33),
|
WRONG_CODE_2FA(33),
|
||||||
CLIENT_OUT_OF_DATE(34),
|
CLIENT_OUT_OF_DATE(34),
|
||||||
EXTRA_VALIDATION_FAILED(35),
|
EXTRA_VALIDATION_FAILED(35),
|
||||||
REQUIRE_QQ_FOR_ACCOUNT(36);
|
REQUIRE_QQ_FOR_ACCOUNT(36)
|
||||||
}
|
}
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
package de.fiereu.openmmo.protocols.game
|
package de.fiereu.openmmo.protocols.game
|
||||||
|
|
||||||
import de.fiereu.openmmo.protocols.Protocol
|
import de.fiereu.openmmo.protocols.Protocol
|
||||||
import de.fiereu.openmmo.protocols.incomingPacket
|
|
||||||
import de.fiereu.openmmo.protocols.outgoingPacket
|
|
||||||
import de.fiereu.openmmo.protocols.game.packets.JoinGamePacket
|
import de.fiereu.openmmo.protocols.game.packets.JoinGamePacket
|
||||||
import de.fiereu.openmmo.protocols.game.packets.JoinPacketDeserializer
|
import de.fiereu.openmmo.protocols.game.packets.JoinPacketDeserializer
|
||||||
import de.fiereu.openmmo.protocols.game.packets.JoinPacketSerializer
|
import de.fiereu.openmmo.protocols.game.packets.JoinPacketSerializer
|
||||||
|
import de.fiereu.openmmo.protocols.incomingPacket
|
||||||
|
import de.fiereu.openmmo.protocols.outgoingPacket
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Game Protocol implementation. This protocol handles in-game communication after the TLS handshake is
|
* Game Protocol implementation. This protocol handles in-game communication after the TLS handshake
|
||||||
* complete.
|
* is complete.
|
||||||
*/
|
*/
|
||||||
abstract class GameProtocol : Protocol() {
|
abstract class GameProtocol : Protocol() {
|
||||||
override val async: Boolean
|
override val async: Boolean
|
||||||
|
|||||||
+15
-19
@@ -9,28 +9,22 @@ import de.fiereu.openmmo.protocols.readUtf16LE
|
|||||||
import de.fiereu.openmmo.protocols.writeUtf16LE
|
import de.fiereu.openmmo.protocols.writeUtf16LE
|
||||||
import io.netty.buffer.ByteBuf
|
import io.netty.buffer.ByteBuf
|
||||||
|
|
||||||
data class RomInfo(
|
data class RomInfo(val code: String, val id: Byte, val type: Byte)
|
||||||
val code: String,
|
|
||||||
val id: Byte,
|
|
||||||
val type: Byte
|
|
||||||
)
|
|
||||||
|
|
||||||
abstract class GameAuthenticationData
|
abstract class GameAuthenticationData
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used when a player reconnects to the game server after a disconnection.
|
* Used when a player reconnects to the game server after a disconnection. This data typically
|
||||||
* This data typically includes the player's unique identifier and a session key
|
* includes the player's unique identifier and a session key that was issued by the login server to
|
||||||
* that was issued by the login server to re-establish the session.
|
* re-establish the session.
|
||||||
*/
|
*/
|
||||||
data class ReconnectAuthData(
|
data class ReconnectAuthData(val playerId: Long, val sessionKey: ByteArray) :
|
||||||
val playerId: Long,
|
GameAuthenticationData()
|
||||||
val sessionKey: ByteArray
|
|
||||||
) : GameAuthenticationData()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used when a player is joining the game server for the first time after logging in.
|
* Used when a player is joining the game server for the first time after logging in. This data
|
||||||
* This data typically includes the user's unique identifier and a session key
|
* typically includes the user's unique identifier and a session key that was issued by the login
|
||||||
* that was issued by the login server to authenticate the session.
|
* server to authenticate the session.
|
||||||
*/
|
*/
|
||||||
data class NewAuthData(
|
data class NewAuthData(
|
||||||
val userId: Int,
|
val userId: Int,
|
||||||
@@ -69,7 +63,9 @@ class JoinPacketSerializer : PacketSerializer<JoinGamePacket> {
|
|||||||
buffer.writeByte(packet.authData.sessionKey.size)
|
buffer.writeByte(packet.authData.sessionKey.size)
|
||||||
buffer.writeBytes(packet.authData.sessionKey)
|
buffer.writeBytes(packet.authData.sessionKey)
|
||||||
}
|
}
|
||||||
else -> throw IllegalArgumentException("Unsupported authentication data type: ${packet.authData::class.simpleName}")
|
else ->
|
||||||
|
throw IllegalArgumentException(
|
||||||
|
"Unsupported authentication data type: ${packet.authData::class.simpleName}")
|
||||||
}
|
}
|
||||||
buffer.writeBytes(packet.mac)
|
buffer.writeBytes(packet.mac)
|
||||||
buffer.writeIntLE(packet.clientRevision)
|
buffer.writeIntLE(packet.clientRevision)
|
||||||
@@ -104,7 +100,8 @@ class JoinPacketSerializer : PacketSerializer<JoinGamePacket> {
|
|||||||
class JoinPacketDeserializer : PacketDeserializer<JoinGamePacket> {
|
class JoinPacketDeserializer : PacketDeserializer<JoinGamePacket> {
|
||||||
override fun deserialize(buffer: ByteBuf): JoinGamePacket {
|
override fun deserialize(buffer: ByteBuf): JoinGamePacket {
|
||||||
val authOption = buffer.readByte()
|
val authOption = buffer.readByte()
|
||||||
val authenticationData = when (authOption) {
|
val authenticationData =
|
||||||
|
when (authOption) {
|
||||||
0x00.toByte() -> {
|
0x00.toByte() -> {
|
||||||
val userId = buffer.readIntLE()
|
val userId = buffer.readIntLE()
|
||||||
val sessionKeyLength = buffer.readUnsignedByte().toInt()
|
val sessionKeyLength = buffer.readUnsignedByte().toInt()
|
||||||
@@ -171,7 +168,6 @@ class JoinPacketDeserializer : PacketDeserializer<JoinGamePacket> {
|
|||||||
platform,
|
platform,
|
||||||
arch,
|
arch,
|
||||||
bitness,
|
bitness,
|
||||||
unk2
|
unk2)
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,45 +3,45 @@ package de.fiereu.openmmo.protocols.tls
|
|||||||
import de.fiereu.openmmo.protocols.Protocol
|
import de.fiereu.openmmo.protocols.Protocol
|
||||||
import de.fiereu.openmmo.protocols.incomingPacket
|
import de.fiereu.openmmo.protocols.incomingPacket
|
||||||
import de.fiereu.openmmo.protocols.outgoingPacket
|
import de.fiereu.openmmo.protocols.outgoingPacket
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.ExistingSessionPacket
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.GameServerListPacket
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.GameServerListPacketDeserializer
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.GameServerListPacketSerializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.GameServerNodesPacket
|
import de.fiereu.openmmo.protocols.tls.packets.GameServerNodesPacket
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.GameServerNodesPacketDeserializer
|
import de.fiereu.openmmo.protocols.tls.packets.GameServerNodesPacketDeserializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.GameServerNodesPacketSerializer
|
import de.fiereu.openmmo.protocols.tls.packets.GameServerNodesPacketSerializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.JoinGameServerPacket
|
import de.fiereu.openmmo.protocols.tls.packets.JoinGameServerPacket
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.JoinGameServerPacketDeserializer
|
import de.fiereu.openmmo.protocols.tls.packets.JoinGameServerPacketDeserializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.JoinGameServerPacketSerializer
|
import de.fiereu.openmmo.protocols.tls.packets.JoinGameServerPacketSerializer
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.LoginKickPacket
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.LoginKickPacketDeserializer
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.LoginKickPacketSerializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.LoginRequestPacket
|
import de.fiereu.openmmo.protocols.tls.packets.LoginRequestPacket
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.LoginRequestPacketDeserializer
|
import de.fiereu.openmmo.protocols.tls.packets.LoginRequestPacketDeserializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.LoginRequestPacketSerializer
|
import de.fiereu.openmmo.protocols.tls.packets.LoginRequestPacketSerializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.LoginResponsePacket
|
import de.fiereu.openmmo.protocols.tls.packets.LoginResponsePacket
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.LoginResponsePacketDeserializer
|
import de.fiereu.openmmo.protocols.tls.packets.LoginResponsePacketDeserializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.LoginResponsePacketSerializer
|
import de.fiereu.openmmo.protocols.tls.packets.LoginResponsePacketSerializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.RequestGameServerListPacket
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.RequestGameServerListPacketDeserializer
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.RequestGameServerListPacketSerializer
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.GameServerListPacket
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.GameServerListPacketDeserializer
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.GameServerListPacketSerializer
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.ToSConfirmationPacket
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.ToSConfirmationPacketDeserializer
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.ToSConfirmationPacketSerializer
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.LoginKickPacket
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.LoginKickPacketDeserializer
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.LoginKickPacketSerializer
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.SentCredentialsPacket
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.SentCredentialsPacketDeserializer
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.SentCredentialsPacketSerializer
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.MfaChallengePacket
|
import de.fiereu.openmmo.protocols.tls.packets.MfaChallengePacket
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.MfaChallengePacketDeserializer
|
import de.fiereu.openmmo.protocols.tls.packets.MfaChallengePacketDeserializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.MfaChallengePacketSerializer
|
import de.fiereu.openmmo.protocols.tls.packets.MfaChallengePacketSerializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.MfaResponsePacket
|
import de.fiereu.openmmo.protocols.tls.packets.MfaResponsePacket
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.MfaResponsePacketDeserializer
|
import de.fiereu.openmmo.protocols.tls.packets.MfaResponsePacketDeserializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.MfaResponsePacketSerializer
|
import de.fiereu.openmmo.protocols.tls.packets.MfaResponsePacketSerializer
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.RequestGameServerListPacket
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.RequestGameServerListPacketDeserializer
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.RequestGameServerListPacketSerializer
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.SentCredentialsPacket
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.SentCredentialsPacketDeserializer
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.SentCredentialsPacketSerializer
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.SentExistingSessionPacketDeserializer
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.SentExistingSessionPacketSerializer
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.ToSConfirmationPacket
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.ToSConfirmationPacketDeserializer
|
||||||
|
import de.fiereu.openmmo.protocols.tls.packets.ToSConfirmationPacketSerializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.ToSPacket
|
import de.fiereu.openmmo.protocols.tls.packets.ToSPacket
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.ToSPacketDeserializer
|
import de.fiereu.openmmo.protocols.tls.packets.ToSPacketDeserializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.ToSPacketSerializer
|
import de.fiereu.openmmo.protocols.tls.packets.ToSPacketSerializer
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.ExistingSessionPacket
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.SentExistingSessionPacketDeserializer
|
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.SentExistingSessionPacketSerializer
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Login Protocol implementation. This protocol handles the login process after the TLS handshake is
|
* Login Protocol implementation. This protocol handles the login process after the TLS handshake is
|
||||||
@@ -73,7 +73,8 @@ class LoginServerProtocol() : LoginProtocol() {
|
|||||||
class LoginClientProtocol() : LoginProtocol() {
|
class LoginClientProtocol() : LoginProtocol() {
|
||||||
init {
|
init {
|
||||||
incomingPacket(0x01u, LoginResponsePacketDeserializer())
|
incomingPacket(0x01u, LoginResponsePacketDeserializer())
|
||||||
outgoingPacket(0x02u, RequestGameServerListPacketSerializer(), RequestGameServerListPacket::class)
|
outgoingPacket(
|
||||||
|
0x02u, RequestGameServerListPacketSerializer(), RequestGameServerListPacket::class)
|
||||||
outgoingPacket(0x03u, JoinGameServerPacketSerializer(), JoinGameServerPacket::class)
|
outgoingPacket(0x03u, JoinGameServerPacketSerializer(), JoinGameServerPacket::class)
|
||||||
incomingPacket(0x03u, GameServerNodesPacketDeserializer())
|
incomingPacket(0x03u, GameServerNodesPacketDeserializer())
|
||||||
outgoingPacket(0x04u, ToSConfirmationPacketSerializer(), ToSConfirmationPacket::class)
|
outgoingPacket(0x04u, ToSConfirmationPacketSerializer(), ToSConfirmationPacket::class)
|
||||||
|
|||||||
+3
-3
@@ -4,10 +4,10 @@ import com.github.maltalex.ineter.base.IPv4Address
|
|||||||
import com.github.maltalex.ineter.base.IPv6Address
|
import com.github.maltalex.ineter.base.IPv6Address
|
||||||
import de.fiereu.openmmo.protocols.PacketDeserializer
|
import de.fiereu.openmmo.protocols.PacketDeserializer
|
||||||
import de.fiereu.openmmo.protocols.PacketSerializer
|
import de.fiereu.openmmo.protocols.PacketSerializer
|
||||||
import de.fiereu.openmmo.protocols.readUtf16LE
|
|
||||||
import de.fiereu.openmmo.protocols.writeUtf16LE
|
|
||||||
import de.fiereu.openmmo.protocols.writeIpLE
|
|
||||||
import de.fiereu.openmmo.protocols.readIpLE
|
import de.fiereu.openmmo.protocols.readIpLE
|
||||||
|
import de.fiereu.openmmo.protocols.readUtf16LE
|
||||||
|
import de.fiereu.openmmo.protocols.writeIpLE
|
||||||
|
import de.fiereu.openmmo.protocols.writeUtf16LE
|
||||||
import io.netty.buffer.ByteBuf
|
import io.netty.buffer.ByteBuf
|
||||||
|
|
||||||
data class ExistingSessionPacket(
|
data class ExistingSessionPacket(
|
||||||
|
|||||||
+1
-3
@@ -14,9 +14,7 @@ data class GameServer(
|
|||||||
val joinable: Boolean
|
val joinable: Boolean
|
||||||
)
|
)
|
||||||
|
|
||||||
data class GameServerListPacket(
|
data class GameServerListPacket(val gameServers: List<GameServer>)
|
||||||
val gameServers: List<GameServer>
|
|
||||||
)
|
|
||||||
|
|
||||||
class GameServerListPacketSerializer : PacketSerializer<GameServerListPacket> {
|
class GameServerListPacketSerializer : PacketSerializer<GameServerListPacket> {
|
||||||
override fun serialize(packet: GameServerListPacket, buffer: ByteBuf) {
|
override fun serialize(packet: GameServerListPacket, buffer: ByteBuf) {
|
||||||
|
|||||||
+7
-16
@@ -13,10 +13,9 @@ import de.fiereu.openmmo.protocols.writeUtf16LE
|
|||||||
import io.netty.buffer.ByteBuf
|
import io.netty.buffer.ByteBuf
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Nodes are address entries for game servers that the client can connect to.
|
* Nodes are address entries for game servers that the client can connect to. The nodes are selected
|
||||||
* The nodes are selected by a weighted random algorithm on the client side.
|
* by a weighted random algorithm on the client side. The weight is a value between 0 and 255, where
|
||||||
* The weight is a value between 0 and 255, where 0 means the node
|
* 0 means the node will never be selected and 255 means the node will always be selected.
|
||||||
* will never be selected and 255 means the node will always be selected.
|
|
||||||
* Typically, nodes are assigned weights based on their capacity or priority.
|
* Typically, nodes are assigned weights based on their capacity or priority.
|
||||||
*/
|
*/
|
||||||
data class GameServerNode(
|
data class GameServerNode(
|
||||||
@@ -48,7 +47,8 @@ class GameServerNodesPacketSerializer : PacketSerializer<GameServerNodesPacket>
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val gsd = requireNotNull(packet.gameServerData) { "GameServerData must be provided for AUTHED state" }
|
val gsd =
|
||||||
|
requireNotNull(packet.gameServerData) { "GameServerData must be provided for AUTHED state" }
|
||||||
|
|
||||||
buffer.writeIntLE(gsd.userId)
|
buffer.writeIntLE(gsd.userId)
|
||||||
buffer.writeByte(gsd.sessionToken.size)
|
buffer.writeByte(gsd.sessionToken.size)
|
||||||
@@ -116,16 +116,7 @@ class GameServerNodesPacketDeserializer : PacketDeserializer<GameServerNodesPack
|
|||||||
|
|
||||||
return GameServerNodesPacket(
|
return GameServerNodesPacket(
|
||||||
LoginState.AUTHED,
|
LoginState.AUTHED,
|
||||||
GameServerData(
|
GameServerData(gameServerId, userId, sessionToken, localAddress, localHostname, port),
|
||||||
gameServerId,
|
nodes)
|
||||||
userId,
|
|
||||||
sessionToken,
|
|
||||||
localAddress,
|
|
||||||
localHostname,
|
|
||||||
port
|
|
||||||
),
|
|
||||||
nodes
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+1
-3
@@ -4,9 +4,7 @@ import de.fiereu.openmmo.protocols.PacketDeserializer
|
|||||||
import de.fiereu.openmmo.protocols.PacketSerializer
|
import de.fiereu.openmmo.protocols.PacketSerializer
|
||||||
import io.netty.buffer.ByteBuf
|
import io.netty.buffer.ByteBuf
|
||||||
|
|
||||||
data class JoinGameServerPacket(
|
data class JoinGameServerPacket(val gameServerId: UByte)
|
||||||
val gameServerId: UByte
|
|
||||||
)
|
|
||||||
|
|
||||||
class JoinGameServerPacketSerializer : PacketSerializer<JoinGameServerPacket> {
|
class JoinGameServerPacketSerializer : PacketSerializer<JoinGameServerPacket> {
|
||||||
override fun serialize(packet: JoinGameServerPacket, buffer: ByteBuf) {
|
override fun serialize(packet: JoinGameServerPacket, buffer: ByteBuf) {
|
||||||
|
|||||||
+6
-7
@@ -3,10 +3,10 @@ package de.fiereu.openmmo.protocols.tls.packets
|
|||||||
import com.github.maltalex.ineter.base.IPv4Address
|
import com.github.maltalex.ineter.base.IPv4Address
|
||||||
import de.fiereu.openmmo.protocols.PacketDeserializer
|
import de.fiereu.openmmo.protocols.PacketDeserializer
|
||||||
import de.fiereu.openmmo.protocols.PacketSerializer
|
import de.fiereu.openmmo.protocols.PacketSerializer
|
||||||
import de.fiereu.openmmo.protocols.readUtf16LE
|
|
||||||
import de.fiereu.openmmo.protocols.writeUtf16LE
|
|
||||||
import de.fiereu.openmmo.protocols.writeIpRangeLE
|
|
||||||
import de.fiereu.openmmo.protocols.readIpRangeLE
|
import de.fiereu.openmmo.protocols.readIpRangeLE
|
||||||
|
import de.fiereu.openmmo.protocols.readUtf16LE
|
||||||
|
import de.fiereu.openmmo.protocols.writeIpRangeLE
|
||||||
|
import de.fiereu.openmmo.protocols.writeUtf16LE
|
||||||
import io.netty.buffer.ByteBuf
|
import io.netty.buffer.ByteBuf
|
||||||
|
|
||||||
// TODO needs proper investigation and implementation
|
// TODO needs proper investigation and implementation
|
||||||
@@ -17,9 +17,7 @@ enum class KickReason {
|
|||||||
C
|
C
|
||||||
}
|
}
|
||||||
|
|
||||||
data class LoginKickPacket(
|
data class LoginKickPacket(val reason: KickReason?)
|
||||||
val reason: KickReason?
|
|
||||||
)
|
|
||||||
|
|
||||||
class LoginKickPacketSerializer : PacketSerializer<LoginKickPacket> {
|
class LoginKickPacketSerializer : PacketSerializer<LoginKickPacket> {
|
||||||
override fun serialize(packet: LoginKickPacket, buffer: ByteBuf) {
|
override fun serialize(packet: LoginKickPacket, buffer: ByteBuf) {
|
||||||
@@ -68,7 +66,8 @@ class LoginKickPacketDeserializer : PacketDeserializer<LoginKickPacket> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val reasonOrdinal = buffer.readUnsignedByte().toInt()
|
val reasonOrdinal = buffer.readUnsignedByte().toInt()
|
||||||
val reason = KickReason.entries.getOrNull(reasonOrdinal)
|
val reason =
|
||||||
|
KickReason.entries.getOrNull(reasonOrdinal)
|
||||||
?: throw IllegalArgumentException("Unknown kick reason: $reasonOrdinal")
|
?: throw IllegalArgumentException("Unknown kick reason: $reasonOrdinal")
|
||||||
|
|
||||||
when (reason) {
|
when (reason) {
|
||||||
|
|||||||
+5
-6
@@ -8,10 +8,7 @@ import de.fiereu.openmmo.protocols.writeUtf16LE
|
|||||||
import io.netty.buffer.ByteBuf
|
import io.netty.buffer.ByteBuf
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
|
|
||||||
data class LoginResponsePacket(
|
data class LoginResponsePacket(val state: LoginState, val ratelimitEnd: LocalDateTime?) {
|
||||||
val state: LoginState,
|
|
||||||
val ratelimitEnd: LocalDateTime?
|
|
||||||
) {
|
|
||||||
constructor(state: LoginState) : this(state, null)
|
constructor(state: LoginState) : this(state, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,8 +16,10 @@ class LoginResponsePacketSerializer : PacketSerializer<LoginResponsePacket> {
|
|||||||
override fun serialize(packet: LoginResponsePacket, buffer: ByteBuf) {
|
override fun serialize(packet: LoginResponsePacket, buffer: ByteBuf) {
|
||||||
buffer.writeByte(packet.state.id)
|
buffer.writeByte(packet.state.id)
|
||||||
if (packet.state == LoginState.RATE_LIMITED || packet.state == LoginState.RATE_LIMITED_2FA) {
|
if (packet.state == LoginState.RATE_LIMITED || packet.state == LoginState.RATE_LIMITED_2FA) {
|
||||||
val epochSeconds = packet.ratelimitEnd?.toEpochSecond(java.time.ZoneOffset.UTC)
|
val epochSeconds =
|
||||||
?: throw IllegalArgumentException("ratelimitEnd must be provided for RATE_LIMITED states")
|
packet.ratelimitEnd?.toEpochSecond(java.time.ZoneOffset.UTC)
|
||||||
|
?: throw IllegalArgumentException(
|
||||||
|
"ratelimitEnd must be provided for RATE_LIMITED states")
|
||||||
buffer.writeLongLE(epochSeconds)
|
buffer.writeLongLE(epochSeconds)
|
||||||
}
|
}
|
||||||
if (packet.state == LoginState.AUTHED) {
|
if (packet.state == LoginState.AUTHED) {
|
||||||
|
|||||||
+1
-4
@@ -6,10 +6,7 @@ import de.fiereu.openmmo.protocols.readUtf16LE
|
|||||||
import de.fiereu.openmmo.protocols.writeUtf16LE
|
import de.fiereu.openmmo.protocols.writeUtf16LE
|
||||||
import io.netty.buffer.ByteBuf
|
import io.netty.buffer.ByteBuf
|
||||||
|
|
||||||
data class MfaChallengePacket(
|
data class MfaChallengePacket(val unk: Byte, val email: String)
|
||||||
val unk: Byte,
|
|
||||||
val email: String
|
|
||||||
)
|
|
||||||
|
|
||||||
class MfaChallengePacketSerializer : PacketSerializer<MfaChallengePacket> {
|
class MfaChallengePacketSerializer : PacketSerializer<MfaChallengePacket> {
|
||||||
override fun serialize(packet: MfaChallengePacket, buffer: ByteBuf) {
|
override fun serialize(packet: MfaChallengePacket, buffer: ByteBuf) {
|
||||||
|
|||||||
+1
-3
@@ -6,9 +6,7 @@ import de.fiereu.openmmo.protocols.readUtf16LE
|
|||||||
import de.fiereu.openmmo.protocols.writeUtf16LE
|
import de.fiereu.openmmo.protocols.writeUtf16LE
|
||||||
import io.netty.buffer.ByteBuf
|
import io.netty.buffer.ByteBuf
|
||||||
|
|
||||||
data class MfaResponsePacket(
|
data class MfaResponsePacket(val mfaCode: String)
|
||||||
val mfaCode: String
|
|
||||||
)
|
|
||||||
|
|
||||||
class MfaResponsePacketSerializer : PacketSerializer<MfaResponsePacket> {
|
class MfaResponsePacketSerializer : PacketSerializer<MfaResponsePacket> {
|
||||||
override fun serialize(packet: MfaResponsePacket, buffer: ByteBuf) {
|
override fun serialize(packet: MfaResponsePacket, buffer: ByteBuf) {
|
||||||
|
|||||||
+12
-13
@@ -8,27 +8,26 @@ import io.netty.buffer.ByteBuf
|
|||||||
import java.util.Base64
|
import java.util.Base64
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This packet is sent to the Client to give it the credentials for a user.
|
* This packet is sent to the Client to give it the credentials for a user. These credentials are
|
||||||
* These credentials are used so no password is stored on the User PC and the Client can
|
* used so no password is stored on the User PC and the Client can automatically log in the user
|
||||||
* automatically log in the user without asking for a password.
|
* without asking for a password.
|
||||||
*/
|
*/
|
||||||
data class SentCredentialsPacket(
|
data class SentCredentialsPacket(val username: String, val key: String) {
|
||||||
val username: String,
|
|
||||||
val key: String
|
|
||||||
) {
|
|
||||||
/**
|
/**
|
||||||
* Constructor for when a key is provided.
|
* Constructor for when a key is provided.
|
||||||
|
*
|
||||||
* @param username the username of the user whose credentials we want to send.
|
* @param username the username of the user whose credentials we want to send.
|
||||||
* @param keyBytes the key for the user as a byte array.
|
* @param keyBytes the key for the user as a byte array.
|
||||||
*/
|
*/
|
||||||
constructor(username: String, keyBytes: ByteArray?) : this(
|
constructor(
|
||||||
username,
|
username: String,
|
||||||
keyBytes?.let { Base64.getEncoder().encodeToString(it) } ?: ""
|
keyBytes: ByteArray?
|
||||||
)
|
) : this(username, keyBytes?.let { Base64.getEncoder().encodeToString(it) } ?: "")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for when no key is provided.
|
* Constructor for when no key is provided. The Client will remove the credentials for this user
|
||||||
* The Client will remove the credentials for this user from its credential list.
|
* from its credential list.
|
||||||
|
*
|
||||||
* @param username the username of the user whose credentials we want to remove.
|
* @param username the username of the user whose credentials we want to remove.
|
||||||
*/
|
*/
|
||||||
constructor(username: String) : this(username, "")
|
constructor(username: String) : this(username, "")
|
||||||
|
|||||||
+1
-3
@@ -4,9 +4,7 @@ import de.fiereu.openmmo.protocols.PacketDeserializer
|
|||||||
import de.fiereu.openmmo.protocols.PacketSerializer
|
import de.fiereu.openmmo.protocols.PacketSerializer
|
||||||
import io.netty.buffer.ByteBuf
|
import io.netty.buffer.ByteBuf
|
||||||
|
|
||||||
data class ToSConfirmationPacket(
|
data class ToSConfirmationPacket(val confirmationKey: Byte)
|
||||||
val confirmationKey: Byte
|
|
||||||
)
|
|
||||||
|
|
||||||
class ToSConfirmationPacketSerializer : PacketSerializer<ToSConfirmationPacket> {
|
class ToSConfirmationPacketSerializer : PacketSerializer<ToSConfirmationPacket> {
|
||||||
override fun serialize(packet: ToSConfirmationPacket, buffer: ByteBuf) {
|
override fun serialize(packet: ToSConfirmationPacket, buffer: ByteBuf) {
|
||||||
|
|||||||
@@ -3,16 +3,13 @@ package de.fiereu.openmmo.protocols.tls.packets
|
|||||||
import de.fiereu.openmmo.protocols.PacketDeserializer
|
import de.fiereu.openmmo.protocols.PacketDeserializer
|
||||||
import de.fiereu.openmmo.protocols.PacketSerializer
|
import de.fiereu.openmmo.protocols.PacketSerializer
|
||||||
import io.netty.buffer.ByteBuf
|
import io.netty.buffer.ByteBuf
|
||||||
import java.io.ByteArrayOutputStream
|
|
||||||
import java.io.ByteArrayInputStream
|
import java.io.ByteArrayInputStream
|
||||||
|
import java.io.ByteArrayOutputStream
|
||||||
import java.nio.charset.StandardCharsets
|
import java.nio.charset.StandardCharsets
|
||||||
import java.util.zip.GZIPInputStream
|
import java.util.zip.GZIPInputStream
|
||||||
import java.util.zip.GZIPOutputStream
|
import java.util.zip.GZIPOutputStream
|
||||||
|
|
||||||
data class ToSPacket(
|
data class ToSPacket(val confirmationKey: Byte, val tosText: String)
|
||||||
val confirmationKey: Byte,
|
|
||||||
val tosText: String
|
|
||||||
)
|
|
||||||
|
|
||||||
class ToSPacketSerializer : PacketSerializer<ToSPacket> {
|
class ToSPacketSerializer : PacketSerializer<ToSPacket> {
|
||||||
override fun serialize(packet: ToSPacket, buffer: ByteBuf) {
|
override fun serialize(packet: ToSPacket, buffer: ByteBuf) {
|
||||||
|
|||||||
+5
-14
@@ -23,7 +23,8 @@ class GameServerNodesPacketBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AuthedPacketBuilder internal constructor(
|
class AuthedPacketBuilder
|
||||||
|
internal constructor(
|
||||||
private val userId: Int,
|
private val userId: Int,
|
||||||
private val sessionToken: ByteArray,
|
private val sessionToken: ByteArray,
|
||||||
private val gameServerId: UByte
|
private val gameServerId: UByte
|
||||||
@@ -33,11 +34,7 @@ class AuthedPacketBuilder internal constructor(
|
|||||||
private var port: UShort? = null
|
private var port: UShort? = null
|
||||||
private var nodes: List<GameServerNode> = emptyList()
|
private var nodes: List<GameServerNode> = emptyList()
|
||||||
|
|
||||||
fun withLocalEndpoint(
|
fun withLocalEndpoint(address: IPAddress, hostname: String, port: UShort): AuthedPacketBuilder {
|
||||||
address: IPAddress,
|
|
||||||
hostname: String,
|
|
||||||
port: UShort
|
|
||||||
): AuthedPacketBuilder {
|
|
||||||
this.localAddress = address
|
this.localAddress = address
|
||||||
this.localHostname = hostname
|
this.localHostname = hostname
|
||||||
this.port = port
|
this.port = port
|
||||||
@@ -54,14 +51,8 @@ class AuthedPacketBuilder internal constructor(
|
|||||||
requireNotNull(localHostname) { "Local hostname must be set for AUTHED packets" }
|
requireNotNull(localHostname) { "Local hostname must be set for AUTHED packets" }
|
||||||
requireNotNull(port) { "Port must be set for AUTHED packets" }
|
requireNotNull(port) { "Port must be set for AUTHED packets" }
|
||||||
|
|
||||||
val gameServerData = GameServerData(
|
val gameServerData =
|
||||||
gameServerId,
|
GameServerData(gameServerId, userId, sessionToken, localAddress!!, localHostname!!, port!!)
|
||||||
userId,
|
|
||||||
sessionToken,
|
|
||||||
localAddress!!,
|
|
||||||
localHostname!!,
|
|
||||||
port!!
|
|
||||||
)
|
|
||||||
|
|
||||||
return GameServerNodesPacket(LoginState.AUTHED, gameServerData, nodes)
|
return GameServerNodesPacket(LoginState.AUTHED, gameServerData, nodes)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,8 +30,7 @@ class TlsServerProtocol(serverKeyPair: Pair<ECPrivateKey, ECPublicKey>) : TlsPro
|
|||||||
init {
|
init {
|
||||||
incomingPacket(0x00u, ClientHelloPacketDeserializer())
|
incomingPacket(0x00u, ClientHelloPacketDeserializer())
|
||||||
outgoingPacket(
|
outgoingPacket(
|
||||||
0x01u, ServerHelloPacketSerializer(serverKeyPair.first), ServerHelloPacket::class
|
0x01u, ServerHelloPacketSerializer(serverKeyPair.first), ServerHelloPacket::class)
|
||||||
)
|
|
||||||
incomingPacket(0x02u, ClientReadyPacketDeserializer())
|
incomingPacket(0x02u, ClientReadyPacketDeserializer())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package de.fiereu.openmmo.protocols
|
|||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import io.netty.buffer.ByteBuf
|
import io.netty.buffer.ByteBuf
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
import kotlin.reflect.jvm.jvmErasure
|
|
||||||
|
|
||||||
/** Value class wrapping a UByte to represent an opcode. */
|
/** Value class wrapping a UByte to represent an opcode. */
|
||||||
@JvmInline
|
@JvmInline
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ dependencies {
|
|||||||
|
|
||||||
application { mainClass.set("de.fiereu.openmmo.server.game.GameServerKt") }
|
application { mainClass.set("de.fiereu.openmmo.server.game.GameServerKt") }
|
||||||
|
|
||||||
|
|
||||||
fun env(key: String): Any {
|
fun env(key: String): Any {
|
||||||
val value =
|
val value =
|
||||||
property(key)
|
property(key)
|
||||||
@@ -116,9 +115,9 @@ tasks.register("cleanMigrateAndGenerate") {
|
|||||||
spotless { kotlin { targetExclude("src/main/jooq/**") } }
|
spotless { kotlin { targetExclude("src/main/jooq/**") } }
|
||||||
|
|
||||||
// If someone knows a better way then this please please please help me :(
|
// If someone knows a better way then this please please please help me :(
|
||||||
listOf("classes", "processResources", "spotlessKotlin", "spotlessKotlinGradle", "spotlessMisc").forEach { taskName ->
|
listOf("classes", "processResources", "spotlessKotlin", "spotlessKotlinGradle", "spotlessMisc")
|
||||||
|
.forEach { taskName ->
|
||||||
tasks.named(taskName) {
|
tasks.named(taskName) {
|
||||||
listOf("copyPublicKeyGame", "copyPrivateKeyGame")
|
listOf("copyPublicKeyGame", "copyPrivateKeyGame").forEach { dependsOn(it) }
|
||||||
.forEach { dependsOn(it) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-1
@@ -32,7 +32,9 @@ class GameProtocolHandler(
|
|||||||
|
|
||||||
fun onJoinGame(event: PacketEvent<JoinGamePacket>) {
|
fun onJoinGame(event: PacketEvent<JoinGamePacket>) {
|
||||||
log.info { "Player joined the game." }
|
log.info { "Player joined the game." }
|
||||||
log.debug { "This is what the Game knows about you:\n${event.packet.clientInfo.values.joinToString("\n")}" }
|
log.debug {
|
||||||
|
"This is what the Game knows about you:\n${event.packet.clientInfo.values.joinToString("\n")}"
|
||||||
|
}
|
||||||
// TODO handle player joining the game
|
// TODO handle player joining the game
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,10 +123,9 @@ tasks.register("cleanMigrateAndGenerate") {
|
|||||||
spotless { kotlin { targetExclude("src/main/jooq/**") } }
|
spotless { kotlin { targetExclude("src/main/jooq/**") } }
|
||||||
|
|
||||||
// If someone knows a better way then this please please please help me :(
|
// If someone knows a better way then this please please please help me :(
|
||||||
listOf("classes", "processResources", "spotlessKotlin", "spotlessKotlinGradle", "spotlessMisc").forEach { taskName ->
|
listOf("classes", "processResources", "spotlessKotlin", "spotlessKotlinGradle", "spotlessMisc")
|
||||||
|
.forEach { taskName ->
|
||||||
tasks.named(taskName) {
|
tasks.named(taskName) {
|
||||||
listOf("copyPublicKeyGame", "copyPrivateKeyGame")
|
listOf("copyPublicKeyGame", "copyPrivateKeyGame").forEach { dependsOn(it) }
|
||||||
.forEach { dependsOn(it) }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+15
-19
@@ -10,10 +10,10 @@ import de.fiereu.openmmo.protocols.tls.packets.GameServerNode
|
|||||||
import de.fiereu.openmmo.protocols.tls.packets.JoinGameServerPacket
|
import de.fiereu.openmmo.protocols.tls.packets.JoinGameServerPacket
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.LoginRequestPacket
|
import de.fiereu.openmmo.protocols.tls.packets.LoginRequestPacket
|
||||||
import de.fiereu.openmmo.protocols.tls.packets.RequestGameServerListPacket
|
import de.fiereu.openmmo.protocols.tls.packets.RequestGameServerListPacket
|
||||||
import de.fiereu.openmmo.server.login.protocol.login.ext.respondTo
|
|
||||||
import de.fiereu.openmmo.server.login.protocol.login.ext.respondForAuthedUser
|
import de.fiereu.openmmo.server.login.protocol.login.ext.respondForAuthedUser
|
||||||
import de.fiereu.openmmo.server.login.protocol.login.ext.respondWithState
|
import de.fiereu.openmmo.server.login.protocol.login.ext.respondTo
|
||||||
import de.fiereu.openmmo.server.login.protocol.login.ext.respondWithServers
|
import de.fiereu.openmmo.server.login.protocol.login.ext.respondWithServers
|
||||||
|
import de.fiereu.openmmo.server.login.protocol.login.ext.respondWithState
|
||||||
import de.fiereu.openmmo.server.netty.handlers.ProtocolHandler
|
import de.fiereu.openmmo.server.netty.handlers.ProtocolHandler
|
||||||
import de.fiereu.openmmo.server.protocol.PacketEvent
|
import de.fiereu.openmmo.server.protocol.PacketEvent
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
@@ -37,7 +37,8 @@ class LoginProtocolHandler(
|
|||||||
coroutineScope.launch {
|
coroutineScope.launch {
|
||||||
when (event.packet) {
|
when (event.packet) {
|
||||||
is LoginRequestPacket -> onLoginRequest(event as PacketEvent<LoginRequestPacket>)
|
is LoginRequestPacket -> onLoginRequest(event as PacketEvent<LoginRequestPacket>)
|
||||||
is RequestGameServerListPacket -> onGameServerListRequest(event as PacketEvent<RequestGameServerListPacket>)
|
is RequestGameServerListPacket ->
|
||||||
|
onGameServerListRequest(event as PacketEvent<RequestGameServerListPacket>)
|
||||||
is JoinGameServerPacket -> onServerSelection(event as PacketEvent<JoinGameServerPacket>)
|
is JoinGameServerPacket -> onServerSelection(event as PacketEvent<JoinGameServerPacket>)
|
||||||
else -> log.warn { "Unhandled login packet type: ${event.packet::class.simpleName}" }
|
else -> log.warn { "Unhandled login packet type: ${event.packet::class.simpleName}" }
|
||||||
}
|
}
|
||||||
@@ -53,32 +54,27 @@ class LoginProtocolHandler(
|
|||||||
fun onGameServerListRequest(event: PacketEvent<RequestGameServerListPacket>) {
|
fun onGameServerListRequest(event: PacketEvent<RequestGameServerListPacket>) {
|
||||||
log.info { "Received game server list request" }
|
log.info { "Received game server list request" }
|
||||||
// TODO replace hardcoded server list with actual server list from database or config
|
// TODO replace hardcoded server list with actual server list from database or config
|
||||||
event.respondWithServers(listOf(
|
event.respondWithServers(listOf(GameServer(0x00u, "OpenMMO", 0u, 1u, true)))
|
||||||
GameServer(0x00u, "OpenMMO", 0u, 1u, true)
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onServerSelection(event: PacketEvent<JoinGameServerPacket>) {
|
fun onServerSelection(event: PacketEvent<JoinGameServerPacket>) {
|
||||||
log.info { "Received server selection for server id ${event.packet.gameServerId}" }
|
log.info { "Received server selection for server id ${event.packet.gameServerId}" }
|
||||||
// TODO proper server node selection handling (depends on onGameServerListRequest implementation)
|
// TODO proper server node selection handling (depends on onGameServerListRequest
|
||||||
|
// implementation)
|
||||||
// Example refuse connection: event.respondWithState(LoginState.INVALID_PASSWORD)
|
// Example refuse connection: event.respondWithState(LoginState.INVALID_PASSWORD)
|
||||||
event.respondForAuthedUser(
|
event
|
||||||
userId = 1,
|
.respondForAuthedUser(userId = 1, sessionToken = ByteArray(16) { 0x42 })
|
||||||
sessionToken = ByteArray(16) { 0x42 }
|
|
||||||
)
|
|
||||||
.withLocalEndpoint(
|
.withLocalEndpoint(
|
||||||
address = IPAddress.of("127.0.0.1"),
|
address = IPAddress.of("127.0.0.1"), hostname = "localhost", port = 7777u)
|
||||||
hostname = "localhost",
|
.withNodes(
|
||||||
port = 7777u
|
listOf(
|
||||||
)
|
|
||||||
.withNodes(listOf(
|
|
||||||
GameServerNode(
|
GameServerNode(
|
||||||
iPv4Address = IPv4Address.of("127.0.0.1"),
|
iPv4Address = IPv4Address.of("127.0.0.1"),
|
||||||
iPv6Address = IPv6Address.of("::1"),
|
iPv6Address = IPv6Address.of("::1"),
|
||||||
port = 7777u,
|
port = 7777u,
|
||||||
weight = 0x01u // Always select this node (only one node available in this example)
|
weight =
|
||||||
)
|
0x01u // Always select this node (only one node available in this example)
|
||||||
))
|
)))
|
||||||
.respondTo(event)
|
.respondTo(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-4
@@ -16,10 +16,7 @@ fun PacketEvent<JoinGameServerPacket>.respondForAuthedUser(
|
|||||||
sessionToken: ByteArray
|
sessionToken: ByteArray
|
||||||
): AuthedPacketBuilder {
|
): AuthedPacketBuilder {
|
||||||
return GameServerNodesPacketBuilder.forAuthedUser(
|
return GameServerNodesPacketBuilder.forAuthedUser(
|
||||||
userId = userId,
|
userId = userId, sessionToken = sessionToken, gameServerId = this.packet.gameServerId)
|
||||||
sessionToken = sessionToken,
|
|
||||||
gameServerId = this.packet.gameServerId
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun AuthedPacketBuilder.respondTo(event: PacketEvent<*>) {
|
fun AuthedPacketBuilder.respondTo(event: PacketEvent<*>) {
|
||||||
|
|||||||
Reference in new issue
Block a user