mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 10:25:06 -04:00
network: reset signature when reinitializing
This commit is contained in:
parent
e2a8d0a0cf
commit
b00087b6dc
@ -13,6 +13,7 @@
|
||||
|
||||
package de.bixilon.minosoft.data.chat.signature.signer
|
||||
|
||||
import de.bixilon.kutil.exception.Broken
|
||||
import de.bixilon.minosoft.data.chat.signature.LastSeenMessageList
|
||||
import de.bixilon.minosoft.data.text.ChatComponent
|
||||
import de.bixilon.minosoft.protocol.network.connection.play.PlayConnection
|
||||
@ -24,6 +25,8 @@ import java.util.*
|
||||
|
||||
interface MessageSigner {
|
||||
|
||||
fun reset(): Unit = Broken("Not yet implemented")
|
||||
|
||||
fun signMessage(privateKey: PrivateKey, message: String, preview: ChatComponent?, salt: Long, sender: UUID, time: Instant, lastSeen: LastSeenMessageList): ByteArray
|
||||
|
||||
|
||||
|
@ -32,6 +32,10 @@ class MessageSigner3(
|
||||
) : MessageSigner {
|
||||
private var index = AtomicInteger()
|
||||
|
||||
override fun reset() {
|
||||
index.set(0)
|
||||
}
|
||||
|
||||
override fun signMessage(privateKey: PrivateKey, message: String, preview: ChatComponent?, salt: Long, sender: UUID, time: Instant, lastSeen: LastSeenMessageList): ByteArray {
|
||||
return signMessage(privateKey, message, salt, sender, time, lastSeen)
|
||||
}
|
||||
|
@ -168,7 +168,10 @@ class InitializeS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
||||
connection.settingsManager.sendClientSettings()
|
||||
connection.sendBrand()
|
||||
|
||||
connection.player.keyManagement.sendSession()
|
||||
if (connection.version >= ProtocolVersions.V_1_19_4) { // TODO: find out version
|
||||
connection.util.signer.reset()
|
||||
}
|
||||
connection.player.keyManagement.sendSession()
|
||||
|
||||
connection.state = PlayConnectionStates.SPAWNING
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user