mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-02-12 19:31:07 +00:00
* Move /common/src to /src * Move services to net.psforever package * Move /pslogin to /server
29 lines
739 B
Scala
29 lines
739 B
Scala
// Copyright (c) 2017 PSForever
|
|
package game
|
|
|
|
import org.specs2.mutable._
|
|
import net.psforever.packet._
|
|
import net.psforever.packet.game._
|
|
import net.psforever.types.PlanetSideEmpire
|
|
import scodec.bits._
|
|
|
|
class ContinentalLockUpdateMessageTest extends Specification {
|
|
val string = hex"A8 16 00 40"
|
|
|
|
"decode" in {
|
|
PacketCoding.DecodePacket(string).require match {
|
|
case ContinentalLockUpdateMessage(continent_guid, empire) =>
|
|
continent_guid mustEqual 22
|
|
empire mustEqual PlanetSideEmpire.NC
|
|
case _ =>
|
|
ko
|
|
}
|
|
}
|
|
|
|
"encode" in {
|
|
val msg = ContinentalLockUpdateMessage(22, PlanetSideEmpire.NC)
|
|
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
|
|
|
pkt mustEqual string
|
|
}
|
|
}
|