Customer Service (#1247)

* initial workings for a csr/gm player mode

* weird line removal after merge

* too many changes and refactors, but the code compiles properly; need to push these to the repo and sort out issues with it all later; hopefully, nothing has changed except for the csr stuff

* extensive changes to mode logic for refactoring and functionality improvements, especially for accommodating csr spectator mode

* csr's may now see players who are spectating, including csr's who are spectating, including a wide variety of their behavior such as location, weapon management, etc.; removes zoning cancel messages as a required log from certain use item actions

* corrected various issues identified in the comments of PR#1247

* restored killed->autorevive functionality; removed last traces of old door code from general operations

* knife stab corrected; spitfire turret corrected; blockmap interactivity using zone interaction allowance flag; visibility during resurgence code for csr; removing messages and experience gain for interactions with csr

* pruning imports and correcting the default spectator setting

* separated router/telepad activity from other vehicular activity, previously all considered a form of mounting/dismounting, and restored support experience rewards

* can not activate or deactive spectator of gm when dead; zoning while spectator removes spectator and defaults to sanctuary

* field turrets are neutral-neutral when constructed by a csr; custom bang command 'setempire' will adjust the faction affiliation of a variety of game objects

* fixed facility occupation recognition

* when transitioning between player modes, do not parse new messages about transitioning between player modes, until fully transitioned between player modes
This commit is contained in:
Fate-JH 2024-12-02 13:26:37 -05:00 committed by GitHub
parent 360c3264bd
commit 58238df1fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
63 changed files with 6844 additions and 3960 deletions

View file

@ -16,7 +16,6 @@ import net.psforever.objects.zones.{Zone, ZoneMap}
import net.psforever.objects._
import net.psforever.objects.definition.ProjectileDefinition
import net.psforever.objects.serverobject.CommonMessages
import net.psforever.objects.serverobject.environment.interaction.common.Watery.OxygenStateTarget
import net.psforever.objects.serverobject.environment.{DeepSquare, EnvironmentAttribute, Pool}
import net.psforever.objects.sourcing.{PlayerSource, SourceEntry}
import net.psforever.objects.vital.base.DamageResolution
@ -533,7 +532,7 @@ class PlayerControlDeathStandingTest extends ActorTest {
assert(player2.isAlive)
player2.Actor ! Vitality.Damage(applyDamageTo)
val msg_avatar = avatarProbe.receiveN(8, 500 milliseconds)
val msg_avatar = avatarProbe.receiveN(5, 500 milliseconds)
val msg_stamina = probe.receiveOne(500 milliseconds)
activityProbe.expectNoMessage(200 milliseconds)
assert(
@ -550,31 +549,25 @@ class PlayerControlDeathStandingTest extends ActorTest {
)
assert(
msg_avatar(1) match {
case AvatarServiceMessage("TestCharacter2", AvatarAction.DropSpecialItem()) => true
case _ => false
}
)
assert(
msg_avatar(2) match {
case AvatarServiceMessage("TestCharacter2", AvatarAction.Killed(PlanetSideGUID(2), None)) => true
case AvatarServiceMessage("TestCharacter2", AvatarAction.Killed(PlanetSideGUID(2), _, None)) => true
case _ => false
}
)
assert(
msg_avatar(3) match {
msg_avatar(2) match {
case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(2), 0, _)) => true
case _ => false
}
)
assert(
msg_avatar(4) match {
msg_avatar(3) match {
case AvatarServiceMessage("TestCharacter2", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(2), 7, _)) =>
true
case _ => false
}
)
assert(
msg_avatar(5) match {
msg_avatar(4) match {
case AvatarServiceMessage(
"TestCharacter2",
AvatarAction.SendResponse(_, DestroyMessage(PlanetSideGUID(2), PlanetSideGUID(1), _, _))
@ -583,27 +576,6 @@ class PlayerControlDeathStandingTest extends ActorTest {
case _ => false
}
)
assert(
msg_avatar(6) match {
case AvatarServiceMessage(
"TestCharacter2",
AvatarAction.SendResponse(
_,
AvatarDeadStateMessage(DeadState.Dead, 300000, 300000, Vector3.Zero, PlanetSideEmpire.NC, true)
)
) =>
true
case _ => false
}
)
assert(
msg_avatar(7) match {
case AvatarServiceMessage("test", AvatarAction.DestroyDisplay(killer, victim, _, _))
if killer.Name.equals(player1.Name) && victim.Name.equals(player2.Name) =>
true
case _ => false
}
)
assert(player2.Health <= player2.Definition.DamageDestroysAt)
assert(player2.Armor == 0)
assert(!player2.isAlive)
@ -680,7 +652,7 @@ class PlayerControlDeathStandingTest extends ActorTest {
// assert(player2.isAlive)
//
// player2.Actor ! Vitality.Damage(applyDamageTo)
// val msg_avatar = avatarProbe.receiveN(9, 1500 milliseconds)
// val msg_avatar = avatarProbe.receiveN(3, 1500 milliseconds)
// val msg_stamina = probe.receiveOne(500 milliseconds)
// activityProbe.expectNoMessage(200 milliseconds)
// assert(
@ -691,83 +663,30 @@ class PlayerControlDeathStandingTest extends ActorTest {
// )
// assert(
// msg_avatar.head match {
// case AvatarServiceMessage("TestCharacter2", AvatarAction.DropSpecialItem()) => true
// case _ => false
// case AvatarServiceMessage(
// "TestCharacter2",
// AvatarAction.Killed(PlanetSideGUID(2), _, Some(PlanetSideGUID(7)))
// ) =>
// true
// case _ => false
// }
// )
// assert(
// msg_avatar(1) match {
// case AvatarServiceMessage(
// "TestCharacter2",
// AvatarAction.Killed(PlanetSideGUID(2), Some(PlanetSideGUID(7)))
// ) =>
// true
// case _ => false
// case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(2), 0, _)) => true
// case _ => false
// }
// )
// assert(
// msg_avatar(2) match {
// case AvatarServiceMessage(
// "TestCharacter2",
// AvatarAction.SendResponse(_, ObjectDetachMessage(PlanetSideGUID(7), PlanetSideGUID(2), _, _, _, _))
// ) =>
// true
// case _ => false
// }
// )
// assert(
// msg_avatar(3) match {
// case AvatarServiceMessage(
// "TestCharacter2",
// AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(2), 29, 1)
// ) =>
// true
// case _ => false
// }
// )
// assert(
// msg_avatar(4) match {
// case AvatarServiceMessage("test", AvatarAction.ObjectDelete(PlanetSideGUID(2), PlanetSideGUID(2), _)) => true
// case _ => false
// }
// )
// assert(
// msg_avatar(5) match {
// case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(2), 0, _)) => true
// case _ => false
// }
// )
// assert(
// msg_avatar(6) match {
// case AvatarServiceMessage(
// "TestCharacter2",
// AvatarAction.SendResponse(_, DestroyMessage(PlanetSideGUID(2), PlanetSideGUID(1), _, _))
// ) =>
// true
// case _ => false
// }
// )
// assert(
// msg_avatar(7) match {
// case AvatarServiceMessage(
// "TestCharacter2",
// AvatarAction.SendResponse(
// _,
// AvatarDeadStateMessage(DeadState.Dead, 300000, 300000, Vector3.Zero, PlanetSideEmpire.NC, true)
// )
// ) =>
// true
// case _ => false
// }
// )
// assert(
// msg_avatar(8) match {
// case AvatarServiceMessage("test", AvatarAction.DestroyDisplay(killer, victim, _, _))
// if killer.Name.equals(player1.Name) && victim.Name.equals(player2.Name) =>
// true
// case _ => false
// }
// )
// assert(player2.Health <= player2.Definition.DamageDestroysAt)
// assert(!player2.isAlive)
// }