mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-04-29 08:15:29 +00:00
IFF/Door orientation - Building MapID/GUID changes - Ishundar full config (#244)
* Move door orientation logic from the door itself to the IFF lock, as the lock has the correct orientation in the UBR files, whereas the door does not. * Remove ModelID from buildings (is now GUID) and change "ID" to be "MapId". A building can also be constructed with both a GUID and MapID. * Update Maps.scala and Zones.scala to (for the moment) only have Ishundar configured with Sounours V3 playtest base ownership. Default starting zone is also moved to Ishundar for now. * Fix oopsie with West Zaqar Tower * Add proximity terminal positions to constructors * Offset vehicle spawning by the correct amount from game_objects.adb.lst * Orient players correctly when spawning at a respawn tube * Apply a 90 degree offset to tech plant garage locks, as these are the only locks where the orientation does not match the orientation of the door * Add missing spawn terminals, repair/rearm terminals for both ground and air. * Additional documentation for GOAM / PAM packets
This commit is contained in:
parent
8313ce6491
commit
3738feec12
31 changed files with 6366 additions and 2106 deletions
|
|
@ -30,7 +30,7 @@ class AmenityTest extends Specification {
|
|||
|
||||
"can be owned by a building" in {
|
||||
val ao = new AmenityObject()
|
||||
val bldg = Building(10, Zone.Nowhere, StructureType.Building)
|
||||
val bldg = Building(0, 10, Zone.Nowhere, StructureType.Building)
|
||||
|
||||
ao.Owner = bldg
|
||||
ao.Owner mustEqual bldg
|
||||
|
|
@ -54,7 +54,7 @@ class AmenityTest extends Specification {
|
|||
"confer faction allegiance through ownership" in {
|
||||
//see FactionAffinityTest
|
||||
val ao = new AmenityObject()
|
||||
val bldg = Building(10, Zone.Nowhere, StructureType.Building)
|
||||
val bldg = Building(0, 10, Zone.Nowhere, StructureType.Building)
|
||||
ao.Owner = bldg
|
||||
bldg.Faction mustEqual PlanetSideEmpire.NEUTRAL
|
||||
ao.Faction mustEqual PlanetSideEmpire.NEUTRAL
|
||||
|
|
@ -69,8 +69,8 @@ class AmenityTest extends Specification {
|
|||
class BuildingTest extends Specification {
|
||||
"Building" should {
|
||||
"construct" in {
|
||||
val bldg = Building(10, Zone.Nowhere, StructureType.Building)
|
||||
bldg.Id mustEqual 10
|
||||
val bldg = Building(0, 10, Zone.Nowhere, StructureType.Building)
|
||||
bldg.MapId mustEqual 10
|
||||
bldg.Actor mustEqual ActorRef.noSender
|
||||
bldg.Amenities mustEqual Nil
|
||||
bldg.Zone mustEqual Zone.Nowhere
|
||||
|
|
@ -78,7 +78,7 @@ class BuildingTest extends Specification {
|
|||
}
|
||||
|
||||
"change faction affinity" in {
|
||||
val bldg = Building(10, Zone.Nowhere, StructureType.Building)
|
||||
val bldg = Building(0, 10, Zone.Nowhere, StructureType.Building)
|
||||
bldg.Faction mustEqual PlanetSideEmpire.NEUTRAL
|
||||
|
||||
bldg.Faction = PlanetSideEmpire.TR
|
||||
|
|
@ -86,7 +86,7 @@ class BuildingTest extends Specification {
|
|||
}
|
||||
|
||||
"keep track of amenities" in {
|
||||
val bldg = Building(10, Zone.Nowhere, StructureType.Building)
|
||||
val bldg = Building(0, 10, Zone.Nowhere, StructureType.Building)
|
||||
val door1 = Door(GlobalDefinitions.door)
|
||||
val door2 = Door(GlobalDefinitions.door)
|
||||
|
||||
|
|
@ -104,8 +104,8 @@ class BuildingTest extends Specification {
|
|||
class WarpGateTest extends Specification {
|
||||
"WarpGate" should {
|
||||
"construct" in {
|
||||
val bldg = WarpGate(10, Zone.Nowhere)
|
||||
bldg.Id mustEqual 10
|
||||
val bldg = WarpGate(0, 10, Zone.Nowhere)
|
||||
bldg.MapId mustEqual 10
|
||||
bldg.Actor mustEqual ActorRef.noSender
|
||||
bldg.Amenities mustEqual Nil
|
||||
bldg.Zone mustEqual Zone.Nowhere
|
||||
|
|
@ -117,7 +117,7 @@ class WarpGateTest extends Specification {
|
|||
class BuildingControl1Test extends ActorTest {
|
||||
"Building Control" should {
|
||||
"construct" in {
|
||||
val bldg = Building(10, Zone.Nowhere, StructureType.Building)
|
||||
val bldg = Building(0, 10, Zone.Nowhere, StructureType.Building)
|
||||
bldg.Actor = system.actorOf(Props(classOf[BuildingControl], bldg), "test")
|
||||
assert(bldg.Actor != ActorRef.noSender)
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ class BuildingControl1Test extends ActorTest {
|
|||
|
||||
class BuildingControl2Test extends ActorTest {
|
||||
ServiceManager.boot(system) ! ServiceManager.Register(Props[GalaxyService], "galaxy")
|
||||
val bldg = Building(10, Zone.Nowhere, StructureType.Building)
|
||||
val bldg = Building(0, 10, Zone.Nowhere, StructureType.Building)
|
||||
bldg.Faction = PlanetSideEmpire.TR
|
||||
bldg.Actor = system.actorOf(Props(classOf[BuildingControl], bldg), "test")
|
||||
bldg.Actor ! "startup"
|
||||
|
|
@ -148,7 +148,7 @@ class BuildingControl2Test extends ActorTest {
|
|||
|
||||
class BuildingControl3Test extends ActorTest {
|
||||
ServiceManager.boot(system) ! ServiceManager.Register(Props[GalaxyService], "galaxy")
|
||||
val bldg = Building(10, Zone.Nowhere, StructureType.Building)
|
||||
val bldg = Building(0, 10, Zone.Nowhere, StructureType.Building)
|
||||
bldg.Faction = PlanetSideEmpire.TR
|
||||
bldg.Actor = system.actorOf(Props(classOf[BuildingControl], bldg), "test")
|
||||
val door1 = Door(GlobalDefinitions.door)
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class DoorTest extends Specification {
|
|||
}
|
||||
|
||||
"be opened and closed (2; toggle)" in {
|
||||
val msg = UseItemMessage(PlanetSideGUID(6585), PlanetSideGUID(0), PlanetSideGUID(372), 4294967295L, false, Vector3(5.0f,0.0f,0.0f), Vector3(0.0f,0.0f,0.0f), 11, 25, 0, 364)
|
||||
val msg = UseItemMessage(PlanetSideGUID(6585), PlanetSideGUID(0), PlanetSideGUID(372), 4294967295L, false, Vector3(5.0f, 0.0f, 0.0f), Vector3(0.0f, 0.0f, 0.0f), 11, 25, 0, 364)
|
||||
val door = Door(GlobalDefinitions.door)
|
||||
door.Open mustEqual None
|
||||
door.Use(player, msg)
|
||||
|
|
@ -51,27 +51,6 @@ class DoorTest extends Specification {
|
|||
door.Use(player, msg)
|
||||
door.Open mustEqual None
|
||||
}
|
||||
|
||||
"keep track of its orientation as a North-corrected vector" in {
|
||||
val ulp = math.ulp(1)
|
||||
val door = Door(GlobalDefinitions.door)
|
||||
|
||||
door.Orientation = Vector3(0, 0, 0) //face North
|
||||
door.Outwards.x < ulp mustEqual true
|
||||
door.Outwards.y mustEqual 1
|
||||
|
||||
door.Orientation = Vector3(0, 0, 90) //face East
|
||||
door.Outwards.x mustEqual 1
|
||||
door.Outwards.y < ulp mustEqual true
|
||||
|
||||
door.Orientation = Vector3(0, 0, 180) //face South
|
||||
door.Outwards.x < ulp mustEqual true
|
||||
door.Outwards.y mustEqual -1
|
||||
|
||||
door.Orientation = Vector3(0, 0, 270) //face West
|
||||
door.Outwards.x mustEqual -1
|
||||
door.Outwards.y < ulp mustEqual true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -122,7 +101,7 @@ object DoorControlTest {
|
|||
def SetUpAgents(faction : PlanetSideEmpire.Value)(implicit system : ActorSystem) : (Player, Door) = {
|
||||
val door = Door(GlobalDefinitions.door)
|
||||
door.Actor = system.actorOf(Props(classOf[DoorControl], door), "door")
|
||||
door.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
door.Owner = new Building(building_guid = 0, map_id = 0, Zone.Nowhere, StructureType.Building)
|
||||
door.Owner.Faction = faction
|
||||
(Player(Avatar("test", faction, CharacterGender.Male, 0, CharacterVoice.Mute)), door)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class FacilityTurretControl2Test extends ActorTest {
|
|||
val obj = FacilityTurret(GlobalDefinitions.manned_turret)
|
||||
obj.GUID = PlanetSideGUID(1)
|
||||
obj.Actor = system.actorOf(Props(classOf[FacilityTurretControl], obj), "turret-control")
|
||||
val bldg = Building(0, Zone.Nowhere, StructureType.Building)
|
||||
val bldg = Building(guid = 0, map_id = 0, Zone.Nowhere, StructureType.Building)
|
||||
bldg.Amenities = obj
|
||||
bldg.Faction = PlanetSideEmpire.TR
|
||||
|
||||
|
|
@ -129,7 +129,7 @@ class FacilityTurretControl3Test extends ActorTest {
|
|||
val obj = FacilityTurret(GlobalDefinitions.manned_turret)
|
||||
obj.GUID = PlanetSideGUID(1)
|
||||
obj.Actor = system.actorOf(Props(classOf[FacilityTurretControl], obj), "turret-control")
|
||||
val bldg = Building(0, Zone.Nowhere, StructureType.Building)
|
||||
val bldg = Building(guid = 0, map_id = 0, Zone.Nowhere, StructureType.Building)
|
||||
bldg.Amenities = obj
|
||||
|
||||
"FacilityTurretControl" should {
|
||||
|
|
@ -157,7 +157,7 @@ class FacilityTurretControl4Test extends ActorTest {
|
|||
val obj = FacilityTurret(objDef)
|
||||
obj.GUID = PlanetSideGUID(1)
|
||||
obj.Actor = system.actorOf(Props(classOf[FacilityTurretControl], obj), "turret-control")
|
||||
val bldg = Building(0, Zone.Nowhere, StructureType.Building)
|
||||
val bldg = Building(guid = 0, map_id = 0, Zone.Nowhere, StructureType.Building)
|
||||
bldg.Amenities = obj
|
||||
|
||||
"FacilityTurretControl" should {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class FactionAffinityTest extends Specification {
|
|||
|
||||
"inherits affinity from owner 2" in {
|
||||
val obj = new Door(GlobalDefinitions.door)
|
||||
val bldg = new Building(1, Zone.Nowhere, StructureType.Building)
|
||||
val bldg = new Building(building_guid = 0, map_id = 1, Zone.Nowhere, StructureType.Building)
|
||||
obj.Owner = bldg
|
||||
obj.Faction mustEqual PlanetSideEmpire.NEUTRAL
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import net.psforever.objects.serverobject.locks.{IFFLock, IFFLockControl}
|
|||
import net.psforever.objects.serverobject.structures.{Building, StructureType}
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.packet.game.PlanetSideGUID
|
||||
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire}
|
||||
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire, Vector3}
|
||||
import org.specs2.mutable.Specification
|
||||
|
||||
class IFFLockTest extends Specification {
|
||||
|
|
@ -20,6 +20,27 @@ class IFFLockTest extends Specification {
|
|||
}
|
||||
|
||||
//TODO internal hacking logic will be re-written later
|
||||
|
||||
"keep track of its orientation as a North-corrected vector" in {
|
||||
val ulp = math.ulp(1)
|
||||
val lock = IFFLock(GlobalDefinitions.lock_external)
|
||||
|
||||
lock.Orientation = Vector3(0, 0, 0) //face North
|
||||
lock.Outwards.x < ulp mustEqual true
|
||||
lock.Outwards.y mustEqual 1
|
||||
|
||||
lock.Orientation = Vector3(0, 0, 90) //face East
|
||||
lock.Outwards.x mustEqual 1
|
||||
lock.Outwards.y < ulp mustEqual true
|
||||
|
||||
lock.Orientation = Vector3(0, 0, 180) //face South
|
||||
lock.Outwards.x < ulp mustEqual true
|
||||
lock.Outwards.y mustEqual -1
|
||||
|
||||
lock.Orientation = Vector3(0, 0, 270) //face West
|
||||
lock.Outwards.x mustEqual -1
|
||||
lock.Outwards.y < ulp mustEqual true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -68,7 +89,7 @@ object IFFLockControlTest {
|
|||
def SetUpAgents(faction : PlanetSideEmpire.Value)(implicit system : ActorSystem) : (Player, IFFLock) = {
|
||||
val lock = IFFLock(GlobalDefinitions.lock_external)
|
||||
lock.Actor = system.actorOf(Props(classOf[IFFLockControl], lock), "lock-control")
|
||||
lock.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
lock.Owner = new Building(building_guid = 0, map_id = 0, Zone.Nowhere, StructureType.Building)
|
||||
lock.Owner.Faction = faction
|
||||
(Player(Avatar("test", faction, CharacterGender.Male, 0, CharacterVoice.Mute)), lock)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,9 +111,7 @@ class ResourceSiloControlNtuWarningTest extends ActorTest {
|
|||
obj.GUID = PlanetSideGUID(1)
|
||||
obj.Actor = system.actorOf(Props(classOf[ResourceSiloControl], obj), "test-silo")
|
||||
obj.Actor ! "startup"
|
||||
obj.Owner = new Building(0, Zone.Nowhere, StructureType.Building) {
|
||||
ModelId = 6
|
||||
}
|
||||
obj.Owner = new Building(building_guid = 6, map_id = 0, Zone.Nowhere, StructureType.Building)
|
||||
|
||||
"Resource silo" should {
|
||||
"announce high ntu" in {
|
||||
|
|
@ -146,9 +144,7 @@ class ResourceSiloControlUpdate1Test extends ActorTest {
|
|||
obj.GUID = PlanetSideGUID(1)
|
||||
obj.Actor = system.actorOf(Props(classOf[ResourceSiloControl], obj), "test-silo")
|
||||
obj.Actor ! "startup"
|
||||
val bldg = new Building(0, Zone.Nowhere, StructureType.Building) {
|
||||
ModelId = 6
|
||||
}
|
||||
val bldg = new Building(building_guid = 6, map_id = 0, Zone.Nowhere, StructureType.Building)
|
||||
val probe2 = TestProbe()
|
||||
bldg.Actor = system.actorOf(Props(classOf[ResourceSiloTest.ProbedBuildingControl], probe2), "test-bldg")
|
||||
obj.Owner = bldg
|
||||
|
|
@ -215,9 +211,7 @@ class ResourceSiloControlUpdate2Test extends ActorTest {
|
|||
obj.GUID = PlanetSideGUID(1)
|
||||
obj.Actor = system.actorOf(Props(classOf[ResourceSiloControl], obj), "test-silo")
|
||||
obj.Actor ! "startup"
|
||||
val bldg = new Building(0, Zone.Nowhere, StructureType.Building) {
|
||||
ModelId = 6
|
||||
}
|
||||
val bldg = new Building(building_guid = 6, map_id = 0, Zone.Nowhere, StructureType.Building)
|
||||
val probe2 = TestProbe()
|
||||
bldg.Actor = system.actorOf(Props(classOf[ResourceSiloTest.ProbedBuildingControl], probe2), "test-bldg")
|
||||
obj.Owner = bldg
|
||||
|
|
@ -276,9 +270,7 @@ class ResourceSiloControlNoUpdateTest extends ActorTest {
|
|||
obj.GUID = PlanetSideGUID(1)
|
||||
obj.Actor = system.actorOf(Props(classOf[ResourceSiloControl], obj), "test-silo")
|
||||
obj.Actor ! "startup"
|
||||
val bldg = new Building(0, Zone.Nowhere, StructureType.Building) {
|
||||
ModelId = 6
|
||||
}
|
||||
val bldg = new Building(building_guid = 6, map_id = 6, Zone.Nowhere, StructureType.Building)
|
||||
val probe2 = TestProbe()
|
||||
bldg.Actor = system.actorOf(Props(classOf[ResourceSiloTest.ProbedBuildingControl], probe2), "test-bldg")
|
||||
obj.Owner = bldg
|
||||
|
|
@ -298,7 +290,7 @@ class ResourceSiloControlNoUpdateTest extends ActorTest {
|
|||
expectNoMsg(500 milliseconds)
|
||||
probe1.expectNoMsg(500 milliseconds)
|
||||
probe2.expectNoMsg(500 milliseconds)
|
||||
assert(obj.ChargeLevel == 300)
|
||||
assert(obj.ChargeLevel == 299 || obj.ChargeLevel == 300) // Just in case the capacitor level drops while waiting for the message check 299 & 300
|
||||
assert(obj.CapacitorDisplay == 3)
|
||||
assert(obj.LowNtuWarningOn == false)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@ import scala.concurrent.duration.Duration
|
|||
class BuildingBuilderTest extends ActorTest {
|
||||
"Building object" should {
|
||||
"build" in {
|
||||
val structure : (Int,Zone,ActorContext)=>Building = Building.Structure(StructureType.Building)
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuildingTestActor], structure, 10, Zone.Nowhere), "building")
|
||||
val structure : (Int,Int,Zone,ActorContext)=>Building = Building.Structure(StructureType.Building)
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuildingTestActor], structure, 10, 10, Zone.Nowhere), "building")
|
||||
actor ! "!"
|
||||
|
||||
val reply = receiveOne(Duration.create(1000, "ms"))
|
||||
assert(reply.isInstanceOf[Building])
|
||||
assert(reply.asInstanceOf[Building].Id == 10)
|
||||
assert(reply.asInstanceOf[Building].MapId == 10)
|
||||
assert(reply.asInstanceOf[Building].Zone == Zone.Nowhere)
|
||||
}
|
||||
}
|
||||
|
|
@ -31,13 +31,13 @@ class BuildingBuilderTest extends ActorTest {
|
|||
class WarpGateBuilderTest extends ActorTest {
|
||||
"WarpGate object" should {
|
||||
"build" in {
|
||||
val structure : (Int,Zone,ActorContext)=>Building = WarpGate.Structure
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuildingTestActor], structure, 10, Zone.Nowhere), "wgate")
|
||||
val structure : (Int,Int,Zone,ActorContext)=>Building = WarpGate.Structure
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuildingTestActor], structure, 10, 10, Zone.Nowhere), "wgate")
|
||||
actor ! "!"
|
||||
|
||||
val reply = receiveOne(Duration.create(1000, "ms"))
|
||||
assert(reply.isInstanceOf[Building])
|
||||
assert(reply.asInstanceOf[Building].Id == 10)
|
||||
assert(reply.asInstanceOf[Building].MapId == 10)
|
||||
assert(reply.asInstanceOf[Building].Zone == Zone.Nowhere)
|
||||
}
|
||||
}
|
||||
|
|
@ -65,14 +65,12 @@ class DoorObjectBuilderTest2 extends ActorTest {
|
|||
"Door object" should {
|
||||
"build" in {
|
||||
val hub = ServerObjectBuilderTest.NumberPoolHub
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuilderTestActor], ServerObjectBuilder(1, Door.Constructor(Vector3(1, 2, 3), Vector3(90, 180, 45))), hub), "door")
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuilderTestActor], ServerObjectBuilder(1, Door.Constructor(Vector3(1, 2, 3))), hub), "door")
|
||||
actor ! "!"
|
||||
|
||||
val reply = receiveOne(Duration.create(1000, "ms"))
|
||||
assert(reply.isInstanceOf[Door])
|
||||
assert(reply.asInstanceOf[Door].Position == Vector3(1, 2, 3))
|
||||
assert(reply.asInstanceOf[Door].Orientation == Vector3(90, 180, 45))
|
||||
assert(reply.asInstanceOf[Door].Outwards == Vector3(0.70710677f, 0.70710677f, 0f))
|
||||
assert(reply.asInstanceOf[Door].HasGUID)
|
||||
assert(reply.asInstanceOf[Door].GUID == PlanetSideGUID(1))
|
||||
assert(reply == hub(1).get)
|
||||
|
|
@ -85,7 +83,7 @@ class IFFLockObjectBuilderTest extends ActorTest {
|
|||
"IFFLock object" should {
|
||||
"build" in {
|
||||
val hub = ServerObjectBuilderTest.NumberPoolHub
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuilderTestActor], ServerObjectBuilder(1, IFFLock.Constructor), hub), "lock")
|
||||
val actor = system.actorOf(Props(classOf[ServerObjectBuilderTest.BuilderTestActor], ServerObjectBuilder(1, IFFLock.Constructor(Vector3(0f, 0f, 0f), Vector3(0f, 0f, 0f))), hub), "lock")
|
||||
actor ! "!"
|
||||
|
||||
val reply = receiveOne(Duration.create(1000, "ms"))
|
||||
|
|
@ -279,10 +277,10 @@ object ServerObjectBuilderTest {
|
|||
}
|
||||
}
|
||||
|
||||
class BuildingTestActor(structure_con : (Int,Zone,ActorContext)=>Building, building_id : Int, zone : Zone) extends Actor {
|
||||
class BuildingTestActor(structure_con : (Int,Int,Zone,ActorContext)=>Building, building_guid : Int, map_id : Int, zone : Zone) extends Actor {
|
||||
def receive : Receive = {
|
||||
case _ =>
|
||||
sender ! FoundationBuilder(structure_con).Build(building_id, zone)(context)
|
||||
sender ! FoundationBuilder(structure_con).Build(building_guid, map_id, zone)(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ object VehicleSpawnPadControlTest {
|
|||
|
||||
val pad = VehicleSpawnPad(GlobalDefinitions.spawn_pad)
|
||||
pad.Actor = system.actorOf(Props(classOf[VehicleSpawnControl], pad), s"test-pad-${System.nanoTime()}")
|
||||
pad.Owner = new Building(0, zone, StructureType.Building)
|
||||
pad.Owner = new Building(building_guid = 0, map_id = 0, zone, StructureType.Building)
|
||||
pad.Owner.Faction = faction
|
||||
val player = Player(Avatar("test", faction, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
player.GUID = PlanetSideGUID(10)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import org.specs2.mutable.Specification
|
|||
import scala.concurrent.duration._
|
||||
|
||||
class ZoneTest extends Specification {
|
||||
def test(a: Int, b : Zone, c : ActorContext) : Building = { Building.NoBuilding }
|
||||
def test(a: Int, b: Int, c : Zone, d : ActorContext) : Building = { Building.NoBuilding }
|
||||
|
||||
"ZoneMap" should {
|
||||
"construct" in {
|
||||
|
|
@ -33,11 +33,11 @@ class ZoneTest extends Specification {
|
|||
"references bases by a positive building id (defaults to 0)" in {
|
||||
val map = new ZoneMap("map13")
|
||||
map.LocalBuildings mustEqual Map.empty
|
||||
map.LocalBuilding(10, FoundationBuilder(test))
|
||||
map.LocalBuildings.keySet.contains(10) mustEqual true
|
||||
map.LocalBuilding(-1, FoundationBuilder(test))
|
||||
map.LocalBuildings.keySet.contains(10) mustEqual true
|
||||
map.LocalBuildings.keySet.contains(-1) mustEqual false
|
||||
map.LocalBuilding(building_guid = 10, map_id = 0, FoundationBuilder(test))
|
||||
map.LocalBuildings.keySet.contains((10, 0)) mustEqual true
|
||||
map.LocalBuilding(building_guid = -1, map_id = 0, FoundationBuilder(test))
|
||||
map.LocalBuildings.keySet.contains((0, 0)) mustEqual true
|
||||
map.LocalBuildings.keySet.contains((-1, 0)) mustEqual false
|
||||
}
|
||||
|
||||
"associates objects to bases (doesn't check numbers)" in {
|
||||
|
|
@ -87,7 +87,7 @@ class ZoneTest extends Specification {
|
|||
}
|
||||
|
||||
val map13 = new ZoneMap("map13")
|
||||
map13.LocalBuilding(10, FoundationBuilder(test))
|
||||
map13.LocalBuilding(building_guid = 0, map_id = 10, FoundationBuilder(test))
|
||||
class TestObject extends IdentifiableEntity
|
||||
|
||||
"Zone" should {
|
||||
|
|
@ -172,7 +172,7 @@ class ZoneActorTest extends ActorTest {
|
|||
|
||||
"set up spawn groups based on buildings" in {
|
||||
val map6 = new ZoneMap("map6") {
|
||||
LocalBuilding(1, FoundationBuilder(Building.Structure(StructureType.Building, Vector3(1,1,1))))
|
||||
LocalBuilding(building_guid = 1, map_id = 1, FoundationBuilder(Building.Structure(StructureType.Building, Vector3(1,1,1))))
|
||||
LocalObject(1, SpawnTube.Constructor(Vector3.Zero, Vector3.Zero))
|
||||
LocalObject(2, Terminal.Constructor(GlobalDefinitions.dropship_vehicle_terminal))
|
||||
LocalObject(3, SpawnTube.Constructor(Vector3.Zero, Vector3.Zero))
|
||||
|
|
@ -180,11 +180,11 @@ class ZoneActorTest extends ActorTest {
|
|||
ObjectToBuilding(2, 1)
|
||||
ObjectToBuilding(3, 1)
|
||||
|
||||
LocalBuilding(2, FoundationBuilder(Building.Structure(StructureType.Building)))
|
||||
LocalBuilding(building_guid = 2, map_id = 2, FoundationBuilder(Building.Structure(StructureType.Building)))
|
||||
LocalObject(7, SpawnTube.Constructor(Vector3.Zero, Vector3.Zero))
|
||||
ObjectToBuilding(7, 2)
|
||||
|
||||
LocalBuilding(3, FoundationBuilder(Building.Structure(StructureType.Building, Vector3(1,1,1))))
|
||||
LocalBuilding(building_guid = 3, map_id = 3, FoundationBuilder(Building.Structure(StructureType.Building, Vector3(1,1,1))))
|
||||
LocalObject(4, Terminal.Constructor(GlobalDefinitions.dropship_vehicle_terminal))
|
||||
LocalObject(5, SpawnTube.Constructor(Vector3.Zero, Vector3.Zero))
|
||||
LocalObject(6, Terminal.Constructor(GlobalDefinitions.dropship_vehicle_terminal))
|
||||
|
|
@ -200,7 +200,7 @@ class ZoneActorTest extends ActorTest {
|
|||
val groups = zone.SpawnGroups()
|
||||
assert(groups.size == 2)
|
||||
zone.SpawnGroups().foreach({ case(building, tubes) =>
|
||||
if(building.Id == 1) {
|
||||
if(building.MapId == 1) {
|
||||
val building1 = zone.SpawnGroups(building)
|
||||
assert(tubes.length == 2)
|
||||
assert(tubes.head == building1.head)
|
||||
|
|
@ -208,7 +208,7 @@ class ZoneActorTest extends ActorTest {
|
|||
assert(tubes(1) == building1(1))
|
||||
assert(tubes(1).GUID == PlanetSideGUID(3))
|
||||
}
|
||||
else if(building.Id == 3) {
|
||||
else if(building.MapId == 3) {
|
||||
val building2 = zone.SpawnGroups(building)
|
||||
assert(tubes.length == 1)
|
||||
assert(tubes.head == building2.head)
|
||||
|
|
@ -222,11 +222,11 @@ class ZoneActorTest extends ActorTest {
|
|||
|
||||
"select spawn points based on the position of the player in reference to buildings" in {
|
||||
val map6 = new ZoneMap("map6") {
|
||||
LocalBuilding(1, FoundationBuilder(Building.Structure(StructureType.Building, Vector3(1,1,1))))
|
||||
LocalBuilding(building_guid = 1, map_id = 1, FoundationBuilder(Building.Structure(StructureType.Building, Vector3(1,1,1))))
|
||||
LocalObject(1, SpawnTube.Constructor(Vector3.Zero, Vector3.Zero))
|
||||
ObjectToBuilding(1, 1)
|
||||
|
||||
LocalBuilding(3, FoundationBuilder(Building.Structure(StructureType.Building, Vector3(4,4,4))))
|
||||
LocalBuilding(building_guid = 3, map_id = 3, FoundationBuilder(Building.Structure(StructureType.Building, Vector3(4,4,4))))
|
||||
LocalObject(5, SpawnTube.Constructor(Vector3.Zero, Vector3.Zero))
|
||||
ObjectToBuilding(5, 3)
|
||||
}
|
||||
|
|
@ -255,9 +255,9 @@ class ZoneActorTest extends ActorTest {
|
|||
|
||||
"will report if no spawn points have been found in a zone" in {
|
||||
val map6 = new ZoneMap("map6") {
|
||||
LocalBuilding(1, FoundationBuilder(Building.Structure(StructureType.Building, Vector3(1,1,1))))
|
||||
LocalBuilding(building_guid = 1, map_id = 1, FoundationBuilder(Building.Structure(StructureType.Building, Vector3(1,1,1))))
|
||||
|
||||
LocalBuilding(3, FoundationBuilder(Building.Structure(StructureType.Tower, Vector3(4,4,4))))
|
||||
LocalBuilding(building_guid = 3, map_id = 3, FoundationBuilder(Building.Structure(StructureType.Tower, Vector3(4,4,4))))
|
||||
LocalObject(5, SpawnTube.Constructor(Vector3.Zero, Vector3.Zero))
|
||||
ObjectToBuilding(5, 3)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ object ImplantTerminalMechTest {
|
|||
|
||||
val terminal = ImplantTerminalMech(GlobalDefinitions.implant_terminal_mech)
|
||||
terminal.Actor = system.actorOf(Props(classOf[ImplantTerminalMechControl], terminal), "mech")
|
||||
terminal.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner = new Building(building_guid = 0, map_id = 0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner.Faction = faction
|
||||
terminal.GUID = PlanetSideGUID(1)
|
||||
(Player(Avatar("test", faction, CharacterGender.Male, 0, CharacterVoice.Mute)), terminal)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class OrderTerminalTest extends Specification {
|
|||
val avatar = Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)
|
||||
val player = Player(avatar)
|
||||
|
||||
val building = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
val building = new Building(building_guid = 0, map_id = 0, Zone.Nowhere, StructureType.Building)
|
||||
building.Faction = PlanetSideEmpire.TR
|
||||
val infantryTerminal = Terminal(GlobalDefinitions.order_terminal)
|
||||
infantryTerminal.Owner = building
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class ProximityTerminalControlStartTest extends ActorTest {
|
|||
AddPool("dynamic", 1 to 10)
|
||||
}
|
||||
}
|
||||
new Building(0, zone, StructureType.Facility) {
|
||||
new Building(building_guid = 0, map_id = 0, zone, StructureType.Facility) {
|
||||
Amenities = terminal
|
||||
Faction = PlanetSideEmpire.VS
|
||||
}
|
||||
|
|
@ -153,7 +153,7 @@ class ProximityTerminalControlTwoUsersTest extends ActorTest {
|
|||
AddPool("dynamic", 1 to 10)
|
||||
}
|
||||
}
|
||||
new Building(0, zone, StructureType.Facility) {
|
||||
new Building(building_guid = 0, map_id = 0, zone, StructureType.Facility) {
|
||||
Amenities = terminal
|
||||
Faction = PlanetSideEmpire.VS
|
||||
}
|
||||
|
|
@ -205,7 +205,7 @@ class ProximityTerminalControlStopTest extends ActorTest {
|
|||
AddPool("dynamic", 1 to 10)
|
||||
}
|
||||
}
|
||||
new Building(0, zone, StructureType.Facility) {
|
||||
new Building(building_guid = 0, map_id = 0, zone, StructureType.Facility) {
|
||||
Amenities = terminal
|
||||
Faction = PlanetSideEmpire.VS
|
||||
}
|
||||
|
|
@ -256,7 +256,7 @@ class ProximityTerminalControlNotStopTest extends ActorTest {
|
|||
AddPool("dynamic", 1 to 10)
|
||||
}
|
||||
}
|
||||
new Building(0, zone, StructureType.Facility) {
|
||||
new Building(building_guid = 0, map_id = 0, zone, StructureType.Facility) {
|
||||
Amenities = terminal
|
||||
Faction = PlanetSideEmpire.VS
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ object TerminalControlTest {
|
|||
def SetUpAgents(tdef : TerminalDefinition, faction : PlanetSideEmpire.Value)(implicit system : ActorSystem) : (Player, Terminal) = {
|
||||
val terminal = Terminal(tdef)
|
||||
terminal.Actor = system.actorOf(Props(classOf[TerminalControl], terminal), "test-term")
|
||||
terminal.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner = new Building(building_guid = 0, map_id = 0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner.Faction = faction
|
||||
(Player(Avatar("test", faction, CharacterGender.Male, 0, CharacterVoice.Mute)), terminal)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue