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

@ -0,0 +1,58 @@
// Copyright (c) 2017 PSForever
package game.objectcreate
import net.psforever.packet.PacketCoding
import net.psforever.packet.game.{ObjectCreateMessage, PlanetSideGUID}
import net.psforever.packet.game.objectcreate._
import net.psforever.types.{PlanetSideEmpire, Vector3}
import org.specs2.mutable._
import scodec.bits._
class CommonFieldDataWithPlacementTest extends Specification {
val string_boomer = hex"17 A5000000 CA0000F1630938D5A8F1400003F0031100"
"Boomer" should {
"decode" in {
PacketCoding.DecodePacket(string_boomer).require match {
case ObjectCreateMessage(len, cls, guid, parent, data) =>
len mustEqual 165
cls mustEqual ObjectClass.boomer
guid mustEqual PlanetSideGUID(3840)
parent.isDefined mustEqual false
data match {
case CommonFieldDataWithPlacement(pos, com) =>
pos.coord mustEqual Vector3(4704.172f, 5546.4375f, 82.234375f)
pos.orient mustEqual Vector3.z(272.8125f)
com match {
case CommonFieldData(faction, bops, alternate, v1, v2, v3, v4, v5, fguid) =>
faction mustEqual PlanetSideEmpire.TR
bops mustEqual false
alternate mustEqual false
v1 mustEqual false
v2.isEmpty mustEqual true
v3 mustEqual false
v4.contains(false) mustEqual true
v5.isEmpty mustEqual true
fguid mustEqual PlanetSideGUID(8290)
case _ =>
ko
}
case _ =>
ko
}
case _ =>
ko
}
}
"encode" in {
val obj = CommonFieldDataWithPlacement(
PlacementData(Vector3(4704.172f, 5546.4375f, 82.234375f), Vector3.z(272.8125f)),
CommonFieldData(PlanetSideEmpire.TR, false, false, false, None, false, Some(false), None, PlanetSideGUID(8290))
)
val msg = ObjectCreateMessage(ObjectClass.boomer, PlanetSideGUID(3840), obj)
val pkt = PacketCoding.EncodePacket(msg).require.toByteVector
pkt mustEqual string_boomer
}
}
}