mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-02-27 18:23:36 +00:00
added (failing) tests for unhandled situation; unworking code that leads towards handling that situation
This commit is contained in:
parent
758eab167b
commit
ce165aa9a5
2 changed files with 41 additions and 3 deletions
|
|
@ -303,6 +303,7 @@ class GamePacketTest extends Specification {
|
|||
val stringMedkit = hex"28 7210 01 00 90 C0 6D65646B6974 80 80"
|
||||
val stringImplant = hex"28 7210 04 00 D0 A0 7375726765 80 80"
|
||||
val stringMacro = hex"28 4C05 08 00 B1 C0 73686F72746375745F6D6163726F 83 4E00 5400 5500 9B 2F00 7000 6C00 6100 7400 6F00 6F00 6E00 2000 4900 6E00 6300 6F00 6D00 6900 6E00 6700 2000 4E00 5400 5500 2000 7300 7000 6100 6D00 2100"
|
||||
val stringRemove = hex"28 4C05 01 00 00"
|
||||
|
||||
"decode (medkit)" in {
|
||||
PacketCoding.DecodePacket(stringMedkit).require match {
|
||||
|
|
@ -349,6 +350,21 @@ class GamePacketTest extends Specification {
|
|||
}
|
||||
}
|
||||
|
||||
"decode (remove)" in {
|
||||
PacketCoding.DecodePacket(stringRemove).require match {
|
||||
case CreateShortcutMessage(player_guid, slot, unk1, unk2, purpose, effect1, effect2) =>
|
||||
player_guid mustEqual PlanetSideGUID(1356)
|
||||
slot mustEqual 1
|
||||
unk1 mustEqual 0
|
||||
unk2 mustEqual 0
|
||||
purpose mustEqual ""
|
||||
effect1 mustEqual ""
|
||||
effect2 mustEqual ""
|
||||
case default =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode (medkit)" in {
|
||||
val msg = CreateShortcutMessage(PlanetSideGUID(4210), 1, 0, 4, "medkit")
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
|
@ -369,6 +385,13 @@ class GamePacketTest extends Specification {
|
|||
|
||||
pkt mustEqual stringMacro
|
||||
}
|
||||
|
||||
"encode (remove)" in {
|
||||
val msg = CreateShortcutMessage(PlanetSideGUID(1356), 1, 0, 0, "")
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual stringRemove
|
||||
}
|
||||
}
|
||||
|
||||
"DropItemMessage" should {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue