2019-12-13 03:00:55 -05:00
|
|
|
// Copyright (c) 2017 PSForever
|
|
|
|
|
package actor.objects
|
|
|
|
|
|
|
|
|
|
import akka.actor.{ActorRef, ActorSystem, Props}
|
|
|
|
|
import akka.testkit.TestProbe
|
|
|
|
|
import actor.base.ActorTest
|
|
|
|
|
import net.psforever.objects.serverobject.pad.{VehicleSpawnControl, VehicleSpawnPad}
|
|
|
|
|
import net.psforever.objects.serverobject.structures.StructureType
|
2020-08-01 12:25:03 +02:00
|
|
|
import net.psforever.objects.{GlobalDefinitions, Player, Vehicle}
|
2019-12-13 03:00:55 -05:00
|
|
|
import net.psforever.objects.zones.Zone
|
2020-01-06 08:45:55 -05:00
|
|
|
import net.psforever.types.{PlanetSideGUID, _}
|
2020-08-23 03:26:06 +02:00
|
|
|
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
|
2020-07-22 17:28:09 +02:00
|
|
|
import akka.actor.typed.scaladsl.adapter._
|
|
|
|
|
import net.psforever.actors.zone.ZoneActor
|
2020-08-01 12:25:03 +02:00
|
|
|
import net.psforever.objects.avatar.Avatar
|
2021-05-05 10:13:57 -04:00
|
|
|
import net.psforever.objects.serverobject.terminals.Terminal
|
2019-12-13 03:00:55 -05:00
|
|
|
|
|
|
|
|
import scala.concurrent.duration._
|
|
|
|
|
|
|
|
|
|
class VehicleSpawnControl1Test extends ActorTest {
|
|
|
|
|
"VehicleSpawnControl" should {
|
|
|
|
|
"construct" in {
|
|
|
|
|
val obj = VehicleSpawnPad(GlobalDefinitions.mb_pad_creation)
|
|
|
|
|
obj.Actor = system.actorOf(Props(classOf[VehicleSpawnControl], obj), "mb_pad_creation")
|
|
|
|
|
assert(obj.Actor != ActorRef.noSender)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class VehicleSpawnControl2Test extends ActorTest {
|
|
|
|
|
"VehicleSpawnControl" should {
|
|
|
|
|
"complete a vehicle order" in {
|
2021-05-05 10:13:57 -04:00
|
|
|
val (vehicle, player, pad, terminal, zone) = VehicleSpawnPadControlTest.SetUpAgents(PlanetSideEmpire.TR)
|
2020-07-14 05:54:05 +02:00
|
|
|
val probe = new TestProbe(system, "zone-events")
|
2019-12-13 03:00:55 -05:00
|
|
|
|
2021-05-05 10:13:57 -04:00
|
|
|
zone.VehicleEvents = probe.ref //zone events
|
|
|
|
|
pad.Actor ! VehicleSpawnPad.VehicleOrder(player, vehicle, terminal) //order
|
2019-12-13 03:00:55 -05:00
|
|
|
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.ConcealPlayer])
|
2021-04-29 09:38:51 -04:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleServiceMessage])
|
2019-12-13 03:00:55 -05:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.AttachToRails])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.StartPlayerSeatedInVehicle])
|
Hart (#723)
* 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
2021-03-23 09:44:10 -04:00
|
|
|
vehicle.Seats(0).mount(player)
|
2019-12-13 03:00:55 -05:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.PlayerSeatedInVehicle])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.DetachFromRails])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.ServerVehicleOverrideStart])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.ServerVehicleOverrideEnd])
|
|
|
|
|
//if we move the vehicle away from the pad, we should receive a ResetSpawnPad message
|
|
|
|
|
//that means that the first order has cleared and the spawn pad is now waiting for additional orders
|
2020-07-14 05:54:05 +02:00
|
|
|
vehicle.Position = Vector3(12, 0, 0)
|
2019-12-13 03:00:55 -05:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.ResetSpawnPad])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class VehicleSpawnControl3Test extends ActorTest {
|
|
|
|
|
"VehicleSpawnControl" should {
|
|
|
|
|
"block the second vehicle order until the first is completed" in {
|
2021-05-05 10:13:57 -04:00
|
|
|
val (vehicle, player, pad, terminal, zone) = VehicleSpawnPadControlTest.SetUpAgents(PlanetSideEmpire.TR)
|
2019-12-13 03:00:55 -05:00
|
|
|
//we can recycle the vehicle and the player for each order
|
2020-07-14 05:54:05 +02:00
|
|
|
val probe = new TestProbe(system, "zone-events")
|
2021-03-21 14:22:00 -04:00
|
|
|
val player2 = Player(Avatar(0, "test2", player.Faction, CharacterSex.Male, 0, CharacterVoice.Mute))
|
2019-12-13 03:00:55 -05:00
|
|
|
player2.GUID = PlanetSideGUID(11)
|
2020-08-01 12:25:03 +02:00
|
|
|
player2.Continent = zone.id
|
|
|
|
|
player2.Spawn()
|
2019-12-13 03:00:55 -05:00
|
|
|
|
2021-05-05 10:13:57 -04:00
|
|
|
zone.VehicleEvents = probe.ref //zone events
|
|
|
|
|
pad.Actor ! VehicleSpawnPad.VehicleOrder(player, vehicle, terminal) //first order
|
|
|
|
|
pad.Actor ! VehicleSpawnPad.VehicleOrder(player2, vehicle, terminal) //second order (vehicle shared)
|
2019-12-13 03:00:55 -05:00
|
|
|
|
|
|
|
|
assert(probe.receiveOne(1 seconds) match {
|
|
|
|
|
case VehicleSpawnPad.PeriodicReminder(_, VehicleSpawnPad.Reminders.Queue, _) => true
|
2020-07-14 05:54:05 +02:00
|
|
|
case _ => false
|
2019-12-13 03:00:55 -05:00
|
|
|
})
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.ConcealPlayer])
|
2021-04-29 09:38:51 -04:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleServiceMessage])
|
2019-12-13 03:00:55 -05:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.AttachToRails])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.StartPlayerSeatedInVehicle])
|
Hart (#723)
* 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
2021-03-23 09:44:10 -04:00
|
|
|
vehicle.Seats(0).mount(player)
|
2019-12-13 03:00:55 -05:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.PlayerSeatedInVehicle])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.DetachFromRails])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.ServerVehicleOverrideStart])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.ServerVehicleOverrideEnd])
|
|
|
|
|
assert(probe.receiveOne(1 minute) match {
|
|
|
|
|
case VehicleSpawnPad.PeriodicReminder(_, VehicleSpawnPad.Reminders.Blocked, _) => true
|
2020-07-14 05:54:05 +02:00
|
|
|
case _ => false
|
2019-12-13 03:00:55 -05:00
|
|
|
})
|
|
|
|
|
assert(probe.receiveOne(1 minute) match {
|
|
|
|
|
case VehicleSpawnPad.PeriodicReminder(_, VehicleSpawnPad.Reminders.Blocked, _) => true
|
2020-07-14 05:54:05 +02:00
|
|
|
case _ => false
|
2019-12-13 03:00:55 -05:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//if we move the vehicle away from the pad, we should receive a second ConcealPlayer message
|
|
|
|
|
//that means that the first order has cleared and the spawn pad is now working on the second order successfully
|
|
|
|
|
player.VehicleSeated = None //since shared between orders, as necessary
|
Hart (#723)
* 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
2021-03-23 09:44:10 -04:00
|
|
|
vehicle.Seats(0).unmount(player)
|
2020-07-14 05:54:05 +02:00
|
|
|
vehicle.Position = Vector3(12, 0, 0)
|
2019-12-13 03:00:55 -05:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.ResetSpawnPad])
|
|
|
|
|
probe.expectMsgClass(3 seconds, classOf[VehicleSpawnPad.ConcealPlayer])
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class VehicleSpawnControl4Test extends ActorTest {
|
|
|
|
|
"VehicleSpawnControl" should {
|
|
|
|
|
"clean up the vehicle if the driver-to-be is on the wrong continent" in {
|
2021-05-05 10:13:57 -04:00
|
|
|
val (vehicle, player, pad, terminal, zone) = VehicleSpawnPadControlTest.SetUpAgents(PlanetSideEmpire.TR)
|
2020-07-14 05:54:05 +02:00
|
|
|
val probe = new TestProbe(system, "zone-events")
|
2019-12-13 03:00:55 -05:00
|
|
|
zone.VehicleEvents = probe.ref
|
|
|
|
|
player.Continent = "problem" //problem
|
|
|
|
|
|
2021-05-05 10:13:57 -04:00
|
|
|
pad.Actor ! VehicleSpawnPad.VehicleOrder(player, vehicle, terminal) //order
|
2019-12-13 03:00:55 -05:00
|
|
|
|
2020-04-27 21:22:59 -04:00
|
|
|
val msg = probe.receiveOne(1 minute)
|
2020-10-10 09:16:56 -04:00
|
|
|
// assert(
|
|
|
|
|
// msg match {
|
|
|
|
|
// case VehicleServiceMessage.Decon(RemoverActor.AddTask(v, z, _)) => (v == vehicle) && (z == zone)
|
|
|
|
|
// case _ => false
|
|
|
|
|
// }
|
|
|
|
|
// )
|
2020-05-26 19:50:54 -04:00
|
|
|
probe.expectNoMessage(5 seconds)
|
2019-12-13 03:00:55 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class VehicleSpawnControl5Test extends ActorTest() {
|
|
|
|
|
"VehicleSpawnControl" should {
|
|
|
|
|
"abandon a destroyed vehicle on the spawn pad (blocking)" in {
|
2021-05-05 10:13:57 -04:00
|
|
|
val (vehicle, player, pad, terminal, zone) = VehicleSpawnPadControlTest.SetUpAgents(PlanetSideEmpire.TR)
|
2019-12-13 03:00:55 -05:00
|
|
|
|
|
|
|
|
val probe = new TestProbe(system, "zone-events")
|
|
|
|
|
zone.VehicleEvents = probe.ref
|
2021-05-05 10:13:57 -04:00
|
|
|
pad.Actor ! VehicleSpawnPad.VehicleOrder(player, vehicle, terminal) //order
|
2019-12-13 03:00:55 -05:00
|
|
|
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.ConcealPlayer])
|
2021-04-29 09:38:51 -04:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleServiceMessage])
|
2019-12-13 03:00:55 -05:00
|
|
|
vehicle.Health = 0 //problem
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.AttachToRails])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.DetachFromRails])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.RevealPlayer])
|
|
|
|
|
assert(probe.receiveOne(1 minute) match {
|
2020-07-14 05:54:05 +02:00
|
|
|
case VehicleServiceMessage(_, VehicleAction.LoadVehicle(_, _, _, _, _)) => true
|
|
|
|
|
case _ => false
|
2019-12-13 03:00:55 -05:00
|
|
|
})
|
|
|
|
|
assert(probe.receiveOne(1 minute) match {
|
|
|
|
|
case VehicleSpawnPad.PeriodicReminder(_, VehicleSpawnPad.Reminders.Blocked, _) => true
|
2020-07-14 05:54:05 +02:00
|
|
|
case _ => false
|
2019-12-13 03:00:55 -05:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class VehicleSpawnControl6Test extends ActorTest() {
|
|
|
|
|
"VehicleSpawnControl" should {
|
|
|
|
|
"abandon a vehicle on the spawn pad if driver is unfit to drive (blocking)" in {
|
2021-05-05 10:13:57 -04:00
|
|
|
val (vehicle, player, pad, terminal, zone) = VehicleSpawnPadControlTest.SetUpAgents(PlanetSideEmpire.TR)
|
2019-12-13 03:00:55 -05:00
|
|
|
|
|
|
|
|
val probe = new TestProbe(system, "zone-events")
|
|
|
|
|
zone.VehicleEvents = probe.ref
|
2021-05-05 10:13:57 -04:00
|
|
|
pad.Actor ! VehicleSpawnPad.VehicleOrder(player, vehicle, terminal) //order
|
2019-12-13 03:00:55 -05:00
|
|
|
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.ConcealPlayer])
|
2021-04-29 09:38:51 -04:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleServiceMessage])
|
2019-12-13 03:00:55 -05:00
|
|
|
player.Die
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.AttachToRails])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.DetachFromRails])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.RevealPlayer])
|
|
|
|
|
assert(probe.receiveOne(1 minute) match {
|
2020-07-14 05:54:05 +02:00
|
|
|
case VehicleServiceMessage(_, VehicleAction.LoadVehicle(_, _, _, _, _)) => true
|
|
|
|
|
case _ => false
|
2019-12-13 03:00:55 -05:00
|
|
|
})
|
|
|
|
|
assert(probe.receiveOne(1 minute) match {
|
|
|
|
|
case VehicleSpawnPad.PeriodicReminder(_, VehicleSpawnPad.Reminders.Blocked, _) => true
|
2020-07-14 05:54:05 +02:00
|
|
|
case _ => false
|
2019-12-13 03:00:55 -05:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class VehicleSpawnControl7Test extends ActorTest {
|
|
|
|
|
"VehicleSpawnControl" should {
|
|
|
|
|
"abandon a vehicle on the spawn pad if driver is unfit to drive (blocking)" in {
|
2021-05-05 10:13:57 -04:00
|
|
|
val (vehicle, player, pad, terminal, zone) = VehicleSpawnPadControlTest.SetUpAgents(PlanetSideEmpire.TR)
|
2020-07-14 05:54:05 +02:00
|
|
|
val probe = new TestProbe(system, "zone-events")
|
2019-12-13 03:00:55 -05:00
|
|
|
player.ExoSuit = ExoSuitType.MAX
|
|
|
|
|
|
2021-05-05 10:13:57 -04:00
|
|
|
zone.VehicleEvents = probe.ref //zone events
|
|
|
|
|
pad.Actor ! VehicleSpawnPad.VehicleOrder(player, vehicle, terminal) //order
|
2019-12-13 03:00:55 -05:00
|
|
|
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.ConcealPlayer])
|
2021-04-29 09:38:51 -04:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleServiceMessage])
|
2019-12-13 03:00:55 -05:00
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.AttachToRails])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.StartPlayerSeatedInVehicle])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.DetachFromRails])
|
|
|
|
|
probe.expectMsgClass(1 minute, classOf[VehicleSpawnPad.RevealPlayer])
|
|
|
|
|
assert(probe.receiveOne(1 minute) match {
|
2020-07-14 05:54:05 +02:00
|
|
|
case VehicleServiceMessage(_, VehicleAction.LoadVehicle(_, _, _, _, _)) => true
|
|
|
|
|
case _ => false
|
2019-12-13 03:00:55 -05:00
|
|
|
})
|
|
|
|
|
assert(probe.receiveOne(1 minute) match {
|
|
|
|
|
case VehicleSpawnPad.PeriodicReminder(_, VehicleSpawnPad.Reminders.Blocked, _) => true
|
2020-07-14 05:54:05 +02:00
|
|
|
case _ => false
|
2019-12-13 03:00:55 -05:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object VehicleSpawnPadControlTest {
|
|
|
|
|
import net.psforever.objects.zones.ZoneMap
|
|
|
|
|
private val map = new ZoneMap("test-map")
|
|
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
def SetUpAgents(
|
|
|
|
|
faction: PlanetSideEmpire.Value
|
2021-05-05 10:13:57 -04:00
|
|
|
)(implicit system: ActorSystem): (Vehicle, Player, VehicleSpawnPad, Terminal, Zone) = {
|
2019-12-13 03:00:55 -05:00
|
|
|
import net.psforever.objects.guid.NumberPoolHub
|
2020-09-15 19:46:56 -04:00
|
|
|
import net.psforever.objects.guid.source.MaxNumberSource
|
2019-12-13 03:00:55 -05:00
|
|
|
import net.psforever.objects.serverobject.structures.Building
|
2021-06-21 23:40:44 -04:00
|
|
|
import net.psforever.objects.vehicles.control.VehicleControl
|
2019-12-13 03:00:55 -05:00
|
|
|
import net.psforever.objects.Tool
|
2021-03-21 14:22:00 -04:00
|
|
|
import net.psforever.types.CharacterSex
|
2019-12-13 03:00:55 -05:00
|
|
|
|
2021-05-05 10:13:57 -04:00
|
|
|
val terminal = Terminal(GlobalDefinitions.vehicle_terminal_combined)
|
2020-07-14 05:54:05 +02:00
|
|
|
val vehicle = Vehicle(GlobalDefinitions.two_man_assault_buggy)
|
Lump of Coal (#982)
* preliminary elements needed to battle frame robotics; mostly from previous branch
* introduction of FrameVehicleStateMessage and anticipated event system paths for BFR's; spawning amenities for BFR's are parsed and built from the zonemap files, but their coordinates are currently incorrect, and the resulting entity will not function atm
* bfr's spawn correctly; default arm weapons will spawn correctly; bfr rearm terminal added but arm swap not working correctly; bfr shields charge if not full; proper separation of vehicle spawn pad types
* arm weapon swapping in bfr's; swapped weapons switch, contextually, to either *_left or to *_right depending on the mounting; partial support for entities that do not have an OCDM packet form
* crouching improves shield regeneration
* some projectiles damage the bfr regardless of its shield
* delay the final vehicle explosion; start of vehicle subsystems
* handling for bfr shield ui updates; more of vehicle subsystems; corrections to TradeMessage packet; clarifications for FrameVehicleStateMessage package; report on flight status of bfr's
* control agency support for vehicle subsystems for arm weapon fire control
* vehicle capacitor, for what it's worth; shield and capacitor are influenced by recharge freeze and drain
* initial packet and tests for AvatarAwardMessage; update the fields of FreindsResponse, DetailedCharacterData, and LoadoutType for FavoritesMessage; corrections to intiailization packets in SessionActor; players start as imprinted by default
* support for GOAM and GAM integration into vehicle control agencies using a basic actor superclass; addition of vehicle subsystems; modifications to bfr control agency to allow for weapon handiness and subsystem control; fixed Fit mapping for vehicle override; made mountable seat transcoders independent
* delayed explosions to accompany the delayed death for the bfr; bfr terminal window closes on successful purchase
* the bfr armor siphon works
* clarification for bfr inventory item manipulation; corrections to length of bfr transcoder for flight variants; everything else in in support of the various arm weapons that can be assigned to the bfr, including damage proxy support for causing/interacting with/cleaning up after radiation cloud projectiles
* fixed the apc emp burst; fixed bfr arm weapon manipulation for activated subsystem; armor and ntu siphon support
* battleframe loadouts available upon vehicle spawn (vs and tr only)
* adb values for siphons; subsystem update message; some repairs
* cargo vehicles are subject to radiation damage; damage for battleframes are different depending on shield evasion status; battleframe loadout deleting supported; bfr kill box; automatically wire bfr sheds, includeing the ones in sanctuary
* proper bfr spawn angles; bfr vehicle timers; projectiles are no longer radiation clouds by default; better remote projectile cleanup; resolving incorrect weapon arm enabled states for bfrs
* added tests for FrameVehicleState and GenericObjectActionAtPosition; pass around maximum sector for zone interactions
* changed the triggers for the stamina regeneration timer
* potential fix for issue related to finding arm weapon mounts
* modifications to how vehicle subsystems are automated; jammer field updates; support and passing around custom block map ranges; does include activated dev tests for battleframe PAM, which will need to be stripped out later
* commit while working on subsystems mk2
* subsystems fail when jammed; an unoccupied bfr does not have shields active; pulling a bfr of one variant should block the other variant too
* fix distance check with radiation clouds; blocked bfr weaponry from anywhere but bfr arm mounts and cursor; ammunition depletion of aphelion laser; bfr shields deactivates when unoccupied
* significant modifications to vehicle subsystem operations; disambiguation of weapon subsystems; debuffs to charge rate and use rate for the capacitor and shield of bfr; test for ComponentDamageMessage; somewhat proper jammering operations for bfr
2022-01-27 09:57:51 -05:00
|
|
|
val weapon = vehicle.WeaponControlledFromSeat(1).head.asInstanceOf[Tool]
|
2020-09-15 19:46:56 -04:00
|
|
|
val guid: NumberPoolHub = new NumberPoolHub(MaxNumberSource(5))
|
2020-04-27 21:31:53 -04:00
|
|
|
guid.AddPool("test-pool", (0 to 5).toList)
|
2020-02-14 21:11:40 -05:00
|
|
|
guid.register(vehicle, "test-pool")
|
|
|
|
|
guid.register(weapon, "test-pool")
|
|
|
|
|
guid.register(weapon.AmmoSlot.Box, "test-pool")
|
2020-07-14 05:54:05 +02:00
|
|
|
val zone = new Zone("test-zone", map, 0) {
|
|
|
|
|
override def SetupNumberPools(): Unit = {}
|
2019-12-13 03:00:55 -05:00
|
|
|
}
|
2020-02-14 21:11:40 -05:00
|
|
|
zone.GUID(guid)
|
2023-03-25 23:29:03 -04:00
|
|
|
zone.actor = system.spawn(ZoneActor(zone), s"test-zone-${System.currentTimeMillis()}")
|
2019-12-13 13:46:21 -05:00
|
|
|
|
|
|
|
|
// Hack: Wait for the Zone to finish booting, otherwise later tests will fail randomly due to race conditions
|
|
|
|
|
// with actor probe setting
|
|
|
|
|
// TODO(chord): Remove when Zone supports notification of booting being complete
|
|
|
|
|
Thread.sleep(5000)
|
|
|
|
|
|
2023-03-25 23:29:03 -04:00
|
|
|
vehicle.Actor = system.actorOf(Props(classOf[VehicleControl], vehicle), s"vehicle-control-${System.currentTimeMillis()}")
|
2019-12-13 03:00:55 -05:00
|
|
|
|
|
|
|
|
val pad = VehicleSpawnPad(GlobalDefinitions.mb_pad_creation)
|
2023-03-25 23:29:03 -04:00
|
|
|
pad.Actor = system.actorOf(Props(classOf[VehicleSpawnControl], pad), s"test-pad-${System.currentTimeMillis()}")
|
2020-07-14 05:54:05 +02:00
|
|
|
pad.Owner =
|
|
|
|
|
new Building("Building", building_guid = 0, map_id = 0, zone, StructureType.Building, GlobalDefinitions.building)
|
2019-12-13 03:00:55 -05:00
|
|
|
pad.Owner.Faction = faction
|
2020-02-14 21:11:40 -05:00
|
|
|
pad.Zone = zone
|
2020-04-27 21:31:53 -04:00
|
|
|
guid.register(pad, "test-pool")
|
2021-03-21 14:22:00 -04:00
|
|
|
val player = Player(Avatar(0, "test", faction, CharacterSex.Male, 0, CharacterVoice.Mute))
|
2020-02-14 21:11:40 -05:00
|
|
|
guid.register(player, "test-pool")
|
|
|
|
|
player.Zone = zone
|
2020-08-01 12:25:03 +02:00
|
|
|
player.Spawn()
|
2019-12-13 03:00:55 -05:00
|
|
|
//note: pad and vehicle are both at Vector3(1,0,0) so they count as blocking
|
2020-07-14 05:54:05 +02:00
|
|
|
pad.Position = Vector3(1, 0, 0)
|
|
|
|
|
vehicle.Position = Vector3(1, 0, 0)
|
2021-05-05 10:13:57 -04:00
|
|
|
(vehicle, player, pad, terminal, zone)
|
2019-12-13 03:00:55 -05:00
|
|
|
}
|
|
|
|
|
}
|