mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-17 11:00:43 +00:00
31 lines
900 B
Scala
31 lines
900 B
Scala
// Copyright (c) 2016 PSForever.net to present
|
|
package game
|
|
|
|
import org.specs2.mutable._
|
|
import net.psforever.packet._
|
|
import net.psforever.packet.game._
|
|
import scodec.bits._
|
|
|
|
class BroadcastWarpgateUpdateMessageTest extends Specification {
|
|
val string = hex"D9 0D 00 01 00 20"
|
|
|
|
"decode" in {
|
|
PacketCoding.DecodePacket(string).require match {
|
|
case BroadcastWarpgateUpdateMessage(continent_guid, building_guid, state1, state2, state3) =>
|
|
continent_guid mustEqual PlanetSideGUID(13)
|
|
building_guid mustEqual PlanetSideGUID(1)
|
|
state1 mustEqual false
|
|
state2 mustEqual false
|
|
state3 mustEqual true
|
|
case _ =>
|
|
ko
|
|
}
|
|
}
|
|
|
|
"encode" in {
|
|
val msg = BroadcastWarpgateUpdateMessage(PlanetSideGUID(13), PlanetSideGUID(1), false, false, true)
|
|
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
|
|
|
pkt mustEqual string
|
|
}
|
|
}
|