Packet: LoadMapMessage (#61)

* Add LoadMapMessage packet

* Add LoadMapMessage test
This commit is contained in:
aphedox 2016-08-14 17:37:06 -05:00 committed by pschord
parent 83264de081
commit a37fb3214c
4 changed files with 65 additions and 2 deletions

View file

@ -837,6 +837,31 @@ class GamePacketTest extends Specification {
}
}
"LoadMapMessage" should {
val string = hex"31 85 6D61703130 83 7A3130 0FA0 19000000 F6 F1 60 86 80"
"decode" in {
PacketCoding.DecodePacket(string).require match {
case LoadMapMessage(map_name, nav_map_name, unk1, unk2, weapons_unlocked, unk3) =>
map_name mustEqual "map10"
nav_map_name mustEqual "z10"
unk1 mustEqual 40975
unk2 mustEqual 25
weapons_unlocked mustEqual true
unk3 mustEqual 230810349
case default =>
ko
}
}
"encode" in {
val msg = LoadMapMessage("map10","z10",40975,25,true,230810349)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string
}
}
"QuantityUpdateMessage" should {
val string = hex"3D 5300 7B000000"