mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-02-20 23:23:35 +00:00
clarifying the fields of this packet; adding working tests; adding WSA match case; reset starting continent back to home3 (my mistake)
This commit is contained in:
parent
12d2bdf1bb
commit
bdd7d0ec36
3 changed files with 43 additions and 7 deletions
28
common/src/test/scala/game/UnuseItemMessageTest.scala
Normal file
28
common/src/test/scala/game/UnuseItemMessageTest.scala
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import scodec.bits._
|
||||
|
||||
class UnuseItemMessageTest extends Specification {
|
||||
val string = hex"26 4B00 340D"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.DecodePacket(string).require match {
|
||||
case UnuseItemMessage(player, item) =>
|
||||
player mustEqual PlanetSideGUID(75)
|
||||
item mustEqual PlanetSideGUID(3380)
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = UnuseItemMessage(PlanetSideGUID(75), PlanetSideGUID(3380))
|
||||
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue