mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -04:00
chat message: set sender to null if uuid is 0
This commit is contained in:
parent
1ec4fda1bd
commit
14588f55c4
@ -26,6 +26,7 @@ import de.bixilon.minosoft.protocol.packets.s2c.PlayS2CPacket
|
||||
import de.bixilon.minosoft.protocol.protocol.PlayInByteBuffer
|
||||
import de.bixilon.minosoft.protocol.protocol.ProtocolDefinition
|
||||
import de.bixilon.minosoft.protocol.protocol.ProtocolVersions
|
||||
import de.bixilon.minosoft.util.KUtil
|
||||
import de.bixilon.minosoft.util.logging.Log
|
||||
import de.bixilon.minosoft.util.logging.LogLevels
|
||||
import de.bixilon.minosoft.util.logging.LogMessageType
|
||||
@ -58,7 +59,7 @@ class ChatMessageS2CP(buffer: PlayInByteBuffer) : PlayS2CPacket {
|
||||
override fun handle(connection: PlayConnection) {
|
||||
val type = if (overlay) connection.registries.messageTypeRegistry[DefaultMessageTypes.GAME]!! else type
|
||||
val sender = sender
|
||||
val message: ChatMessage = if (sender == null) {
|
||||
val message: ChatMessage = if (sender == null || sender == KUtil.NULL_UUID) {
|
||||
SimpleChatMessage(text, type)
|
||||
} else {
|
||||
PlayerChatMessage(text, type, connection.getMessageSender(sender))
|
||||
|
@ -57,6 +57,7 @@ import javax.net.ssl.SSLContext
|
||||
|
||||
|
||||
object KUtil {
|
||||
val NULL_UUID = UUID(0L, 0L)
|
||||
val RANDOM = Random()
|
||||
val EMPTY_BYTE_ARRAY = ByteArray(0)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user