mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-04 21:10:23 +00:00
* initial OrbitalShuttleTimeMsg packet and tests; new objects to support HART shuttle transport system * master was stale * grouped scheduling for timing orbital shuttle activity * door lock controls for HART shuttle lifecycle, and specifically for the doors that lead into the shuttle boarding hallway * separation of the door from the door unlocking logic, which now has to be provided if performed by an outside source; a door that is locked either by bolt, HART routine, or other reason, can now be shut immediately; message when HART is not docked with a corresponding entry hallway door * better degree of door logic control; all shuttle-related messages have been moved to LocalService; careful managing of 'original state' for the shuttle's cycle * modification of seat mounting and cargo mounting support entities to expand functionality * absolutely very little to do with the feature of this branch and a lot to do with yak-shaving; long story short, class inheritance is greatly modified and mountable seats can now accept multiple players if initialized properly * a lot has changed: distribution of MountableBehavior, mount point information is more complex, vehicles convert differently, the routine of the shuttle timer is initialized differently; you can now successfully utilize the HART shuttle to drop into a zone * swap of shutle from pad to pad control; tests and comments * eject players from HART gantry hallway as if passengers dismounting from seat when not boarding through the use of environmental geometry; HART system uses duration from config settings to set scheduler * rebase to curious master; repairs to vector rotation calculations; regression of mountable changes involving seats with occupancy greater than 1; orbital shuttle as a unique vehicle and amenity; corrected dismount offsets and offset calculations; weird angle of nc hart a building has been properly accommodated; hart events have prerequisite animation states * rebase with master; looks like rebase with merged_master, which is also a commit * lots of tests (though not nearly enough); checking the permission group of a shuttle seat no longer creates that seat * fixing explosions * fixed the persistence monitor service potentially using non-printable unicode in actor names * can not use a droppod to gain access to one's own sanctuary * removed hart facility update that causing open bay doors and beeping * PR review changes * fix for aggravation issues
250 lines
8.9 KiB
Scala
250 lines
8.9 KiB
Scala
// Copyright (c) 2017 PSForever
|
|
package objects
|
|
|
|
import akka.actor.ActorContext
|
|
import base.FreedContextActorTest
|
|
import net.psforever.objects.GlobalDefinitions
|
|
import net.psforever.objects.guid.NumberPoolHub
|
|
import net.psforever.objects.serverobject.ServerObjectBuilder
|
|
import net.psforever.objects.serverobject.structures.{Building, FoundationBuilder, StructureType, WarpGate}
|
|
import net.psforever.objects.serverobject.terminals.ProximityTerminal
|
|
import net.psforever.objects.zones.Zone
|
|
import net.psforever.types.{PlanetSideGUID, Vector3}
|
|
|
|
class BuildingBuilderTest extends FreedContextActorTest {
|
|
"Building object" should {
|
|
"build" in {
|
|
val structure: (String, Int, Int, Zone, ActorContext) => Building = Building.Structure(StructureType.Building)
|
|
val building = FoundationBuilder(structure).Build("building", 10, 10, Zone.Nowhere)(context)
|
|
assert(building ne null)
|
|
assert(building.isInstanceOf[Building])
|
|
assert(building.MapId == 10)
|
|
assert(building.Zone == Zone.Nowhere)
|
|
}
|
|
}
|
|
}
|
|
|
|
class WarpGateBuilderTest extends FreedContextActorTest {
|
|
"WarpGate object" should {
|
|
"build" in {
|
|
val structure: (String, Int, Int, Zone, ActorContext) => Building = WarpGate.Structure
|
|
val building = FoundationBuilder(structure).Build("wgate", 10, 10, Zone.Nowhere)(context)
|
|
assert(building ne null)
|
|
assert(building.isInstanceOf[WarpGate])
|
|
assert(building.MapId == 10)
|
|
assert(building.Zone == Zone.Nowhere)
|
|
}
|
|
}
|
|
}
|
|
|
|
class DoorObjectBuilderTest1 extends FreedContextActorTest {
|
|
import net.psforever.objects.serverobject.doors.Door
|
|
"Door object" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1, Door.Constructor).Build(context, hub)
|
|
assert(obj.isInstanceOf[Door])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
class DoorObjectBuilderTest2 extends FreedContextActorTest {
|
|
import net.psforever.objects.serverobject.doors.Door
|
|
"Door object" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1, Door.Constructor(Vector3(1, 2, 3))).Build(context, hub)
|
|
assert(obj.isInstanceOf[Door])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj == hub(1).get)
|
|
assert(obj.Position == Vector3(1, 2, 3))
|
|
}
|
|
}
|
|
}
|
|
|
|
class IFFLockObjectBuilderTest extends FreedContextActorTest {
|
|
import net.psforever.objects.serverobject.locks.IFFLock
|
|
"IFFLock object" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1, IFFLock.Constructor(Vector3(1f, 1f, 1f), Vector3(2f, 2f, 2f))).Build(context, hub)
|
|
assert(obj.isInstanceOf[IFFLock])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj.Position == Vector3(1,1,1))
|
|
assert(obj.Outwards == Vector3(0.034899496f, 0.99939084f, 0.0f))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
class ImplantTerminalMechObjectBuilderTest extends FreedContextActorTest {
|
|
|
|
import net.psforever.objects.serverobject.terminals.implant.ImplantTerminalMech
|
|
|
|
"Implant terminal mech object" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1, ImplantTerminalMech.Constructor(Vector3.Zero)).Build(context, hub)
|
|
assert(obj.isInstanceOf[ImplantTerminalMech])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
class TerminalObjectBuilderTest extends FreedContextActorTest {
|
|
import net.psforever.objects.GlobalDefinitions.order_terminal
|
|
import net.psforever.objects.serverobject.terminals.Terminal
|
|
"Terminal object" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1, Terminal.Constructor(Vector3(1.1f, 2.2f, 3.3f), order_terminal)).Build(context, hub)
|
|
assert(obj.isInstanceOf[Terminal])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj.Position == Vector3(1.1f, 2.2f, 3.3f))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
class ProximityTerminalObjectBuilderTest extends FreedContextActorTest {
|
|
import net.psforever.objects.GlobalDefinitions.medical_terminal
|
|
import net.psforever.objects.serverobject.terminals.Terminal
|
|
"Terminal object" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1, ProximityTerminal.Constructor(medical_terminal)).Build(context, hub)
|
|
assert(obj.isInstanceOf[Terminal])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
class VehicleSpawnPadObjectBuilderTest extends FreedContextActorTest {
|
|
import net.psforever.objects.serverobject.pad.VehicleSpawnPad
|
|
"Vehicle spawn pad object" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1,
|
|
VehicleSpawnPad.Constructor(
|
|
Vector3(1.1f, 2.2f, 3.3f), GlobalDefinitions.mb_pad_creation, Vector3(4.4f, 5.5f, 6.6f)
|
|
)
|
|
).Build(context, hub)
|
|
assert(obj.isInstanceOf[VehicleSpawnPad])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj.Position == Vector3(1.1f, 2.2f, 3.3f))
|
|
assert(obj.Orientation == Vector3(4.4f, 5.5f, 6.6f))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
class LocalProjectileBuilderTest extends FreedContextActorTest {
|
|
import net.psforever.objects.LocalProjectile
|
|
"Local projectile object" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1, LocalProjectile.Constructor).Build(context, hub)
|
|
assert(obj.isInstanceOf[LocalProjectile])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
class LockerObjectBuilderTest extends FreedContextActorTest {
|
|
import net.psforever.objects.serverobject.mblocker.Locker
|
|
"Locker object" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1, Locker.Constructor).Build(context, hub)
|
|
assert(obj.isInstanceOf[Locker])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
class ResourceSiloObjectBuilderTest extends FreedContextActorTest {
|
|
import net.psforever.objects.serverobject.resourcesilo.ResourceSilo
|
|
"Resource silo object" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1, ResourceSilo.Constructor(Vector3(1f, 1f, 1f))).Build(context, hub)
|
|
assert(obj.isInstanceOf[ResourceSilo])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj.Position == Vector3(1,1,1))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
class SpawnTubeObjectBuilderTest extends FreedContextActorTest {
|
|
import net.psforever.objects.serverobject.tube.SpawnTube
|
|
"Spawn tube object" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(
|
|
1,
|
|
SpawnTube.Constructor(Vector3(3980.4062f, 4267.3047f, 257.5625f), Vector3(0, 0, 90))
|
|
).Build(context, hub)
|
|
assert(obj.isInstanceOf[SpawnTube])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj.Position == Vector3(3980.4062f, 4267.3047f, 257.5625f))
|
|
assert(obj.Orientation == Vector3(0, 0, 90))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
class FacilityTurretObjectBuilderTest extends FreedContextActorTest {
|
|
import net.psforever.objects.GlobalDefinitions.manned_turret
|
|
import net.psforever.objects.serverobject.turret.FacilityTurret
|
|
"FacilityTurretObjectBuilder" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1, FacilityTurret.Constructor(manned_turret)).Build(context, hub)
|
|
assert(obj.isInstanceOf[FacilityTurret])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
class OrbitalShuttlePadObjectBuilderTest extends FreedContextActorTest {
|
|
import net.psforever.objects.GlobalDefinitions.obbasemesh
|
|
import net.psforever.objects.serverobject.shuttle.OrbitalShuttlePad
|
|
"OrbitalShuttlePadObjectBuilder" should {
|
|
"build" in {
|
|
val hub = ServerObjectBuilderTest.NumberPoolHub
|
|
val obj = ServerObjectBuilder(1, OrbitalShuttlePad.Constructor(Vector3.Zero, obbasemesh, Vector3.Zero)).Build(context, hub)
|
|
assert(obj.isInstanceOf[OrbitalShuttlePad])
|
|
assert(obj.HasGUID)
|
|
assert(obj.GUID == PlanetSideGUID(1))
|
|
assert(obj == hub(1).get)
|
|
}
|
|
}
|
|
}
|
|
|
|
object ServerObjectBuilderTest {
|
|
import net.psforever.objects.guid.source.MaxNumberSource
|
|
def NumberPoolHub: NumberPoolHub = {
|
|
val obj = new NumberPoolHub(new MaxNumberSource(2))
|
|
obj
|
|
}
|
|
}
|