mirror of
https://github.com/Bixilon/Minosoft.git
synced 2026-12-03 23:08:18 +00:00
network: reset signature when reinitializing
This commit is contained in:
3 files changed
+11
-1
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user