From 08b02846b9583d0cae669bde82a37d1c3dbf5780 Mon Sep 17 00:00:00 2001 From: ScrawnyRonnie Date: Wed, 30 Jul 2025 10:39:50 -0400 Subject: [PATCH] gm sees anims and crouch bfr --- .../actors/session/csr/GeneralLogic.scala | 3 +++ .../actors/session/normal/GeneralLogic.scala | 3 +++ .../session/support/ZoningOperations.scala | 3 +++ .../scala/net/psforever/objects/Vehicles.scala | 16 +++++++++++++++- .../packet/game/GenericObjectActionMessage.scala | 1 + 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/main/scala/net/psforever/actors/session/csr/GeneralLogic.scala b/src/main/scala/net/psforever/actors/session/csr/GeneralLogic.scala index d9c76b6ef..2cd1782ec 100644 --- a/src/main/scala/net/psforever/actors/session/csr/GeneralLogic.scala +++ b/src/main/scala/net/psforever/actors/session/csr/GeneralLogic.scala @@ -187,6 +187,9 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex pZone.blockMap.sector(player).livePlayerList.collect { case t if t.GUID != player.GUID => pZone.LocalEvents ! LocalServiceMessage(t.Name, LocalAction.SendResponse(EmoteMsg(avatarGuid, emote))) } + pZone.AllPlayers.collect { case t if t.GUID != player.GUID && !t.allowInteraction => + pZone.LocalEvents ! LocalServiceMessage(t.Name, LocalAction.SendResponse(EmoteMsg(avatarGuid, emote))) + } } def handleDropItem(pkt: DropItemMessage): Unit = { diff --git a/src/main/scala/net/psforever/actors/session/normal/GeneralLogic.scala b/src/main/scala/net/psforever/actors/session/normal/GeneralLogic.scala index 97a7a5f93..608f06d00 100644 --- a/src/main/scala/net/psforever/actors/session/normal/GeneralLogic.scala +++ b/src/main/scala/net/psforever/actors/session/normal/GeneralLogic.scala @@ -206,6 +206,9 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex pZone.blockMap.sector(player).livePlayerList.collect { case t if t.GUID != player.GUID => pZone.LocalEvents ! LocalServiceMessage(t.Name, LocalAction.SendResponse(EmoteMsg(avatarGuid, emote))) } + pZone.AllPlayers.collect { case t if t.GUID != player.GUID && !t.allowInteraction => + pZone.LocalEvents ! LocalServiceMessage(t.Name, LocalAction.SendResponse(EmoteMsg(avatarGuid, emote))) + } } def handleDropItem(pkt: DropItemMessage): Unit = { diff --git a/src/main/scala/net/psforever/actors/session/support/ZoningOperations.scala b/src/main/scala/net/psforever/actors/session/support/ZoningOperations.scala index 4bb807c9b..ae62987a0 100644 --- a/src/main/scala/net/psforever/actors/session/support/ZoningOperations.scala +++ b/src/main/scala/net/psforever/actors/session/support/ZoningOperations.scala @@ -3809,6 +3809,9 @@ class ZoningOperations( pZone.blockMap.sector(player).livePlayerList.collect { case t if t.GUID != player.GUID => pZone.LocalEvents ! LocalServiceMessage(t.Name, LocalAction.SendGenericObjectActionMessage(t.GUID, player.GUID, GenericObjectActionEnum.PlayerDeconstructs)) } + pZone.AllPlayers.collect { case t if t.GUID != player.GUID && !t.allowInteraction => + pZone.LocalEvents ! LocalServiceMessage(t.Name, LocalAction.SendGenericObjectActionMessage(t.GUID, player.GUID, GenericObjectActionEnum.PlayerDeconstructs)) + } } def stopDeconstructing(): Unit = { diff --git a/src/main/scala/net/psforever/objects/Vehicles.scala b/src/main/scala/net/psforever/objects/Vehicles.scala index 259dc2845..019f4d7f2 100644 --- a/src/main/scala/net/psforever/objects/Vehicles.scala +++ b/src/main/scala/net/psforever/objects/Vehicles.scala @@ -10,7 +10,7 @@ import net.psforever.objects.serverobject.transfer.TransferContainer import net.psforever.objects.serverobject.structures.WarpGate import net.psforever.objects.vehicles._ import net.psforever.objects.zones.Zone -import net.psforever.packet.game.{ChatMsg, HackMessage, HackState, HackState1, HackState7, TriggeredSound} +import net.psforever.packet.game.{ChatMsg, FrameVehicleStateMessage, GenericObjectActionEnum, GenericObjectActionMessage, HackMessage, HackState, HackState1, HackState7, TriggeredSound, VehicleStateMessage} import net.psforever.types.{ChatMessageType, DriveState, PlanetSideEmpire, PlanetSideGUID, Vector3} import net.psforever.services.Service import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage} @@ -274,6 +274,20 @@ object Vehicles { VehicleAction.KickPassenger(player.GUID, 4, unk2 = false, tGuid) ) } + // In case BFR is occupied and may or may not be crouched + if (GlobalDefinitions.isBattleFrameVehicle(target.Definition) && target.Seat(0).isDefined) { + zone.LocalEvents ! LocalServiceMessage( + zoneid, + LocalAction.SendGenericObjectActionMessage(PlanetSideGUID(-1), target.GUID, GenericObjectActionEnum.BFRShieldsDown)) + zone.LocalEvents ! LocalServiceMessage( + zoneid, + LocalAction.SendResponse( + FrameVehicleStateMessage(target.GUID, 0, target.Position, target.Orientation, Some(Vector3(0f, 0f, 0f)), unk2=false, 0, 0, is_crouched=true, is_airborne=false, ascending_flight=false, 10, 0, 0))) + zone.LocalEvents ! LocalServiceMessage( + zoneid, + LocalAction.SendResponse( + VehicleStateMessage(target.GUID, 0, target.Position, target.Orientation, Some(Vector3(0f, 0f, 0f)), None, 0, 0, 15, is_decelerating=false, is_cloaked=false))) + } }) // If the vehicle can fly and is flying: deconstruct it; and well played to whomever managed to hack a plane in mid air if (target.Definition.CanFly && target.isFlying) { diff --git a/src/main/scala/net/psforever/packet/game/GenericObjectActionMessage.scala b/src/main/scala/net/psforever/packet/game/GenericObjectActionMessage.scala index aa71a534c..8d4b7e4cb 100644 --- a/src/main/scala/net/psforever/packet/game/GenericObjectActionMessage.scala +++ b/src/main/scala/net/psforever/packet/game/GenericObjectActionMessage.scala @@ -92,4 +92,5 @@ object GenericObjectActionEnum extends Enumeration { */ val FlagSpawned = Value(14) val PlayerDeconstructs = Value(6) + val BFRShieldsDown = Value(45) }