From 1af6e96f23271a5098cce38bfa10375a3b7ef6a8 Mon Sep 17 00:00:00 2001 From: Tyluur Date: Thu, 4 Jan 2024 10:39:20 -0500 Subject: [PATCH 1/4] feat: add chat type message structure --- data/packets.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/data/packets.yml b/data/packets.yml index 4eeb15183..2ddfbcb26 100644 --- a/data/packets.yml +++ b/data/packets.yml @@ -695,12 +695,6 @@ in-packets: length: 6 ignore: true - - message: gg.rsmod.game.message.impl.IgnoreMessage # No data - type: FIXED - opcode: 23 - length: 1 - ignore: true - - message: gg.rsmod.game.message.impl.IgnoreMessage # No data type: VARIABLE_BYTE opcode: 37 @@ -1151,4 +1145,12 @@ in-packets: - name: height type: SHORT - name: display_mode + type: BYTE + + - message: gg.rsmod.game.message.impl.ChatTypeMessage # No data + type: FIXED + opcode: 26 + length: 1 + structure: + - name: type type: BYTE \ No newline at end of file From 38c7af03457799e75e84d57ab54daf8bcc9ce886 Mon Sep 17 00:00:00 2001 From: Tyluur Date: Thu, 4 Jan 2024 10:40:31 -0500 Subject: [PATCH 2/4] feat: add chat type message data class --- .../kotlin/gg/rsmod/game/message/impl/ChatTypeMessage.kt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 game/src/main/kotlin/gg/rsmod/game/message/impl/ChatTypeMessage.kt diff --git a/game/src/main/kotlin/gg/rsmod/game/message/impl/ChatTypeMessage.kt b/game/src/main/kotlin/gg/rsmod/game/message/impl/ChatTypeMessage.kt new file mode 100644 index 000000000..9f1c27dcb --- /dev/null +++ b/game/src/main/kotlin/gg/rsmod/game/message/impl/ChatTypeMessage.kt @@ -0,0 +1,5 @@ +package gg.rsmod.game.message.impl + +import gg.rsmod.game.message.Message + +data class ChatTypeMessage(val type: Int) : Message \ No newline at end of file From 751ceb2e712753ca8bcbff8a3dcd267c8fab7c9c Mon Sep 17 00:00:00 2001 From: Tyluur Date: Thu, 4 Jan 2024 10:40:51 -0500 Subject: [PATCH 3/4] feat: add chat type message decoder --- .../rsmod/game/message/decoder/ChatTypeDecoder.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 game/src/main/kotlin/gg/rsmod/game/message/decoder/ChatTypeDecoder.kt diff --git a/game/src/main/kotlin/gg/rsmod/game/message/decoder/ChatTypeDecoder.kt b/game/src/main/kotlin/gg/rsmod/game/message/decoder/ChatTypeDecoder.kt new file mode 100644 index 000000000..3a8e6410f --- /dev/null +++ b/game/src/main/kotlin/gg/rsmod/game/message/decoder/ChatTypeDecoder.kt @@ -0,0 +1,14 @@ +package gg.rsmod.game.message.decoder + +import gg.rsmod.game.message.MessageDecoder +import gg.rsmod.game.message.impl.ChatTypeMessage + +class ChatTypeDecoder : MessageDecoder() { + + override fun decode( + opcode: Int, opcodeIndex: Int, values: HashMap, stringValues: HashMap + ): ChatTypeMessage { + val type = values["type"]!!.toInt() + return ChatTypeMessage(type) + } +} \ No newline at end of file From 132818b3c51e4676fa0b2d281b7d9a2073a1f6a6 Mon Sep 17 00:00:00 2001 From: Tyluur Date: Thu, 4 Jan 2024 10:46:35 -0500 Subject: [PATCH 4/4] chore: correct & cleanup chat type message data --- data/packets.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/packets.yml b/data/packets.yml index 2ddfbcb26..97f52aefc 100644 --- a/data/packets.yml +++ b/data/packets.yml @@ -1147,9 +1147,9 @@ in-packets: - name: display_mode type: BYTE - - message: gg.rsmod.game.message.impl.ChatTypeMessage # No data + - message: gg.rsmod.game.message.impl.ChatTypeMessage type: FIXED - opcode: 26 + opcode: 23 length: 1 structure: - name: type