found the purpose of the unknown value

This commit is contained in:
FateJH 2017-01-28 22:29:14 -05:00
parent 055a6096a1
commit 50bf69fc91
2 changed files with 34 additions and 11 deletions

View file

@ -2184,8 +2184,9 @@ class GamePacketTest extends Specification {
"ZoneInfoMessage" should {
val string = hex"C6 0C 00 80 00 00 00 00"
val string_cavern = hex"C6 1B 00 1D F9 F3 00 00"
"decode" in {
"decode (normal)" in {
PacketCoding.DecodePacket(string).require match {
case ZoneInfoMessage(zone, empire_status, unk) =>
zone mustEqual 12
@ -2196,12 +2197,30 @@ class GamePacketTest extends Specification {
}
}
"encode" in {
"decode (cavern)" in {
PacketCoding.DecodePacket(string_cavern).require match {
case ZoneInfoMessage(zone, empire_status, unk) =>
zone mustEqual 27
empire_status mustEqual false
unk mustEqual 15135547
case default =>
ko
}
}
"encode (normal)" in {
val msg = ZoneInfoMessage(12, true, 0)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string
}
"encode (cavern)" in {
val msg = ZoneInfoMessage(27, false, 15135547)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string_cavern
}
}
"PingMsg" should {