Add BailType enumeration and update parameters for vehicle dismounting with correct naming and type

This commit is contained in:
Mazo 2018-05-21 06:47:21 +01:00
parent cfe2dffa44
commit 6f65603942
8 changed files with 52 additions and 33 deletions

View file

@ -5,23 +5,24 @@ import org.specs2.mutable._
import net.psforever.packet._
import net.psforever.packet.game._
import scodec.bits._
import net.psforever.types.BailType
class DismountVehicleMsgTest extends Specification {
val string = hex"0F C609 00"
"decode" in {
PacketCoding.DecodePacket(string).require match {
case DismountVehicleMsg(player_guid, unk1, unk2) =>
case DismountVehicleMsg(player_guid, bailType, wasKickedByDriver) =>
player_guid mustEqual PlanetSideGUID(2502)
unk1 mustEqual 0
unk2 mustEqual false
bailType mustEqual 0
wasKickedByDriver mustEqual false
case _ =>
ko
}
}
"encode" in {
val msg = DismountVehicleMsg(PlanetSideGUID(2502), 0, false)
val msg = DismountVehicleMsg(PlanetSideGUID(2502), BailType.Normal, false)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string