mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-21 04:50:41 +00:00
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
This commit is contained in:
parent
e3de497be3
commit
71ab35ecab
127 changed files with 4672 additions and 1870 deletions
|
|
@ -8,7 +8,7 @@ import net.psforever.objects.ballistics._
|
|||
import net.psforever.objects.ce.DeployedItem
|
||||
import net.psforever.objects.guid.NumberPoolHub
|
||||
import net.psforever.objects.guid.source.MaxNumberSource
|
||||
import net.psforever.objects.serverobject.mount.Mountable
|
||||
import net.psforever.objects.serverobject.mount.{MountInfo, Mountable}
|
||||
import net.psforever.objects.vital.Vitality
|
||||
import net.psforever.objects.zones.{Zone, ZoneMap}
|
||||
import net.psforever.objects.{TurretDeployable, _}
|
||||
|
|
@ -156,8 +156,11 @@ class TurretDeployableTest extends Specification {
|
|||
}
|
||||
|
||||
"may have mount point" in {
|
||||
new TurretDeployable(GlobalDefinitions.spitfire_turret).MountPoints mustEqual Map()
|
||||
new TurretDeployable(GlobalDefinitions.portable_manned_turret_vs).MountPoints mustEqual Map(1 -> 0, 2 -> 0)
|
||||
new TurretDeployable(GlobalDefinitions.spitfire_turret).MountPoints.isEmpty mustEqual true
|
||||
|
||||
val pmt = new TurretDeployable(GlobalDefinitions.portable_manned_turret_vs)
|
||||
pmt.MountPoints.get(1).contains(MountInfo(0, Vector3(0, 0, 0))) mustEqual true
|
||||
pmt.MountPoints.get(2).contains(MountInfo(0, Vector3(0, 0, 0))) mustEqual true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -669,15 +672,15 @@ class TurretControlMountTest extends ActorTest {
|
|||
obj.Faction = PlanetSideEmpire.TR
|
||||
obj.Actor = system.actorOf(Props(classOf[TurretControl], obj), s"${obj.Definition.Name}_test")
|
||||
|
||||
assert(obj.Seats(0).Occupant.isEmpty)
|
||||
assert(obj.Seats(0).occupant.isEmpty)
|
||||
val player1 = Player(Avatar(0, "test1", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
obj.Actor ! Mountable.TryMount(player1, 0)
|
||||
obj.Actor ! Mountable.TryMount(player1, 1)
|
||||
val reply1a = receiveOne(200 milliseconds)
|
||||
assert(reply1a.isInstanceOf[Mountable.MountMessages])
|
||||
val reply1b = reply1a.asInstanceOf[Mountable.MountMessages]
|
||||
assert(reply1b.player == player1)
|
||||
assert(reply1b.response.isInstanceOf[Mountable.CanMount])
|
||||
assert(obj.Seats(0).Occupant.contains(player1))
|
||||
assert(obj.Seats(0).occupant.contains(player1))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -689,18 +692,18 @@ class TurretControlBlockMountTest extends ActorTest {
|
|||
obj.Faction = PlanetSideEmpire.TR
|
||||
obj.Actor = system.actorOf(Props(classOf[TurretControl], obj), s"${obj.Definition.Name}_test")
|
||||
|
||||
assert(obj.Seats(0).Occupant.isEmpty)
|
||||
assert(obj.Seats(0).occupant.isEmpty)
|
||||
val player1 = Player(Avatar(0, "test1", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
obj.Actor ! Mountable.TryMount(player1, 0)
|
||||
obj.Actor ! Mountable.TryMount(player1, 1)
|
||||
val reply1a = receiveOne(200 milliseconds)
|
||||
assert(reply1a.isInstanceOf[Mountable.MountMessages])
|
||||
val reply1b = reply1a.asInstanceOf[Mountable.MountMessages]
|
||||
assert(reply1b.player == player1)
|
||||
assert(reply1b.response.isInstanceOf[Mountable.CanMount])
|
||||
assert(obj.Seats(0).Occupant.contains(player1))
|
||||
assert(obj.Seats(0).occupant.contains(player1))
|
||||
|
||||
val player2 = Player(Avatar(1, "test2", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
obj.Actor ! Mountable.TryMount(player2, 0)
|
||||
obj.Actor ! Mountable.TryMount(player2, 1)
|
||||
val reply2a = receiveOne(200 milliseconds)
|
||||
assert(reply2a.isInstanceOf[Mountable.MountMessages])
|
||||
val reply2b = reply2a.asInstanceOf[Mountable.MountMessages]
|
||||
|
|
@ -717,15 +720,15 @@ class TurretControlBlockBetrayalMountTest extends ActorTest {
|
|||
obj.Faction = PlanetSideEmpire.TR
|
||||
obj.Actor = system.actorOf(Props(classOf[TurretControl], obj), s"${obj.Definition.Name}_test")
|
||||
|
||||
assert(obj.Seats(0).Occupant.isEmpty)
|
||||
assert(obj.Seats(0).occupant.isEmpty)
|
||||
val player = Player(Avatar(0, "test", PlanetSideEmpire.VS, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
obj.Actor ! Mountable.TryMount(player, 0)
|
||||
obj.Actor ! Mountable.TryMount(player, 1)
|
||||
val reply1a = receiveOne(200 milliseconds)
|
||||
assert(reply1a.isInstanceOf[Mountable.MountMessages])
|
||||
val reply1b = reply1a.asInstanceOf[Mountable.MountMessages]
|
||||
assert(reply1b.player == player)
|
||||
assert(reply1b.response.isInstanceOf[Mountable.CanNotMount])
|
||||
assert(obj.Seats(0).Occupant.isEmpty)
|
||||
assert(obj.Seats(0).occupant.isEmpty)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -737,15 +740,15 @@ class TurretControlDismountTest extends ActorTest {
|
|||
obj.Faction = PlanetSideEmpire.TR
|
||||
obj.Actor = system.actorOf(Props(classOf[TurretControl], obj), s"${obj.Definition.Name}_test")
|
||||
|
||||
assert(obj.Seats(0).Occupant.isEmpty)
|
||||
assert(obj.Seats(0).occupant.isEmpty)
|
||||
val player = Player(Avatar(0, "test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
obj.Actor ! Mountable.TryMount(player, 0)
|
||||
obj.Actor ! Mountable.TryMount(player, 1)
|
||||
val reply1a = receiveOne(200 milliseconds)
|
||||
assert(reply1a.isInstanceOf[Mountable.MountMessages])
|
||||
val reply1b = reply1a.asInstanceOf[Mountable.MountMessages]
|
||||
assert(reply1b.player == player)
|
||||
assert(reply1b.response.isInstanceOf[Mountable.CanMount])
|
||||
assert(obj.Seats(0).Occupant.contains(player))
|
||||
assert(obj.Seats(0).occupant.contains(player))
|
||||
|
||||
obj.Actor ! Mountable.TryDismount(player, 0)
|
||||
val reply2a = receiveOne(200 milliseconds)
|
||||
|
|
@ -753,7 +756,7 @@ class TurretControlDismountTest extends ActorTest {
|
|||
val reply2b = reply2a.asInstanceOf[Mountable.MountMessages]
|
||||
assert(reply2b.player == player)
|
||||
assert(reply2b.response.isInstanceOf[Mountable.CanDismount])
|
||||
assert(obj.Seats(0).Occupant.isEmpty)
|
||||
assert(obj.Seats(0).occupant.isEmpty)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -762,21 +765,25 @@ class TurretControlBetrayalMountTest extends ActorTest {
|
|||
"TurretControl" should {
|
||||
"allow all allegiances" in {
|
||||
val obj = new TurretDeployable(
|
||||
new TurretDeployableDefinition(685) { FactionLocked = false } //required (defaults to true)
|
||||
new TurretDeployableDefinition(685) {
|
||||
MountPoints += 1 -> MountInfo(0, Vector3.Zero)
|
||||
FactionLocked = false
|
||||
} //required (defaults to true)
|
||||
) { GUID = PlanetSideGUID(1) }
|
||||
obj.Faction = PlanetSideEmpire.TR
|
||||
obj.Actor = system.actorOf(Props(classOf[TurretControl], obj), s"${obj.Definition.Name}_test")
|
||||
val probe = new TestProbe(system)
|
||||
|
||||
assert(obj.Seats(0).Occupant.isEmpty)
|
||||
assert(obj.Seats(0).occupant.isEmpty)
|
||||
val player = Player(Avatar(0, "test", PlanetSideEmpire.NC, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
assert(player.Faction != obj.Faction)
|
||||
obj.Actor ! Mountable.TryMount(player, 0)
|
||||
val reply1a = receiveOne(200 milliseconds)
|
||||
obj.Actor.tell(Mountable.TryMount(player, 1), probe.ref)
|
||||
val reply1a = probe.receiveOne(200 milliseconds)
|
||||
assert(reply1a.isInstanceOf[Mountable.MountMessages])
|
||||
val reply1b = reply1a.asInstanceOf[Mountable.MountMessages]
|
||||
assert(reply1b.player == player)
|
||||
assert(reply1b.response.isInstanceOf[Mountable.CanMount])
|
||||
assert(obj.Seats(0).Occupant.contains(player))
|
||||
assert(obj.Seats(0).occupant.contains(player))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue