mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-06 05:50:23 +00:00
changing three FLoat values for orientation into a Vector3; all tests updated
This commit is contained in:
parent
9095564e68
commit
e071f6ea56
5 changed files with 120 additions and 111 deletions
|
|
@ -5,19 +5,16 @@ import net.psforever.packet.Marshallable
|
|||
import net.psforever.types.{Angular, Vector3}
|
||||
import scodec.codecs._
|
||||
import scodec.Codec
|
||||
import shapeless.{::, HNil}
|
||||
|
||||
/**
|
||||
* A specific location and heading in game world coordinates and game world measurements.
|
||||
* @param coord the xyz-coordinate location in the world
|
||||
* @param roll the amount of roll that affects orientation
|
||||
* @param pitch the amount of pitch that affects orientation
|
||||
* @param yaw the amount of yaw that affects orientation
|
||||
* @param orient the ijk-orientation around the object's center
|
||||
* @param vel optional movement data (that occurs upon placement)
|
||||
*/
|
||||
final case class PlacementData(coord : Vector3,
|
||||
roll : Float,
|
||||
pitch : Float,
|
||||
yaw : Float,
|
||||
orient : Vector3,
|
||||
vel : Option[Vector3] = None
|
||||
) extends StreamBitSize {
|
||||
override def bitsize : Long = {
|
||||
|
|
@ -35,7 +32,7 @@ object PlacementData extends Marshallable[PlacementData] {
|
|||
* @return a `PlacementData` object
|
||||
*/
|
||||
def apply(x : Float, y : Float, z : Float) : PlacementData =
|
||||
new PlacementData(Vector3(x, y, z), 0f, 0f, 0f)
|
||||
new PlacementData(Vector3(x, y, z), Vector3(0f,0f,0f))
|
||||
|
||||
/**
|
||||
* An abbreviated constructor for creating `PlacementData`, ignoring the `Vector3` for position data, supplying other important fields.
|
||||
|
|
@ -48,7 +45,7 @@ object PlacementData extends Marshallable[PlacementData] {
|
|||
* @return a `PlacementData` object
|
||||
*/
|
||||
def apply(x : Float, y : Float, z : Float, roll : Float, pitch : Float, yaw : Float) : PlacementData =
|
||||
new PlacementData(Vector3(x, y, z), roll, pitch, yaw)
|
||||
new PlacementData(Vector3(x, y, z), Vector3(roll, pitch, yaw))
|
||||
|
||||
/**
|
||||
* An abbreviated constructor for creating `PlacementData`, ignoring the `Vector3` for position data, supplying all other fields.
|
||||
|
|
@ -62,7 +59,7 @@ object PlacementData extends Marshallable[PlacementData] {
|
|||
* @return a `PlacementData` object
|
||||
*/
|
||||
def apply(x : Float, y : Float, z : Float, roll : Float, pitch : Float, yaw : Float, vel : Vector3) : PlacementData =
|
||||
new PlacementData(Vector3(x, y, z), roll, pitch, yaw, Some(vel))
|
||||
new PlacementData(Vector3(x, y, z), Vector3(roll, pitch, yaw), Some(vel))
|
||||
|
||||
implicit val codec : Codec[PlacementData] = (
|
||||
("coord" | Vector3.codec_pos) ::
|
||||
|
|
@ -70,5 +67,14 @@ object PlacementData extends Marshallable[PlacementData] {
|
|||
("pitch" | Angular.codec_pitch) ::
|
||||
("yaw" | Angular.codec_yaw()) ::
|
||||
optional(bool, "vel" | Vector3.codec_vel)
|
||||
).as[PlacementData]
|
||||
).xmap[PlacementData] (
|
||||
{
|
||||
case xyz :: i :: j :: k :: vel :: HNil =>
|
||||
PlacementData(xyz, Vector3(i, j, k), vel)
|
||||
},
|
||||
{
|
||||
case PlacementData(xyz, Vector3(i, j, k), vel) =>
|
||||
xyz :: i :: j :: k :: vel :: HNil
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,9 +180,9 @@ class ObjectCreateDetailedMessageTest extends Specification {
|
|||
char.appearance.pos.coord.x mustEqual 3674.8438f
|
||||
char.appearance.pos.coord.y mustEqual 2726.789f
|
||||
char.appearance.pos.coord.z mustEqual 91.15625f
|
||||
char.appearance.pos.roll mustEqual 0
|
||||
char.appearance.pos.pitch mustEqual 0f
|
||||
char.appearance.pos.yaw mustEqual 36.5625f
|
||||
char.appearance.pos.orient.x mustEqual 0
|
||||
char.appearance.pos.orient.y mustEqual 0f
|
||||
char.appearance.pos.orient.z mustEqual 36.5625f
|
||||
char.appearance.basic_appearance.name mustEqual "IlllIIIlllIlIllIlllIllI"
|
||||
char.appearance.basic_appearance.faction mustEqual PlanetSideEmpire.VS
|
||||
char.appearance.basic_appearance.sex mustEqual CharacterGender.Female
|
||||
|
|
@ -367,8 +367,7 @@ class ObjectCreateDetailedMessageTest extends Specification {
|
|||
val app = CharacterAppearanceData(
|
||||
PlacementData(
|
||||
Vector3(3674.8438f, 2726.789f, 91.15625f),
|
||||
0,
|
||||
0f, 36.5625f
|
||||
Vector3(0f, 0f, 36.5625f)
|
||||
),
|
||||
BasicCharacterData(
|
||||
"IlllIIIlllIlIllIlllIllI",
|
||||
|
|
|
|||
|
|
@ -48,9 +48,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
projectile.pos.coord.x mustEqual 4644.5938f
|
||||
projectile.pos.coord.y mustEqual 5472.0938f
|
||||
projectile.pos.coord.z mustEqual 82.375f
|
||||
projectile.pos.roll mustEqual 0f
|
||||
projectile.pos.pitch mustEqual 30.9375f
|
||||
projectile.pos.yaw mustEqual 171.5625f
|
||||
projectile.pos.orient.x mustEqual 0f
|
||||
projectile.pos.orient.y mustEqual 30.9375f
|
||||
projectile.pos.orient.z mustEqual 171.5625f
|
||||
projectile.unk1 mustEqual 0
|
||||
projectile.unk2 mustEqual TrackedProjectileData.striker_missile_targetting_projectile_data
|
||||
case _ =>
|
||||
|
|
@ -88,9 +88,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
drop.pos.coord.x mustEqual 4579.3438f
|
||||
drop.pos.coord.y mustEqual 5615.0703f
|
||||
drop.pos.coord.z mustEqual 72.953125f
|
||||
drop.pos.pitch mustEqual 0f
|
||||
drop.pos.roll mustEqual 0f
|
||||
drop.pos.yaw mustEqual 98.4375f
|
||||
drop.pos.orient.x mustEqual 0f
|
||||
drop.pos.orient.y mustEqual 0f
|
||||
drop.pos.orient.z mustEqual 98.4375f
|
||||
drop.obj.isInstanceOf[CommonTerminalData] mustEqual true
|
||||
val term = drop.obj.asInstanceOf[CommonTerminalData]
|
||||
term.faction mustEqual PlanetSideEmpire.NC
|
||||
|
|
@ -249,9 +249,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
flag.pos.coord.x mustEqual 3912.0312f
|
||||
flag.pos.coord.y mustEqual 5169.4375f
|
||||
flag.pos.coord.z mustEqual 59.96875f
|
||||
flag.pos.roll mustEqual 0f
|
||||
flag.pos.pitch mustEqual 0f
|
||||
flag.pos.yaw mustEqual 47.8125f
|
||||
flag.pos.orient.x mustEqual 0f
|
||||
flag.pos.orient.y mustEqual 0f
|
||||
flag.pos.orient.z mustEqual 47.8125f
|
||||
flag.faction mustEqual PlanetSideEmpire.NC
|
||||
flag.unk1 mustEqual 21
|
||||
flag.unk2 mustEqual 4
|
||||
|
|
@ -274,9 +274,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
drop.pos.coord.x mustEqual 4708.461f
|
||||
drop.pos.coord.y mustEqual 5547.539f
|
||||
drop.pos.coord.z mustEqual 72.703125f
|
||||
drop.pos.roll mustEqual 0f
|
||||
drop.pos.pitch mustEqual 0f
|
||||
drop.pos.yaw mustEqual 194.0625f
|
||||
drop.pos.orient.x mustEqual 0f
|
||||
drop.pos.orient.y mustEqual 0f
|
||||
drop.pos.orient.z mustEqual 194.0625f
|
||||
drop.obj.isInstanceOf[ACEData] mustEqual true
|
||||
val ace = drop.obj.asInstanceOf[ACEData]
|
||||
ace.unk1 mustEqual 8
|
||||
|
|
@ -299,9 +299,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
drop.pos.coord.x mustEqual 4777.633f
|
||||
drop.pos.coord.y mustEqual 5485.4062f
|
||||
drop.pos.coord.z mustEqual 85.8125f
|
||||
drop.pos.roll mustEqual 0f
|
||||
drop.pos.pitch mustEqual 0f
|
||||
drop.pos.yaw mustEqual 14.0625f
|
||||
drop.pos.orient.x mustEqual 0f
|
||||
drop.pos.orient.y mustEqual 0f
|
||||
drop.pos.orient.z mustEqual 14.0625f
|
||||
drop.obj.isInstanceOf[CommandDetonaterData] mustEqual true
|
||||
case _ =>
|
||||
ko
|
||||
|
|
@ -321,9 +321,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
drop.pos.coord.x mustEqual 4684.7344f
|
||||
drop.pos.coord.y mustEqual 5547.4844f
|
||||
drop.pos.coord.z mustEqual 83.765625f
|
||||
drop.pos.roll mustEqual 0f
|
||||
drop.pos.pitch mustEqual 0f
|
||||
drop.pos.yaw mustEqual 199.6875f
|
||||
drop.pos.orient.x mustEqual 0f
|
||||
drop.pos.orient.y mustEqual 0f
|
||||
drop.pos.orient.z mustEqual 199.6875f
|
||||
drop.obj.isInstanceOf[AmmoBoxData] mustEqual true
|
||||
val box = drop.obj.asInstanceOf[AmmoBoxData]
|
||||
box.unk mustEqual 0
|
||||
|
|
@ -345,9 +345,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
drop.pos.coord.x mustEqual 4691.1953f
|
||||
drop.pos.coord.y mustEqual 5537.039f
|
||||
drop.pos.coord.z mustEqual 65.484375f
|
||||
drop.pos.roll mustEqual 0f
|
||||
drop.pos.pitch mustEqual 0f
|
||||
drop.pos.yaw mustEqual 0f
|
||||
drop.pos.orient.x mustEqual 0f
|
||||
drop.pos.orient.y mustEqual 0f
|
||||
drop.pos.orient.z mustEqual 0f
|
||||
drop.obj.isInstanceOf[WeaponData] mustEqual true
|
||||
val wep = drop.obj.asInstanceOf[WeaponData]
|
||||
wep.unk1 mustEqual 4
|
||||
|
|
@ -377,9 +377,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
drop.pos.coord.x mustEqual 4789.133f
|
||||
drop.pos.coord.y mustEqual 5522.3125f
|
||||
drop.pos.coord.z mustEqual 72.3125f
|
||||
drop.pos.roll mustEqual 0f
|
||||
drop.pos.pitch mustEqual 0f
|
||||
drop.pos.yaw mustEqual 306.5625f
|
||||
drop.pos.orient.x mustEqual 0f
|
||||
drop.pos.orient.y mustEqual 0f
|
||||
drop.pos.orient.z mustEqual 306.5625f
|
||||
drop.obj.isInstanceOf[WeaponData] mustEqual true
|
||||
val wep = drop.obj.asInstanceOf[WeaponData]
|
||||
wep.unk1 mustEqual 2
|
||||
|
|
@ -417,9 +417,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
dropped.pos.coord.x mustEqual 4675.039f
|
||||
dropped.pos.coord.y mustEqual 5506.953f
|
||||
dropped.pos.coord.z mustEqual 72.703125f
|
||||
dropped.pos.roll mustEqual 0f
|
||||
dropped.pos.pitch mustEqual 0f
|
||||
dropped.pos.yaw mustEqual 230.625f
|
||||
dropped.pos.orient.x mustEqual 0f
|
||||
dropped.pos.orient.y mustEqual 0f
|
||||
dropped.pos.orient.z mustEqual 230.625f
|
||||
dropped.obj.isInstanceOf[REKData] mustEqual true
|
||||
val rek = dropped.obj.asInstanceOf[REKData]
|
||||
rek.unk1 mustEqual 8
|
||||
|
|
@ -443,9 +443,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
boomer.deploy.pos.coord.x mustEqual 4704.172f
|
||||
boomer.deploy.pos.coord.y mustEqual 5546.4375f
|
||||
boomer.deploy.pos.coord.z mustEqual 82.234375f
|
||||
boomer.deploy.pos.roll mustEqual 0f
|
||||
boomer.deploy.pos.pitch mustEqual 0f
|
||||
boomer.deploy.pos.yaw mustEqual 272.8125f
|
||||
boomer.deploy.pos.orient.x mustEqual 0f
|
||||
boomer.deploy.pos.orient.y mustEqual 0f
|
||||
boomer.deploy.pos.orient.z mustEqual 272.8125f
|
||||
boomer.deploy.unk mustEqual 0
|
||||
boomer.deploy.player_guid mustEqual PlanetSideGUID(4145)
|
||||
case _ =>
|
||||
|
|
@ -466,9 +466,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
turret.deploy.pos.coord.x mustEqual 4577.7812f
|
||||
turret.deploy.pos.coord.y mustEqual 5624.828f
|
||||
turret.deploy.pos.coord.z mustEqual 72.046875f
|
||||
turret.deploy.pos.roll mustEqual 0f
|
||||
turret.deploy.pos.pitch mustEqual 2.8125f
|
||||
turret.deploy.pos.yaw mustEqual 264.375f
|
||||
turret.deploy.pos.orient.x mustEqual 0f
|
||||
turret.deploy.pos.orient.y mustEqual 2.8125f
|
||||
turret.deploy.pos.orient.z mustEqual 264.375f
|
||||
turret.deploy.faction mustEqual PlanetSideEmpire.NC
|
||||
turret.deploy.unk mustEqual 12
|
||||
turret.deploy.player_guid mustEqual PlanetSideGUID(3871)
|
||||
|
|
@ -492,9 +492,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
turret.deploy.pos.coord.x mustEqual 4527.633f
|
||||
turret.deploy.pos.coord.y mustEqual 6271.3594f
|
||||
turret.deploy.pos.coord.z mustEqual 70.265625f
|
||||
turret.deploy.pos.roll mustEqual 0f
|
||||
turret.deploy.pos.pitch mustEqual 0f
|
||||
turret.deploy.pos.yaw mustEqual 154.6875f
|
||||
turret.deploy.pos.orient.x mustEqual 0f
|
||||
turret.deploy.pos.orient.y mustEqual 0f
|
||||
turret.deploy.pos.orient.z mustEqual 154.6875f
|
||||
turret.deploy.faction mustEqual PlanetSideEmpire.VS
|
||||
turret.deploy.unk mustEqual 4
|
||||
turret.deploy.player_guid mustEqual PlanetSideGUID(4232)
|
||||
|
|
@ -533,9 +533,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
trap.deploy.pos.coord.x mustEqual 3572.4453f
|
||||
trap.deploy.pos.coord.y mustEqual 3277.9766f
|
||||
trap.deploy.pos.coord.z mustEqual 114.0f
|
||||
trap.deploy.pos.roll mustEqual 0f
|
||||
trap.deploy.pos.pitch mustEqual 0f
|
||||
trap.deploy.pos.yaw mustEqual 90.0f
|
||||
trap.deploy.pos.orient.x mustEqual 0f
|
||||
trap.deploy.pos.orient.y mustEqual 0f
|
||||
trap.deploy.pos.orient.z mustEqual 90.0f
|
||||
trap.deploy.faction mustEqual PlanetSideEmpire.VS
|
||||
trap.deploy.unk mustEqual 4
|
||||
trap.health mustEqual 255
|
||||
|
|
@ -558,9 +558,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
aegis.deploy.pos.coord.x mustEqual 3571.2266f
|
||||
aegis.deploy.pos.coord.y mustEqual 3278.0938f
|
||||
aegis.deploy.pos.coord.z mustEqual 114.0f
|
||||
aegis.deploy.pos.roll mustEqual 0f
|
||||
aegis.deploy.pos.pitch mustEqual 0f
|
||||
aegis.deploy.pos.yaw mustEqual 90.0f
|
||||
aegis.deploy.pos.orient.x mustEqual 0f
|
||||
aegis.deploy.pos.orient.y mustEqual 0f
|
||||
aegis.deploy.pos.orient.z mustEqual 90.0f
|
||||
aegis.deploy.faction mustEqual PlanetSideEmpire.VS
|
||||
aegis.deploy.unk mustEqual 4
|
||||
aegis.health mustEqual 255
|
||||
|
|
@ -583,9 +583,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
omft.deploy.pos.coord.x mustEqual 3567.1406f
|
||||
omft.deploy.pos.coord.y mustEqual 2988.0078f
|
||||
omft.deploy.pos.coord.z mustEqual 71.84375f
|
||||
omft.deploy.pos.roll mustEqual 0f
|
||||
omft.deploy.pos.pitch mustEqual 0f
|
||||
omft.deploy.pos.yaw mustEqual 185.625f
|
||||
omft.deploy.pos.orient.x mustEqual 0f
|
||||
omft.deploy.pos.orient.y mustEqual 0f
|
||||
omft.deploy.pos.orient.z mustEqual 185.625f
|
||||
omft.deploy.faction mustEqual PlanetSideEmpire.VS
|
||||
omft.deploy.unk mustEqual 4
|
||||
omft.deploy.player_guid mustEqual PlanetSideGUID(2502)
|
||||
|
|
@ -666,9 +666,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
pc.appearance.pos.coord.x mustEqual 3674.8438f
|
||||
pc.appearance.pos.coord.y mustEqual 2726.789f
|
||||
pc.appearance.pos.coord.z mustEqual 91.15625f
|
||||
pc.appearance.pos.roll mustEqual 0f
|
||||
pc.appearance.pos.pitch mustEqual 0f
|
||||
pc.appearance.pos.yaw mustEqual 64.6875f
|
||||
pc.appearance.pos.orient.x mustEqual 0f
|
||||
pc.appearance.pos.orient.y mustEqual 0f
|
||||
pc.appearance.pos.orient.z mustEqual 64.6875f
|
||||
pc.appearance.pos.vel.isDefined mustEqual true
|
||||
pc.appearance.pos.vel.get.x mustEqual 1.4375f
|
||||
pc.appearance.pos.vel.get.y mustEqual -0.4375f
|
||||
|
|
@ -765,9 +765,9 @@ class ObjectCreateMessageTest extends Specification {
|
|||
pc.appearance.pos.coord.x mustEqual 4629.8906f
|
||||
pc.appearance.pos.coord.y mustEqual 6316.4453f
|
||||
pc.appearance.pos.coord.z mustEqual 54.734375f
|
||||
pc.appearance.pos.roll mustEqual 0f
|
||||
pc.appearance.pos.pitch mustEqual 0f
|
||||
pc.appearance.pos.yaw mustEqual 126.5625f
|
||||
pc.appearance.pos.orient.x mustEqual 0f
|
||||
pc.appearance.pos.orient.y mustEqual 0f
|
||||
pc.appearance.pos.orient.z mustEqual 126.5625f
|
||||
pc.appearance.pos.vel.isDefined mustEqual false
|
||||
pc.appearance.basic_appearance.name mustEqual "Angello"
|
||||
pc.appearance.basic_appearance.faction mustEqual PlanetSideEmpire.VS
|
||||
|
|
@ -904,7 +904,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
|
||||
"encode (ace, dropped)" in {
|
||||
val obj = DroppedItemData(
|
||||
PlacementData(Vector3(4708.461f, 5547.539f, 72.703125f), 0f, 0f, 194.0625f),
|
||||
PlacementData(4708.461f, 5547.539f, 72.703125f, 0f, 0f, 194.0625f),
|
||||
ACEData(8, 8)
|
||||
)
|
||||
val msg = ObjectCreateMessage(ObjectClass.ace, PlanetSideGUID(4388), obj)
|
||||
|
|
@ -915,7 +915,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
|
||||
"encode (detonator, dropped)" in {
|
||||
val obj = DroppedItemData(
|
||||
PlacementData(Vector3(4777.633f, 5485.4062f, 85.8125f), 0f, 0f, 14.0625f),
|
||||
PlacementData(4777.633f, 5485.4062f, 85.8125f, 0f, 0f, 14.0625f),
|
||||
CommandDetonaterData()
|
||||
)
|
||||
val msg = ObjectCreateMessage(ObjectClass.command_detonater, PlanetSideGUID(3682), obj)
|
||||
|
|
@ -926,7 +926,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
|
||||
"encode (shotgun shells, dropped)" in {
|
||||
val obj = DroppedItemData(
|
||||
PlacementData(Vector3(4684.7344f, 5547.4844f, 83.765625f), 0f, 0f, 199.6875f),
|
||||
PlacementData(4684.7344f, 5547.4844f, 83.765625f, 0f, 0f, 199.6875f),
|
||||
AmmoBoxData()
|
||||
)
|
||||
val msg = ObjectCreateMessage(ObjectClass.shotgun_shell, PlanetSideGUID(3453), obj)
|
||||
|
|
@ -937,7 +937,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
|
||||
"encode (lasher, dropped)" in {
|
||||
val obj = DroppedItemData(
|
||||
PlacementData(Vector3(4691.1953f, 5537.039f, 65.484375f), 0.0f, 0.0f, 0.0f),
|
||||
PlacementData(4691.1953f, 5537.039f, 65.484375f, 0.0f, 0.0f, 0.0f),
|
||||
WeaponData(4, 0, ObjectClass.energy_cell, PlanetSideGUID(3268), 0, AmmoBoxData())
|
||||
)
|
||||
val msg = ObjectCreateMessage(ObjectClass.lasher, PlanetSideGUID(3074), obj)
|
||||
|
|
@ -948,7 +948,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
|
||||
"encode (punisher, dropped)" in {
|
||||
val obj = DroppedItemData(
|
||||
PlacementData(Vector3(4789.133f, 5522.3125f, 72.3125f), 0f, 0f, 306.5625f),
|
||||
PlacementData(4789.133f, 5522.3125f, 72.3125f, 0f, 0f, 306.5625f),
|
||||
WeaponData(2, 0, 0,
|
||||
AmmoBoxData(ObjectClass.bullet_9mm, PlanetSideGUID(3528), 0, AmmoBoxData()) ::
|
||||
AmmoBoxData(ObjectClass.rocket, PlanetSideGUID(3031), 1, AmmoBoxData()) ::
|
||||
|
|
@ -963,7 +963,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
|
||||
"encode (REK, dropped)" in {
|
||||
val obj = DroppedItemData(
|
||||
PlacementData(Vector3(4675.039f, 5506.953f, 72.703125f), 0f, 0f, 230.625f),
|
||||
PlacementData(4675.039f, 5506.953f, 72.703125f, 0f, 0f, 230.625f),
|
||||
REKData(8, 0, 3)
|
||||
)
|
||||
val msg = ObjectCreateMessage(ObjectClass.remote_electronics_kit, PlanetSideGUID(4355), obj)
|
||||
|
|
@ -975,7 +975,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
"encode (boomer)" in {
|
||||
val obj = SmallDeployableData(
|
||||
CommonFieldData(
|
||||
PlacementData(Vector3(4704.172f, 5546.4375f, 82.234375f), 0f, 0f, 272.8125f),
|
||||
PlacementData(4704.172f, 5546.4375f, 82.234375f, 0f, 0f, 272.8125f),
|
||||
PlanetSideEmpire.TR, 0, PlanetSideGUID(4145)
|
||||
)
|
||||
)
|
||||
|
|
@ -988,7 +988,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
"encode (spitfire, short)" in {
|
||||
val obj = SmallTurretData(
|
||||
CommonFieldData(
|
||||
PlacementData(Vector3(4577.7812f, 5624.828f, 72.046875f), 0f, 2.8125f, 264.375f),
|
||||
PlacementData(4577.7812f, 5624.828f, 72.046875f, 0f, 2.8125f, 264.375f),
|
||||
PlanetSideEmpire.NC, 12, PlanetSideGUID(3871)
|
||||
),
|
||||
255 //sets to 0
|
||||
|
|
@ -1006,7 +1006,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
"encode (spitfire)" in {
|
||||
val obj = SmallTurretData(
|
||||
CommonFieldData(
|
||||
PlacementData(Vector3(4527.633f, 6271.3594f, 70.265625f), 0f, 0f, 154.6875f),
|
||||
PlacementData(4527.633f, 6271.3594f, 70.265625f, 0f, 0f, 154.6875f),
|
||||
PlanetSideEmpire.VS, 4, PlanetSideGUID(4232)
|
||||
),
|
||||
255,
|
||||
|
|
@ -1025,7 +1025,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
"encode (trap)" in {
|
||||
val obj = TRAPData(
|
||||
CommonFieldData(
|
||||
PlacementData(Vector3(3572.4453f, 3277.9766f, 114.0f), 0f, 0f, 90.0f),
|
||||
PlacementData(3572.4453f, 3277.9766f, 114.0f, 0f, 0f, 90.0f),
|
||||
PlanetSideEmpire.VS, 4, PlanetSideGUID(2502)
|
||||
),
|
||||
255
|
||||
|
|
@ -1043,7 +1043,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
"encode (aegis)" in {
|
||||
val obj = AegisShieldGeneratorData(
|
||||
CommonFieldData(
|
||||
PlacementData(Vector3(3571.2266f, 3278.0938f, 114.0f), 0f, 0f, 90.0f),
|
||||
PlacementData(3571.2266f, 3278.0938f, 114.0f, 0f, 0f, 90.0f),
|
||||
PlanetSideEmpire.VS, 4, PlanetSideGUID(2366)
|
||||
),
|
||||
255
|
||||
|
|
@ -1057,7 +1057,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
"encode (orion)" in {
|
||||
val obj = OneMannedFieldTurretData(
|
||||
CommonFieldData(
|
||||
PlacementData(Vector3(3567.1406f, 2988.0078f, 71.84375f), 0f, 0f, 185.625f),
|
||||
PlacementData(3567.1406f, 2988.0078f, 71.84375f, 0f, 0f, 185.625f),
|
||||
PlanetSideEmpire.VS, 4, PlanetSideGUID(2502)
|
||||
),
|
||||
255,
|
||||
|
|
@ -1093,7 +1093,7 @@ class ObjectCreateMessageTest extends Specification {
|
|||
CharacterAppearanceData(
|
||||
PlacementData(
|
||||
Vector3(3674.8438f, 2726.789f, 91.15625f),
|
||||
0f, 0f, 64.6875f,
|
||||
Vector3(0f, 0f, 64.6875f),
|
||||
Some(Vector3(1.4375f, -0.4375f, 0f))
|
||||
),
|
||||
BasicCharacterData(
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
fury.basic.pos.coord.x mustEqual 6531.961f
|
||||
fury.basic.pos.coord.y mustEqual 1872.1406f
|
||||
fury.basic.pos.coord.z mustEqual 24.734375f
|
||||
fury.basic.pos.roll mustEqual 0f
|
||||
fury.basic.pos.pitch mustEqual 0f
|
||||
fury.basic.pos.yaw mustEqual 357.1875f
|
||||
fury.basic.pos.orient.x mustEqual 0f
|
||||
fury.basic.pos.orient.y mustEqual 0f
|
||||
fury.basic.pos.orient.z mustEqual 357.1875f
|
||||
fury.basic.pos.vel.isDefined mustEqual false
|
||||
fury.basic.faction mustEqual PlanetSideEmpire.VS
|
||||
fury.basic.unk mustEqual 4
|
||||
|
|
@ -78,9 +78,9 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
ant.basic.pos.coord.x mustEqual 3674.8438f
|
||||
ant.basic.pos.coord.y mustEqual 2726.789f
|
||||
ant.basic.pos.coord.z mustEqual 91.15625f
|
||||
ant.basic.pos.roll mustEqual 0f
|
||||
ant.basic.pos.pitch mustEqual 0f
|
||||
ant.basic.pos.yaw mustEqual 90.0f
|
||||
ant.basic.pos.orient.x mustEqual 0f
|
||||
ant.basic.pos.orient.y mustEqual 0f
|
||||
ant.basic.pos.orient.z mustEqual 90.0f
|
||||
ant.basic.faction mustEqual PlanetSideEmpire.VS
|
||||
ant.basic.unk mustEqual 4
|
||||
ant.basic.player_guid mustEqual PlanetSideGUID(0)
|
||||
|
|
@ -104,9 +104,9 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
lightning.basic.pos.coord.x mustEqual 3674.8438f
|
||||
lightning.basic.pos.coord.y mustEqual 2726.789f
|
||||
lightning.basic.pos.coord.z mustEqual 91.15625f
|
||||
lightning.basic.pos.roll mustEqual 0f
|
||||
lightning.basic.pos.pitch mustEqual 0f
|
||||
lightning.basic.pos.yaw mustEqual 90.0f
|
||||
lightning.basic.pos.orient.x mustEqual 0f
|
||||
lightning.basic.pos.orient.y mustEqual 0f
|
||||
lightning.basic.pos.orient.z mustEqual 90.0f
|
||||
lightning.basic.faction mustEqual PlanetSideEmpire.VS
|
||||
lightning.basic.unk mustEqual 4
|
||||
lightning.basic.player_guid mustEqual PlanetSideGUID(0)
|
||||
|
|
@ -155,9 +155,9 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
deliverer.basic.pos.coord.x mustEqual 6531.961f
|
||||
deliverer.basic.pos.coord.y mustEqual 1872.1406f
|
||||
deliverer.basic.pos.coord.z mustEqual 24.734375f
|
||||
deliverer.basic.pos.roll mustEqual 0f
|
||||
deliverer.basic.pos.pitch mustEqual 0f
|
||||
deliverer.basic.pos.yaw mustEqual 357.1875f
|
||||
deliverer.basic.pos.orient.x mustEqual 0f
|
||||
deliverer.basic.pos.orient.y mustEqual 0f
|
||||
deliverer.basic.pos.orient.z mustEqual 357.1875f
|
||||
deliverer.basic.faction mustEqual PlanetSideEmpire.NC
|
||||
deliverer.basic.unk mustEqual 4
|
||||
deliverer.basic.player_guid mustEqual PlanetSideGUID(0)
|
||||
|
|
@ -221,9 +221,9 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
ams.basic.pos.coord.x mustEqual 3674.0f
|
||||
ams.basic.pos.coord.y mustEqual 2726.789f
|
||||
ams.basic.pos.coord.z mustEqual 91.15625f
|
||||
ams.basic.pos.roll mustEqual 0f
|
||||
ams.basic.pos.pitch mustEqual 0f
|
||||
ams.basic.pos.yaw mustEqual 90.0f
|
||||
ams.basic.pos.orient.x mustEqual 0f
|
||||
ams.basic.pos.orient.y mustEqual 0f
|
||||
ams.basic.pos.orient.z mustEqual 90.0f
|
||||
ams.basic.faction mustEqual PlanetSideEmpire.VS
|
||||
ams.basic.unk mustEqual 0
|
||||
ams.basic.player_guid mustEqual PlanetSideGUID(34082)
|
||||
|
|
@ -253,9 +253,9 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
dams.pos.coord.x mustEqual 3674.0f
|
||||
dams.pos.coord.y mustEqual 2726.789f
|
||||
dams.pos.coord.z mustEqual 91.15625f
|
||||
dams.pos.roll mustEqual 0f
|
||||
dams.pos.pitch mustEqual 0f
|
||||
dams.pos.yaw mustEqual 90.0f
|
||||
dams.pos.orient.x mustEqual 0f
|
||||
dams.pos.orient.y mustEqual 0f
|
||||
dams.pos.orient.z mustEqual 90.0f
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
|
|
@ -274,9 +274,9 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
switchblade.basic.pos.coord.x mustEqual 6531.961f
|
||||
switchblade.basic.pos.coord.y mustEqual 1872.1406f
|
||||
switchblade.basic.pos.coord.z mustEqual 24.734375f
|
||||
switchblade.basic.pos.roll mustEqual 0f
|
||||
switchblade.basic.pos.pitch mustEqual 0f
|
||||
switchblade.basic.pos.yaw mustEqual 357.1875f
|
||||
switchblade.basic.pos.orient.x mustEqual 0f
|
||||
switchblade.basic.pos.orient.y mustEqual 0f
|
||||
switchblade.basic.pos.orient.z mustEqual 357.1875f
|
||||
switchblade.basic.faction mustEqual PlanetSideEmpire.VS
|
||||
switchblade.basic.unk mustEqual 4
|
||||
switchblade.health mustEqual 255
|
||||
|
|
@ -321,9 +321,9 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
droppod.basic.pos.coord.x mustEqual 5108.0f
|
||||
droppod.basic.pos.coord.y mustEqual 6164.0f
|
||||
droppod.basic.pos.coord.z mustEqual 1023.9844f
|
||||
droppod.basic.pos.roll mustEqual 0f
|
||||
droppod.basic.pos.pitch mustEqual 0f
|
||||
droppod.basic.pos.yaw mustEqual 90.0f
|
||||
droppod.basic.pos.orient.x mustEqual 0f
|
||||
droppod.basic.pos.orient.y mustEqual 0f
|
||||
droppod.basic.pos.orient.z mustEqual 90.0f
|
||||
droppod.basic.unk mustEqual 4
|
||||
droppod.basic.player_guid mustEqual PlanetSideGUID(0)
|
||||
droppod.burn mustEqual false
|
||||
|
|
@ -366,9 +366,9 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
shuttle.pos.get.coord.x mustEqual 5610.0156f
|
||||
shuttle.pos.get.coord.y mustEqual 4255.258f
|
||||
shuttle.pos.get.coord.z mustEqual 134.1875f
|
||||
shuttle.pos.get.roll mustEqual 0f
|
||||
shuttle.pos.get.pitch mustEqual 0f
|
||||
shuttle.pos.get.yaw mustEqual 180.0f
|
||||
shuttle.pos.get.orient.x mustEqual 0f
|
||||
shuttle.pos.get.orient.y mustEqual 0f
|
||||
shuttle.pos.get.orient.z mustEqual 180.0f
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
|
|
@ -455,7 +455,8 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
|
||||
"encode (ams)" in {
|
||||
val obj = AMSData(
|
||||
CommonFieldData(PlacementData(3674.0f, 2726.789f, 91.15625f, 0f, 0f, 90.0f),
|
||||
CommonFieldData(
|
||||
PlacementData(3674.0f, 2726.789f, 91.15625f, 0f, 0f, 90.0f),
|
||||
PlanetSideEmpire.VS, 0,
|
||||
PlanetSideGUID(34082)
|
||||
),
|
||||
|
|
@ -485,8 +486,10 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
|
||||
"encode (switchblade)" in {
|
||||
val obj = Vehicle2Data(
|
||||
CommonFieldData(PlacementData(6531.961f, 1872.1406f, 24.734375f, 0f, 0f, 357.1875f),
|
||||
PlanetSideEmpire.VS, 4
|
||||
CommonFieldData(
|
||||
PlacementData(6531.961f, 1872.1406f, 24.734375f, 0f, 0f, 357.1875f),
|
||||
PlanetSideEmpire.VS,
|
||||
4
|
||||
),
|
||||
255,
|
||||
DriveState.Mobile,
|
||||
|
|
@ -504,7 +507,8 @@ class ObjectCreateMessageVehiclesTest extends Specification {
|
|||
val obj = DroppodData(
|
||||
CommonFieldData(
|
||||
PlacementData(5108.0f, 6164.0f, 1023.9844f, 0f, 0f, 90.0f),
|
||||
PlanetSideEmpire.VS, 4
|
||||
PlanetSideEmpire.VS,
|
||||
4
|
||||
)
|
||||
)
|
||||
val msg = ObjectCreateMessage(ObjectClass.droppod, PlanetSideGUID(3595), obj)
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
val app = CharacterAppearanceData(
|
||||
PlacementData(
|
||||
Vector3(3674.8438f, 2726.789f, 91.15625f),
|
||||
0f, 0f, 90f
|
||||
Vector3(0f, 0f, 90f)
|
||||
),
|
||||
BasicCharacterData(
|
||||
"IlllIIIlllIlIllIlllIllI",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue