mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-13 00:50:32 +00:00
Packet: PickupItemMessage and create tests (#117)
This commit is contained in:
parent
f4fa24f344
commit
06004b0af0
4 changed files with 73 additions and 1 deletions
30
common/src/test/scala/game/PickupItemMessageTest.scala
Normal file
30
common/src/test/scala/game/PickupItemMessageTest.scala
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import scodec.bits._
|
||||
|
||||
class PickupItemMessageTest extends Specification {
|
||||
val string = hex"36 5600 4B00 00 0000"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case PickupItemMessage(item_guid, player_guid, unk1, unk2) =>
|
||||
item_guid mustEqual PlanetSideGUID(86)
|
||||
player_guid mustEqual PlanetSideGUID(75)
|
||||
unk1 mustEqual 0
|
||||
unk2 mustEqual 0
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = PickupItemMessage(PlanetSideGUID(86), PlanetSideGUID(75), 0, 0)
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue