2021-06-02 11:51:38 -04:00
|
|
|
// Copyright (c) 2021 PSForever
|
|
|
|
|
package objects
|
|
|
|
|
|
|
|
|
|
import akka.actor.{ActorRef, Props}
|
The Blockmap (#852)
* separating geometry classes
* 2d geometry; retirement of the *3D suffix
* makings of an early block map datastructure
* entities in a zone - players, corpses, vehicles, deployables, ground clutter, and buildings - divided between sectors of the zone upon creation, management, or mounting; superfluous messages to keep track of blockmap state, for now
* trait for entities to be added to the blockmap; internal entity data keeps track of current blockmap sector information; calls to add/remove/update functions changed
* modified pieces of environment into an entities that can be added to a block map and have a countable bounding region; fixes for vehicle control seat occcupant collection; fix for squad individual callback references (original issue still remains?)
* introduced the block map into various existijng game calculationa where target selection can be reduced by its probing
* he_mines and jammer_mines now trigger if a valid target is detected at the initial point of deploy; they also trigger later, after a valid target has moved into the arming range of the mine
* conversion of interactions with zone into a queued, periodic set of tasks
* explosive deployable control -> mine deployable control
* tests repaired and all tests working
* mostly comments and documentation
* amenities are now represented on the blockmap
2021-06-11 23:02:48 -04:00
|
|
|
import akka.actor.typed.scaladsl.adapter._
|
2021-06-02 11:51:38 -04:00
|
|
|
import akka.testkit.TestProbe
|
2021-06-21 23:40:44 -04:00
|
|
|
import base.{ActorTest, FreedContextActorTest}
|
The Blockmap (#852)
* separating geometry classes
* 2d geometry; retirement of the *3D suffix
* makings of an early block map datastructure
* entities in a zone - players, corpses, vehicles, deployables, ground clutter, and buildings - divided between sectors of the zone upon creation, management, or mounting; superfluous messages to keep track of blockmap state, for now
* trait for entities to be added to the blockmap; internal entity data keeps track of current blockmap sector information; calls to add/remove/update functions changed
* modified pieces of environment into an entities that can be added to a block map and have a countable bounding region; fixes for vehicle control seat occcupant collection; fix for squad individual callback references (original issue still remains?)
* introduced the block map into various existijng game calculationa where target selection can be reduced by its probing
* he_mines and jammer_mines now trigger if a valid target is detected at the initial point of deploy; they also trigger later, after a valid target has moved into the arming range of the mine
* conversion of interactions with zone into a queued, periodic set of tasks
* explosive deployable control -> mine deployable control
* tests repaired and all tests working
* mostly comments and documentation
* amenities are now represented on the blockmap
2021-06-11 23:02:48 -04:00
|
|
|
import net.psforever.actors.zone.ZoneActor
|
2021-06-02 11:51:38 -04:00
|
|
|
import net.psforever.objects._
|
|
|
|
|
import net.psforever.objects.ce.{DeployableCategory, DeployedItem, TelepadLike}
|
|
|
|
|
import net.psforever.objects.guid.NumberPoolHub
|
|
|
|
|
import net.psforever.objects.guid.source.MaxNumberSource
|
|
|
|
|
import net.psforever.objects.serverobject.deploy.Deployment
|
2021-06-21 23:40:44 -04:00
|
|
|
import net.psforever.objects.vehicles.{Utility, UtilityType}
|
2021-06-02 11:51:38 -04:00
|
|
|
import net.psforever.objects.zones.{Zone, ZoneDeployableActor, ZoneMap}
|
|
|
|
|
import net.psforever.packet.game.objectcreate.ObjectCreateMessageParent
|
|
|
|
|
import net.psforever.packet.game._
|
|
|
|
|
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
|
|
|
|
|
import net.psforever.types.{DriveState, PlanetSideGUID, Vector3}
|
|
|
|
|
|
2023-02-14 00:09:28 -05:00
|
|
|
import scala.collection.mutable
|
2021-06-02 11:51:38 -04:00
|
|
|
import scala.collection.mutable.ListBuffer
|
|
|
|
|
import scala.concurrent.duration._
|
|
|
|
|
|
|
|
|
|
class TelepadDeployableNoRouterTest extends ActorTest {
|
|
|
|
|
val eventsProbe = new TestProbe(system)
|
|
|
|
|
val telepad = Deployables.Make(DeployedItem.router_telepad_deployable)() //guid=1
|
|
|
|
|
val deployableList = new ListBuffer()
|
|
|
|
|
val guid = new NumberPoolHub(new MaxNumberSource(max = 5))
|
|
|
|
|
val zone = new Zone(id = "test", new ZoneMap(name = "test"), zoneNumber = 0) {
|
2023-02-14 00:09:28 -05:00
|
|
|
private val deployables = system.actorOf(Props(classOf[ZoneDeployableActor], this, deployableList, mutable.HashMap[Int, Int]()), name = "test-zone-deployables")
|
2021-06-02 11:51:38 -04:00
|
|
|
|
|
|
|
|
override def SetupNumberPools(): Unit = {}
|
|
|
|
|
GUID(guid)
|
|
|
|
|
override def AvatarEvents: ActorRef = eventsProbe.ref
|
|
|
|
|
override def LocalEvents: ActorRef = eventsProbe.ref
|
|
|
|
|
override def Deployables: ActorRef = deployables
|
The Blockmap (#852)
* separating geometry classes
* 2d geometry; retirement of the *3D suffix
* makings of an early block map datastructure
* entities in a zone - players, corpses, vehicles, deployables, ground clutter, and buildings - divided between sectors of the zone upon creation, management, or mounting; superfluous messages to keep track of blockmap state, for now
* trait for entities to be added to the blockmap; internal entity data keeps track of current blockmap sector information; calls to add/remove/update functions changed
* modified pieces of environment into an entities that can be added to a block map and have a countable bounding region; fixes for vehicle control seat occcupant collection; fix for squad individual callback references (original issue still remains?)
* introduced the block map into various existijng game calculationa where target selection can be reduced by its probing
* he_mines and jammer_mines now trigger if a valid target is detected at the initial point of deploy; they also trigger later, after a valid target has moved into the arming range of the mine
* conversion of interactions with zone into a queued, periodic set of tasks
* explosive deployable control -> mine deployable control
* tests repaired and all tests working
* mostly comments and documentation
* amenities are now represented on the blockmap
2021-06-11 23:02:48 -04:00
|
|
|
|
|
|
|
|
this.actor = new TestProbe(system).ref.toTyped[ZoneActor.Command]
|
2021-06-02 11:51:38 -04:00
|
|
|
}
|
|
|
|
|
guid.register(telepad, number = 1)
|
|
|
|
|
|
|
|
|
|
"TelepadDeployable" should {
|
|
|
|
|
"fail to activate without a router" in {
|
|
|
|
|
assert(deployableList.isEmpty, "no-router telepad deployable test - deployable list is not empty")
|
|
|
|
|
zone.Deployables ! Zone.Deployable.Build(telepad)
|
|
|
|
|
|
|
|
|
|
val eventsMsgs = eventsProbe.receiveN(4, 10.seconds)
|
|
|
|
|
eventsMsgs.head match {
|
2024-08-22 23:33:47 -04:00
|
|
|
case LocalServiceMessage("test", LocalAction.DeployItem(obj)) =>
|
2021-06-02 11:51:38 -04:00
|
|
|
assert(obj eq telepad, "no-router telepad deployable testt - not same telepad")
|
|
|
|
|
case _ =>
|
|
|
|
|
assert( false, "no-router telepad deployable test - wrong deploy message")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(1) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"NEUTRAL",
|
|
|
|
|
LocalAction.DeployableMapIcon(
|
|
|
|
|
PlanetSideGUID(0),
|
|
|
|
|
DeploymentAction.Build,
|
|
|
|
|
DeployableInfo(PlanetSideGUID(1), DeployableIcon.RouterTelepad, Vector3.Zero, PlanetSideGUID(0))
|
|
|
|
|
)
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "no-router telepad deployable test - no icon or wrong icon")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(2) match {
|
|
|
|
|
case LocalServiceMessage("test", LocalAction.EliminateDeployable(`telepad`, PlanetSideGUID(1), Vector3.Zero, 2)) => ;
|
|
|
|
|
case _ => assert(false, "no-router telepad deployable test - not eliminating deployable")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(3) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"NEUTRAL",
|
|
|
|
|
LocalAction.DeployableMapIcon(
|
|
|
|
|
PlanetSideGUID(0),
|
|
|
|
|
DeploymentAction.Dismiss,
|
|
|
|
|
DeployableInfo(PlanetSideGUID(1), DeployableIcon.RouterTelepad, Vector3.Zero, PlanetSideGUID(0))
|
|
|
|
|
)
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "no-router telepad deployable test - no icon or wrong icon cleared")
|
|
|
|
|
}
|
|
|
|
|
assert(deployableList.isEmpty, "no-router telepad deployable test - deployable is being tracked")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class TelepadDeployableNoActivationTest extends ActorTest {
|
|
|
|
|
val eventsProbe = new TestProbe(system)
|
|
|
|
|
val routerProbe = new TestProbe(system)
|
|
|
|
|
val telepad = Deployables.Make(DeployedItem.router_telepad_deployable)() //guid=1
|
|
|
|
|
val router = Vehicle(GlobalDefinitions.router) //guid=2
|
|
|
|
|
val internal = router.Utility(UtilityType.internal_router_telepad_deployable).get //guid=3
|
|
|
|
|
val deployableList = new ListBuffer()
|
|
|
|
|
val guid = new NumberPoolHub(new MaxNumberSource(max = 5))
|
|
|
|
|
val zone = new Zone(id = "test", new ZoneMap(name = "test"), zoneNumber = 0) {
|
2023-02-14 00:09:28 -05:00
|
|
|
private val deployables = system.actorOf(Props(classOf[ZoneDeployableActor], this, deployableList, mutable.HashMap[Int, Int]()), name = "test-zone-deployables")
|
2021-06-02 11:51:38 -04:00
|
|
|
|
|
|
|
|
override def SetupNumberPools(): Unit = {}
|
|
|
|
|
GUID(guid)
|
|
|
|
|
override def AvatarEvents: ActorRef = eventsProbe.ref
|
|
|
|
|
override def LocalEvents: ActorRef = eventsProbe.ref
|
|
|
|
|
override def Deployables: ActorRef = deployables
|
|
|
|
|
override def Vehicles: List[Vehicle] = List(router)
|
The Blockmap (#852)
* separating geometry classes
* 2d geometry; retirement of the *3D suffix
* makings of an early block map datastructure
* entities in a zone - players, corpses, vehicles, deployables, ground clutter, and buildings - divided between sectors of the zone upon creation, management, or mounting; superfluous messages to keep track of blockmap state, for now
* trait for entities to be added to the blockmap; internal entity data keeps track of current blockmap sector information; calls to add/remove/update functions changed
* modified pieces of environment into an entities that can be added to a block map and have a countable bounding region; fixes for vehicle control seat occcupant collection; fix for squad individual callback references (original issue still remains?)
* introduced the block map into various existijng game calculationa where target selection can be reduced by its probing
* he_mines and jammer_mines now trigger if a valid target is detected at the initial point of deploy; they also trigger later, after a valid target has moved into the arming range of the mine
* conversion of interactions with zone into a queued, periodic set of tasks
* explosive deployable control -> mine deployable control
* tests repaired and all tests working
* mostly comments and documentation
* amenities are now represented on the blockmap
2021-06-11 23:02:48 -04:00
|
|
|
|
|
|
|
|
this.actor = new TestProbe(system).ref.toTyped[ZoneActor.Command]
|
2021-06-02 11:51:38 -04:00
|
|
|
}
|
|
|
|
|
guid.register(telepad, number = 1)
|
|
|
|
|
guid.register(router, number = 2)
|
|
|
|
|
guid.register(internal, number = 3)
|
|
|
|
|
router.Actor = eventsProbe.ref
|
|
|
|
|
internal.Actor = routerProbe.ref
|
|
|
|
|
|
|
|
|
|
"TelepadDeployable" should {
|
|
|
|
|
"fail to activate without a connected router" in {
|
|
|
|
|
assert(deployableList.isEmpty, "no-activate telepad deployable test - deployable list is not empty")
|
|
|
|
|
zone.Deployables ! Zone.Deployable.Build(telepad)
|
|
|
|
|
|
|
|
|
|
val eventsMsgs = eventsProbe.receiveN(4, 10.seconds)
|
|
|
|
|
eventsMsgs.head match {
|
2024-08-22 23:33:47 -04:00
|
|
|
case LocalServiceMessage("test", LocalAction.DeployItem(obj)) =>
|
2021-06-02 11:51:38 -04:00
|
|
|
assert(obj eq telepad, "no-activate telepad deployable testt - not same telepad")
|
|
|
|
|
case _ =>
|
|
|
|
|
assert( false, "no-activate telepad deployable test - wrong deploy message")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(1) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"NEUTRAL",
|
|
|
|
|
LocalAction.DeployableMapIcon(
|
|
|
|
|
PlanetSideGUID(0),
|
|
|
|
|
DeploymentAction.Build,
|
|
|
|
|
DeployableInfo(PlanetSideGUID(1), DeployableIcon.RouterTelepad, Vector3.Zero, PlanetSideGUID(0))
|
|
|
|
|
)
|
|
|
|
|
) => ;
|
|
|
|
|
case _ =>
|
|
|
|
|
assert( false, "no-activate telepad deployable test - no icon or wrong icon")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(2) match {
|
|
|
|
|
case LocalServiceMessage("test", LocalAction.EliminateDeployable(`telepad`, PlanetSideGUID(1), Vector3.Zero, 2)) => ;
|
|
|
|
|
case _ => assert(false, "no-activate telepad deployable test - not eliminating deployable")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(3) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"NEUTRAL",
|
|
|
|
|
LocalAction.DeployableMapIcon(
|
|
|
|
|
PlanetSideGUID(0),
|
|
|
|
|
DeploymentAction.Dismiss,
|
|
|
|
|
DeployableInfo(PlanetSideGUID(1), DeployableIcon.RouterTelepad, Vector3.Zero, PlanetSideGUID(0))
|
|
|
|
|
)
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "no-activate telepad deployable test - no icon or wrong icon")
|
|
|
|
|
}
|
|
|
|
|
routerProbe.expectNoMessage(100.millisecond)
|
|
|
|
|
assert(deployableList.isEmpty, "no-activate telepad deployable test - deployable is being tracked")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class TelepadDeployableAttemptTest extends ActorTest {
|
|
|
|
|
val eventsProbe = new TestProbe(system)
|
|
|
|
|
val routerProbe = new TestProbe(system)
|
|
|
|
|
val telepad = new TelepadDeployable(TelepadRouterTest.router_telepad_deployable) //guid=1
|
|
|
|
|
val router = Vehicle(GlobalDefinitions.router) //guid=2
|
|
|
|
|
val internal = router.Utility(UtilityType.internal_router_telepad_deployable).get //guid=3
|
|
|
|
|
val deployableList = new ListBuffer()
|
|
|
|
|
val guid = new NumberPoolHub(new MaxNumberSource(max = 5))
|
|
|
|
|
val zone = new Zone(id = "test", new ZoneMap(name = "test"), zoneNumber = 0) {
|
2023-02-14 00:09:28 -05:00
|
|
|
private val deployables = system.actorOf(Props(classOf[ZoneDeployableActor], this, deployableList, mutable.HashMap[Int, Int]()), name = "test-zone-deployables")
|
2021-06-02 11:51:38 -04:00
|
|
|
|
|
|
|
|
override def SetupNumberPools(): Unit = {}
|
|
|
|
|
GUID(guid)
|
|
|
|
|
override def AvatarEvents: ActorRef = eventsProbe.ref
|
|
|
|
|
override def LocalEvents: ActorRef = eventsProbe.ref
|
|
|
|
|
override def Deployables: ActorRef = deployables
|
|
|
|
|
override def Vehicles: List[Vehicle] = List(router)
|
The Blockmap (#852)
* separating geometry classes
* 2d geometry; retirement of the *3D suffix
* makings of an early block map datastructure
* entities in a zone - players, corpses, vehicles, deployables, ground clutter, and buildings - divided between sectors of the zone upon creation, management, or mounting; superfluous messages to keep track of blockmap state, for now
* trait for entities to be added to the blockmap; internal entity data keeps track of current blockmap sector information; calls to add/remove/update functions changed
* modified pieces of environment into an entities that can be added to a block map and have a countable bounding region; fixes for vehicle control seat occcupant collection; fix for squad individual callback references (original issue still remains?)
* introduced the block map into various existijng game calculationa where target selection can be reduced by its probing
* he_mines and jammer_mines now trigger if a valid target is detected at the initial point of deploy; they also trigger later, after a valid target has moved into the arming range of the mine
* conversion of interactions with zone into a queued, periodic set of tasks
* explosive deployable control -> mine deployable control
* tests repaired and all tests working
* mostly comments and documentation
* amenities are now represented on the blockmap
2021-06-11 23:02:48 -04:00
|
|
|
|
|
|
|
|
this.actor = new TestProbe(system).ref.toTyped[ZoneActor.Command]
|
2021-06-02 11:51:38 -04:00
|
|
|
}
|
|
|
|
|
guid.register(telepad, number = 1)
|
|
|
|
|
guid.register(router, number = 2)
|
|
|
|
|
guid.register(internal, number = 3)
|
|
|
|
|
router.Actor = eventsProbe.ref
|
|
|
|
|
internal.Actor = routerProbe.ref
|
|
|
|
|
telepad.Router = PlanetSideGUID(2) //artificial
|
|
|
|
|
|
|
|
|
|
"TelepadDeployable" should {
|
|
|
|
|
"attempt to link with a connected router" in {
|
|
|
|
|
assert(deployableList.isEmpty, "link attempt telepad deployable test - deployable list is not empty")
|
|
|
|
|
zone.Deployables ! Zone.Deployable.Build(telepad)
|
|
|
|
|
|
|
|
|
|
val eventsMsgs = eventsProbe.receiveN(2, 10.seconds)
|
|
|
|
|
val routerMsgs = routerProbe.receiveN(1, 10.seconds)
|
|
|
|
|
eventsMsgs.head match {
|
2024-08-22 23:33:47 -04:00
|
|
|
case LocalServiceMessage("test", LocalAction.DeployItem(obj)) =>
|
2021-06-02 11:51:38 -04:00
|
|
|
assert(obj eq telepad, "link attempt telepad deployable testt - not same telepad")
|
|
|
|
|
case _ =>
|
|
|
|
|
assert( false, "link attempt telepad deployable test - wrong deploy message")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(1) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"NEUTRAL",
|
|
|
|
|
LocalAction.DeployableMapIcon(
|
|
|
|
|
PlanetSideGUID(0),
|
|
|
|
|
DeploymentAction.Build,
|
|
|
|
|
DeployableInfo(PlanetSideGUID(1), DeployableIcon.RouterTelepad, Vector3.Zero, PlanetSideGUID(0))
|
|
|
|
|
)
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "link attempt telepad deployable test - no icon or wrong icon")
|
|
|
|
|
}
|
|
|
|
|
routerMsgs.head match {
|
|
|
|
|
case TelepadLike.RequestLink(tpad) if tpad eq telepad => ;
|
|
|
|
|
case _ => assert(false, "link attempt telepad deployable test - did not try to link")
|
|
|
|
|
}
|
|
|
|
|
assert(deployableList.contains(telepad), "link attempt telepad deployable test - deployable list is not empty")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-21 23:40:44 -04:00
|
|
|
class TelepadDeployableResponseFromRouterTest extends FreedContextActorTest {
|
2021-06-02 11:51:38 -04:00
|
|
|
val eventsProbe = new TestProbe(system)
|
|
|
|
|
val telepad = new TelepadDeployable(TelepadRouterTest.router_telepad_deployable) //guid=1
|
|
|
|
|
val router = Vehicle(GlobalDefinitions.router) //guid=2
|
|
|
|
|
val internal = router
|
|
|
|
|
.Utility(UtilityType.internal_router_telepad_deployable)
|
|
|
|
|
.get
|
|
|
|
|
.asInstanceOf[Utility.InternalTelepad] //guid=3
|
|
|
|
|
val deployableList = new ListBuffer()
|
|
|
|
|
val guid = new NumberPoolHub(new MaxNumberSource(max = 5))
|
|
|
|
|
val zone = new Zone(id = "test", new ZoneMap(name = "test"), zoneNumber = 0) {
|
2023-02-14 00:09:28 -05:00
|
|
|
private val deployables = system.actorOf(Props(classOf[ZoneDeployableActor], this, deployableList, mutable.HashMap[Int, Int]()), name = "test-zone-deployables")
|
2021-06-02 11:51:38 -04:00
|
|
|
|
|
|
|
|
override def SetupNumberPools(): Unit = {}
|
|
|
|
|
GUID(guid)
|
|
|
|
|
override def AvatarEvents: ActorRef = eventsProbe.ref
|
|
|
|
|
override def LocalEvents: ActorRef = eventsProbe.ref
|
|
|
|
|
override def VehicleEvents: ActorRef = eventsProbe.ref
|
|
|
|
|
override def Deployables: ActorRef = deployables
|
|
|
|
|
override def Vehicles: List[Vehicle] = List(router)
|
The Blockmap (#852)
* separating geometry classes
* 2d geometry; retirement of the *3D suffix
* makings of an early block map datastructure
* entities in a zone - players, corpses, vehicles, deployables, ground clutter, and buildings - divided between sectors of the zone upon creation, management, or mounting; superfluous messages to keep track of blockmap state, for now
* trait for entities to be added to the blockmap; internal entity data keeps track of current blockmap sector information; calls to add/remove/update functions changed
* modified pieces of environment into an entities that can be added to a block map and have a countable bounding region; fixes for vehicle control seat occcupant collection; fix for squad individual callback references (original issue still remains?)
* introduced the block map into various existijng game calculationa where target selection can be reduced by its probing
* he_mines and jammer_mines now trigger if a valid target is detected at the initial point of deploy; they also trigger later, after a valid target has moved into the arming range of the mine
* conversion of interactions with zone into a queued, periodic set of tasks
* explosive deployable control -> mine deployable control
* tests repaired and all tests working
* mostly comments and documentation
* amenities are now represented on the blockmap
2021-06-11 23:02:48 -04:00
|
|
|
|
|
|
|
|
this.actor = new TestProbe(system).ref.toTyped[ZoneActor.Command]
|
2021-06-02 11:51:38 -04:00
|
|
|
}
|
|
|
|
|
guid.register(telepad, number = 1)
|
|
|
|
|
guid.register(router, number = 2)
|
|
|
|
|
guid.register(internal, number = 3)
|
|
|
|
|
guid.register(router.Utility(UtilityType.teleportpad_terminal).get, number = 4) //necessary
|
|
|
|
|
router.Zone = zone
|
2021-06-21 23:40:44 -04:00
|
|
|
router.Definition.Initialize(router, context)
|
2021-06-02 11:51:38 -04:00
|
|
|
telepad.Router = PlanetSideGUID(2) //artificial
|
|
|
|
|
|
|
|
|
|
"TelepadDeployable" should {
|
|
|
|
|
"link with a connected router" in {
|
|
|
|
|
assert(!telepad.Active, "link to router test - telepad active earlier than intended (1)")
|
|
|
|
|
assert(!internal.Active, "link to router test - router internals active earlier than intended")
|
2021-06-21 23:40:44 -04:00
|
|
|
val deploymentProbe = new TestProbe(system)
|
|
|
|
|
router.Actor.tell(Deployment.TryDeploy(DriveState.Deploying), deploymentProbe.ref)
|
2021-06-02 11:51:38 -04:00
|
|
|
eventsProbe.receiveN(10, 10.seconds) //flush all messages related to deployment
|
Repeating the Obvious (#1233)
* adding chat and event messages that have been neglected since; these are easy additions
* completely retooled water interactions for players and vehicles to handle a wading status, before drowning; when player with llu or vehicle with player with llu come into contact with water in this wading state, the llu is lost and the facility hack ends; adding messages to support this and differentiate from an llu facility capture timeout
* periodic message while the llu is active, whether or not there is a carrier, until the hack is finished
* message when inventory is full (assumes player inventory destination, but item winds up in hand due to lack of space, but it works)
* when changing exo-suits, complain if equipment has to be deleted; dropped equipment is limited to special equipment; report a player pointlessly
* announce ams decay to players who have just spawned on an ams, when they spawn on that ams, and for the last round of spawnees when the vehicle finally deconstructs; due to use of the word 'bound' this may be an incorrect application, but matrixing doesn't work anyway
* deconstruction message for would-be driver when vehicle is abandoned on spawn pad; tempo on message delivery is different than usual
* message when player is kicked from orbital shuttle gantry; message when player attempts to bail in a warp gate; message when player attempts to bail from a droppod; stop player from succeeding in bailing from a droppod
* vehicle pad deconstruction complete message; message when nc max shield deactivates when out of capacitor power or when max opens fire; message when ams can not deploy because it is blocked by other entities; message when facility capture requires ntu
* message for deployables being blocked; cleaning up dev test section
* Yellow Ownership (#1226)
* just some tinkering and clean-up
* converted DeployItem from AvatarService to LocalService; attempt at resolving missing overwhip yellow ring is complicated; vehicle ownership packet wqorks on deployables that are mountable, but is less successful on normal simple deployables
* restoration of yellow ring of ownership around deployables; changes to variant of CommonFieldData transcorder used on certain deployable transcoders; static values are assigned parameter names and public variables are given types for completion
* initial packet for GenericObjectAction2Message and tests; repaired transcoders and tests for TRAP and small turrets
* force redraw of the whole boomer to assert reassignment of ownership; it's heavy-handed but it works
* deployable ownership should be asserted during both re-zoning and revival; refactoring of code in ZoningOperations
* message when inventory is full (assumes player inventory destination, but item winds up in hand due to lack of space, but it works)
* vehicle deployment messages added in, then deployment was fixed to accommodate an explicit caller, and that changed a whole lot of the deployment loop for messages; environmental activity was modified to maointain a more responsible start/stop transition; many many test changes (still an issue with a lot of them)
* moving around conditions for losing the llu
* the question of one extra bit for small deployables; also, all tests pass successfully, tho resource silo use remains coin flip; what sorcery is this
* duplicate capture lost message eliminated; flag lost violently due to environment in general rather than just water interaction; flag lost violently due to warp gate envelope interaction; flag lost due to be dropped in an unsafe position
* vary the testing depth for water interaction
* darn tests
* fixed vehicle interference; added missing ArmorShieldOff message; clearing countdown after vehicle spawn should stop countdown from appearing in subsequent vehicle spawns
* the router needs 20m of clearance
* removing the shared group interference information from routers
2024-10-01 16:01:00 -04:00
|
|
|
deploymentProbe.receiveN(2, 10.seconds) //CanDeploy
|
2021-06-21 23:40:44 -04:00
|
|
|
deploymentProbe.expectNoMessage(2.seconds) //intentional delay
|
|
|
|
|
assert(internal.Active, "link to router test - router internals not active when expected")
|
2021-06-02 11:51:38 -04:00
|
|
|
assert(!telepad.Active, "link to router test - telepad active earlier than intended (2)")
|
|
|
|
|
|
|
|
|
|
assert(deployableList.isEmpty, "link to router test - deployable list is not empty")
|
|
|
|
|
zone.Deployables ! Zone.Deployable.Build(telepad)
|
|
|
|
|
|
|
|
|
|
val eventsMsgs = eventsProbe.receiveN(9, 10.seconds)
|
|
|
|
|
eventsMsgs.head match {
|
2024-08-22 23:33:47 -04:00
|
|
|
case LocalServiceMessage("test", LocalAction.DeployItem(obj)) =>
|
2021-06-02 11:51:38 -04:00
|
|
|
assert(obj eq telepad, "link to router test - not same telepad")
|
|
|
|
|
case _ =>
|
|
|
|
|
assert( false, "link to router test - wrong deploy message")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(1) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"NEUTRAL",
|
|
|
|
|
LocalAction.DeployableMapIcon(
|
|
|
|
|
PlanetSideGUID(0),
|
|
|
|
|
DeploymentAction.Build,
|
|
|
|
|
DeployableInfo(PlanetSideGUID(1), DeployableIcon.RouterTelepad, Vector3.Zero, PlanetSideGUID(0))
|
|
|
|
|
)
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "link to router test - no icon or wrong icon")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(2) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"test",
|
|
|
|
|
LocalAction.SendResponse(
|
|
|
|
|
ObjectCreateMessage(_, 744, PlanetSideGUID(3), Some(ObjectCreateMessageParent(PlanetSideGUID(2), 2)), _)
|
|
|
|
|
)
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "link to router test - did not create the internal router telepad (1)")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(3) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"test",
|
|
|
|
|
LocalAction.SendResponse(GenericObjectActionMessage(PlanetSideGUID(3), 27))
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "link to router test - did not create the internal router telepad (2)")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(4) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"test",
|
|
|
|
|
LocalAction.SendResponse(GenericObjectActionMessage(PlanetSideGUID(3), 30))
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "link to router test - did not create the internal router telepad (3)")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(5) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"test",
|
|
|
|
|
LocalAction.SendResponse(GenericObjectActionMessage(PlanetSideGUID(3), 27))
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "link to router test - did not link the internal telepad (1)")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(6) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"test",
|
|
|
|
|
LocalAction.SendResponse(GenericObjectActionMessage(PlanetSideGUID(3), 28))
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "link to router test - did not link the internal telepad (2)")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(7) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"test",
|
|
|
|
|
LocalAction.SendResponse(GenericObjectActionMessage(PlanetSideGUID(1), 27))
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "link to router test - did not link the telepad (1)")
|
|
|
|
|
}
|
|
|
|
|
eventsMsgs(8) match {
|
|
|
|
|
case LocalServiceMessage(
|
|
|
|
|
"test",
|
|
|
|
|
LocalAction.SendResponse(GenericObjectActionMessage(PlanetSideGUID(1), 28))
|
|
|
|
|
) => ;
|
|
|
|
|
case _ => assert(false, "link to router test - did not link the telepad (2)")
|
|
|
|
|
}
|
|
|
|
|
assert(telepad.Active, "link to router test - telepad not active when expected")
|
|
|
|
|
assert(internal.Active, "link to router test - router internals active not active when expected (2)")
|
|
|
|
|
assert(deployableList.contains(telepad), "link to router test - deployable list is not empty")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object TelepadRouterTest {
|
|
|
|
|
val router_telepad_deployable = new TelepadDeployableDefinition(DeployedItem.router_telepad_deployable.id) {
|
|
|
|
|
Name = "test_telepad_dep"
|
|
|
|
|
DeployTime = Duration.create(1, "ms")
|
|
|
|
|
DeployCategory = DeployableCategory.Telepads
|
|
|
|
|
linkTime = 1.second
|
|
|
|
|
}
|
|
|
|
|
}
|