Packet: QuantityUpdateMessage

This commit is contained in:
Chord 2016-08-14 16:34:09 -04:00
parent 93fe7d6be8
commit 0bed8ce5b8
3 changed files with 51 additions and 1 deletions

View file

@ -837,6 +837,27 @@ class GamePacketTest extends Specification {
}
}
"QuantityUpdateMessage" should {
val string = hex"3D 5300 7B000000"
"decode" in {
PacketCoding.DecodePacket(string).require match {
case QuantityUpdateMessage(item_guid, quantity) =>
item_guid mustEqual PlanetSideGUID(83)
quantity mustEqual 123
case default =>
ko
}
}
"encode" in {
val msg = QuantityUpdateMessage(PlanetSideGUID(83), 123)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string
}
}
"PingMsg" should {
val packet = hex"1a 00000000 b0360000"