mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-04-25 05:45:23 +00:00
Packet: QuantityDeltaUpdateMessage (#57)
This commit is contained in:
parent
0bed8ce5b8
commit
83264de081
3 changed files with 51 additions and 1 deletions
|
|
@ -858,6 +858,27 @@ class GamePacketTest extends Specification {
|
|||
}
|
||||
}
|
||||
|
||||
"QuantityDeltaUpdateMessage" should {
|
||||
val string = hex"C4 5300 FBFFFFFF"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case QuantityDeltaUpdateMessage(item_guid, quantity) =>
|
||||
item_guid mustEqual PlanetSideGUID(83)
|
||||
quantity mustEqual -5
|
||||
case default =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = QuantityDeltaUpdateMessage(PlanetSideGUID(83), -5)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
|
||||
"PingMsg" should {
|
||||
val packet = hex"1a 00000000 b0360000"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue