ObjectCreateMessage Alterations, Class Object Adjustments (#243)

* power outage failure resulting in the destruction of the original ocm-fixes branch; the git branch refs were corrupted during commit, but the up-to-date changed files remained intact

* eliminating the need for CommonFieldData2 and CommonFieldData2WithPlacement

* in the middle of integrating CommonFieldData into DetailedLockerContainerData (but not standard LockerContainerData); added field for final boolean in WeaponData

* adding faction affinity to Equipment (to match functionality; not becuase I know what ends ...)

* in the middle of integrating CommonFieldData into DetailedCommandDetonaterData

* applying faction affinity to objects at time of terminal production (but to what ends?); required BoomerTrigger and AmmoBox to always report as NEUTRAL internally

* completed the transition from using the old class-based order terminal system to the page-based order terminal system; unused terminal classes have been eliminated

* more closely aligned TelepadDeployableData and InternalTelepadDeployableData

* modifying TelepadDeployableData make it generic and eliminate the need for InternalTelepadDeployableData after fixing a packet converter to utilize DroppedItemData

* modified Terminal operation to branch further outwards from Terminal.Request to the TerminalDefinition's Request method; modified tests to reflect update

* loosening up matrix terminal definition limitations

* modified ProximityTerminal to support a custom defintition class

* rendered the message passing system for Terminals general (Any) in the full scale so it can be specific in instance cases

* refactored and moved both EquipmentSlot and ExoSuitDefinition

* (re)load Favorites each time player (re)spawns
This commit is contained in:
Fate-JH 2019-03-03 08:23:30 -05:00 committed by GitHub
parent 5fc9e191fe
commit 337cfbe5d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
174 changed files with 6281 additions and 5477 deletions

View file

@ -3,7 +3,8 @@ package game.objectcreate
import net.psforever.packet.PacketCoding
import net.psforever.packet.game.{ObjectCreateMessage, PlanetSideGUID}
import net.psforever.packet.game.objectcreate.{ObjectClass, PlacementData, TrackedProjectileData}
import net.psforever.packet.game.objectcreate._
import net.psforever.types.{PlanetSideEmpire, Vector3}
import org.specs2.mutable._
import scodec.bits._
@ -11,32 +12,45 @@ class TrackedProjectileDataTest extends Specification {
val string_striker_projectile = hex"17 C5000000 A4B 009D 4C129 0CB0A 9814 00 F5 E3 040000666686400"
"TrackedProjectileData" should {
"decode (striker projectile)" in {
"decode" in {
PacketCoding.DecodePacket(string_striker_projectile).require match {
case ObjectCreateMessage(len, cls, guid, parent, data) =>
len mustEqual 197
cls mustEqual ObjectClass.striker_missile_targeting_projectile
guid mustEqual PlanetSideGUID(40192)
parent.isDefined mustEqual false
data.isDefined mustEqual true
data.get.isInstanceOf[TrackedProjectileData] mustEqual true
val projectile = data.get.asInstanceOf[TrackedProjectileData]
projectile.pos.coord.x mustEqual 4644.5938f
projectile.pos.coord.y mustEqual 5472.0938f
projectile.pos.coord.z mustEqual 82.375f
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
data match {
case TrackedProjectileData(CommonFieldDataWithPlacement(pos, deploy), unk2, unk3) =>
pos.coord mustEqual Vector3(4644.5938f, 5472.0938f, 82.375f)
pos.orient mustEqual Vector3(0, 30.9375f, 171.5625f)
deploy.faction mustEqual PlanetSideEmpire.TR
deploy.bops mustEqual false
deploy.alternate mustEqual false
deploy.v1 mustEqual true
deploy.v2.isEmpty mustEqual true
deploy.v3 mustEqual false
deploy.v4.isEmpty mustEqual true
deploy.v5.isEmpty mustEqual true
deploy.guid mustEqual PlanetSideGUID(0)
unk2 mustEqual TrackedProjectile.Striker
unk3 mustEqual 0
case _ =>
ko
}
case _ =>
ko
}
}
"encode (striker projectile)" in {
val obj = TrackedProjectileData.striker(
PlacementData(4644.5938f, 5472.0938f, 82.375f, 0f, 30.9375f, 171.5625f),
"encode" in {
val obj = TrackedProjectileData(
CommonFieldDataWithPlacement(
PlacementData(4644.5938f, 5472.0938f, 82.375f, 0f, 30.9375f, 171.5625f),
CommonFieldData(PlanetSideEmpire.TR, false, false, true, None, false, None, None, PlanetSideGUID(0))
),
TrackedProjectile.Striker,
0
)
val msg = ObjectCreateMessage(ObjectClass.striker_missile_targeting_projectile, PlanetSideGUID(40192), obj)
@ -46,25 +60,5 @@ class TrackedProjectileDataTest extends Specification {
pkt.toBitVector.drop(133).take(7) mustEqual string_striker_projectile.toBitVector.drop(133).take(7)
pkt.toBitVector.drop(141) mustEqual string_striker_projectile.toBitVector.drop(141)
}
"hunter_seeker" in {
TrackedProjectileData.hunter_seeker(PlacementData(0f, 0f, 0f), 0) mustEqual
TrackedProjectileData(PlacementData(0f, 0f, 0f), 0, TrackedProjectileData.hunter_seeker_missile_projectile_data)
}
"oicw" in {
TrackedProjectileData.oicw(PlacementData(0f, 0f, 0f), 0) mustEqual
TrackedProjectileData(PlacementData(0f, 0f, 0f), 0, TrackedProjectileData.oicw_projectile_data)
}
"starfire" in {
TrackedProjectileData.starfire(PlacementData(0f, 0f, 0f), 0) mustEqual
TrackedProjectileData(PlacementData(0f, 0f, 0f), 0, TrackedProjectileData.starfire_projectile_data)
}
"striker" in {
TrackedProjectileData.striker(PlacementData(0f, 0f, 0f), 0) mustEqual
TrackedProjectileData(PlacementData(0f, 0f, 0f), 0, TrackedProjectileData.striker_missile_targetting_projectile_data)
}
}
}