PSF-LoginServer/common/src/test/scala/game/GenericObjectActionMessageTest.scala
FateJH 5428bbbfbf Operational vehicle terminals:
Vehicles can now be pulled from assigned and initialized terminals.  The vehicle's chosen spawn pad controls (or paces) all aspects of the spawning process.  Support Actors ensure that a fully-realized Vehicle will be unloaded and unregistered if left alone, either right after spawning on the pad or after an extended period of time.  The latter half of the procedure used for spawning vehicles is a temporary workaround until future analysis and functionality of the server vehicle override packet is incorporated.

Weapons:

Weapons will now construct their own default magazines thanks to a switch from Ammo.Value to AmmoBoxDefinition in the ToolDefinition.

GenericObjectActionMessage :

The only thing this packet does, at the moment, is obscure the player when he is being promoted into the owner of a vehicle.
2017-11-25 20:55:12 -05:00

28 lines
682 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 GenericObjectActionMessageTest extends Specification {
val string = hex"56 B501 24"
"decode" in {
PacketCoding.DecodePacket(string).require match {
case GenericObjectActionMessage(object_guid, action) =>
object_guid mustEqual PlanetSideGUID(437)
action mustEqual 36
case _ =>
ko
}
}
"encode" in {
val msg = GenericObjectActionMessage(PlanetSideGUID(437), 36)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string
}
}