2017-11-29 22:30:25 -05:00
|
|
|
// Copyright (c) 2017 PSForever
|
|
|
|
|
package objects
|
|
|
|
|
|
2017-12-11 18:17:05 -05:00
|
|
|
import akka.actor.{Actor, ActorRef, Props}
|
2018-07-14 21:25:44 -04:00
|
|
|
import base.ActorTest
|
2020-08-01 12:25:03 +02:00
|
|
|
import net.psforever.objects.Player
|
|
|
|
|
import net.psforever.objects.avatar.Avatar
|
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
|
|
|
import net.psforever.objects.definition.ObjectDefinition
|
|
|
|
|
import net.psforever.objects.serverobject.mount._
|
2017-11-29 22:30:25 -05:00
|
|
|
import net.psforever.objects.serverobject.PlanetSideServerObject
|
2020-01-06 08:45:55 -05:00
|
|
|
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire, PlanetSideGUID}
|
2017-11-29 22:30:25 -05:00
|
|
|
|
|
|
|
|
import scala.concurrent.duration.Duration
|
|
|
|
|
|
2018-07-14 21:25:44 -04:00
|
|
|
class MountableControl1Test extends ActorTest {
|
2017-11-29 22:30:25 -05:00
|
|
|
"MountableControl" should {
|
|
|
|
|
"construct" in {
|
|
|
|
|
val obj = new MountableTest.MountableTestObject
|
|
|
|
|
obj.Actor = system.actorOf(Props(classOf[MountableTest.MountableTestControl], obj), "mech")
|
|
|
|
|
assert(obj.Actor != ActorRef.noSender)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-14 21:25:44 -04:00
|
|
|
class MountableControl2Test extends ActorTest {
|
2017-11-29 22:30:25 -05:00
|
|
|
"MountableControl" should {
|
|
|
|
|
"let a player mount" in {
|
2020-08-01 12:25:03 +02:00
|
|
|
val player = Player(Avatar(0, "test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
2020-07-14 05:54:05 +02:00
|
|
|
val obj = new MountableTest.MountableTestObject
|
2017-11-29 22:30:25 -05:00
|
|
|
obj.Actor = system.actorOf(Props(classOf[MountableTest.MountableTestControl], obj), "mountable")
|
|
|
|
|
val msg = Mountable.TryMount(player, 0)
|
|
|
|
|
|
|
|
|
|
obj.Actor ! msg
|
|
|
|
|
val reply = receiveOne(Duration.create(100, "ms"))
|
|
|
|
|
assert(reply.isInstanceOf[Mountable.MountMessages])
|
|
|
|
|
val reply2 = reply.asInstanceOf[Mountable.MountMessages]
|
|
|
|
|
assert(reply2.player == player)
|
|
|
|
|
assert(reply2.response.isInstanceOf[Mountable.CanMount])
|
|
|
|
|
val reply3 = reply2.response.asInstanceOf[Mountable.CanMount]
|
|
|
|
|
assert(reply3.obj == obj)
|
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
|
|
|
assert(reply3.seat_number == 0)
|
2017-11-29 22:30:25 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-14 21:25:44 -04:00
|
|
|
class MountableControl3Test extends ActorTest {
|
2017-11-29 22:30:25 -05:00
|
|
|
"MountableControl" should {
|
|
|
|
|
"block a player from mounting" in {
|
2020-08-01 12:25:03 +02:00
|
|
|
val player1 = Player(Avatar(0, "test1", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
|
|
|
|
val player2 = Player(Avatar(1, "test2", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
2020-07-14 05:54:05 +02:00
|
|
|
val obj = new MountableTest.MountableTestObject
|
2017-11-29 22:30:25 -05:00
|
|
|
obj.Actor = system.actorOf(Props(classOf[MountableTest.MountableTestControl], obj), "mountable")
|
|
|
|
|
obj.Actor ! Mountable.TryMount(player1, 0)
|
|
|
|
|
receiveOne(Duration.create(100, "ms")) //consume reply
|
|
|
|
|
|
|
|
|
|
obj.Actor ! Mountable.TryMount(player2, 0)
|
|
|
|
|
val reply = receiveOne(Duration.create(100, "ms"))
|
|
|
|
|
assert(reply.isInstanceOf[Mountable.MountMessages])
|
|
|
|
|
val reply2 = reply.asInstanceOf[Mountable.MountMessages]
|
|
|
|
|
assert(reply2.player == player2)
|
|
|
|
|
assert(reply2.response.isInstanceOf[Mountable.CanNotMount])
|
|
|
|
|
val reply3 = reply2.response.asInstanceOf[Mountable.CanNotMount]
|
|
|
|
|
assert(reply3.obj == obj)
|
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
|
|
|
assert(reply3.mount_point == 0)
|
2017-11-29 22:30:25 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object MountableTest {
|
|
|
|
|
class MountableTestObject extends PlanetSideServerObject with Mountable {
|
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
|
|
|
seats += 0 -> new Seat(new SeatDefinition())
|
2018-01-26 15:32:08 -05:00
|
|
|
GUID = PlanetSideGUID(1)
|
|
|
|
|
//eh whatever
|
2020-07-14 05:54:05 +02:00
|
|
|
def Faction = PlanetSideEmpire.TR
|
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
|
|
|
def Definition = new ObjectDefinition(1) with MountableDefinition {
|
|
|
|
|
MountPoints += 0 -> MountInfo(0)
|
|
|
|
|
}
|
2017-11-29 22:30:25 -05:00
|
|
|
}
|
|
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
class MountableTestControl(obj: PlanetSideServerObject with Mountable)
|
|
|
|
|
extends Actor
|
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
|
|
|
with MountableBehavior {
|
2017-12-11 18:17:05 -05:00
|
|
|
override def MountableObject = obj
|
|
|
|
|
|
2020-07-14 05:54:05 +02:00
|
|
|
def receive: Receive = mountBehavior.orElse(dismountBehavior)
|
2017-12-11 18:17:05 -05:00
|
|
|
}
|
2017-11-29 22:30:25 -05:00
|
|
|
}
|