Packet: TimeOfDayMessage (#63)

* init TimeOfDayMessage; the comments are more important than the packet itself for now

* stashing sucks; commiting instead

* TimeOfDayMessage packet, commentary, and testing
This commit is contained in:
Fate-JH 2016-08-19 03:12:47 -04:00 committed by pschord
parent 693763bfda
commit 4a25298920
4 changed files with 174 additions and 1 deletions

View file

@ -469,6 +469,31 @@ class GamePacketTest extends Specification {
}
}
"TimeOfDayMessage" should {
val string = hex"48 00 00 00 47 00 00 20 41"
"decode" in {
PacketCoding.DecodePacket(string).require match {
case TimeOfDayMessage(unk1, time, unk2, unk3, unk4, unk5) =>
unk1 mustEqual 0
time mustEqual 4653056
unk2 mustEqual 0
unk3 mustEqual 0
unk4 mustEqual 32
unk5 mustEqual 65
case default =>
ko
}
}
"encode" in {
val msg = TimeOfDayMessage(0, 4653056, 0, 0, 32, 65)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string
}
}
"PlayerStateMessageUpstream" should {
val string = hex"BD 4B000 E377BA575B616C640A70004014060110007000000"