mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-04 21:10:23 +00:00
30 lines
1 KiB
Scala
30 lines
1 KiB
Scala
// Copyright (c) 2017 PSForever
|
|
package game
|
|
|
|
import org.specs2.mutable._
|
|
import net.psforever.packet._
|
|
import net.psforever.packet.game._
|
|
import scodec.bits._
|
|
|
|
class WarpgateRequestTest extends Specification {
|
|
val string = hex"A4 1D00 1F00 1327 1F00 00 00" //an Extinction warp gate to a Desolation warp gate
|
|
|
|
"decode" in {
|
|
PacketCoding.DecodePacket(string).require match {
|
|
case WarpgateRequest(continent_guid, building_guid, dest_building_guid, dest_continent_guid, unk1, unk2) =>
|
|
continent_guid mustEqual PlanetSideGUID(29)
|
|
building_guid mustEqual PlanetSideGUID(31)
|
|
dest_building_guid mustEqual PlanetSideGUID(10003)
|
|
dest_continent_guid mustEqual PlanetSideGUID(31)
|
|
unk1 mustEqual 0
|
|
unk2 mustEqual 0
|
|
case _ =>
|
|
ko
|
|
}
|
|
}
|
|
"encode" in {
|
|
val msg = WarpgateRequest(PlanetSideGUID(29), PlanetSideGUID(31), PlanetSideGUID(10003), PlanetSideGUID(31), 0, 0)
|
|
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
|
pkt mustEqual string
|
|
}
|
|
}
|