Packet: GenericObjectStateMsg (#36)

* Add GenericObjectStateMsg packet

* Add GenericObjectStateMsg test

* Add GenericObjectStateMsg handler stub
This commit is contained in:
tfarley 2016-07-25 19:20:58 -07:00 committed by pschord
parent 5b5bf28c52
commit d496fc1c2e
4 changed files with 48 additions and 1 deletions

View file

@ -498,5 +498,26 @@ class GamePacketTest extends Specification {
pkt mustEqual string
}
}
"GenericObjectStateMsg" should {
val string = hex"1D 6401 10000000"
"decode" in {
PacketCoding.DecodePacket(string).require match {
case GenericObjectStateMsg(object_guid, state) =>
object_guid mustEqual PlanetSideGUID(356)
state mustEqual 16
case default =>
ko
}
}
"encode" in {
val msg = GenericObjectStateMsg(PlanetSideGUID(356), 16)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string
}
}
}
}