Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Seppe Volkaerts <seppevolkaerts@hotmail.com>
  • Loading branch information
Cybermaxke committed Sep 27, 2024
1 parent 1a81aa7 commit 34f0566
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ internal class ServerInitConnectionHandler(
private var syncModNetIdsPacket: ModDataPacket? = null

override fun initialize() {
connection.protocol = versionedProtocol.protocol
val version = versionedProtocol.version
connection.protocol = versionedProtocol.protocol
connection.protocolVersion = version
connection.send(ConnectionRequestPacket(ProtocolVersions.toString(version)))
debug { "Send server connection request to ${connection.remoteAddress} with $version" }
}
Expand Down Expand Up @@ -171,9 +172,6 @@ internal class ServerInitConnectionHandler(
private fun approveConnection() {
debug { "Approve connection: $playerId" }
val playerId = playerId ?: return
// Connection was approved so the client version was accepted
connection.protocol = versionedProtocol.protocol
connection.protocolVersion = versionedProtocol.version
future.complete(ServerInitConnectionResult.Success(playerId, syncModsPacket, syncModNetIdsPacket))
this.playerId = null
}
Expand Down

0 comments on commit 34f0566

Please sign in to comment.