mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-11 16:10:31 +00:00
30 lines
780 B
Scala
30 lines
780 B
Scala
// Copyright (c) 2017 PSForever
|
|
package game
|
|
|
|
import org.specs2.mutable._
|
|
import net.psforever.packet._
|
|
import net.psforever.packet.game._
|
|
import scodec.bits._
|
|
|
|
class DelayedPathMountMsgTest extends Specification {
|
|
val string = hex"5a f50583044680"
|
|
|
|
"decode" in {
|
|
PacketCoding.DecodePacket(string).require match {
|
|
case DelayedPathMountMsg(player_guid, vehicle_guid,u3,u4) =>
|
|
player_guid mustEqual PlanetSideGUID(1525)
|
|
vehicle_guid mustEqual PlanetSideGUID(1155)
|
|
u3 mustEqual 70
|
|
u4 mustEqual true
|
|
case _ =>
|
|
ko
|
|
}
|
|
}
|
|
|
|
"encode" in {
|
|
val msg = DelayedPathMountMsg(PlanetSideGUID(1525), PlanetSideGUID(1155),70,true)
|
|
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
|
|
|
|
pkt mustEqual string
|
|
}
|
|
}
|