mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-25 06:49:07 +00:00
Add and fill out proper ChatMessageTypes (#48)
This commit is contained in:
parent
05a0239e22
commit
c50f78948a
4 changed files with 383 additions and 72 deletions
|
|
@ -174,7 +174,7 @@ class GamePacketTest extends Specification {
|
|||
"decode" in {
|
||||
PacketCoding.DecodePacket(string_local).require match {
|
||||
case ChatMsg(messagetype, has_wide_contents, recipient, contents, note_contents) =>
|
||||
messagetype mustEqual ChatMessageType.Local
|
||||
messagetype mustEqual ChatMessageType.CMT_OPEN
|
||||
has_wide_contents mustEqual true
|
||||
recipient mustEqual ""
|
||||
contents mustEqual "abc"
|
||||
|
|
@ -185,7 +185,7 @@ class GamePacketTest extends Specification {
|
|||
|
||||
PacketCoding.DecodePacket(string_tell).require match {
|
||||
case ChatMsg(messagetype, has_wide_contents, recipient, contents, note_contents) =>
|
||||
messagetype mustEqual ChatMessageType.Tell
|
||||
messagetype mustEqual ChatMessageType.CMT_TELL
|
||||
has_wide_contents mustEqual true
|
||||
recipient mustEqual "def"
|
||||
contents mustEqual "abc"
|
||||
|
|
@ -196,12 +196,12 @@ class GamePacketTest extends Specification {
|
|||
}
|
||||
|
||||
"encode" in {
|
||||
val msg_local = ChatMsg(ChatMessageType.Local, true, "", "abc", None)
|
||||
val msg_local = ChatMsg(ChatMessageType.CMT_OPEN, true, "", "abc", None)
|
||||
val pkt_local = PacketCoding.EncodePacket(msg_local).require.toByteVector
|
||||
|
||||
pkt_local mustEqual string_local
|
||||
|
||||
val msg_tell = ChatMsg(ChatMessageType.Tell, true, "def", "abc", None)
|
||||
val msg_tell = ChatMsg(ChatMessageType.CMT_TELL, true, "def", "abc", None)
|
||||
val pkt_tell = PacketCoding.EncodePacket(msg_tell).require.toByteVector
|
||||
|
||||
pkt_tell mustEqual string_tell
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue