implemented proper generic event messages that do not have an [System]Action prefix, e.g., Foo not AvatarAction.Foo; made SendResponse accommodate multiple packets at once

This commit is contained in:
Fate-JH 2026-02-03 22:20:35 -05:00
parent 4838c991b3
commit d6925131a4
120 changed files with 985 additions and 988 deletions

View file

@ -16,6 +16,7 @@ import net.psforever.packet.game.{ObjectCreateMessage, PlayerStateMessageUpstrea
import net.psforever.types._
import net.psforever.services.{RemoverActor, Service, ServiceManager}
import net.psforever.services.avatar._
import net.psforever.services.base.messages.{ChangeAmmo, ChangeFireState_Start, ChangeFireState_Stop, ObjectDelete, PlanetsideAttribute, WeaponDryFire}
class AvatarService1Test extends ActorTest {
"AvatarService" should {
@ -198,14 +199,14 @@ class ObjectDeleteTest extends ActorTest {
ServiceManager.boot(system)
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
service ! Service.Join("test")
service ! AvatarServiceMessage("test", PlanetSideGUID(10), AvatarAction.ObjectDelete(PlanetSideGUID(11)))
service ! AvatarServiceMessage("test", PlanetSideGUID(10), ObjectDelete(PlanetSideGUID(11)))
expectMsg(
AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), AvatarAction.ObjectDelete(PlanetSideGUID(11), 0))
AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), ObjectDelete(PlanetSideGUID(11), 0))
)
service ! AvatarServiceMessage("test", PlanetSideGUID(10), AvatarAction.ObjectDelete(PlanetSideGUID(11), 55))
service ! AvatarServiceMessage("test", PlanetSideGUID(10), ObjectDelete(PlanetSideGUID(11), 55))
expectMsg(
AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), AvatarAction.ObjectDelete(PlanetSideGUID(11), 55))
AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), ObjectDelete(PlanetSideGUID(11), 55))
)
}
}
@ -243,8 +244,8 @@ class PlanetsideAttributeTest extends ActorTest {
ServiceManager.boot(system)
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
service ! Service.Join("test")
service ! AvatarServiceMessage("test", PlanetSideGUID(10), AvatarAction.PlanetsideAttribute(5, 1200L))
expectMsg(AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), AvatarAction.PlanetsideAttribute(5, 1200L)))
service ! AvatarServiceMessage("test", PlanetSideGUID(10), PlanetsideAttribute(PlanetSideGUID(10), 5, 1200L))
expectMsg(AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), PlanetsideAttribute(PlanetSideGUID(10), 5, 1200L)))
}
}
}
@ -324,7 +325,7 @@ class PickupItemTest extends ActorTest {
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
service ! Service.Join("test")
service ! PickupItemMessage("test", AvatarAction.PickupItem(tool), Zone.Nowhere)
expectMsg(AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), AvatarAction.ObjectDelete(tool.GUID, 0)))
expectMsg(AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), ObjectDelete(tool.GUID, 0)))
}
}
@ -352,7 +353,7 @@ class ChangeAmmoTest extends ActorTest {
service ! AvatarServiceMessage(
"test",
PlanetSideGUID(10),
AvatarAction.ChangeAmmo(
ChangeAmmo(
PlanetSideGUID(40),
0,
PlanetSideGUID(40),
@ -365,7 +366,7 @@ class ChangeAmmoTest extends ActorTest {
AvatarServiceResponse(
"/test/Avatar",
PlanetSideGUID(10),
AvatarAction.ChangeAmmo(
ChangeAmmo(
PlanetSideGUID(40),
0,
PlanetSideGUID(40),
@ -402,12 +403,12 @@ class ChangeFireStateStartTest extends ActorTest {
ServiceManager.boot(system)
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
service ! Service.Join("test")
service ! AvatarServiceMessage("test", PlanetSideGUID(10), AvatarAction.ChangeFireState_Start(PlanetSideGUID(40)))
service ! AvatarServiceMessage("test", PlanetSideGUID(10), ChangeFireState_Start(PlanetSideGUID(40)))
expectMsg(
AvatarServiceResponse(
"/test/Avatar",
PlanetSideGUID(10),
AvatarAction.ChangeFireState_Start(PlanetSideGUID(40))
ChangeFireState_Start(PlanetSideGUID(40))
)
)
}
@ -420,12 +421,12 @@ class ChangeFireStateStopTest extends ActorTest {
ServiceManager.boot(system)
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
service ! Service.Join("test")
service ! AvatarServiceMessage("test", PlanetSideGUID(10), AvatarAction.ChangeFireState_Stop(PlanetSideGUID(40)))
service ! AvatarServiceMessage("test", PlanetSideGUID(10), ChangeFireState_Stop(PlanetSideGUID(40)))
expectMsg(
AvatarServiceResponse(
"/test/Avatar",
PlanetSideGUID(10),
AvatarAction.ChangeFireState_Stop(PlanetSideGUID(40))
ChangeFireState_Stop(PlanetSideGUID(40))
)
)
}
@ -438,9 +439,9 @@ class WeaponDryFireTest extends ActorTest {
ServiceManager.boot(system)
val service = system.actorOf(Props(classOf[AvatarService], Zone.Nowhere), AvatarServiceTest.TestName)
service ! Service.Join("test")
service ! AvatarServiceMessage("test", PlanetSideGUID(10), AvatarAction.WeaponDryFire(PlanetSideGUID(40)))
service ! AvatarServiceMessage("test", PlanetSideGUID(10), WeaponDryFire(PlanetSideGUID(40)))
expectMsg(
AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), AvatarAction.WeaponDryFire(PlanetSideGUID(40)))
AvatarServiceResponse("/test/Avatar", PlanetSideGUID(10), WeaponDryFire(PlanetSideGUID(40)))
)
}
}

View file

@ -49,6 +49,7 @@ import net.psforever.objects.vital.{DamagingActivity, HealFromImplant, HealingAc
import net.psforever.packet.game.objectcreate.{BasicCharacterData, ObjectClass, RibbonBars}
import net.psforever.packet.game.{Friend => GameFriend, _}
import net.psforever.persistence
import net.psforever.services.base.messages.{SendResponse, PlanetsideAttribute}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.types.{
CharacterSex,
@ -587,7 +588,7 @@ object AvatarActor {
session.zone.AvatarEvents ! AvatarServiceMessage(
player.Faction.toString,
player.GUID,
AvatarAction.PlanetsideAttribute(53, state)
PlanetsideAttribute(player.GUID, 53, state)
)
}
@ -1386,7 +1387,7 @@ class AvatarActor(
session.get.zone.AvatarEvents ! AvatarServiceMessage(
avatar.faction.toString,
session.get.player.GUID,
AvatarAction.PlanetsideAttribute(53, if (lfs) 1 else 0)
PlanetsideAttribute(session.get.player.GUID, 53, if (lfs) 1 else 0)
)
Behaviors.same
@ -1797,7 +1798,7 @@ class AvatarActor(
val zone = player.Zone
zone.AvatarEvents ! AvatarServiceMessage(
zone.id,
AvatarAction.SendResponse(DisplayedAwardMessage(player.GUID, ribbon, bar))
SendResponse(DisplayedAwardMessage(player.GUID, ribbon, bar))
)
Behaviors.same
@ -3163,7 +3164,7 @@ class AvatarActor(
val player = _session.player
zone.AvatarEvents ! AvatarServiceMessage(
player.Name,
AvatarAction.SendResponse(AvatarStatisticsMessage(DeathStatistic(ScoreCard.deathCount(avatar.scorecard))))
SendResponse(AvatarStatisticsMessage(DeathStatistic(ScoreCard.deathCount(avatar.scorecard))))
)
}
@ -3650,7 +3651,7 @@ class AvatarActor(
// What is normally a 60s timer that is set to 120s on the server will still visually update as if 60s
session.get.zone.AvatarEvents ! AvatarServiceMessage(
avatar.name,
AvatarAction.SendResponse(ActionProgressMessage(slot + 6, actionProgress))
SendResponse(ActionProgressMessage(slot + 6, actionProgress))
)
implant.copy(initialized = false, active = false, timer = futureDelay)
} else {
@ -3699,7 +3700,7 @@ class AvatarActor(
//can not formally stop the initialization time on the character information window; set it to 100 to make it look blank
session.get.zone.AvatarEvents ! AvatarServiceMessage(
avatar.name,
AvatarAction.SendResponse(ActionProgressMessage(slot + 6, 100))
SendResponse(ActionProgressMessage(slot + 6, 100))
)
implant.copy(initialized = false, active = false, timer = 0L)
}
@ -3770,7 +3771,7 @@ class AvatarActor(
session.get.zone.AvatarEvents ! AvatarServiceMessage(
session.get.zone.id,
session.get.player.GUID,
AvatarAction.PlanetsideAttribute(28, implant.definition.implantType.value * 2)
PlanetsideAttribute(session.get.player.GUID, 28, implant.definition.implantType.value * 2)
)
sendAvatarImplantMessageToSelf(session.get.player.GUID, ImplantAction.Activation, slot, value = 0)
implant.copy(active = false)
@ -3862,7 +3863,8 @@ class AvatarActor(
zone.AvatarEvents ! AvatarServiceMessage(
zone.id,
sess.player.GUID,
AvatarAction.PlanetsideAttribute(
PlanetsideAttribute(
sess.player.GUID,
28,
implant.definition.implantType.value * 2 + 1
)
@ -3886,7 +3888,7 @@ class AvatarActor(
val actionProgress = calculateImplantTimerStats(implant, AvatarActor.initializationTime(implant))._3
session.get.zone.AvatarEvents ! AvatarServiceMessage(
avatar.name,
AvatarAction.SendResponse(ActionProgressMessage(slot + 6, actionProgress))
SendResponse(ActionProgressMessage(slot + 6, actionProgress))
)
implantOpt
case (None, _) =>

View file

@ -11,9 +11,10 @@ import net.psforever.objects.inventory.Container
import net.psforever.objects.serverobject.containable.ContainableBehavior
import net.psforever.objects.serverobject.mount.Mountable
import net.psforever.objects.vital.RevivingActivity
import net.psforever.packet.game.{AvatarImplantMessage, CreateShortcutMessage, ImplantAction}
import net.psforever.packet.game.{AvatarImplantMessage, CreateShortcutMessage, HitHint, ImplantAction}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceResponse}
import net.psforever.services.base.EventResponse
import net.psforever.services.base.messages.{ChangeAmmo, ChangeFireState_Start, ChangeFireState_Stop, GenericObjectAction, HintsAtAttacker, ObjectDelete, PlanetsideAttribute, ReloadTool, SendResponse, SetEmpire, WeaponDryFire}
import net.psforever.types.ImplantType
//
@ -26,7 +27,7 @@ import net.psforever.objects.inventory.InventoryItem
import net.psforever.objects.serverobject.terminals.{ProximityUnit, Terminal}
import net.psforever.objects.zones.Zoning
import net.psforever.packet.game.objectcreate.ObjectCreateMessageParent
import net.psforever.packet.game.{ArmorChangedMessage, ChangeAmmoMessage, ChangeFireModeMessage, ChangeFireStateMessage_Start, ChangeFireStateMessage_Stop, ChatMsg, DestroyMessage, DrowningTarget, GenericActionMessage, GenericObjectActionMessage, HitHint, ItemTransactionResultMessage, ObjectCreateDetailedMessage, ObjectCreateMessage, ObjectDeleteMessage, ObjectHeldMessage, OxygenStateMessage, PlanetsideAttributeMessage, PlayerStateMessage, ProjectileStateMessage, ReloadMessage, SetEmpireMessage, UseItemMessage, WeaponDryFireMessage}
import net.psforever.packet.game.{ArmorChangedMessage, ChangeAmmoMessage, ChangeFireModeMessage, ChangeFireStateMessage_Start, ChangeFireStateMessage_Stop, ChatMsg, DestroyMessage, DrowningTarget, GenericActionMessage, GenericObjectActionMessage, ItemTransactionResultMessage, ObjectCreateDetailedMessage, ObjectCreateMessage, ObjectDeleteMessage, ObjectHeldMessage, OxygenStateMessage, PlanetsideAttributeMessage, PlayerStateMessage, ProjectileStateMessage, ReloadMessage, SetEmpireMessage, UseItemMessage, WeaponDryFireMessage}
import net.psforever.services.Service
import net.psforever.types.{ChatMessageType, PlanetSideGUID, TransactionType, Vector3}
import net.psforever.util.Config
@ -219,23 +220,23 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.ObjectHeld(_, previousSlot) =>
sendResponse(ObjectHeldMessage(guid, previousSlot, unk1=false))
case AvatarAction.ChangeFireState_Start(weaponGuid)
case ChangeFireState_Start(weaponGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
sendResponse(ChangeFireStateMessage_Start(weaponGuid))
val entry = ops.lastSeenStreamMessage(guid.guid)
ops.lastSeenStreamMessage.put(guid.guid, entry.copy(shooting = Some(weaponGuid)))
case AvatarAction.ChangeFireState_Start(weaponGuid)
case ChangeFireState_Start(weaponGuid)
if isNotSameTarget =>
sendResponse(ChangeFireStateMessage_Start(weaponGuid))
case AvatarAction.ChangeFireState_Stop(weaponGuid)
case ChangeFireState_Stop(weaponGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { msg => msg.visible || msg.shooting.nonEmpty } =>
sendResponse(ChangeFireStateMessage_Stop(weaponGuid))
val entry = ops.lastSeenStreamMessage(guid.guid)
ops.lastSeenStreamMessage.put(guid.guid, entry.copy(shooting = None))
case AvatarAction.ChangeFireState_Stop(weaponGuid)
case ChangeFireState_Stop(weaponGuid)
if isNotSameTarget =>
sendResponse(ChangeFireStateMessage_Stop(weaponGuid))
@ -245,8 +246,8 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.EquipmentCreatedInHand(pkt) if isNotSameTarget =>
sendResponse(pkt)
case AvatarAction.PlanetsideAttribute(attributeType, attributeValue) if isNotSameTarget =>
sendResponse(PlanetsideAttributeMessage(guid, attributeType, attributeValue))
case PlanetsideAttribute(target_guid, attributeType, attributeValue) if isNotSameTarget =>
sendResponse(PlanetsideAttributeMessage(target_guid, attributeType, attributeValue))
case AvatarAction.PlanetsideAttributeToAll(attributeType, attributeValue) =>
sendResponse(PlanetsideAttributeMessage(guid, attributeType, attributeValue))
@ -254,10 +255,10 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.PlanetsideAttributeSelf(attributeType, attributeValue) if isSameTarget =>
sendResponse(PlanetsideAttributeMessage(guid, attributeType, attributeValue))
case AvatarAction.GenericObjectAction(objectGuid, actionCode) if isNotSameTarget =>
case GenericObjectAction(objectGuid, actionCode) if isNotSameTarget =>
sendResponse(GenericObjectActionMessage(objectGuid, actionCode))
case AvatarAction.HitHint(sourceGuid) if player.isAlive =>
case HintsAtAttacker(sourceGuid) if player.isAlive =>
sendResponse(HitHint(sourceGuid, guid))
sessionLogic.zoning.CancelZoningProcess()
@ -432,14 +433,14 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
sessionLogic.general.kitToBeUsed = None
sendResponse(ChatMsg(ChatMessageType.UNK_225, msg))
case AvatarAction.SendResponse(msg) =>
sendResponse(msg)
case SendResponse(msgs) =>
msgs.foreach(sendResponse)
case AvatarAction.SendResponseTargeted(targetGuid, msg) if resolvedPlayerGuid == targetGuid =>
sendResponse(msg)
/* common messages (maybe once every respawn) */
case AvatarAction.Reload(itemGuid)
case ReloadTool(itemGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
sendResponse(ReloadMessage(itemGuid, ammo_clip=1, unk1=0))
@ -498,12 +499,12 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
}
/* uncommon messages (utility, or once in a while) */
case AvatarAction.ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
case ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
ops.changeAmmoProcedures(weapon_guid, previous_guid, ammo_id, ammo_guid, weapon_slot, ammo_data)
sendResponse(ChangeAmmoMessage(weapon_guid, 1))
case AvatarAction.ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
case ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
if isNotSameTarget =>
ops.changeAmmoProcedures(weapon_guid, previous_guid, ammo_id, ammo_guid, weapon_slot, ammo_data)
@ -520,11 +521,11 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.DropCreatedItem(pkt) if isNotSameTarget =>
sendResponse(pkt)
case AvatarAction.ObjectDelete(itemGuid, unk) if isNotSameTarget =>
case ObjectDelete(itemGuid, unk) if isNotSameTarget =>
sendResponse(ObjectDeleteMessage(itemGuid, unk))
/* rare messages */
case AvatarAction.SetEmpire(objectGuid, faction) if isNotSameTarget =>
case SetEmpire(objectGuid, faction) if isNotSameTarget =>
sendResponse(SetEmpireMessage(objectGuid, faction))
case AvatarAction.DropSpecialItem() =>
@ -573,7 +574,7 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
)
)
case AvatarAction.WeaponDryFire(weaponGuid)
case WeaponDryFire(weaponGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
continent.GUID(weaponGuid).collect {
case tool: Tool if tool.Magazine == 0 =>

View file

@ -17,6 +17,7 @@ import net.psforever.objects.zones.Zone
import net.psforever.packet.game.{ChatMsg, SetChatFilterMessage}
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.{ObjectDelete, SetEmpire}
import net.psforever.services.chat.{ChatChannel, DefaultChannel, SpectatorChannel, SquadChannel}
import net.psforever.types.ChatMessageType.{CMT_TOGGLESPECTATORMODE, CMT_TOGGLE_GM}
import net.psforever.types.{ChatMessageType, PlanetSideEmpire}
@ -337,7 +338,7 @@ class ChatLogic(val ops: ChatOperations, implicit val context: ActorContext) ext
.filter(_.spectator)
.foreach { spectator =>
val guid = spectator.GUID
events ! AvatarServiceMessage(channel, guid, AvatarAction.ObjectDelete(guid))
events ! AvatarServiceMessage(channel, guid, ObjectDelete(guid))
}
true
}
@ -392,7 +393,7 @@ class ChatLogic(val ops: ChatOperations, implicit val context: ActorContext) ext
o.Faction = foundFaction
continent.AvatarEvents ! AvatarServiceMessage(
continent.id,
AvatarAction.SetEmpire(o.GUID, foundFaction)
SetEmpire(o.GUID, foundFaction)
)
true
case o: Building =>
@ -405,7 +406,7 @@ class ChatLogic(val ops: ChatOperations, implicit val context: ActorContext) ext
o.Faction = foundFaction
continent.AvatarEvents ! AvatarServiceMessage(
continent.id,
AvatarAction.SetEmpire(o.GUID, foundFaction)
SetEmpire(o.GUID, foundFaction)
)
true
}

View file

@ -11,6 +11,7 @@ import net.psforever.objects.zones.Zone
import net.psforever.packet.game.{ChatMsg, ObjectCreateDetailedMessage, PlanetsideAttributeMessage}
import net.psforever.packet.game.objectcreate.RibbonBars
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.services.chat.{CustomerServiceChannel, SpectatorChannel}
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.types.{ChatMessageType, MeritCommendation, PlanetSideGUID}
@ -181,14 +182,14 @@ case object CustomerServiceRepresentativeMode extends PlayerMode {
player.Health = maxHealthOfPlayer.toInt
player.LogActivity(player.ClearHistory().head)
data.sendResponse(PlanetsideAttributeMessage(guid, 0, maxHealthOfPlayer))
data.continent.AvatarEvents ! AvatarServiceMessage(zoneid, guid, AvatarAction.PlanetsideAttribute(0, maxHealthOfPlayer))
data.continent.AvatarEvents ! AvatarServiceMessage(zoneid, PlanetsideAttribute(guid, 0, maxHealthOfPlayer))
}
//below half armor, full armor
val maxArmor = player.MaxArmor.toLong
if (player.Armor < maxArmor) {
player.Armor = maxArmor.toInt
data.sendResponse(PlanetsideAttributeMessage(guid, 4, maxArmor))
data.continent.AvatarEvents ! AvatarServiceMessage(zoneid, guid, AvatarAction.PlanetsideAttribute(4, maxArmor))
data.continent.AvatarEvents ! AvatarServiceMessage(zoneid, PlanetsideAttribute(guid, 4, maxArmor))
}
}
@ -203,7 +204,7 @@ case object CustomerServiceRepresentativeMode extends PlayerMode {
data.sendResponse(PlanetsideAttributeMessage(guid, shieldsUi, maxShieldsOfVehicle))
data.continent.VehicleEvents ! VehicleServiceMessage(
data.continent.id,
VehicleAction.PlanetsideAttribute(guid, shieldsUi, maxShieldsOfVehicle)
PlanetsideAttribute(guid, shieldsUi, maxShieldsOfVehicle)
)
}
}
@ -217,7 +218,7 @@ case object CustomerServiceRepresentativeMode extends PlayerMode {
data.sendResponse(PlanetsideAttributeMessage(guid, 0, maxHealthOf))
data.continent.VehicleEvents ! VehicleServiceMessage(
data.continent.id,
VehicleAction.PlanetsideAttribute(guid, 0, maxHealthOf)
PlanetsideAttribute(guid, 0, maxHealthOf)
)
}
}

View file

@ -35,7 +35,7 @@ import net.psforever.packet.game.OutfitEventAction.{Initial, OutfitInfo, OutfitR
import net.psforever.packet.game.{ActionCancelMessage, AvatarFirstTimeEventMessage, AvatarImplantMessage, AvatarJumpMessage, BattleplanMessage, BindPlayerMessage, BugReportMessage, ChangeFireModeMessage, ChangeShortcutBankMessage, CharacterCreateRequestMessage, CharacterRequestMessage, ChatMsg, CollisionIs, ConnectToWorldRequestMessage, CreateShortcutMessage, DeadState, DeployObjectMessage, DisplayedAwardMessage, DropItemMessage, EmoteMsg, FacilityBenefitShieldChargeRequestMessage, FriendsRequest, GenericAction, GenericActionMessage, GenericCollisionMsg, GenericObjectActionAtPositionMessage, GenericObjectActionMessage, GenericObjectStateMsg, HitHint, InvalidTerrainMessage, LootItemMessage, MoveItemMessage, ObjectDetectedMessage, ObjectHeldMessage, OutfitEvent, OutfitMemberEvent, OutfitMembershipRequest, OutfitMembershipResponse, OutfitRequest, OutfitRequestAction, PickupItemMessage, PlanetsideAttributeMessage, PlayerStateMessageUpstream, RequestDestroyMessage, TargetingImplantRequest, TerrainCondition, TradeMessage, UnuseItemMessage, UseItemMessage, VoiceHostInfo, VoiceHostRequest, ZipLineMessage}
import net.psforever.services.RemoverActor
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage, CorpseEnvelope}
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.types.{CapacitorStateType, ChatMessageType, Cosmetic, ExoSuitType, PlanetSideEmpire, PlanetSideGUID, Vector3}
import scala.concurrent.duration._
@ -163,15 +163,8 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
}
def handleEmote(pkt: EmoteMsg): Unit = {
val EmoteMsg(avatarGuid, emote) = pkt
val pZone = player.Zone
sendResponse(EmoteMsg(avatarGuid, emote))
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)))
}
sendResponse(pkt)
ops.handleEmote(pkt)
}
def handleDropItem(pkt: DropItemMessage): Unit = {
@ -442,7 +435,7 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
continent.AvatarEvents ! AvatarServiceMessage(
continent.id,
player.GUID,
AvatarAction.PlanetsideAttribute(19, 1)
PlanetsideAttribute(player.GUID, 19, 1)
)
definition match {
case GlobalDefinitions.trhev_dualcycler | GlobalDefinitions.trhev_burster =>
@ -463,7 +456,7 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
continent.AvatarEvents ! AvatarServiceMessage(
continent.id,
player.GUID,
AvatarAction.PlanetsideAttribute(19, 0)
PlanetsideAttribute(player.GUID, 19, 0)
)
definition match {
case GlobalDefinitions.trhev_dualcycler | GlobalDefinitions.trhev_burster =>

View file

@ -15,7 +15,8 @@ import net.psforever.objects.serverobject.turret.{FacilityTurret, WeaponTurret}
import net.psforever.objects.vehicles.AccessPermissionGroup
import net.psforever.objects.vital.InGameHistory
import net.psforever.packet.game.{ChatMsg, DelayedPathMountMsg, DismountVehicleCargoMsg, DismountVehicleMsg, GenericObjectActionMessage, MountVehicleCargoMsg, MountVehicleMsg, ObjectDetachMessage, PlanetsideAttributeMessage, PlayerStasisMessage, PlayerStateShiftMessage, ShiftState}
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.base.messages.{SendResponse, SetEmpire}
import net.psforever.services.local.LocalServiceMessage
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.types.{BailType, ChatMessageType, DriveState, PlanetSideGUID, Vector3}
@ -159,7 +160,7 @@ class MountHandlerLogic(val ops: SessionMountHandlers, implicit val context: Act
case Mountable.CanMount(obj: FacilityTurret, seatNumber, _)
if obj.Definition == GlobalDefinitions.vanu_sentry_turret =>
sessionLogic.zoning.CancelZoningProcess()
obj.Zone.LocalEvents ! LocalServiceMessage(obj.Zone.id, LocalAction.SetEmpire(obj.GUID, player.Faction))
obj.Zone.LocalEvents ! LocalServiceMessage(obj.Zone.id, SetEmpire(obj.GUID, player.Faction))
sendResponse(PlanetsideAttributeMessage(obj.GUID, attribute_type=0, obj.Health))
ops.updateWeaponAtSeatPosition(obj, seatNumber)
ops.MountingAction(tplayer, obj, seatNumber)
@ -200,7 +201,7 @@ class MountHandlerLogic(val ops: SessionMountHandlers, implicit val context: Act
sendResponse(DelayedPathMountMsg(pguid, sguid, u1=60, u2=true))
continent.LocalEvents ! LocalServiceMessage(
continent.id,
LocalAction.SendResponse(ObjectDetachMessage(sguid, pguid, pos, roll=0, pitch=0, zang))
SendResponse(ObjectDetachMessage(sguid, pguid, pos, roll=0, pitch=0, zang))
)
sessionLogic.keepAliveFunc = sessionLogic.zoning.NormalKeepAlive
@ -214,7 +215,7 @@ class MountHandlerLogic(val ops: SessionMountHandlers, implicit val context: Act
//DismountAction(...) uses vehicle service, so use that service to coordinate the remainder of the messages
events ! VehicleServiceMessage(
player.Name,
VehicleAction.SendResponse(PlayerStasisMessage(pguid)) //the stasis message
SendResponse(PlayerStasisMessage(pguid)) //the stasis message
)
//when the player dismounts, they will be positioned where the shuttle was when it disappeared in the sky
//the player will fall to the ground and is perfectly vulnerable in this state
@ -222,12 +223,12 @@ class MountHandlerLogic(val ops: SessionMountHandlers, implicit val context: Act
//having no in-game avatar target will throw us out of the map screen when deploying and cause softlock
events ! VehicleServiceMessage(
player.Name,
VehicleAction.SendResponse(PlayerStateShiftMessage(ShiftState(unk=0, obj.Position, obj.Orientation.z, vel=None)))
SendResponse(PlayerStateShiftMessage(ShiftState(unk=0, obj.Position, obj.Orientation.z, vel=None)))
)
events ! VehicleServiceMessage(
continent.id,
pguid,
VehicleAction.SendResponse(GenericObjectActionMessage(pguid, code=9)) //conceal the player
SendResponse(GenericObjectActionMessage(pguid, code=9)) //conceal the player
)
sessionLogic.keepAliveFunc = sessionLogic.zoning.NormalKeepAlive

View file

@ -8,6 +8,7 @@ import net.psforever.objects.{Player, Session, Vehicle}
import net.psforever.objects.zones.Zone
import net.psforever.packet.PlanetSidePacket
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.ObjectDelete
import net.psforever.services.chat.SpectatorChannel
import net.psforever.services.teamwork.{SquadAction, SquadServiceMessage}
import net.psforever.types.{ChatMessageType, SquadRequestType}
@ -45,7 +46,7 @@ class SpectatorCSRModeLogic(data: SessionData) extends ModeLogic {
//
player.spectator = true
data.chat.JoinChannel(SpectatorChannel)
continent.AvatarEvents ! AvatarServiceMessage(continent.id, pguid, AvatarAction.ObjectDelete(pguid))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, pguid, ObjectDelete(pguid))
sendResponse(ChatMsg(ChatMessageType.CMT_TOGGLESPECTATORMODE, "on"))
sendResponse(ChatMsg(ChatMessageType.UNK_225, "CSR SPECTATOR MODE ON"))
}

View file

@ -11,7 +11,9 @@ import net.psforever.objects.serverobject.mount.Mountable
import net.psforever.objects.vehicles.control.BfrFlight
import net.psforever.objects.zones.Zone
import net.psforever.objects.zones.interaction.InteractsWithZone
import net.psforever.packet.game.{ChildObjectStateMessage, DeployRequestMessage, FrameVehicleStateMessage, VehicleStateMessage, VehicleSubStateMessage}
import net.psforever.packet.game.{ChildObjectStateMessage, DeployRequestMessage, FrameVehicleStateMessage, PlanetsideAttributeMessage, VehicleStateMessage, VehicleSubStateMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.types.{DriveState, Vector3}

View file

@ -14,6 +14,7 @@ import net.psforever.objects.vital.interaction.Adversarial
import net.psforever.packet.game.{AvatarImplantMessage, CreateShortcutMessage, ImplantAction, PlanetsideStringAttributeMessage}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.EventResponse
import net.psforever.services.base.messages.{ChangeAmmo, ChangeFireState_Start, ChangeFireState_Stop, GenericObjectAction, HintsAtAttacker, ObjectDelete, PlanetsideAttribute, ReloadTool, SendResponse, SetEmpire, WeaponDryFire}
import net.psforever.types.ImplantType
import scala.concurrent.duration._
@ -218,23 +219,23 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.ObjectHeld(_, previousSlot) =>
sendResponse(ObjectHeldMessage(guid, previousSlot, unk1=false))
case AvatarAction.ChangeFireState_Start(weaponGuid)
case ChangeFireState_Start(weaponGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
sendResponse(ChangeFireStateMessage_Start(weaponGuid))
val entry = ops.lastSeenStreamMessage(guid.guid)
ops.lastSeenStreamMessage.put(guid.guid, entry.copy(shooting = Some(weaponGuid)))
case AvatarAction.ChangeFireState_Start(weaponGuid)
case ChangeFireState_Start(weaponGuid)
if isNotSameTarget =>
sendResponse(ChangeFireStateMessage_Start(weaponGuid))
case AvatarAction.ChangeFireState_Stop(weaponGuid)
case ChangeFireState_Stop(weaponGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { msg => msg.visible || msg.shooting.nonEmpty } =>
sendResponse(ChangeFireStateMessage_Stop(weaponGuid))
val entry = ops.lastSeenStreamMessage(guid.guid)
ops.lastSeenStreamMessage.put(guid.guid, entry.copy(shooting = None))
case AvatarAction.ChangeFireState_Stop(weaponGuid)
case ChangeFireState_Stop(weaponGuid)
if isNotSameTarget =>
sendResponse(ChangeFireStateMessage_Stop(weaponGuid))
@ -244,8 +245,8 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.EquipmentCreatedInHand(pkt) if isNotSameTarget =>
sendResponse(pkt)
case AvatarAction.PlanetsideAttribute(attributeType, attributeValue) if isNotSameTarget =>
sendResponse(PlanetsideAttributeMessage(guid, attributeType, attributeValue))
case PlanetsideAttribute(target_guid, attributeType, attributeValue) if isNotSameTarget =>
sendResponse(PlanetsideAttributeMessage(target_guid, attributeType, attributeValue))
case AvatarAction.PlanetsideAttributeToAll(attributeType, attributeValue) =>
sendResponse(PlanetsideAttributeMessage(guid, attributeType, attributeValue))
@ -256,10 +257,10 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.PlanetsideStringAttribute(attributeType, attributeValue) =>
sendResponse(PlanetsideStringAttributeMessage(guid, attributeType, attributeValue))
case AvatarAction.GenericObjectAction(objectGuid, actionCode) if isNotSameTarget =>
case GenericObjectAction(objectGuid, actionCode) if isNotSameTarget =>
sendResponse(GenericObjectActionMessage(objectGuid, actionCode))
case AvatarAction.HitHint(sourceGuid) if player.isAlive =>
case HintsAtAttacker(sourceGuid) if player.isAlive =>
sendResponse(HitHint(sourceGuid, guid))
sessionLogic.zoning.CancelZoningProcessWithDescriptiveReason("cancel_dmg")
@ -486,14 +487,14 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.RemoveFromOutfitChat(outfit_id) =>
ops.removeFromOutfitChat(outfit_id)
case AvatarAction.SendResponse(msg) =>
sendResponse(msg)
case SendResponse(msgs) =>
msgs.foreach(sendResponse)
case AvatarAction.SendResponseTargeted(targetGuid, msg) if resolvedPlayerGuid == targetGuid =>
sendResponse(msg)
/* common messages (maybe once every respawn) */
case AvatarAction.Reload(itemGuid)
case ReloadTool(itemGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
sendResponse(ReloadMessage(itemGuid, ammo_clip=1, unk1=0))
@ -606,12 +607,12 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
}
/* uncommon messages (utility, or once in a while) */
case AvatarAction.ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
case ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
ops.changeAmmoProcedures(weapon_guid, previous_guid, ammo_id, ammo_guid, weapon_slot, ammo_data)
sendResponse(ChangeAmmoMessage(weapon_guid, 1))
case AvatarAction.ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
case ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
if isNotSameTarget =>
ops.changeAmmoProcedures(weapon_guid, previous_guid, ammo_id, ammo_guid, weapon_slot, ammo_data)
@ -628,11 +629,11 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.DropCreatedItem(pkt) if isNotSameTarget =>
sendResponse(pkt)
case AvatarAction.ObjectDelete(itemGuid, unk) if isNotSameTarget =>
case ObjectDelete(itemGuid, unk) if isNotSameTarget =>
sendResponse(ObjectDeleteMessage(itemGuid, unk))
/* rare messages */
case AvatarAction.SetEmpire(objectGuid, faction) if isNotSameTarget =>
case SetEmpire(objectGuid, faction) if isNotSameTarget =>
sendResponse(SetEmpireMessage(objectGuid, faction))
case AvatarAction.DropSpecialItem() =>
@ -681,7 +682,7 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
)
)
case AvatarAction.WeaponDryFire(weaponGuid)
case WeaponDryFire(weaponGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
continent.GUID(weaponGuid).collect {
case tool: Tool if tool.Magazine == 0 =>
@ -700,6 +701,6 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
//make player invisible on client
events ! AvatarServiceMessage(player.Name, playerGuid, AvatarAction.PlanetsideAttributeToAll(29, 1))
//only the dead player should "see" their own body, so that the death camera has something to focus on
events ! AvatarServiceMessage(continent.id, playerGuid, AvatarAction.ObjectDelete(playerGuid))
events ! AvatarServiceMessage(continent.id, playerGuid, ObjectDelete(playerGuid))
}
}

View file

@ -6,6 +6,7 @@ import net.psforever.actors.session.AvatarActor
import net.psforever.actors.session.support.{GalaxyHandlerFunctions, SessionData, SessionGalaxyHandlers}
import net.psforever.packet.game.{BroadcastWarpgateUpdateMessage, FriendsResponse, HotSpotUpdateMessage, ZoneInfoMessage, ZonePopulationUpdateMessage, HotSpotInfo => PacketHotSpotInfo}
import net.psforever.services.base.EventResponse
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.galaxy.{GalaxyAction, GalaxyServiceMessage}
import net.psforever.types.{MemberAction, PlanetSideEmpire}
@ -85,8 +86,8 @@ class GalaxyHandlerLogic(val ops: SessionGalaxyHandlers, implicit val context: A
case GalaxyAction.LogStatusChange(name) if avatar.people.friend.exists(_.name.equals(name)) =>
avatarActor ! AvatarActor.MemberListRequest(MemberAction.UpdateFriend, name)
case GalaxyAction.SendResponse(msg) =>
sendResponse(msg)
case SendResponse(msgs) =>
msgs.foreach(sendResponse)
case _ => ()
}

View file

@ -43,7 +43,7 @@ import net.psforever.packet.PlanetSideGamePacket
import net.psforever.packet.game.{ActionCancelMessage, ActionResultMessage, AvatarFirstTimeEventMessage, AvatarImplantMessage, AvatarJumpMessage, BattleplanMessage, BindPlayerMessage, BugReportMessage, ChangeFireModeMessage, ChangeShortcutBankMessage, CharacterCreateRequestMessage, CharacterRequestAction, CharacterRequestMessage, ChatMsg, CollisionIs, ConnectToWorldRequestMessage, CreateShortcutMessage, DeadState, DeployObjectMessage, DisplayedAwardMessage, DropItemMessage, EmoteMsg, FacilityBenefitShieldChargeRequestMessage, FriendsRequest, GenericAction, GenericActionMessage, GenericCollisionMsg, GenericObjectActionAtPositionMessage, GenericObjectActionMessage, GenericObjectStateMsg, HitHint, InvalidTerrainMessage, LootItemMessage, MoveItemMessage, ObjectDetectedMessage, ObjectHeldMessage, OutfitMembershipRequest, OutfitMembershipRequestAction, OutfitMembershipResponse, OutfitRequest, OutfitRequestAction, PickupItemMessage, PlanetsideAttributeMessage, PlayerStateMessageUpstream, RequestDestroyMessage, TargetingImplantRequest, TerrainCondition, TradeMessage, UnuseItemMessage, UseItemMessage, VoiceHostInfo, VoiceHostRequest, ZipLineMessage}
import net.psforever.services.account.{AccountPersistenceService, RetrieveAccountData}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.services.local.support.CaptureFlagManager
import net.psforever.types.{CapacitorStateType, ChatMessageType, Cosmetic, ExoSuitType, ImplantType, PlanetSideEmpire, PlanetSideGUID, Vector3}
import net.psforever.util.Config
@ -213,15 +213,8 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
}
def handleEmote(pkt: EmoteMsg): Unit = {
val EmoteMsg(avatarGuid, emote) = pkt
val pZone = player.Zone
sendResponse(EmoteMsg(avatarGuid, emote))
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)))
}
sendResponse(pkt)
ops.handleEmote(pkt)
}
def handleDropItem(pkt: DropItemMessage): Unit = {
@ -528,7 +521,7 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
continent.AvatarEvents ! AvatarServiceMessage(
continent.id,
player.GUID,
AvatarAction.PlanetsideAttribute(19, 1)
PlanetsideAttribute(player.GUID, 19, 1)
)
definition match {
case GlobalDefinitions.trhev_dualcycler | GlobalDefinitions.trhev_burster =>
@ -550,7 +543,7 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
continent.AvatarEvents ! AvatarServiceMessage(
continent.id,
player.GUID,
AvatarAction.PlanetsideAttribute(19, 0)
PlanetsideAttribute(player.GUID, 19, 0)
)
definition match {
case GlobalDefinitions.trhev_dualcycler | GlobalDefinitions.trhev_burster =>

View file

@ -10,6 +10,7 @@ import net.psforever.objects.vehicles.MountableWeapons
import net.psforever.objects.{BoomerDeployable, ExplosiveDeployable, TelepadDeployable, Tool, TurretDeployable}
import net.psforever.packet.game.{ChatMsg, DeployableObjectsInfoMessage, GenericActionMessage, GenericObjectActionMessage, GenericObjectStateMsg, HackMessage, HackState, HackState1, InventoryStateMessage, ObjectAttachMessage, ObjectCreateMessage, ObjectDeleteMessage, ObjectDetachMessage, OrbitalShuttleTimeMsg, PadAndShuttlePair, PlanetsideAttributeMessage, ProximityTerminalUseMessage, SetEmpireMessage, TriggerEffectMessage, TriggerSoundMessage, TriggeredSound, VehicleStateMessage}
import net.psforever.services.base.EventResponse
import net.psforever.services.base.messages.{GenericObjectAction, ObjectDelete, PlanetsideAttribute, SendResponse, SetEmpire}
import net.psforever.services.{InterstellarClusterService, Service}
import net.psforever.services.local.LocalAction
import net.psforever.types.{ChatMessageType, PlanetSideGUID, SpawnGroup}
@ -138,16 +139,16 @@ class LocalHandlerLogic(val ops: SessionLocalHandlers, implicit val context: Act
obj.Destroyed = true
ops.DeconstructDeployable(obj, dguid, pos, obj.Orientation, effect)
case LocalAction.SendHackMessageHackCleared(targetGuid, unk1, unk2) =>
case LocalAction.HackClear(targetGuid, unk1, unk2) =>
sendResponse(HackMessage(HackState1.Unk0, targetGuid, guid, progress=0, unk1.toFloat, HackState.HackCleared, unk2))
case LocalAction.HackObject(targetGuid, unk1, unk2) =>
sessionLogic.general.hackObject(targetGuid, unk1, unk2)
case LocalAction.PlanetsideAttribute(targetGuid, attributeType, attributeValue) =>
case PlanetsideAttribute(targetGuid, attributeType, attributeValue) =>
sessionLogic.general.sendPlanetsideAttributeMessage(targetGuid, attributeType, attributeValue)
case LocalAction.GenericObjectAction(targetGuid, actionNumber) =>
case GenericObjectAction(targetGuid, actionNumber) =>
sendResponse(GenericObjectActionMessage(targetGuid, actionNumber))
case LocalAction.GenericActionMessage(actionNumber) =>
@ -174,7 +175,7 @@ class LocalHandlerLogic(val ops: SessionLocalHandlers, implicit val context: Act
player.Carrying = None
}
case LocalAction.ObjectDelete(objectGuid, unk) if isNotSameTarget =>
case ObjectDelete(objectGuid, unk) if isNotSameTarget =>
sendResponse(ObjectDeleteMessage(objectGuid, unk))
case LocalAction.ProximityTerminalEffect(object_guid, true) =>
@ -190,21 +191,19 @@ class LocalHandlerLogic(val ops: SessionLocalHandlers, implicit val context: Act
case LocalAction.RouterTelepadTransport(passengerGuid, srcGuid, destGuid) =>
sessionLogic.general.useRouterTelepadEffect(passengerGuid, srcGuid, destGuid)
case LocalAction.SendResponse(msg) =>
msg match {
case m: GenericObjectActionMessage =>
case SendResponse(msgs) =>
msgs.foreach {
case msg @ (m: GenericObjectActionMessage)
if (m.code == 58 || m.code == 60 || m.code == 61) && !sessionLogic.zoning.spawn.startEnqueueSquadMessages =>
// delay building virus alert if player is dead/respawning
if ((m.code == 58 || m.code == 60 || m.code == 61) && !sessionLogic.zoning.spawn.startEnqueueSquadMessages) {
sessionLogic.zoning.spawn.enqueueNewActivity(ActivityQueuedTask(
SpawnOperations.delaySendGenericObjectActionMessage(msg), 1))
} else {
sendResponse(msg)
}
case _ =>
sessionLogic.zoning.spawn.enqueueNewActivity(ActivityQueuedTask(
SpawnOperations.delaySendGenericObjectActionMessage(msg), 1)
)
case msg =>
sendResponse(msg)
}
case LocalAction.SetEmpire(objectGuid, empire) =>
case SetEmpire(objectGuid, empire) =>
sendResponse(SetEmpireMessage(objectGuid, empire))
case LocalAction.ShuttleEvent(ev) =>

View file

@ -16,7 +16,8 @@ import net.psforever.objects.serverobject.turret.{FacilityTurret, WeaponTurret}
import net.psforever.objects.vehicles.AccessPermissionGroup
import net.psforever.objects.vital.InGameHistory
import net.psforever.packet.game.{ChatMsg, DelayedPathMountMsg, DismountVehicleCargoMsg, DismountVehicleMsg, GenericObjectActionMessage, MountVehicleCargoMsg, MountVehicleMsg, ObjectDetachMessage, PlanetsideAttributeMessage, PlayerStasisMessage, PlayerStateShiftMessage, ShiftState}
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.base.messages.{SendResponse, SetEmpire}
import net.psforever.services.local.LocalServiceMessage
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.types.{BailType, ChatMessageType, DriveState, PlanetSideGUID, Vector3}
@ -190,7 +191,7 @@ class MountHandlerLogic(val ops: SessionMountHandlers, implicit val context: Act
if obj.Definition == GlobalDefinitions.vanu_sentry_turret =>
log.info(s"${player.Name} mounts the ${obj.Definition.Name}")
sessionLogic.zoning.CancelZoningProcessWithDescriptiveReason("cancel_mount")
obj.Zone.LocalEvents ! LocalServiceMessage(obj.Zone.id, LocalAction.SetEmpire(obj.GUID, player.Faction))
obj.Zone.LocalEvents ! LocalServiceMessage(obj.Zone.id, SetEmpire(obj.GUID, player.Faction))
sendResponse(PlanetsideAttributeMessage(obj.GUID, attribute_type=0, obj.Health))
ops.updateWeaponAtSeatPosition(obj, seatNumber)
ops.MountingAction(tplayer, obj, seatNumber)
@ -235,7 +236,7 @@ class MountHandlerLogic(val ops: SessionMountHandlers, implicit val context: Act
sendResponse(DelayedPathMountMsg(pguid, sguid, u1=60, u2=true))
continent.LocalEvents ! LocalServiceMessage(
continent.id,
LocalAction.SendResponse(ObjectDetachMessage(sguid, pguid, pos, roll=0, pitch=0, zang))
SendResponse(ObjectDetachMessage(sguid, pguid, pos, roll=0, pitch=0, zang))
)
sessionLogic.keepAliveFunc = sessionLogic.zoning.NormalKeepAlive
@ -248,22 +249,18 @@ class MountHandlerLogic(val ops: SessionMountHandlers, implicit val context: Act
ops.DismountAction(tplayer, obj, seatNum)
continent.actor ! ZoneActor.RemoveFromBlockMap(player) //character doesn't need it
//DismountAction(...) uses vehicle service, so use that service to coordinate the remainder of the messages
events ! VehicleServiceMessage(
player.Name,
VehicleAction.SendResponse(PlayerStasisMessage(pguid)) //the stasis message
)
//when the player dismounts, they will be positioned where the shuttle was when it disappeared in the sky
//the player will fall to the ground and is perfectly vulnerable in this state
//additionally, our player must exist in the current zone
//having no in-game avatar target will throw us out of the map screen when deploying and cause softlock
events ! VehicleServiceMessage(
player.Name,
VehicleAction.SendResponse(PlayerStateShiftMessage(ShiftState(unk=0, obj.Position, obj.Orientation.z, vel=None)))
)
events ! VehicleServiceMessage(player.Name, SendResponse(Seq(
PlayerStasisMessage(pguid),
PlayerStateShiftMessage(ShiftState(unk=0, obj.Position, obj.Orientation.z, vel=None))
)))
events ! VehicleServiceMessage(
continent.id,
pguid,
VehicleAction.SendResponse(GenericObjectActionMessage(pguid, code=9)) //conceal the player
SendResponse(GenericObjectActionMessage(pguid, code=9)) //conceal the player
)
sessionLogic.keepAliveFunc = sessionLogic.zoning.NormalKeepAlive

View file

@ -15,6 +15,7 @@ import net.psforever.packet.game.objectcreate.ObjectCreateMessageParent
import net.psforever.packet.game.{ChangeAmmoMessage, ChangeFireStateMessage_Start, ChangeFireStateMessage_Stop, ChatMsg, ChildObjectStateMessage, DeadState, DeployRequestMessage, DismountVehicleMsg, FrameVehicleStateMessage, GenericObjectActionMessage, HitHint, InventoryStateMessage, ObjectAttachMessage, ObjectCreateDetailedMessage, ObjectCreateMessage, ObjectDeleteMessage, ObjectDetachMessage, PlanetsideAttributeMessage, ReloadMessage, ServerVehicleOverrideMsg, VehicleStateMessage, WeaponDryFireMessage}
import net.psforever.services.Service
import net.psforever.services.base.EventResponse
import net.psforever.services.base.messages.{ChangeAmmo, ChangeFireState_Start, ChangeFireState_Stop, GenericObjectAction, HintsAtAttacker, ObjectDelete, PlanetsideAttribute, ReloadTool, SendResponse, WeaponDryFire}
import net.psforever.services.local.support.CaptureFlagManager
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceResponse}
import net.psforever.types.{BailType, ChatMessageType, PlanetSideGUID, Vector3}
@ -98,16 +99,16 @@ class VehicleHandlerLogic(val ops: SessionVehicleHandlers, implicit val context:
if isNotSameTarget =>
sendResponse(FrameVehicleStateMessage(vguid, u1, pos, oient, vel, u2, u3, u4, is_crouched, u6, u7, u8, u9, uA))
case VehicleAction.ChangeFireState_Start(weaponGuid) if isNotSameTarget =>
case ChangeFireState_Start(weaponGuid) if isNotSameTarget =>
sendResponse(ChangeFireStateMessage_Start(weaponGuid))
case VehicleAction.ChangeFireState_Stop(weaponGuid) if isNotSameTarget =>
case ChangeFireState_Stop(weaponGuid) if isNotSameTarget =>
sendResponse(ChangeFireStateMessage_Stop(weaponGuid))
case VehicleAction.Reload(itemGuid) if isNotSameTarget =>
case ReloadTool(itemGuid) if isNotSameTarget =>
sendResponse(ReloadMessage(itemGuid, ammo_clip=1, unk1=0))
case VehicleAction.ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data) if isNotSameTarget =>
case ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data) if isNotSameTarget =>
sendResponse(ObjectDetachMessage(weapon_guid, previous_guid, Vector3.Zero, 0))
//TODO? sendResponse(ObjectDeleteMessage(previousAmmoGuid, 0))
sendResponse(
@ -120,7 +121,7 @@ class VehicleHandlerLogic(val ops: SessionVehicleHandlers, implicit val context:
)
sendResponse(ChangeAmmoMessage(weapon_guid, 1))
case VehicleAction.WeaponDryFire(weaponGuid) if isNotSameTarget =>
case WeaponDryFire(weaponGuid) if isNotSameTarget =>
continent.GUID(weaponGuid).collect {
case tool: Tool if tool.Magazine == 0 =>
// check that the magazine is still empty before sending WeaponDryFireMessage
@ -137,16 +138,16 @@ class VehicleHandlerLogic(val ops: SessionVehicleHandlers, implicit val context:
case VehicleAction.DeployRequest(objectGuid, state, unk1, unk2, pos) if isNotSameTarget =>
sendResponse(DeployRequestMessage(guid, objectGuid, state, unk1, unk2, pos))
case VehicleAction.SendResponse(msg) =>
sendResponse(msg)
case SendResponse(msgs) =>
msgs.foreach(sendResponse)
case VehicleAction.EquipmentCreatedInSlot(pkt) if isNotSameTarget =>
sendResponse(pkt)
case VehicleAction.GenericObjectAction(objectGuid, action) if isNotSameTarget =>
case GenericObjectAction(objectGuid, action) if isNotSameTarget =>
sendResponse(GenericObjectActionMessage(objectGuid, action))
case VehicleAction.HitHint(sourceGuid) if player.isAlive =>
case HintsAtAttacker(sourceGuid) if player.isAlive =>
sendResponse(HitHint(sourceGuid, player.GUID))
case VehicleAction.InventoryState(obj, parentGuid, start, conData) if isNotSameTarget =>
@ -187,7 +188,7 @@ class VehicleHandlerLogic(val ops: SessionVehicleHandlers, implicit val context:
sendResponse(ObjectCreateMessage(vtype, vguid, vdata))
Vehicles.ReloadAccessPermissions(vehicle, player.Name)
case VehicleAction.ObjectDelete(itemGuid) if isNotSameTarget =>
case ObjectDelete(itemGuid, _) if isNotSameTarget =>
sendResponse(ObjectDeleteMessage(itemGuid, unk1=0))
case VehicleAction.Ownership(vehicleGuid) if resolvedPlayerGuid == guid =>
@ -198,7 +199,7 @@ class VehicleHandlerLogic(val ops: SessionVehicleHandlers, implicit val context:
case VehicleAction.LoseOwnership(_, vehicleGuid) =>
ops.announceAmsDecay(vehicleGuid,msg = "@ams_decaystarted")
case VehicleAction.PlanetsideAttribute(vehicleGuid, attributeType, attributeValue) if isNotSameTarget =>
case PlanetsideAttribute(vehicleGuid, attributeType, attributeValue) if isNotSameTarget =>
sendResponse(PlanetsideAttributeMessage(vehicleGuid, attributeType, attributeValue))
case VehicleAction.SeatPermissions(vehicleGuid, seatGroup, permission) if isNotSameTarget =>

View file

@ -9,6 +9,7 @@ import net.psforever.objects.avatar.scoring.Kill
import net.psforever.objects.sourcing.PlayerSource
import net.psforever.packet.game.{AvatarImplantMessage, ImplantAction}
import net.psforever.services.base.EventResponse
import net.psforever.services.base.messages.{ChangeAmmo, ChangeFireState_Start, ChangeFireState_Stop, GenericObjectAction, HintsAtAttacker, ObjectDelete, PlanetsideAttribute, ReloadTool, SendResponse, SetEmpire, WeaponDryFire}
import scala.concurrent.duration._
//
@ -182,23 +183,23 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.ObjectHeld(_, previousSlot) =>
sendResponse(ObjectHeldMessage(guid, previousSlot, unk1=false))
case AvatarAction.ChangeFireState_Start(weaponGuid)
case ChangeFireState_Start(weaponGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
sendResponse(ChangeFireStateMessage_Start(weaponGuid))
val entry = ops.lastSeenStreamMessage(guid.guid)
ops.lastSeenStreamMessage.put(guid.guid, entry.copy(shooting = Some(weaponGuid)))
case AvatarAction.ChangeFireState_Start(weaponGuid)
case ChangeFireState_Start(weaponGuid)
if isNotSameTarget =>
sendResponse(ChangeFireStateMessage_Start(weaponGuid))
case AvatarAction.ChangeFireState_Stop(weaponGuid)
case ChangeFireState_Stop(weaponGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { msg => msg.visible || msg.shooting.nonEmpty } =>
sendResponse(ChangeFireStateMessage_Stop(weaponGuid))
val entry = ops.lastSeenStreamMessage(guid.guid)
ops.lastSeenStreamMessage.put(guid.guid, entry.copy(shooting = None))
case AvatarAction.ChangeFireState_Stop(weaponGuid)
case ChangeFireState_Stop(weaponGuid)
if isNotSameTarget =>
sendResponse(ChangeFireStateMessage_Stop(weaponGuid))
@ -208,8 +209,8 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.EquipmentCreatedInHand(pkt) if isNotSameTarget =>
sendResponse(pkt)
case AvatarAction.PlanetsideAttribute(attributeType, attributeValue) if isNotSameTarget =>
sendResponse(PlanetsideAttributeMessage(guid, attributeType, attributeValue))
case PlanetsideAttribute(target_guid, attributeType, attributeValue) if isNotSameTarget =>
sendResponse(PlanetsideAttributeMessage(target_guid, attributeType, attributeValue))
case AvatarAction.PlanetsideAttributeToAll(attributeType, attributeValue) =>
sendResponse(PlanetsideAttributeMessage(guid, attributeType, attributeValue))
@ -217,10 +218,10 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.PlanetsideAttributeSelf(attributeType, attributeValue) if isSameTarget =>
sendResponse(PlanetsideAttributeMessage(guid, attributeType, attributeValue))
case AvatarAction.GenericObjectAction(objectGuid, actionCode) if isNotSameTarget =>
case GenericObjectAction(objectGuid, actionCode) if isNotSameTarget =>
sendResponse(GenericObjectActionMessage(objectGuid, actionCode))
case AvatarAction.HitHint(sourceGuid) if player.isAlive =>
case HintsAtAttacker(sourceGuid) if player.isAlive =>
sendResponse(HitHint(sourceGuid, guid))
sessionLogic.zoning.CancelZoningProcess()
@ -411,19 +412,21 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.FacilityCaptureRewards(buildingId, zoneNumber, cep) =>
ops.facilityCaptureRewards(buildingId, zoneNumber, cep)
case AvatarAction.SendResponse(pkt: AvatarImplantMessage)
if pkt.player_guid == player.GUID && pkt.action == ImplantAction.Initialization =>
//special spectator implants stay initialized and do not deinitialize
()
case AvatarAction.SendResponse(msg) =>
sendResponse(msg)
case SendResponse(msgs) =>
msgs.foreach {
case pkt: AvatarImplantMessage
if pkt.player_guid == player.GUID && pkt.action == ImplantAction.Initialization =>
//special spectator implants stay initialized and do not deinitialize
()
case msg =>
sendResponse(msg)
}
case AvatarAction.SendResponseTargeted(targetGuid, msg) if resolvedPlayerGuid == targetGuid =>
sendResponse(msg)
/* common messages (maybe once every respawn) */
case AvatarAction.Reload(itemGuid)
case ReloadTool(itemGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
sendResponse(ReloadMessage(itemGuid, ammo_clip=1, unk1=0))
@ -496,12 +499,12 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
)
/* uncommon messages (utility, or once in a while) */
case AvatarAction.ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
case ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
ops.changeAmmoProcedures(weapon_guid, previous_guid, ammo_id, ammo_guid, weapon_slot, ammo_data)
sendResponse(ChangeAmmoMessage(weapon_guid, 1))
case AvatarAction.ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
case ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data)
if isNotSameTarget =>
ops.changeAmmoProcedures(weapon_guid, previous_guid, ammo_id, ammo_guid, weapon_slot, ammo_data)
@ -518,11 +521,11 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
case AvatarAction.DropCreatedItem(pkt) if isNotSameTarget =>
sendResponse(pkt)
case AvatarAction.ObjectDelete(itemGuid, unk) if isNotSameTarget =>
case ObjectDelete(itemGuid, unk) if isNotSameTarget =>
sendResponse(ObjectDeleteMessage(itemGuid, unk))
/* rare messages */
case AvatarAction.SetEmpire(objectGuid, faction) if isNotSameTarget =>
case SetEmpire(objectGuid, faction) if isNotSameTarget =>
sendResponse(SetEmpireMessage(objectGuid, faction))
case AvatarAction.DropSpecialItem() =>
@ -571,7 +574,7 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A
)
)
case AvatarAction.WeaponDryFire(weaponGuid)
case WeaponDryFire(weaponGuid)
if isNotSameTarget && ops.lastSeenStreamMessage.get(guid.guid).exists { _.visible } =>
continent.GUID(weaponGuid).collect {
case tool: Tool if tool.Magazine == 0 =>

View file

@ -17,6 +17,7 @@ import net.psforever.packet.PlanetSideGamePacket
import net.psforever.packet.game.{ActionCancelMessage, AvatarFirstTimeEventMessage, AvatarImplantMessage, AvatarJumpMessage, BattleplanMessage, BindPlayerMessage, BugReportMessage, ChangeFireModeMessage, ChangeShortcutBankMessage, CharacterCreateRequestMessage, CharacterRequestMessage, CollisionIs, ConnectToWorldRequestMessage, CreateShortcutMessage, DeployObjectMessage, DisplayedAwardMessage, DropItemMessage, EmoteMsg, FacilityBenefitShieldChargeRequestMessage, FriendsRequest, GenericAction, GenericActionMessage, GenericCollisionMsg, GenericObjectActionAtPositionMessage, GenericObjectActionMessage, GenericObjectStateMsg, HitHint, ImplantAction, InvalidTerrainMessage, LootItemMessage, MoveItemMessage, ObjectDetectedMessage, ObjectHeldMessage, OutfitMembershipRequest, OutfitMembershipResponse, OutfitRequest, PickupItemMessage, PlanetsideAttributeMessage, PlayerStateMessageUpstream, RequestDestroyMessage, TargetingImplantRequest, TradeMessage, UnuseItemMessage, UseItemMessage, VoiceHostInfo, VoiceHostRequest, ZipLineMessage}
import net.psforever.services.account.AccountPersistenceService
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.types.{ExoSuitType, Vector3}
import scala.concurrent.duration.DurationInt
@ -106,8 +107,7 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
}
def handleEmote(pkt: EmoteMsg): Unit = {
val EmoteMsg(avatarGuid, emote) = pkt
sendResponse(EmoteMsg(avatarGuid, emote))
sendResponse(pkt)
}
def handleDropItem(pkt: DropItemMessage): Unit = { /* intentionally blank */ }
@ -231,7 +231,7 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
continent.AvatarEvents ! AvatarServiceMessage(
continent.id,
player.GUID,
AvatarAction.PlanetsideAttribute(19, 1)
PlanetsideAttribute(player.GUID, 19, 1)
)
definition match {
case GlobalDefinitions.trhev_dualcycler | GlobalDefinitions.trhev_burster =>
@ -253,7 +253,7 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
continent.AvatarEvents ! AvatarServiceMessage(
continent.id,
player.GUID,
AvatarAction.PlanetsideAttribute(19, 0)
PlanetsideAttribute(player.GUID, 19, 0)
)
definition match {
case GlobalDefinitions.trhev_dualcycler | GlobalDefinitions.trhev_burster =>

View file

@ -12,7 +12,8 @@ import net.psforever.objects.serverobject.mount.Mountable
import net.psforever.objects.serverobject.terminals.implant.ImplantTerminalMech
import net.psforever.objects.vital.InGameHistory
import net.psforever.packet.game.{DelayedPathMountMsg, DismountVehicleCargoMsg, DismountVehicleMsg, GenericObjectActionMessage, MountVehicleCargoMsg, MountVehicleMsg, ObjectDetachMessage, PlayerStasisMessage, PlayerStateShiftMessage, ShiftState}
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.local.LocalServiceMessage
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
object MountHandlerLogic {
@ -62,7 +63,7 @@ class MountHandlerLogic(val ops: SessionMountHandlers, implicit val context: Act
sendResponse(DelayedPathMountMsg(pguid, sguid, u1=60, u2=true))
continent.LocalEvents ! LocalServiceMessage(
continent.id,
LocalAction.SendResponse(ObjectDetachMessage(sguid, pguid, pos, roll=0, pitch=0, zang))
SendResponse(ObjectDetachMessage(sguid, pguid, pos, roll=0, pitch=0, zang))
)
obj.Zone.actor ! ZoneActor.RemoveFromBlockMap(player)
sessionLogic.keepAliveFunc = sessionLogic.zoning.NormalKeepAlive
@ -75,22 +76,18 @@ class MountHandlerLogic(val ops: SessionMountHandlers, implicit val context: Act
ops.DismountAction(tplayer, obj, seatNum)
continent.actor ! ZoneActor.RemoveFromBlockMap(player) //character doesn't need it
//DismountAction(...) uses vehicle service, so use that service to coordinate the remainder of the messages
events ! VehicleServiceMessage(
player.Name,
VehicleAction.SendResponse(PlayerStasisMessage(pguid)) //the stasis message
)
//when the player dismounts, they will be positioned where the shuttle was when it disappeared in the sky
//the player will fall to the ground and is perfectly vulnerable in this state
//additionally, our player must exist in the current zone
//having no in-game avatar target will throw us out of the map screen when deploying and cause softlock
events ! VehicleServiceMessage(
player.Name,
VehicleAction.SendResponse(PlayerStateShiftMessage(ShiftState(unk=0, obj.Position, obj.Orientation.z, vel=None)))
)
events ! VehicleServiceMessage(player.Name, SendResponse(Seq(
PlayerStasisMessage(pguid),
PlayerStateShiftMessage(ShiftState(unk=0, obj.Position, obj.Orientation.z, vel=None))
)))
events ! VehicleServiceMessage(
continent.id,
pguid,
VehicleAction.SendResponse(GenericObjectActionMessage(pguid, code=9)) //conceal the player
SendResponse(GenericObjectActionMessage(pguid, code=9)) //conceal the player
)
context.self ! SessionActor.SetMode(NormalMode)
sessionLogic.keepAliveFunc = sessionLogic.zoning.NormalKeepAlive

View file

@ -11,7 +11,8 @@ import net.psforever.packet.PlanetSidePacket
import net.psforever.packet.game.{DeployableInfo, DeployableObjectsInfoMessage, DeploymentAction, ObjectCreateDetailedMessage, ObjectDeleteMessage}
import net.psforever.packet.game.objectcreate.{ObjectClass, ObjectCreateMessageParent, RibbonBars}
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.ObjectDelete
import net.psforever.services.chat.SpectatorChannel
import net.psforever.services.teamwork.{SquadAction, SquadServiceMessage}
import net.psforever.types.{CapacitorStateType, ChatMessageType, ExoSuitType, MeritCommendation, SquadRequestType}
@ -68,7 +69,7 @@ class SpectatorModeLogic(data: SessionData) extends ModeLogic {
player.Inventory.Items
.foreach { entry => sendResponse(ObjectDeleteMessage(entry.GUID, 0)) }
sendResponse(ObjectDeleteMessage(player.avatar.locker.GUID, 0))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, pguid, AvatarAction.ObjectDelete(pguid))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, pguid, ObjectDelete(pguid))
player.Holsters()
.collect { case slot if slot.Equipment.nonEmpty => sendResponse(ObjectDeleteMessage(slot.Equipment.get.GUID, 0)) }
val vehicleAndSeat = data.vehicles.GetMountableAndSeat(None, player, continent) match {

View file

@ -9,6 +9,7 @@ import net.psforever.objects.serverobject.pad.VehicleSpawnPad
import net.psforever.packet.game.objectcreate.ObjectCreateMessageParent
import net.psforever.packet.game.{ChangeAmmoMessage, ChangeFireStateMessage_Start, ChangeFireStateMessage_Stop, ChildObjectStateMessage, DeadState, DeployRequestMessage, DismountVehicleMsg, FrameVehicleStateMessage, GenericObjectActionMessage, InventoryStateMessage, ObjectAttachMessage, ObjectCreateDetailedMessage, ObjectCreateMessage, ObjectDeleteMessage, ObjectDetachMessage, PlanetsideAttributeMessage, ReloadMessage, ServerVehicleOverrideMsg, VehicleStateMessage, WeaponDryFireMessage}
import net.psforever.services.base.EventResponse
import net.psforever.services.base.messages.{ChangeAmmo, ChangeFireState_Start, ChangeFireState_Stop, GenericObjectAction, ObjectDelete, PlanetsideAttribute, ReloadTool, SendResponse, WeaponDryFire}
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceResponse}
import net.psforever.types.{BailType, PlanetSideGUID, Vector3}
@ -83,16 +84,16 @@ class VehicleHandlerLogic(val ops: SessionVehicleHandlers, implicit val context:
if isNotSameTarget =>
sendResponse(FrameVehicleStateMessage(vguid, u1, pos, oient, vel, u2, u3, u4, is_crouched, u6, u7, u8, u9, uA))
case VehicleAction.ChangeFireState_Start(weaponGuid) if isNotSameTarget =>
case ChangeFireState_Start(weaponGuid) if isNotSameTarget =>
sendResponse(ChangeFireStateMessage_Start(weaponGuid))
case VehicleAction.ChangeFireState_Stop(weaponGuid) if isNotSameTarget =>
case ChangeFireState_Stop(weaponGuid) if isNotSameTarget =>
sendResponse(ChangeFireStateMessage_Stop(weaponGuid))
case VehicleAction.Reload(itemGuid) if isNotSameTarget =>
case ReloadTool(itemGuid) if isNotSameTarget =>
sendResponse(ReloadMessage(itemGuid, ammo_clip=1, unk1=0))
case VehicleAction.ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data) if isNotSameTarget =>
case ChangeAmmo(weapon_guid, weapon_slot, previous_guid, ammo_id, ammo_guid, ammo_data) if isNotSameTarget =>
sendResponse(ObjectDetachMessage(weapon_guid, previous_guid, Vector3.Zero, 0))
//TODO? sendResponse(ObjectDeleteMessage(previousAmmoGuid, 0))
sendResponse(
@ -105,7 +106,7 @@ class VehicleHandlerLogic(val ops: SessionVehicleHandlers, implicit val context:
)
sendResponse(ChangeAmmoMessage(weapon_guid, 1))
case VehicleAction.WeaponDryFire(weaponGuid) if isNotSameTarget =>
case WeaponDryFire(weaponGuid) if isNotSameTarget =>
continent.GUID(weaponGuid).collect {
case tool: Tool if tool.Magazine == 0 =>
// check that the magazine is still empty before sending WeaponDryFireMessage
@ -122,13 +123,13 @@ class VehicleHandlerLogic(val ops: SessionVehicleHandlers, implicit val context:
case VehicleAction.DeployRequest(objectGuid, state, unk1, unk2, pos) if isNotSameTarget =>
sendResponse(DeployRequestMessage(guid, objectGuid, state, unk1, unk2, pos))
case VehicleAction.SendResponse(msg) =>
sendResponse(msg)
case SendResponse(msgs) =>
msgs.foreach(sendResponse)
case VehicleAction.EquipmentCreatedInSlot(pkt) if isNotSameTarget =>
sendResponse(pkt)
case VehicleAction.GenericObjectAction(objectGuid, action) if isNotSameTarget =>
case GenericObjectAction(objectGuid, action) if isNotSameTarget =>
sendResponse(GenericObjectActionMessage(objectGuid, action))
case VehicleAction.InventoryState(obj, parentGuid, start, conData) if isNotSameTarget =>
@ -165,10 +166,10 @@ class VehicleHandlerLogic(val ops: SessionVehicleHandlers, implicit val context:
sendResponse(ObjectCreateMessage(vtype, vguid, vdata))
Vehicles.ReloadAccessPermissions(vehicle, player.Name)
case VehicleAction.ObjectDelete(itemGuid) if isNotSameTarget =>
case ObjectDelete(itemGuid, _) if isNotSameTarget =>
sendResponse(ObjectDeleteMessage(itemGuid, unk1=0))
case VehicleAction.PlanetsideAttribute(vehicleGuid, attributeType, attributeValue) if isNotSameTarget =>
case PlanetsideAttribute(vehicleGuid, attributeType, attributeValue) if isNotSameTarget =>
sendResponse(PlanetsideAttributeMessage(vehicleGuid, attributeType, attributeValue))
case VehicleAction.SeatPermissions(vehicleGuid, seatGroup, permission) if isNotSameTarget =>

View file

@ -19,6 +19,7 @@ import net.psforever.objects.zones.blockmap.BlockMapEntity
import net.psforever.objects.zones.exp.ToDatabase
import net.psforever.services.RemoverActor
import net.psforever.services.avatar.GroundEnvelope
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.local.support.HackCaptureActor
import net.psforever.services.local.{CaptureMessage, LocalAction, LocalServiceMessage}
@ -195,6 +196,32 @@ class GeneralOperations(
private[session] var progressBarUpdate: Cancellable = Default.Cancellable
private var charSavedTimer: Cancellable = Default.Cancellable
def handleEmote(pkt: EmoteMsg): Unit = {
val guid = player.GUID
val zone = player.Zone
val events = zone.LocalEvents
val msg = SendResponse(pkt)
sessionLogic
.localSector
.livePlayerList
.filter(_.GUID != guid)
.foreach { p =>
events ! LocalServiceMessage(p.Name, msg)
}
//todo better way to collect csr players while utilizing the aforementioned benefit of localSector
val position = player.Position
val rangeSq = {
val range = math.sqrt(2 * math.pow(sessionLogic.localSector.rangeX.toDouble, 2))
range * range
}
zone
.AllPlayers
.filter { p => !p.allowInteraction && p.GUID != guid && Vector3.DistanceSquared(p.Position, position) < rangeSq }
.foreach { p =>
events ! LocalServiceMessage(p.Name, msg)
}
}
def handleDropItem(pkt: DropItemMessage): GeneralOperations.ItemDropState.Behavior = {
val DropItemMessage(itemGuid) = pkt
(sessionLogic.validObject(itemGuid, decorator = "DropItem"), player.FreeHand.Equipment) match {
@ -881,6 +908,19 @@ class GeneralOperations(
sendResponse(HackMessage(HackState1.Unk0, targetGuid, player_guid=Service.defaultPlayerGUID, progress=100, unk1.toFloat, HackState.Hacked, unk2))
}
/**
* Send a PlanetsideAttributeMessage packet to the client
* @param targetGuid The target of the attribute
* @param attribute The attribute
* @param attributeValue The attribute value
*/
def sendPlanetsideAttributeMessage(
targetGuid: PlanetSideGUID,
attribute: PlanetsideAttributeEnum,
attributeValue: Long
): Unit = {
sendPlanetsideAttributeMessage(targetGuid, attribute.id, attributeValue)
}
/**
* Send a PlanetsideAttributeMessage packet to the client
* @param targetGuid The target of the attribute
@ -889,7 +929,7 @@ class GeneralOperations(
*/
def sendPlanetsideAttributeMessage(
targetGuid: PlanetSideGUID,
attributeNumber: PlanetsideAttributeEnum,
attributeNumber: Int,
attributeValue: Long
): Unit = {
sendResponse(PlanetsideAttributeMessage(targetGuid, attributeNumber, attributeValue))

View file

@ -10,6 +10,7 @@ import net.psforever.objects.zones.exp
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage, AvatarServiceResponse}
import net.psforever.services.base.EventResponse
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.chat.OutfitChannel
import scala.collection.mutable
@ -215,9 +216,7 @@ class SessionAvatarHandlers(
context.self ! AvatarServiceResponse(
playerName,
Service.defaultPlayerGUID,
AvatarAction.SendResponse(
ObjectDetachMessage(obj.GUID, playerGuid, player.Position, Vector3.Zero)
)
SendResponse(ObjectDetachMessage(obj.GUID, playerGuid, player.Position, Vector3.Zero))
)
//player no longer seated
obj.PassengerInSeat(player).foreach { seatNumber =>

View file

@ -8,6 +8,7 @@ import net.psforever.objects.{PlanetSideGameObject, Tool, Vehicle}
import net.psforever.objects.vehicles.{CargoBehavior, MountableWeapons}
import net.psforever.objects.vital.InGameHistory
import net.psforever.packet.game.{DismountVehicleCargoMsg, GenericObjectActionMessage, InventoryStateMessage, MountVehicleCargoMsg, MountVehicleMsg, ObjectAttachMessage, ObjectDetachMessage, PlanetsideAttributeMessage}
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.types.{BailType, PlanetSideGUID, Vector3}
//
@ -204,11 +205,11 @@ class SessionMountHandlers(
sessionLogic.keepAliveFunc = sessionLogic.zoning.NormalKeepAlive
continent.VehicleEvents ! VehicleServiceMessage(
continent.id,
VehicleAction.SendResponse(PlanetsideAttributeMessage(obj.GUID, 81, 1))
SendResponse(PlanetsideAttributeMessage(obj.GUID, 81, 1))
)
continent.VehicleEvents ! VehicleServiceMessage(
continent.id,
VehicleAction.SendResponse(ObjectDetachMessage(obj.GUID, tplayer.GUID, tplayer.Position, obj.Orientation))
SendResponse(ObjectDetachMessage(obj.GUID, tplayer.GUID, tplayer.Position, obj.Orientation))
)
}
else {

View file

@ -2,6 +2,7 @@
package net.psforever.actors.session.support
import akka.actor.{ActorContext, ActorRef, typed}
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.services.teamwork.SquadServiceResponse
import scala.collection.mutable
@ -10,7 +11,7 @@ import net.psforever.actors.session.AvatarActor
import net.psforever.objects.teamwork.Squad
import net.psforever.objects.{Default, Player}
import net.psforever.packet.game._
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.teamwork.{SquadResponse, SquadServiceMessage, SquadAction => SquadServiceAction}
import net.psforever.types.{PlanetSideEmpire, PlanetSideGUID, Vector3}
@ -108,7 +109,7 @@ class SessionSquadHandlers(
continent.AvatarEvents ! AvatarServiceMessage(
s"${player.Faction}",
player.GUID,
AvatarAction.PlanetsideAttribute(31, squad_supplement_id)
PlanetsideAttribute(player.GUID, 31, squad_supplement_id)
)
sendResponse(PlanetsideAttributeMessage(player.GUID, 32, elem.index))
case _ =>
@ -287,7 +288,7 @@ class SessionSquadHandlers(
* @param value value to associate the player
*/
def GiveSquadColorsForOthers(guid: PlanetSideGUID, factionChannel: String, value: Long): Unit = {
continent.AvatarEvents ! AvatarServiceMessage(factionChannel, guid, AvatarAction.PlanetsideAttribute(31, value))
continent.AvatarEvents ! AvatarServiceMessage(factionChannel, guid, PlanetsideAttribute(guid, 31, value))
}
/**

View file

@ -28,7 +28,8 @@ import net.psforever.objects.vital.projectile.ProjectileReason
import net.psforever.objects.zones.exp.ToDatabase
import net.psforever.packet.game.UplinkRequest
import net.psforever.services.Service
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.base.messages.{ChangeAmmo, ChangeFireState_Start, ChangeFireState_Stop, ReloadTool, SendResponse, WeaponDryFire}
import net.psforever.services.local.LocalServiceMessage
import net.psforever.types.{ChatMessageType, PlanetSideEmpire, ValidPlanetSideGUID, Vector3}
import net.psforever.util.Config
@ -282,12 +283,12 @@ class WeaponAndProjectileOperations(
.orElse { continent.GUID(weapon_guid) }
.collect {
case _: Equipment if containerOpt.exists(_.isInstanceOf[Player]) =>
continent.AvatarEvents ! AvatarServiceMessage(continent.id, player.GUID, AvatarAction.WeaponDryFire(weapon_guid))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, player.GUID, WeaponDryFire(weapon_guid))
case _: Equipment =>
continent.VehicleEvents ! VehicleServiceMessage(
continent.id,
player.GUID,
VehicleAction.WeaponDryFire(weapon_guid)
WeaponDryFire(weapon_guid)
)
}
.orElse {
@ -350,7 +351,7 @@ class WeaponAndProjectileOperations(
player.Zone.LocalEvents ! LocalServiceMessage(
s"${player.Zone.id}",
PlanetSideGUID(-1),
LocalAction.SendResponse(TriggerEffectMessage(Service.defaultPlayerGUID, empColor, None, Some(TriggeredEffectLocation(player.Position, Vector3(0, 0, 90)))))
SendResponse(TriggerEffectMessage(Service.defaultPlayerGUID, empColor, None, Some(TriggeredEffectLocation(player.Position, Vector3(0, 0, 90)))))
)
context.system.scheduler.scheduleOnce(delay = 1 seconds) {
Zone.serverSideDamage(player.Zone, player, empSize, SpecialEmp.createEmpInteraction(empSize, player.Position),
@ -360,7 +361,7 @@ class WeaponAndProjectileOperations(
player.Zone.LocalEvents ! LocalServiceMessage(
s"$playerFaction",
PlanetSideGUID(-1),
LocalAction.SendResponse(OrbitalStrikeWaypointMessage(player.GUID, pos.get.x, pos.get.y))
SendResponse(OrbitalStrikeWaypointMessage(player.GUID, pos.get.x, pos.get.y))
)
sendResponse(UplinkResponse(code.value, 0))
orbitalStrikePos = pos
@ -389,12 +390,12 @@ class WeaponAndProjectileOperations(
player.Zone.LocalEvents ! LocalServiceMessage(
s"${player.Zone.id}",
PlanetSideGUID(-1),
LocalAction.SendResponse(TriggerEffectMessage(ValidPlanetSideGUID(0), strikeType, None, Some(TriggeredEffectLocation(orbitalStrikePos.get, Vector3(0, 0, 90)))))
SendResponse(TriggerEffectMessage(ValidPlanetSideGUID(0), strikeType, None, Some(TriggeredEffectLocation(orbitalStrikePos.get, Vector3(0, 0, 90)))))
)
player.Zone.LocalEvents ! LocalServiceMessage(
s"$playerFaction",
PlanetSideGUID(-1),
LocalAction.SendResponse(OrbitalStrikeWaypointMessage(player.GUID, None))
SendResponse(OrbitalStrikeWaypointMessage(player.GUID, None))
)
context.system.scheduler.scheduleOnce(delay = 5 seconds) {
val sectorTargets = Zone.findOrbitalStrikeTargets(player.Zone, orbitalStrikePos.get, osSize.DamageRadius, Zone.getOrbitbalStrikeTargets)
@ -758,7 +759,7 @@ class WeaponAndProjectileOperations(
//chain lash effect
continent.AvatarEvents ! AvatarServiceMessage(
continent.id,
AvatarAction.SendResponse(ChainLashMessage(hitPos, projectile.profile.ObjectId, guidRefs.toList))
SendResponse(ChainLashMessage(hitPos, projectile.profile.ObjectId, guidRefs.toList))
)
//chain lash target output
outputRefs.toList
@ -942,9 +943,9 @@ class WeaponAndProjectileOperations(
tool.Magazine = 0
sendResponse(InventoryStateMessage(tool.AmmoSlot.Box.GUID, weapon_guid, 0))
sendResponse(ChangeFireStateMessage_Stop(weapon_guid))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, player.GUID, AvatarAction.ChangeFireState_Stop(weapon_guid))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, player.GUID, ChangeFireState_Stop(weapon_guid))
sendResponse(WeaponDryFireMessage(weapon_guid))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, player.GUID, AvatarAction.WeaponDryFire(weapon_guid))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, player.GUID, WeaponDryFire(weapon_guid))
}
/**
@ -1088,7 +1089,7 @@ class WeaponAndProjectileOperations(
continent.AvatarEvents ! AvatarServiceMessage(
sessionLogic.zoning.zoneChannel,
player.GUID,
AvatarAction.ChangeFireState_Start(itemGuid)
ChangeFireState_Start(itemGuid)
)
}
@ -1100,7 +1101,7 @@ class WeaponAndProjectileOperations(
continent.VehicleEvents ! VehicleServiceMessage(
continent.id,
player.GUID,
VehicleAction.ChangeFireState_Start(itemGuid)
ChangeFireState_Start(itemGuid)
)
}
@ -1129,7 +1130,7 @@ class WeaponAndProjectileOperations(
continent.AvatarEvents ! AvatarServiceMessage(
sessionLogic.zoning.zoneChannel,
player.GUID,
AvatarAction.ChangeFireState_Stop(itemGuid)
ChangeFireState_Stop(itemGuid)
)
}
@ -1141,7 +1142,7 @@ class WeaponAndProjectileOperations(
continent.VehicleEvents ! VehicleServiceMessage(
continent.id,
player.GUID,
VehicleAction.ChangeFireState_Stop(itemGuid)
ChangeFireState_Stop(itemGuid)
)
}
@ -1198,14 +1199,14 @@ class WeaponAndProjectileOperations(
used by ReloadMessage handling
*/
def reloadPlayerMessages(itemGuid: PlanetSideGUID): Unit = {
continent.AvatarEvents ! AvatarServiceMessage(sessionLogic.zoning.zoneChannel, player.GUID, AvatarAction.Reload(itemGuid))
continent.AvatarEvents ! AvatarServiceMessage(sessionLogic.zoning.zoneChannel, player.GUID, ReloadTool(itemGuid))
}
def reloadVehicleMessages(itemGuid: PlanetSideGUID): Unit = {
continent.VehicleEvents ! VehicleServiceMessage(
continent.id,
player.GUID,
VehicleAction.Reload(itemGuid)
ReloadTool(itemGuid)
)
}
@ -1382,7 +1383,7 @@ class WeaponAndProjectileOperations(
continent.AvatarEvents ! AvatarServiceMessage(
sessionLogic.zoning.zoneChannel,
player.GUID,
AvatarAction.ChangeAmmo(
ChangeAmmo(
tool_guid,
ammoSlotIndex,
previous_box_guid,
@ -1587,7 +1588,7 @@ class WeaponAndProjectileOperations(
shootingStop.clear()
(prefire ++ shooting).foreach { guid =>
sendResponse(ChangeFireStateMessage_Stop(guid))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, player.GUID, AvatarAction.ChangeFireState_Stop(guid))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, player.GUID, ChangeFireState_Stop(guid))
}
prefire.clear()
shooting.clear()

View file

@ -23,6 +23,7 @@ import net.psforever.objects.zones.blockmap.BlockMapEntity
import net.psforever.packet.game.GenericAction.FirstPersonViewWithEffect
import net.psforever.packet.game.{CampaignStatistic, ChangeFireStateMessage_Start, CloudInfo, GenericActionMessage, GenericObjectActionEnum, HackState7, MailMessage, ObjectDetectedMessage, SessionStatistic, StormInfo, TriggeredSound, TrainingZoneMessage, WeatherMessage}
import net.psforever.services.avatar.{CorpseEnvelope, ReleaseMessage}
import net.psforever.services.base.messages.{GenericObjectAction, ObjectDelete, PlanetsideAttribute, SendResponse}
import net.psforever.services.chat.DefaultChannel
import scala.concurrent.duration._
@ -852,7 +853,7 @@ class ZoningOperations(
case None =>
spawn.deadState = DeadState.Release // cancel movement updates
player.Position = position
// continent.AvatarEvents ! AvatarServiceMessage(continent.Id, AvatarAction.ObjectDelete(player.GUID, player.GUID))
// continent.AvatarEvents ! AvatarServiceMessage(continent.Id, ObjectDelete(player.GUID, player.GUID))
spawn.LoadZonePhysicalSpawnPoint(zoneId, position, Vector3.Zero, 0 seconds, None)
case _ => // seated in something that is not a vehicle or the vehicle is cargo, in which case we can't move
}
@ -1209,7 +1210,7 @@ class ZoningOperations(
continent.LocalEvents ! LocalServiceMessage(
continent.id,
PlanetSideGUID(-1),
LocalAction.SendResponse(ObjectAttachMessage(llu.Carrier.get.GUID, llu.GUID, 252))
SendResponse(ObjectAttachMessage(llu.Carrier.get.GUID, llu.GUID, 252))
)
}
case _ => ()
@ -2888,7 +2889,7 @@ class ZoningOperations(
if (player.VisibleSlots.contains(index)) {
events ! AvatarServiceMessage(
zoneId,
AvatarAction.ObjectDelete(obj.GUID)
ObjectDelete(obj.GUID)
)
} else {
sendResponse(ObjectDeleteMessage(obj.GUID, 0))
@ -2922,7 +2923,7 @@ class ZoningOperations(
val pguid = tplayer.GUID
zone.Population ! Zone.Population.Release(avatar)
sendResponse(ObjectDeleteMessage(pguid, 0))
zone.AvatarEvents ! AvatarServiceMessage(zone.id, pguid, AvatarAction.ObjectDelete(pguid))
zone.AvatarEvents ! AvatarServiceMessage(zone.id, pguid, ObjectDelete(pguid))
TaskWorkflow.execute(GUIDTask.unregisterPlayer(zone.GUID, tplayer))
}
}
@ -3181,7 +3182,7 @@ class ZoningOperations(
continent.AvatarEvents ! AvatarServiceMessage(
continent.id,
player_guid,
AvatarAction.ObjectDelete(player_guid, unk=effect)
ObjectDelete(player_guid, unk=effect)
)
InGameHistory.SpawnReconstructionActivity(player, toZoneNumber, betterSpawnPoint)
LoadZoneAsPlayerUsing(player, pos, ori, toSide, zoneId)
@ -3345,7 +3346,7 @@ class ZoningOperations(
//looking for squad (members)
if (tplayer.avatar.lookingForSquad) {
sendResponse(PlanetsideAttributeMessage(guid, 53, 1))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, guid, AvatarAction.PlanetsideAttribute(53, 1))
continent.AvatarEvents ! AvatarServiceMessage(continent.id, guid, PlanetsideAttribute(guid, 53, 1))
}
sendResponse(AvatarSearchCriteriaMessage(guid, List(0, 0, 0, 0, 0, 0)))
//these are facilities and towers and bunkers in the zone, but not necessarily all of them for some reason
@ -4003,14 +4004,14 @@ class ZoningOperations(
pZone.LocalEvents ! LocalServiceMessage(
t.Name,
t.GUID,
LocalAction.GenericObjectAction(player.GUID, GenericObjectActionEnum.PlayerDeconstructs)
GenericObjectAction(player.GUID, GenericObjectActionEnum.PlayerDeconstructs.id)
)
}
pZone.AllPlayers.collect { case t if t.GUID != player.GUID && !t.allowInteraction =>
pZone.LocalEvents ! LocalServiceMessage(
t.Name,
t.GUID,
LocalAction.GenericObjectAction(player.GUID, GenericObjectActionEnum.PlayerDeconstructs)
GenericObjectAction(player.GUID, GenericObjectActionEnum.PlayerDeconstructs.id)
)
}
}

View file

@ -11,8 +11,9 @@ import net.psforever.objects.zones.Zone
import net.psforever.packet.PlanetSideGamePacket
import net.psforever.packet.game.ContinentalLockUpdateMessage
import net.psforever.persistence
import net.psforever.services.base.messages.{SendResponse, SetEmpire}
import net.psforever.services.galaxy.{GalaxyAction, GalaxyServiceMessage}
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.local.LocalServiceMessage
import net.psforever.services.{InterstellarClusterService, ServiceManager}
import net.psforever.types.PlanetSideEmpire
import net.psforever.util.Database.ctx
@ -167,7 +168,7 @@ object BuildingActor {
val building = details.building
val zone = building.Zone
building.Faction = faction
zone.LocalEvents ! LocalServiceMessage(zone.id, LocalAction.SetEmpire(building.GUID, faction))
zone.LocalEvents ! LocalServiceMessage(zone.id, SetEmpire(building.GUID, faction))
}
}
@ -232,7 +233,7 @@ class BuildingActor(
case MapUpdate() =>
details.galaxyService ! GalaxyServiceMessage(GalaxyAction.MapUpdate(details.building.infoUpdateMessage()))
details.galaxyService ! GalaxyServiceMessage(GalaxyAction.SendResponse(details.building.densityLevelUpdateMessage(building)))
details.galaxyService ! GalaxyServiceMessage(SendResponse(details.building.densityLevelUpdateMessage(building)))
Behaviors.same
case AmenityStateChange(amenity, data) =>
@ -254,15 +255,15 @@ class BuildingActor(
logic.ntu(details, msg)
case DensityLevelUpdate(building) =>
details.galaxyService ! GalaxyServiceMessage(GalaxyAction.SendResponse(details.building.densityLevelUpdateMessage(building)))
details.galaxyService ! GalaxyServiceMessage(SendResponse(details.building.densityLevelUpdateMessage(building)))
Behaviors.same
case ContinentalLock(zone) =>
details.galaxyService ! GalaxyServiceMessage(GalaxyAction.SendResponse(ContinentalLockUpdateMessage(zone.Number, zone.lockedBy)))
details.galaxyService ! GalaxyServiceMessage(SendResponse(ContinentalLockUpdateMessage(zone.Number, zone.lockedBy)))
Behaviors.same
case HomeLockBenefits(msg) =>
details.galaxyService ! GalaxyServiceMessage(GalaxyAction.SendResponse(msg))
details.galaxyService ! GalaxyServiceMessage(SendResponse(msg))
Behaviors.same
}
}

View file

@ -20,7 +20,8 @@ import net.psforever.objects.zones.exp.{ExperienceCalculator, SupportExperienceC
import net.psforever.packet.game.{BuildingInfoUpdateMessage, PlanetsideAttributeMessage}
import net.psforever.util.Database._
import net.psforever.persistence
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.local.LocalServiceMessage
import scala.collection.mutable
import scala.util.{Failure, Success}
@ -236,24 +237,24 @@ class ZoneActor(
if (msg.generator_state == PlanetSideGeneratorState.Normal && building.hasCavernLockBenefit) {
zone.LocalEvents ! LocalServiceMessage(
zone.id,
LocalAction.SendResponse(PlanetsideAttributeMessage(building.GUID, 67, 1))
SendResponse(PlanetsideAttributeMessage(building.GUID, 67, 1))
)
}
msg.is_hacked match {
case true if building.BuildingType == StructureType.Facility && !zone.map.cavern =>
zone.LocalEvents ! LocalServiceMessage(
zone.id,
LocalAction.SendResponse(PlanetsideAttributeMessage(building.GUID, 67, 0))
SendResponse(PlanetsideAttributeMessage(building.GUID, 67, 0))
)
case false if building.hasCavernLockBenefit =>
zone.LocalEvents ! LocalServiceMessage(
zone.id,
LocalAction.SendResponse(PlanetsideAttributeMessage(building.GUID, 67, 1))
SendResponse(PlanetsideAttributeMessage(building.GUID, 67, 1))
)
case false if building.BuildingType == StructureType.Facility && !zone.map.cavern && !building.hasCavernLockBenefit =>
zone.LocalEvents ! LocalServiceMessage(
zone.id,
LocalAction.SendResponse(PlanetsideAttributeMessage(building.GUID, 67, 0))
SendResponse(PlanetsideAttributeMessage(building.GUID, 67, 0))
)
case _ =>
}

View file

@ -9,7 +9,7 @@ import net.psforever.objects.serverobject.structures.{Amenity, Building, Structu
import net.psforever.objects.serverobject.terminals.capture.{CaptureTerminal, CaptureTerminalAware, CaptureTerminalAwareBehavior}
import net.psforever.services.galaxy.{GalaxyAction, GalaxyServiceMessage}
import net.psforever.services.local.support.HackClearActor
import net.psforever.services.local.ClearMessage
import net.psforever.services.local.HackClearMessage
import net.psforever.types.PlanetSideEmpire
/**
@ -53,7 +53,7 @@ case object CavernFacilityLogic
// When a CC is hacked (or resecured) all currently hacked amenities for the base should return to their default unhacked state
building.HackableAmenities.foreach(amenity => {
if (amenity.HackedBy.isDefined) {
building.Zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(amenity))
building.Zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(amenity))
}
})
// No map update needed - will be sent by `HackCaptureActor` when required

View file

@ -9,7 +9,7 @@ import net.psforever.objects.serverobject.structures.{Amenity, Building}
import net.psforever.objects.serverobject.terminals.capture.{CaptureTerminal, CaptureTerminalAware, CaptureTerminalAwareBehavior}
import net.psforever.services.galaxy.{GalaxyAction, GalaxyServiceMessage}
import net.psforever.services.local.support.HackClearActor
import net.psforever.services.local.ClearMessage
import net.psforever.services.local.HackClearMessage
import net.psforever.types.PlanetSideEmpire
/**
@ -53,7 +53,7 @@ case object FacilityLogic
// When a CC is hacked (or resecured) all currently hacked amenities for the base should return to their default unhacked state
building.HackableAmenities.foreach(amenity => {
if (amenity.HackedBy.isDefined) {
building.Zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(amenity))
building.Zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(amenity))
}
})
// No map update needed - will be sent by `HackCaptureActor` when required

View file

@ -16,8 +16,9 @@ import net.psforever.objects.sourcing.PlayerSource
import net.psforever.packet.game.PlanetsideAttributeMessage
import net.psforever.services.InterstellarClusterService
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.{GenericObjectAction, SendResponse}
import net.psforever.services.galaxy.{GalaxyAction, GalaxyServiceMessage}
import net.psforever.services.local.{CaptureMessage, ClearMessage, LocalAction, LocalServiceMessage}
import net.psforever.services.local.{CaptureMessage, HackClearMessage, LocalServiceMessage}
import net.psforever.services.local.support.{HackCaptureActor, HackClearActor}
import net.psforever.types.PlanetSideEmpire
@ -102,7 +103,7 @@ case object MajorFacilityLogic
hackedAmenities
}
amenitiesToClear.foreach { amenity =>
building.Zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(amenity))
building.Zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(amenity))
}
// No map update needed - will be sent by `HackCaptureActor` when required
case dome: ForceDomePhysics =>
@ -203,7 +204,7 @@ case object MajorFacilityLogic
case Some(GeneratorControl.Event.UnderAttack) =>
val events = zone.AvatarEvents
val guid = building.GUID
val msg = AvatarAction.GenericObjectAction(guid, 15)
val msg = GenericObjectAction(guid, 15)
building.PlayersInSOI.foreach { player =>
events ! AvatarServiceMessage(player.Name, msg)
}
@ -219,14 +220,14 @@ case object MajorFacilityLogic
case Some(GeneratorControl.Event.Destabilized) =>
val events = zone.AvatarEvents
val guid = building.GUID
val msg = AvatarAction.GenericObjectAction(guid, 16)
val msg = GenericObjectAction(guid, 16)
building.PlayersInSOI.foreach { player =>
events ! AvatarServiceMessage(player.Name, msg)
}
if (building.hasCavernLockBenefit) {
zone.LocalEvents ! LocalServiceMessage(
zone.id,
LocalAction.SendResponse(PlanetsideAttributeMessage(building.GUID, 67, 0))
SendResponse(PlanetsideAttributeMessage(building.GUID, 67, 0))
)
}
false
@ -248,7 +249,7 @@ case object MajorFacilityLogic
val events = zone.AvatarEvents
val guid = building.GUID
val msg1 = AvatarAction.PlanetsideAttributeToAll(46, 0)
val msg2 = AvatarAction.GenericObjectAction(guid, 17)
val msg2 = GenericObjectAction(guid, 17)
building.PlayersInSOI.foreach { player =>
val name = player.Name
events ! AvatarServiceMessage(name, guid, msg1) //reset ???; might be global?

View file

@ -4,7 +4,7 @@ package net.psforever.actors.zone.building
import akka.actor.typed.Behavior
import akka.actor.typed.scaladsl.Behaviors
import net.psforever.actors.commands.NtuCommand
import net.psforever.actors.zone.{BuildingActor, ZoneActor}
import net.psforever.actors.zone.BuildingActor
import net.psforever.objects.serverobject.structures.{Amenity, Building, WarpGate}
import net.psforever.services.galaxy.{GalaxyAction, GalaxyServiceMessage}
import net.psforever.types.PlanetSideEmpire

View file

@ -16,6 +16,7 @@ import net.psforever.objects.vital.TerminalUsedActivity
import net.psforever.objects.zones.Zone
import net.psforever.types.{ExoSuitType, PlanetSideGUID, TransactionType, Vector3}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.ObjectDelete
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
@ -279,7 +280,7 @@ object WorldSession {
* @throws `RuntimeException` if slot is not a player visible slot (holsters)
* @see `ask`
* @see `AvatarAction.ObjectDelete`
* @see `AvatarAction.SendResponse`
* @see `SendResponse`
* @see `Containable.CanNotPutItemInSlot`
* @see `Containable.PutItemInSlotOnly`
* @see `GUIDTask.registerEquipment`
@ -366,7 +367,7 @@ object WorldSession {
localZone.GUID(item_guid) match {
case Some(_) => ()
case None => //acting on old data?
localZone.AvatarEvents ! AvatarServiceMessage(localZone.id, AvatarAction.ObjectDelete(item_guid))
localZone.AvatarEvents ! AvatarServiceMessage(localZone.id, ObjectDelete(item_guid))
}
case _ => ()
}
@ -590,7 +591,7 @@ object WorldSession {
localGUID match {
case Some(guid) =>
//see LockerContainerControl.RemoveItemFromSlotCallback
localSource.Zone.AvatarEvents ! AvatarServiceMessage(localChannel, AvatarAction.ObjectDelete(guid))
localSource.Zone.AvatarEvents ! AvatarServiceMessage(localChannel, ObjectDelete(guid))
case None => ()
}
val moveResult = ask(localDestination.Actor, Containable.PutItemInSlotOrAway(localItem, Some(localDestSlot)))
@ -692,7 +693,7 @@ object WorldSession {
localGUID match {
case Some(guid) =>
//see LockerContainerControl.RemoveItemFromSlotCallback
localSource.Zone.AvatarEvents ! AvatarServiceMessage(localChannel, AvatarAction.ObjectDelete(guid))
localSource.Zone.AvatarEvents ! AvatarServiceMessage(localChannel, ObjectDelete(guid))
case None => ()
}
val moveResult = ask(localDestination.Actor, Containable.PutItemInSlotOrAway(localItem, Some(localDestSlot)))

View file

@ -11,7 +11,8 @@ import net.psforever.objects.vital.Vitality
import net.psforever.objects.vital.etc.TriggerUsedReason
import net.psforever.objects.vital.interaction.DamageInteraction
import net.psforever.objects.zones.Zone
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.ObjectDelete
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.types.PlanetSideEmpire
@ -108,7 +109,7 @@ class BoomerDeployableControl(mine: BoomerDeployable)
}
zone.AvatarEvents! AvatarServiceMessage(
zone.id,
AvatarAction.ObjectDelete(guid)
ObjectDelete(guid)
)
TaskWorkflow.execute(GUIDTask.unregisterObject(zone.GUID, trigger))
case None => ()

View file

@ -12,7 +12,8 @@ import net.psforever.objects.serverobject.{CommonMessages, PlanetSideServerObjec
import net.psforever.objects.sourcing.{PlayerSource, SourceEntry, TurretSource}
import net.psforever.objects.vital.{DismountingActivity, InGameActivity, MountingActivity, ShieldCharge}
import net.psforever.packet.game.HackState1
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.services.vehicle.VehicleServiceMessage
import scala.annotation.unused
@ -99,7 +100,7 @@ class FieldTurretControl(turret: TurretDeployable)
turret.Shields = turret.Shields + amount
turret.Zone.VehicleEvents ! VehicleServiceMessage(
s"${turret.Actor}",
VehicleAction.PlanetsideAttribute(turret.GUID, turret.Definition.shieldUiAttribute, turret.Shields)
PlanetsideAttribute(turret.GUID, turret.Definition.shieldUiAttribute, turret.Shields)
)
}
}

View file

@ -21,6 +21,7 @@ import net.psforever.packet.game._
import net.psforever.types.{ChatMessageType, ExoSuitType, PlanetSideGUID, Vector3}
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.{ObjectDelete, SendResponse}
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import scala.annotation.tailrec
@ -50,7 +51,7 @@ object Players {
val uname = user.Name
events ! AvatarServiceMessage(
uname,
AvatarAction.SendResponse(RepairMessage(target.GUID, progress.toInt))
SendResponse(RepairMessage(target.GUID, progress.toInt))
)
true
} else {
@ -77,7 +78,7 @@ object Players {
target.Zone,
medicName,
Service.defaultPlayerGUID,
AvatarAction.SendResponse(
SendResponse(
InventoryStateMessage(item.AmmoSlot.Box.GUID, item.GUID, magazine)
)
)
@ -347,7 +348,7 @@ object Players {
*/
def buildCooldownReset(zone: Zone, channel: String, guid: PlanetSideGUID): Unit = {
//sent to avatar event bus to preempt additional tool management
zone.AvatarEvents ! AvatarServiceMessage(channel, AvatarAction.SendResponse(GenericObjectActionMessage(guid, 21)))
zone.AvatarEvents ! AvatarServiceMessage(channel, SendResponse(GenericObjectActionMessage(guid, 21)))
}
/**
@ -403,7 +404,7 @@ object Players {
}
}) {
val zone = player.Zone
zone.AvatarEvents ! AvatarServiceMessage(zone.id, AvatarAction.ObjectDelete(tool.GUID))
zone.AvatarEvents ! AvatarServiceMessage(zone.id, ObjectDelete(tool.GUID))
true
} else {
false
@ -449,7 +450,7 @@ object Players {
obj.AmmoTypeIndex = ammoType
events ! AvatarServiceMessage(
name,
AvatarAction.SendResponse(ChangeAmmoMessage(obj.GUID, ammoType))
SendResponse(ChangeAmmoMessage(obj.GUID, ammoType))
)
}
if (player.DrawnSlot == Player.HandsDownSlot) {

View file

@ -13,9 +13,9 @@ import net.psforever.objects.serverobject.repair.RepairableEntity
import net.psforever.objects.vital.SimpleResolutions
import net.psforever.objects.vital.interaction.DamageResult
import net.psforever.types.{PlanetSideGUID, Vector3}
import net.psforever.services.Service
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.vehicle.VehicleServiceMessage
import scala.annotation.unused
import scala.concurrent.duration._
@ -77,7 +77,7 @@ class SensorDeployableControl(sensor: SensorDeployable)
case obj: PlanetSideServerObject if !jammedSound =>
obj.Zone.VehicleEvents ! VehicleServiceMessage(
obj.Zone.id,
VehicleAction.PlanetsideAttribute(obj.GUID, 54, 1)
PlanetsideAttribute(obj.GUID, 54, 1)
)
super.StartJammeredSound(obj, dur)
case _ => ;
@ -101,7 +101,7 @@ class SensorDeployableControl(sensor: SensorDeployable)
val zone = obj.Zone
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(obj.GUID, 54, 0)
PlanetsideAttribute(obj.GUID, 54, 0)
)
case _ => ;
}

View file

@ -13,8 +13,9 @@ import net.psforever.objects.serverobject.hackable.Hackable
import net.psforever.objects.serverobject.repair.RepairableEntity
import net.psforever.objects.vital.interaction.DamageResult
import net.psforever.objects.vital.resolution.ResolutionCalculations
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.types.PlanetSideGUID
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.vehicle.VehicleServiceMessage
class ShieldGeneratorDeployable(cdef: ShieldGeneratorDefinition)
extends Deployable(cdef)
@ -126,7 +127,7 @@ class ShieldGeneratorControl(gen: ShieldGeneratorDeployable)
case obj: PlanetSideServerObject with JammableUnit =>
obj.Zone.VehicleEvents ! VehicleServiceMessage(
obj.Zone.id,
VehicleAction.PlanetsideAttribute(obj.GUID, 27, 1)
PlanetsideAttribute(obj.GUID, 27, 1)
)
super.StartJammeredStatus(obj, dur)
case _ => ;
@ -139,7 +140,7 @@ class ShieldGeneratorControl(gen: ShieldGeneratorDeployable)
case obj: PlanetSideServerObject with JammableUnit if obj.Jammed =>
obj.Zone.VehicleEvents ! VehicleServiceMessage(
obj.Zone.id,
VehicleAction.PlanetsideAttribute(obj.GUID, 27, 0)
PlanetsideAttribute(obj.GUID, 27, 0)
)
case _ => ;
}
@ -161,7 +162,7 @@ object ShieldGeneratorControl {
val zone = target.Zone
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(target.GUID, 68, target.Shields)
PlanetsideAttribute(target.GUID, 68, target.Shields)
)
}
}

View file

@ -3,7 +3,8 @@ package net.psforever.objects
import net.psforever.objects.equipment.ChargeFireModeDefinition
import net.psforever.packet.game.QuantityUpdateMessage
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.SendResponse
object Tools {
/**
@ -23,7 +24,7 @@ object Tools {
val magazine = tool.Magazine -= mode.RoundsPerInterval
player.Zone.AvatarEvents ! AvatarServiceMessage(
player.Name,
AvatarAction.SendResponse(QuantityUpdateMessage(tool.AmmoSlot.Box.GUID, magazine))
SendResponse(QuantityUpdateMessage(tool.AmmoSlot.Box.GUID, magazine))
)
player.isAlive
case _ =>

View file

@ -14,6 +14,7 @@ import net.psforever.packet.game.{ChatMsg, FrameVehicleStateMessage, GenericObje
import net.psforever.types.{ChatMessageType, DriveState, PlanetSideEmpire, PlanetSideGUID, Vector3}
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.{GenericObjectAction, SendResponse, SetEmpire}
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
@ -254,7 +255,7 @@ object Vehicles {
val previousOwnerName = target.OwnerName.getOrElse("")
vehicleEvents ! VehicleServiceMessage(
zoneid,
VehicleAction.SendResponse(HackMessage(HackState1.Unk2, tGuid, hGuid, 100, 0f, HackState.Hacked, HackState7.Unk8))
SendResponse(HackMessage(HackState1.Unk2, tGuid, hGuid, 100, 0f, HackState.Hacked, HackState7.Unk8))
)
target.Actor ! CommonMessages.Hack(hacker, target)
// Forcefully dismount any cargo
@ -280,15 +281,15 @@ object Vehicles {
zone.LocalEvents ! LocalServiceMessage(
zoneid,
PlanetSideGUID(-1),
LocalAction.GenericObjectAction(target.GUID, GenericObjectActionEnum.BFRShieldsDown)
GenericObjectAction(target.GUID, GenericObjectActionEnum.BFRShieldsDown.id)
)
zone.LocalEvents ! LocalServiceMessage(
zoneid,
LocalAction.SendResponse(
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(
SendResponse(
VehicleStateMessage(target.GUID, 0, target.Position, target.Orientation, Some(Vector3(0f, 0f, 0f)), None, 0, 0, 15, is_decelerating=false, is_cloaked=false)))
}
})
@ -316,7 +317,7 @@ object Vehicles {
// And broadcast the faction change to other clients
zone.AvatarEvents ! AvatarServiceMessage(
zoneid,
AvatarAction.SetEmpire(tGuid, hFaction)
SetEmpire(tGuid, hFaction)
)
}
localEvents ! LocalServiceMessage(
@ -327,12 +328,12 @@ object Vehicles {
if (zone.Players.exists(_.name.equals(previousOwnerName))) {
localEvents ! LocalServiceMessage(
previousOwnerName,
LocalAction.SendResponse(ChatMsg(ChatMessageType.UNK_226, "@JackStolen"))
SendResponse(ChatMsg(ChatMessageType.UNK_226, "@JackStolen"))
)
}
localEvents ! LocalServiceMessage(
hacker.Name,
LocalAction.SendResponse(ChatMsg(ChatMessageType.UNK_226, "@JackVehicleOwned"))
SendResponse(ChatMsg(ChatMessageType.UNK_226, "@JackVehicleOwned"))
)
// Clean up after specific vehicles, e.g. remove router telepads
// If AMS is deployed, swap it to the new faction
@ -350,7 +351,7 @@ object Vehicles {
}
vehicleEvents ! VehicleServiceMessage(
zoneid,
VehicleAction.SendResponse(HackMessage(HackState1.Unk2, tGuid, tGuid, 0, 1L, HackState.HackCleared, HackState7.Unk8))
SendResponse(HackMessage(HackState1.Unk2, tGuid, tGuid, 0, 1L, HackState.HackCleared, HackState7.Unk8))
)
target.Actor ! CommonMessages.ClearHack()
}

View file

@ -8,7 +8,8 @@ import net.psforever.objects.serverobject.containable.{Containable, ContainableB
import net.psforever.packet.game.{ObjectAttachMessage, ObjectCreateDetailedMessage, ObjectDetachMessage}
import net.psforever.packet.game.objectcreate.ObjectCreateMessageParent
import net.psforever.types.{PlanetSideEmpire, Vector3}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.{ObjectDelete, SendResponse}
class CorpseControl(player: Player) extends Actor with ContainableBehavior {
def ContainerObject = player
@ -26,7 +27,7 @@ class CorpseControl(player: Player) extends Actor with ContainableBehavior {
case Some(slot) =>
obj.Zone.AvatarEvents ! AvatarServiceMessage(
player.Zone.id,
AvatarAction.SendResponse(ObjectAttachMessage(obj.GUID, item.GUID, slot))
SendResponse(ObjectAttachMessage(obj.GUID, item.GUID, slot))
)
case None => ;
}
@ -39,7 +40,7 @@ class CorpseControl(player: Player) extends Actor with ContainableBehavior {
val zone = obj.Zone
val events = zone.AvatarEvents
item.Faction = PlanetSideEmpire.NEUTRAL
events ! AvatarServiceMessage(zone.id, AvatarAction.ObjectDelete(item.GUID))
events ! AvatarServiceMessage(zone.id, ObjectDelete(item.GUID))
}
def PutItemInSlotCallback(item: Equipment, slot: Int): Unit = {
@ -49,7 +50,7 @@ class CorpseControl(player: Player) extends Actor with ContainableBehavior {
val definition = item.Definition
events ! AvatarServiceMessage(
zone.id,
AvatarAction.SendResponse(
SendResponse(
ObjectCreateDetailedMessage(
definition.ObjectId,
item.GUID,
@ -65,7 +66,7 @@ class CorpseControl(player: Player) extends Actor with ContainableBehavior {
val zone = obj.Zone
zone.AvatarEvents ! AvatarServiceMessage(
zone.id,
AvatarAction.SendResponse(ObjectDetachMessage(obj.GUID, item.GUID, Vector3.Zero, 0f))
SendResponse(ObjectDetachMessage(obj.GUID, item.GUID, Vector3.Zero, 0f))
)
}
}

View file

@ -37,6 +37,7 @@ import net.psforever.objects.vital.etc.{PainboxReason, SuicideReason}
import net.psforever.objects.vital.interaction.{DamageInteraction, DamageResult}
import net.psforever.packet.PlanetSideGamePacket
import net.psforever.services.base.EventMessage
import net.psforever.services.base.messages.{HintsAtAttacker, ObjectDelete, PlanetsideAttribute, SendResponse}
import org.joda.time.{LocalDateTime, Seconds}
import scala.concurrent.duration._
@ -150,7 +151,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
val magazine = item.Discharge()
events ! AvatarServiceMessage(
uname,
AvatarAction.SendResponse(InventoryStateMessage(item.AmmoSlot.Box.GUID, item.GUID, magazine.toLong))
SendResponse(InventoryStateMessage(item.AmmoSlot.Box.GUID, item.GUID, magazine.toLong))
)
events ! AvatarServiceMessage(zone.id, guid, AvatarAction.PlanetsideAttributeToAll(0, newHealth))
player.LogActivity(
@ -176,7 +177,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
//progress bar remains visible for all heal attempts
events ! AvatarServiceMessage(
uname,
AvatarAction.SendResponse(RepairMessage(guid, player.Health * 100 / definition.MaxHealth))
SendResponse(RepairMessage(guid, player.Health * 100 / definition.MaxHealth))
)
}
}
@ -216,7 +217,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
val magazine = item.Discharge()
events ! AvatarServiceMessage(
uname,
AvatarAction.SendResponse(InventoryStateMessage(item.AmmoSlot.Box.GUID, item.GUID, magazine.toLong))
SendResponse(InventoryStateMessage(item.AmmoSlot.Box.GUID, item.GUID, magazine.toLong))
)
events ! AvatarServiceMessage(zone.id, guid, AvatarAction.PlanetsideAttributeToAll(4, player.Armor))
player.LogActivity(
@ -247,7 +248,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
//progress bar remains visible for all repair attempts
events ! AvatarServiceMessage(
uname,
AvatarAction.SendResponse(RepairMessage(guid, player.Armor * 100 / player.MaxArmor))
SendResponse(RepairMessage(guid, player.Armor * 100 / player.MaxArmor))
)
}
}
@ -359,7 +360,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
events ! AvatarServiceMessage(
Players.ZoneChannelIfSpectating(player),
unholsteredItem.GUID,
AvatarAction.PlanetsideAttribute(116, player.avatar.hackingSkillLevel())
PlanetsideAttribute(unholsteredItem.GUID, 116, player.avatar.hackingSkillLevel())
)
}
case None => ()
@ -374,7 +375,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
player.Zone.LocalEvents ! LocalServiceMessage(
s"${player.Faction}",
PlanetSideGUID(-1),
LocalAction.SendResponse(OrbitalStrikeWaypointMessage(player.GUID, None))
SendResponse(OrbitalStrikeWaypointMessage(player.GUID, None))
)
}
case None =>
@ -578,7 +579,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
if (reason.startsWith("@")) {
player.Zone.AvatarEvents ! AvatarServiceMessage(
player.Name,
AvatarAction.SendResponse(ChatMsg(ChatMessageType.UNK_227, reason))
SendResponse(ChatMsg(ChatMessageType.UNK_227, reason))
)
}
@ -596,7 +597,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
val trigger = new BoomerTrigger
trigger.Companion = obj.GUID
obj.Trigger = trigger
zone.AvatarEvents ! AvatarServiceMessage(zone.id, AvatarAction.ObjectDelete(tool.GUID))
zone.AvatarEvents ! AvatarServiceMessage(zone.id, ObjectDelete(tool.GUID))
TaskWorkflow.execute(GUIDTask.unregisterEquipment(zone.GUID, tool))
player.Find(tool) match {
case Some(index) if player.VisibleSlots.contains(index) =>
@ -954,7 +955,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
if (aggravated) {
events ! AvatarServiceMessage(
zoneId,
AvatarAction.SendResponse(AggravatedDamageMessage(targetGUID, countableDamage))
SendResponse(AggravatedDamageMessage(targetGUID, countableDamage))
)
} else {
//activity on map
@ -970,18 +971,18 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
zone.AvatarEvents ! AvatarServiceMessage(
target.Name,
target.GUID,
AvatarAction.HitHint(tplayer.GUID)
HintsAtAttacker(tplayer.GUID)
)
case None =>
zone.AvatarEvents ! AvatarServiceMessage(
target.Name,
AvatarAction.SendResponse(DamageWithPositionMessage(countableDamage, pSource.Position))
SendResponse(DamageWithPositionMessage(countableDamage, pSource.Position))
)
}
case source =>
zone.AvatarEvents ! AvatarServiceMessage(
target.Name,
AvatarAction.SendResponse(DamageWithPositionMessage(countableDamage, source.Position))
SendResponse(DamageWithPositionMessage(countableDamage, source.Position))
)
}
case None =>
@ -994,7 +995,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
case _: CollisionReason =>
events ! AvatarServiceMessage(
zoneId,
AvatarAction.SendResponse(AggravatedDamageMessage(targetGUID, countableDamage))
SendResponse(AggravatedDamageMessage(targetGUID, countableDamage))
)
case _ =>
zone.AvatarEvents ! AvatarServiceMessage(
@ -1062,7 +1063,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
val attribute = DamageableEntity.attributionTo(cause, target.Zone, player_guid)
events ! AvatarServiceMessage(
nameChannel,
AvatarAction.SendResponse(DestroyMessage(player_guid, attribute, Service.defaultPlayerGUID, pos)) //how many players get this message?
SendResponse(DestroyMessage(player_guid, attribute, Service.defaultPlayerGUID, pos)) //how many players get this message?
)
}
@ -1176,7 +1177,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
if (slot == obj.DrawnSlot) {
obj.DrawnSlot = Player.HandsDownSlot
}
events ! AvatarServiceMessage(toChannel, AvatarAction.ObjectDelete(item.GUID))
events ! AvatarServiceMessage(toChannel, ObjectDelete(item.GUID))
}
def PutItemInSlotCallback(item: Equipment, slot: Int): Unit = {
@ -1199,7 +1200,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
if (!deployables.Contains(obj) && deployables.Valid(obj)) {
events ! AvatarServiceMessage(
toChannel,
AvatarAction.SendResponse(GenericObjectAction2Message(1, player.GUID, trigger.GUID))
SendResponse(GenericObjectAction2Message(1, player.GUID, trigger.GUID))
)
Players.gainDeployableOwnership(player, obj, deployables.AddOverLimit)
}
@ -1218,7 +1219,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
}
events ! AvatarServiceMessage(
toChannel,
AvatarAction.SendResponse(OCM.detailed(item, ObjectCreateMessageParent(guid, slot)))
SendResponse(OCM.detailed(item, ObjectCreateMessageParent(guid, slot)))
)
if (!player.isBackpack && willBeVisible) {
events ! AvatarServiceMessage(zone.id, guid, AvatarAction.EquipmentInHand(guid, slot, item))
@ -1237,7 +1238,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
}
zone.AvatarEvents ! AvatarServiceMessage(
toChannel,
AvatarAction.ObjectDelete(item.GUID)
ObjectDelete(item.GUID)
)
}
@ -1275,7 +1276,7 @@ object PlayerControl {
}
def sendResponse(zone: Zone, channel: String, msg: PlanetSideGamePacket): Unit = {
zone.AvatarEvents ! AvatarServiceMessage(channel, AvatarAction.SendResponse(msg))
zone.AvatarEvents ! AvatarServiceMessage(channel, SendResponse(msg))
}
def sendResponse(zone: Zone, channel: String, filter: PlanetSideGUID, msg: EventMessage): Unit = {

View file

@ -6,6 +6,7 @@ import net.psforever.objects.serverobject.environment.{EnvironmentAttribute, Env
import net.psforever.objects.serverobject.environment.interaction.{InteractionWith, RespondsToZoneEnvironment}
import net.psforever.objects.serverobject.interior.{Sidedness, TraditionalInteriorAware}
import net.psforever.objects.zones.interaction.InteractsWithZone
import net.psforever.services.base.messages.SendResponse
import net.psforever.types.Vector3
import scala.annotation.unused
@ -90,7 +91,7 @@ class WithEntrance()
): Sidedness = {
import net.psforever.objects.{Player, Vehicle}
import net.psforever.packet.game.ChatMsg
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.types.ChatMessageType
val channel = obj match {
case p: Player => p.Name
@ -100,7 +101,7 @@ class WithEntrance()
if (door.Outwards == Vector3.Zero) {
obj.Zone.AvatarEvents ! AvatarServiceMessage(
channel,
AvatarAction.SendResponse(ChatMsg(ChatMessageType.UNK_229, "Door not configured."))
SendResponse(ChatMsg(ChatMessageType.UNK_229, "Door not configured."))
)
WhichSide
} else {
@ -109,14 +110,14 @@ class WithEntrance()
//outside
obj.Zone.AvatarEvents ! AvatarServiceMessage(
channel,
AvatarAction.SendResponse(ChatMsg(ChatMessageType.UNK_229, "You are now outside"))
SendResponse(ChatMsg(ChatMessageType.UNK_229, "You are now outside"))
)
Sidedness.OutsideOf
} else if (!result && WhichSide != Sidedness.InsideOf) {
//inside
obj.Zone.AvatarEvents ! AvatarServiceMessage(
channel,
AvatarAction.SendResponse(ChatMsg(ChatMessageType.UNK_229, "You are now inside"))
SendResponse(ChatMsg(ChatMessageType.UNK_229, "You are now inside"))
)
Sidedness.InsideOf
} else {

View file

@ -7,7 +7,8 @@ import net.psforever.objects.serverobject.environment.{EnvironmentAttribute, Env
import net.psforever.objects.serverobject.shuttle.OrbitalShuttlePad
import net.psforever.objects.zones.interaction.InteractsWithZone
import net.psforever.packet.game.{ChatMsg, PlayerStateShiftMessage, ShiftState}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.hart.ShuttleState
import net.psforever.types.ChatMessageType
@ -36,10 +37,10 @@ class WithGantry(val channel: String)
val events = shuttle.Zone.AvatarEvents
events ! AvatarServiceMessage(
channel,
AvatarAction.SendResponse(PlayerStateShiftMessage(ShiftState(0, pos, ang, None))))
SendResponse(PlayerStateShiftMessage(ShiftState(0, pos, ang, None))))
events ! AvatarServiceMessage(
channel,
AvatarAction.SendResponse(ChatMsg(ChatMessageType.UNK_227, "@Vehicle_OS_PlacedOutsideHallway"))
SendResponse(ChatMsg(ChatMessageType.UNK_227, "@Vehicle_OS_PlacedOutsideHallway"))
)
case (Some(_: Vehicle) , _)=>
obj.Actor ! RespondsToZoneEnvironment.Timer(

View file

@ -7,7 +7,8 @@ import net.psforever.objects._
import net.psforever.objects.zones.Zone
import net.psforever.packet.game._
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.SetEmpire
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.types.PlanetSideEmpire
@ -284,7 +285,7 @@ object DeployableBehavior {
//visual tells in regards to ownership by faction
zone.AvatarEvents ! AvatarServiceMessage(
zone.id,
AvatarAction.SetEmpire(dGuid, toFaction)
SetEmpire(dGuid, toFaction)
)
//remove knowledge by the previous owner's faction
localEvents ! LocalServiceMessage(

View file

@ -9,6 +9,7 @@ import net.psforever.objects.vehicles.Utility.InternalTelepad
import net.psforever.objects.zones.Zone
import net.psforever.packet.game.{GenericObjectActionMessage, ObjectCreateMessage, ObjectDeleteMessage}
import net.psforever.packet.game.objectcreate.ObjectCreateMessageParent
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.types.PlanetSideGUID
@ -115,7 +116,7 @@ object TelepadLike {
*/
events ! LocalServiceMessage(
zoneId,
LocalAction.SendResponse(
SendResponse(
ObjectCreateMessage(
udef.ObjectId,
utilityGUID,
@ -124,28 +125,20 @@ object TelepadLike {
)
)
)
events ! LocalServiceMessage(
zoneId,
LocalAction.SendResponse(GenericObjectActionMessage(utilityGUID, 27))
)
events ! LocalServiceMessage(
zoneId,
LocalAction.SendResponse(GenericObjectActionMessage(utilityGUID, 30))
)
events ! LocalServiceMessage(zoneId, SendResponse(Seq(
GenericObjectActionMessage(utilityGUID, 27),
GenericObjectActionMessage(utilityGUID, 30)
)))
LinkTelepad(zone, utilityGUID)
}
def LinkTelepad(zone: Zone, telepadGUID: PlanetSideGUID): Unit = {
val events = zone.LocalEvents
val zoneId = zone.id
events ! LocalServiceMessage(
zoneId,
LocalAction.SendResponse(GenericObjectActionMessage(telepadGUID, 27))
)
events ! LocalServiceMessage(
zoneId,
LocalAction.SendResponse(GenericObjectActionMessage(telepadGUID, 28))
)
events ! LocalServiceMessage(zoneId, SendResponse(Seq(
GenericObjectActionMessage(telepadGUID, 27),
GenericObjectActionMessage(telepadGUID, 28)
)))
}
def InitializeTelepadDeployable(zone: Zone, internal: InternalTelepad, pad: TelepadDeployable): Unit = {
@ -175,7 +168,7 @@ class TelepadControl(obj: InternalTelepad) extends akka.actor.Actor {
oldTpad.Actor ! TelepadLike.SeverLink(obj)
}
obj.Telepad = None
zone.LocalEvents ! LocalServiceMessage(zone.id, LocalAction.SendResponse(ObjectDeleteMessage(obj.GUID, 0)))
zone.LocalEvents ! LocalServiceMessage(zone.id, SendResponse(ObjectDeleteMessage(obj.GUID, 0)))
case TelepadLike.RequestLink(tpad: TelepadDeployable) =>
val zone = obj.Zone
@ -204,7 +197,7 @@ class TelepadControl(obj: InternalTelepad) extends akka.actor.Actor {
if (obj.Telepad.contains(tpad.GUID)) {
obj.Telepad = None
val zone = obj.Zone
zone.LocalEvents ! LocalServiceMessage(zone.id, LocalAction.SendResponse(ObjectDeleteMessage(obj.GUID, 0)))
zone.LocalEvents ! LocalServiceMessage(zone.id, SendResponse(ObjectDeleteMessage(obj.GUID, 0)))
}
case _ => ()

View file

@ -10,7 +10,8 @@ import net.psforever.objects.vital.RepairFromArmorSiphon
import net.psforever.objects.vital.etc.{ArmorSiphonModifiers, ArmorSiphonReason}
import net.psforever.objects.vital.interaction.DamageInteraction
import net.psforever.packet.game.QuantityUpdateMessage
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.base.messages.{PlanetsideAttribute, SendResponse}
import net.psforever.services.vehicle.VehicleServiceMessage
import net.psforever.types.PlanetSideGUID
import scala.collection.mutable
@ -79,7 +80,7 @@ object ArmorSiphonBehavior {
val zone = obj.Zone
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(obj.GUID, 0, after)
PlanetsideAttribute(obj.GUID, 0, after)
)
}
case _ => ;
@ -98,7 +99,7 @@ object ArmorSiphonBehavior {
//update current charge level
zone.VehicleEvents ! VehicleServiceMessage(
obj.Actor.toString,
VehicleAction.SendResponse(QuantityUpdateMessage(siphon.AmmoSlot.Box.GUID, siphon.Magazine))
SendResponse(QuantityUpdateMessage(siphon.AmmoSlot.Box.GUID, siphon.Magazine))
)
siphonRecharge.put(guid, context.system.scheduler.scheduleWithFixedDelay(
initialDelay = 3000 milliseconds,
@ -120,7 +121,7 @@ object ArmorSiphonBehavior {
if (after > before) {
zone.VehicleEvents ! VehicleServiceMessage(
obj.Actor.toString,
VehicleAction.SendResponse(QuantityUpdateMessage(siphon.AmmoSlot.Box.GUID, after))
SendResponse(QuantityUpdateMessage(siphon.AmmoSlot.Box.GUID, after))
)
if (after == siphon.MaxMagazine) {
endSiphonRecharge(guid)

View file

@ -8,8 +8,9 @@ import net.psforever.objects.vehicles.MountedWeapons
import net.psforever.objects.vital.interaction.DamageResult
import net.psforever.objects.vital.projectile.ProjectileReason
import net.psforever.objects.zones.{Zone, ZoneAware}
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.types.Vector3
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.vehicle.VehicleServiceMessage
import scala.collection.mutable
import scala.concurrent.duration._
@ -244,7 +245,7 @@ trait JammableMountedWeapons extends JammableBehavior {
case obj: PlanetSideServerObject with MountedWeapons with JammableUnit if !jammedSound =>
obj.Zone.VehicleEvents ! VehicleServiceMessage(
obj.Zone.id,
VehicleAction.PlanetsideAttribute(obj.GUID, 27, 1)
PlanetsideAttribute(obj.GUID, 27, 1)
)
super.StartJammeredSound(target, dur)
case _ => ;
@ -265,7 +266,7 @@ trait JammableMountedWeapons extends JammableBehavior {
case obj: PlanetSideServerObject if jammedSound =>
obj.Zone.VehicleEvents ! VehicleServiceMessage(
obj.Zone.id,
VehicleAction.PlanetsideAttribute(obj.GUID, 27, 0)
PlanetsideAttribute(obj.GUID, 27, 0)
)
case _ => ;
}
@ -309,7 +310,7 @@ object JammableMountedWeapons {
target.Jammed = statusCode == 1
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(target.GUID, 27, statusCode)
PlanetsideAttribute(target.GUID, 27, statusCode)
)
}
}

View file

@ -6,7 +6,8 @@ import net.psforever.objects.equipment.Equipment
import net.psforever.objects.serverobject.containable.{Containable, ContainableBehavior}
import net.psforever.packet.game.objectcreate.ObjectCreateMessageParent
import net.psforever.packet.game.{ObjectAttachMessage, ObjectCreateDetailedMessage, ObjectDetachMessage}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.{ObjectDelete, SendResponse}
import net.psforever.types.{PlanetSideEmpire, Vector3}
/**
@ -35,7 +36,7 @@ class LockerContainerControl(locker: LockerContainer, toChannel: String)
case Some(slot) =>
obj.Zone.AvatarEvents ! AvatarServiceMessage(
toChannel,
AvatarAction.SendResponse(ObjectAttachMessage(obj.GUID, item.GUID, slot))
SendResponse(ObjectAttachMessage(obj.GUID, item.GUID, slot))
)
case None => ;
}
@ -45,7 +46,7 @@ class LockerContainerControl(locker: LockerContainer, toChannel: String)
def RemoveItemFromSlotCallback(item: Equipment, slot: Int): Unit = {
val zone = locker.Zone
zone.AvatarEvents ! AvatarServiceMessage(toChannel, AvatarAction.ObjectDelete(item.GUID))
zone.AvatarEvents ! AvatarServiceMessage(toChannel, ObjectDelete(item.GUID))
}
def PutItemInSlotCallback(item: Equipment, slot: Int): Unit = {
@ -54,7 +55,7 @@ class LockerContainerControl(locker: LockerContainer, toChannel: String)
item.Faction = PlanetSideEmpire.NEUTRAL
zone.AvatarEvents ! AvatarServiceMessage(
toChannel,
AvatarAction.SendResponse(
SendResponse(
ObjectCreateDetailedMessage(
definition.ObjectId,
item.GUID,
@ -69,7 +70,7 @@ class LockerContainerControl(locker: LockerContainer, toChannel: String)
val zone = locker.Zone
zone.AvatarEvents ! AvatarServiceMessage(
toChannel,
AvatarAction.SendResponse(ObjectDetachMessage(locker.GUID, item.GUID, Vector3.Zero, 0f))
SendResponse(ObjectDetachMessage(locker.GUID, item.GUID, Vector3.Zero, 0f))
)
}
}

View file

@ -141,7 +141,7 @@ object DamageableEntity {
* - alert the activity monitor for that `Zone` about the damage; and,
* - provide a feedback message regarding the damage.
* @see `AvatarAction.PlanetsideAttributeToAll`
* @see `AvatarAction.SendResponse`
* @see `SendResponse`
* @see `AvatarServiceMessage`
* @see `DamageFeedbackMessage`
* @see `JammableUnit.Jammered`

View file

@ -8,6 +8,7 @@ import net.psforever.objects.vital.interaction.{DamageInteraction, DamageResult}
import net.psforever.packet.game.DamageWithPositionMessage
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.{HintsAtAttacker, SendResponse}
/**
* Functions to assist other damage-dealing code for objects that contain users.
@ -17,8 +18,8 @@ object DamageableMountable {
/**
* A damaged target alerts its occupants (as it is a `Mountable` object) of the source of the damage.
*
* @see `AvatarAction.HitHint`
* @see `AvatarAction.SendResponse`
* @see `HitHint`
* @see `SendResponse`
* @see `AvatarServiceMessage`
* @see `DamageWithPositionMessage`
* @see `Mountable.Seats`
@ -45,17 +46,17 @@ object DamageableMountable {
val name = pSource.Name
(zone.LivePlayers.find(_.Name == name).orElse(zone.Corpses.find(_.Name == name)) match {
case Some(player) =>
AvatarAction.HitHint(player.GUID)
HintsAtAttacker(player.GUID)
case None =>
AvatarAction.SendResponse(DamageWithPositionMessage(countableDamage, pSource.Position))
SendResponse(DamageWithPositionMessage(countableDamage, pSource.Position))
}) match {
case AvatarAction.HitHint(guid) =>
occupants.map { tplayer => (tplayer.Name, guid, AvatarAction.HitHint(tplayer.GUID)) }
case msg @ HintsAtAttacker(guid) =>
occupants.map { tplayer => (tplayer.Name, guid, msg) }
case msg =>
occupants.map { tplayer => (tplayer.Name, Service.defaultPlayerGUID, msg) }
}
case Some(source) => //object damage
val msg = AvatarAction.SendResponse(DamageWithPositionMessage(countableDamage, source.Position))
val msg = SendResponse(DamageWithPositionMessage(countableDamage, source.Position))
occupants.map { tplayer => (tplayer.Name, Service.defaultPlayerGUID, msg) }
case None =>
List.empty

View file

@ -13,7 +13,8 @@ import net.psforever.objects.zones.Zone
import net.psforever.objects.zones.exp.ToDatabase
import net.psforever.packet.game.DamageWithPositionMessage
import net.psforever.services.Service
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.base.messages.{PlanetsideAttribute, SendResponse}
import net.psforever.services.vehicle.VehicleServiceMessage
import net.psforever.types.Vector3
import scala.concurrent.duration._
@ -144,21 +145,21 @@ trait DamageableVehicle
if (damageToShields > 0) {
events ! VehicleServiceMessage(
shieldChannel,
VehicleAction.PlanetsideAttribute(targetGUID, obj.Definition.shieldUiAttribute, obj.Shields)
PlanetsideAttribute(targetGUID, obj.Definition.shieldUiAttribute, obj.Shields)
)
announceConfrontation = true
}
if (damageToHealth > 0) {
events ! VehicleServiceMessage(
healthChannel,
VehicleAction.PlanetsideAttribute(targetGUID, 0, obj.Health)
PlanetsideAttribute(targetGUID, 0, obj.Health)
)
announceConfrontation = true
}
}
if (announceConfrontation) {
if (showAsAggravated) {
val msg = VehicleAction.SendResponse(DamageWithPositionMessage(totalDamage, Vector3.Zero))
val msg = SendResponse(DamageWithPositionMessage(totalDamage, Vector3.Zero))
obj.Seats.values
.collect { case seat if seat.occupant.nonEmpty => seat.occupant.get.Name }
.foreach { channel =>
@ -219,7 +220,7 @@ trait DamageableVehicle
obj.Shields = 0
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(target.GUID, obj.Definition.shieldUiAttribute, 0)
PlanetsideAttribute(target.GUID, obj.Definition.shieldUiAttribute, 0)
)
}
//database entry
@ -252,13 +253,13 @@ trait DamageableVehicle
val guid = obj.GUID
events ! VehicleServiceMessage(
zoneid,
VehicleAction.PlanetsideAttribute(guid, 0, 1)
PlanetsideAttribute(guid, 0, 1)
)
if (obj.Shields > 0) {
obj.Shields = 0
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(obj.GUID, obj.Definition.shieldUiAttribute, 0)
PlanetsideAttribute(obj.GUID, obj.Definition.shieldUiAttribute, 0)
)
}
//aggravation cancel

View file

@ -9,10 +9,11 @@ import net.psforever.objects.vital.interaction.DamageResult
import net.psforever.objects.zones.Zone
import net.psforever.packet.game.DamageWithPositionMessage
import net.psforever.types.Vector3
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.{ObjectDelete, PlanetsideAttribute, SendResponse}
import net.psforever.services.base.support.SupportActor
import net.psforever.services.vehicle.support.TurretUpgrader
import net.psforever.services.vehicle.{TurretMessage, VehicleAction, VehicleServiceMessage}
import net.psforever.services.vehicle.{TurretMessage, VehicleServiceMessage}
/**
* The "control" `Actor` mixin for damage-handling code for `WeaponTurret` objects.
@ -64,14 +65,14 @@ trait DamageableWeaponTurret
DamageableMountable.DamageAwareness(DamageableObject, cause, damageToHealth)
events ! VehicleServiceMessage(
zoneId,
VehicleAction.PlanetsideAttribute(targetGUID, 0, obj.Health)
PlanetsideAttribute(targetGUID, 0, obj.Health)
)
announceConfrontation = true
}
}
if (announceConfrontation) {
if (aggravated) {
val msg = VehicleAction.SendResponse(DamageWithPositionMessage(damageToHealth, Vector3.Zero))
val msg = SendResponse(DamageWithPositionMessage(damageToHealth, Vector3.Zero))
obj.Seats.values
.collect { case seat if seat.occupant.nonEmpty => seat.occupant.get.Name }
.foreach { channel =>
@ -131,7 +132,7 @@ object DamageableWeaponTurret {
}
.foreach(slot => {
val wep = slot.Equipment.get
avatarEvents ! AvatarServiceMessage(zoneId, AvatarAction.ObjectDelete(wep.GUID))
avatarEvents ! AvatarServiceMessage(zoneId, ObjectDelete(wep.GUID))
})
target match {
case turret: WeaponTurret =>

View file

@ -67,37 +67,10 @@ object Door {
*/
sealed trait Exchange
/**
* Message that carries the result of the processed request message back to the original user (`player`).
* @param player the player who sent this request message
* @param msg the original packet carrying the request
* @param response the result of the processed request
*/
final case class DoorMessage(player: Player, msg: UseItemMessage, response: Exchange)
/**
* This door will open.
*/
final case class OpenEvent() extends Exchange
/**
* This door will close.
*/
final case class CloseEvent() extends Exchange
/**
* This door will do nothing.
*/
final case class NoEvent() extends Exchange
type LockingMechanismLogic = (PlanetSideServerObject, Door) => Boolean
final case class UpdateMechanism(mechanism: LockingMechanismLogic) extends Exchange
case object Lock extends Exchange
case object Unlock extends Exchange
/**
* Overloaded constructor.
* @param tdef the `ObjectDefinition` that constructs this object and maintains some of its immutable fields

View file

@ -8,7 +8,9 @@ import net.psforever.objects.serverobject.affinity.{FactionAffinity, FactionAffi
import net.psforever.objects.serverobject.locks.IFFLock
import net.psforever.objects.serverobject.structures.PoweredAmenityControl
import net.psforever.services.Service
import net.psforever.services.local.{LocalAction, LocalServiceMessage, LocalServiceResponse}
import net.psforever.services.base.support.SupportActor
import net.psforever.services.local.support.DoorCloseActor
import net.psforever.services.local.{DoorMessage, LocalAction, LocalServiceResponse}
/**
* An `Actor` that handles messages being dispatched to a specific `Door`.
@ -19,24 +21,21 @@ class DoorControl(door: Door)
with FactionAffinityBehavior.Check {
def FactionObject: FactionAffinity = door
private var isLocked: Boolean = false
private var lockingMechanism: Door.LockingMechanismLogic = DoorControl.alwaysOpen
def commonBehavior: Receive = checkBehavior
.orElse {
case Door.Lock =>
isLocked = true
case Door.UpdateMechanism(logic) =>
lockingMechanism = logic
if (door.isOpen) {
val zone = door.Zone
door.Open = None
zone.LocalEvents ! LocalServiceMessage(zone.id, LocalAction.DoorSlamsShut(door))
zone.LocalEvents ! DoorMessage(
zone.id,
LocalAction.DoorCloses(door.GUID),
SupportActor.ClearSpecific(List(door), zone)
)
}
case Door.Unlock =>
isLocked = false
case Door.UpdateMechanism(logic) =>
lockingMechanism = logic
}
def poweredStateLogic: Receive =
@ -48,7 +47,7 @@ class DoorControl(door: Door)
case CommonMessages.Use(player, _) =>
testToOpenDoor(player, door, door.Definition.initialOpeningDistance, sender())
case IFFLock.DoorOpenResponse(target: Player) if !isLocked =>
case IFFLock.DoorOpenResponse(target: Player) =>
DoorControl.openDoor(target, door)
case _ => ()
@ -57,7 +56,7 @@ class DoorControl(door: Door)
def unpoweredStateLogic: Receive = {
commonBehavior
.orElse {
case CommonMessages.Use(player, _) if !isLocked =>
case CommonMessages.Use(player, _) =>
//without power, the door opens freely
DoorControl.openDoor(player, door)
@ -83,7 +82,7 @@ class DoorControl(door: Door)
): Unit = {
if (
Doors.testForSpecificTargetHoldingDoorOpen(player, door, maximumDistance * maximumDistance).contains(player) &&
lockingMechanism(player, door) && !isLocked
lockingMechanism(player, door)
) {
DoorControl.openDoor(player, door, replyTo)
}
@ -110,9 +109,10 @@ object DoorControl {
if (!door.isOpen) {
//global open
door.Open = player
zone.LocalEvents ! LocalServiceMessage(
zone.LocalEvents ! DoorMessage(
zone.id,
LocalAction.DoorOpens(zone, door)
LocalAction.DoorOpens(zone, door),
DoorCloseActor.DoorIsOpen(door, zone, System.currentTimeMillis())
)
} else {
//the door should already open, but the requesting player does not see it as open

View file

@ -13,7 +13,8 @@ import net.psforever.objects.vital.interaction.DamageResult
import net.psforever.objects.zones.Zone
import net.psforever.packet.game.TriggerEffectMessage
import net.psforever.types.{PlanetSideGeneratorState, Vector3}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.SendResponse
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
@ -112,7 +113,7 @@ class GeneratorControl(gen: Generator)
//kaboom
zone.AvatarEvents ! AvatarServiceMessage(
zone.id,
AvatarAction.SendResponse(TriggerEffectMessage(gen.GUID, "explosion_generator", None, None))
SendResponse(TriggerEffectMessage(gen.GUID, "explosion_generator", None, None))
)
queuedExplosion.cancel()
queuedExplosion = Default.Cancellable

View file

@ -11,9 +11,10 @@ import net.psforever.objects.serverobject.{CommonMessages, PlanetSideServerObjec
import net.psforever.objects.zones.blockmap.BlockMapEntity
import net.psforever.packet.game.{GenericObjectActionMessage, HackMessage, HackState, HackState1, HackState7, TriggeredSound}
import net.psforever.types.{PlanetSideEmpire, PlanetSideGUID}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.local.support.HackClearActor
import net.psforever.services.local.{ClearMessage, HackEntityMessage, LocalAction, LocalServiceMessage}
import net.psforever.services.local.{HackClearMessage, HackEntityMessage, LocalAction, LocalServiceMessage}
import scala.annotation.unused
import scala.util.{Failure, Success}
@ -90,7 +91,7 @@ object GenericHackables {
}
target.Zone.AvatarEvents ! AvatarServiceMessage(
hacker.Name,
AvatarAction.SendResponse(
SendResponse(
HackMessage(progressType, target.GUID, hacker.GUID, progressGrade, 0L, progressState, HackState7.Unk8)
)
)
@ -179,7 +180,7 @@ object GenericHackables {
zone.LocalEvents ! HackEntityMessage(
zoneId,
pguid,
LocalAction.HackTemporarily(zone, target, hackValue, hackClearValue, duration),
LocalAction.HackObject(target.GUID, hackValue, HackState7.Unk8),
HackClearActor.ObjectIsHacked(target, zone, hackClearValue, HackState7.Unk8, duration)
)
case Failure(_) =>
@ -205,19 +206,19 @@ object GenericHackables {
val currVirus = building.virusId
building.virusId = 8
building.virusInstalledBy = None
zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(target))
zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(target))
zone.LocalEvents ! LocalServiceMessage(
zone.id,
LocalAction.SendResponse(GenericObjectActionMessage(target.GUID, 60))
SendResponse(GenericObjectActionMessage(target.GUID, 60))
)
currVirus match {
case 0L =>
building.HackableAmenities.filter(d => d.Definition == GlobalDefinitions.lock_external).foreach { iff =>
zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(iff))
zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(iff))
}
case 4L =>
building.HackableAmenities.filter(d => d.Definition == GlobalDefinitions.order_terminal).foreach { term =>
zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(term))
zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(term))
}
case _ => ()
}
@ -231,13 +232,13 @@ object GenericHackables {
case 0L =>
if (virus != 0) {
building.HackableAmenities.filter(d => d.Definition == GlobalDefinitions.lock_external).foreach { iff =>
zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(iff))
zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(iff))
}
}
case 4L =>
if (virus != 4) {
building.HackableAmenities.filter(d => d.Definition == GlobalDefinitions.order_terminal).foreach { term =>
zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(term))
zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(term))
}
}
case _ => ()
@ -268,16 +269,16 @@ object GenericHackables {
zone.LocalEvents ! HackEntityMessage(
zoneId,
pguid,
LocalAction.HackTemporarily(zone, target, installedVirusDuration, hackClearValue, installedVirusDuration, unk2=hackState),
LocalAction.HackObject(target.GUID, installedVirusDuration.toLong, hackState),
HackClearActor.ObjectIsHacked(target, zone, hackClearValue, hackState, installedVirusDuration)
)
zone.LocalEvents ! LocalServiceMessage(
zone.id,
LocalAction.SendResponse(GenericObjectActionMessage(target.GUID, 61))
SendResponse(GenericObjectActionMessage(target.GUID, 61))
)
zone.LocalEvents ! LocalServiceMessage(
zone.id,
LocalAction.SendResponse(GenericObjectActionMessage(target.GUID, 58))
SendResponse(GenericObjectActionMessage(target.GUID, 58))
)
//amenities if applicable
virus match {
@ -287,7 +288,7 @@ object GenericHackables {
zone.LocalEvents ! HackEntityMessage(
zoneId,
pguid,
LocalAction.HackTemporarily(zone, iff, hackValue, hackClearValue, installedVirusDuration),
LocalAction.HackObject(target.GUID, hackValue.toLong, HackState7.Unk8),
HackClearActor.ObjectIsHacked(target, zone, hackClearValue, HackState7.Unk8, installedVirusDuration)
)
}
@ -297,7 +298,7 @@ object GenericHackables {
zone.LocalEvents ! HackEntityMessage(
zoneId,
pguid,
LocalAction.HackTemporarily(zone, term, hackValue, hackClearValue, installedVirusDuration),
LocalAction.HackObject(term.GUID, hackValue.toLong, HackState7.Unk8),
HackClearActor.ObjectIsHacked(target, zone, hackClearValue, HackState7.Unk8, installedVirusDuration)
)
}

View file

@ -2,7 +2,7 @@
package net.psforever.objects.serverobject.locks
import net.psforever.services.local.support.HackClearActor
import net.psforever.services.local.ClearMessage
import net.psforever.services.local.HackClearMessage
object IFFLocks {
@ -14,6 +14,6 @@ object IFFLocks {
*/
def FinishResecuringIFFLock(lock: IFFLock)(): Unit = {
val zone = lock.Zone
lock.Zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(lock))
lock.Zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(lock))
}
}

View file

@ -5,7 +5,7 @@ import net.psforever.objects.serverobject.interior.Sidedness
import net.psforever.objects.{Player, Vehicle}
import net.psforever.objects.serverobject.structures.Amenity
import net.psforever.objects.serverobject.terminals.Terminal
import net.psforever.services.base.SelfResponseMessage
import net.psforever.services.base.SelfRespondingEvent
import net.psforever.types.PlanetSideGUID
/**
@ -39,14 +39,14 @@ object VehicleSpawnPad {
* @see `GenericObjectActionMessage`
* @param player_guid the player
*/
final case class ConcealPlayer(player_guid: PlanetSideGUID) extends SelfResponseMessage
final case class ConcealPlayer(player_guid: PlanetSideGUID) extends SelfRespondingEvent
/**
* Message is intended to undo the effects of the above message, `ConcealPlayer`.
* @see `ConcealPlayer`
* @param player_guid the player
*/
final case class RevealPlayer(player_guid: PlanetSideGUID) extends SelfResponseMessage
final case class RevealPlayer(player_guid: PlanetSideGUID) extends SelfRespondingEvent
/**
* Message to attach the vehicle to the spawn pad's lifting platform ("put on rails").
@ -55,7 +55,7 @@ object VehicleSpawnPad {
* @param vehicle the vehicle being spawned
* @param pad the spawn pad
*/
final case class AttachToRails(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfResponseMessage
final case class AttachToRails(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfRespondingEvent
/**
* Message to detach the vehicle from the spawn pad's lifting platform ("put on rails").
@ -63,14 +63,14 @@ object VehicleSpawnPad {
* @param vehicle the vehicle being spawned
* @param pad the spawn pad
*/
final case class DetachFromRails(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfResponseMessage
final case class DetachFromRails(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfRespondingEvent
/**
* Message that resets the spawn pad for its next order fulfillment operation by lowering the lifting platform.
* @see `GenericObjectActionMessage`
* @param pad the spawn pad
*/
final case class ResetSpawnPad(pad: VehicleSpawnPad) extends SelfResponseMessage
final case class ResetSpawnPad(pad: VehicleSpawnPad) extends SelfRespondingEvent
/**
* Message that acts as callback to the driver that the process of sitting in the driver mount will be initiated soon.
@ -78,7 +78,7 @@ object VehicleSpawnPad {
* @param vehicle the vehicle being spawned
* @param pad the spawn pad
*/
final case class StartPlayerSeatedInVehicle(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfResponseMessage
final case class StartPlayerSeatedInVehicle(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfRespondingEvent
/**
* Message that acts as callback to the driver that the process of sitting in the driver mount should be finished.
@ -87,7 +87,7 @@ object VehicleSpawnPad {
* @param pad the spawn pad
*/
//TODO while using fake rails (later edit: what does this mean?)
final case class PlayerSeatedInVehicle(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfResponseMessage
final case class PlayerSeatedInVehicle(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfRespondingEvent
/**
* Message that starts the newly-spawned vehicle to begin driving away from the spawn pad.
@ -97,7 +97,7 @@ object VehicleSpawnPad {
* @param vehicle the vehicle
* @param pad the spawn pad
*/
final case class ServerVehicleOverrideStart(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfResponseMessage
final case class ServerVehicleOverrideStart(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfRespondingEvent
/**
* Message that transitions the newly-spawned vehicle into a cancellable auto-drive state.
@ -107,20 +107,20 @@ object VehicleSpawnPad {
* @param vehicle the vehicle
* @param pad the spawn pad
*/
final case class ServerVehicleOverrideEnd(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfResponseMessage
final case class ServerVehicleOverrideEnd(vehicle: Vehicle, pad: VehicleSpawnPad) extends SelfRespondingEvent
/**
* Message to initiate the process of properly disposing of the vehicle that may have been or was spawned into the game world.
* @param vehicle the vehicle
*/
final case class DisposeVehicle(vehicle: Vehicle) extends SelfResponseMessage
final case class DisposeVehicle(vehicle: Vehicle) extends SelfRespondingEvent
/**
* Message to send targeted messages to the clients of specific users.
* @param reason the nature of the message
* @param data optional information for rendering the message to the client
*/
final case class PeriodicReminder(reason: Reminders.Value, data: Option[Any] = None) extends SelfResponseMessage
final case class PeriodicReminder(reason: Reminders.Value, data: Option[Any] = None) extends SelfRespondingEvent
/**
* An `Enumeration` of reasons for sending a periodic reminder to the user.

View file

@ -9,6 +9,7 @@ import net.psforever.objects.{Player, Tool}
import net.psforever.packet.game.{ChatMsg, InventoryStateMessage, RepairMessage}
import net.psforever.types.{ChatMessageType, PlanetSideEmpire, Vector3}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.SendResponse
/**
* The "control" `Actor` mixin for repair-handling code,
@ -67,7 +68,7 @@ trait RepairableEntity extends Repairable {
* Restore the target entity to a not destroyed state if applicable.
* Always show the repair progress bar window by using the appropriate packet.
* @see `AvatarAction.PlanetsideAttributeToAll`
* @see `AvatarAction.SendResponse`
* @see `SendResponse`
* @see `AvatarService`
* @see `InventoryStateMessage`
* @see `PlanetSideGameObject.isMoving`
@ -90,7 +91,7 @@ trait RepairableEntity extends Repairable {
val magazine = item.Discharge()
events ! AvatarServiceMessage(
player.Name,
AvatarAction.SendResponse(InventoryStateMessage(item.AmmoSlot.Box.GUID, item.GUID, magazine.toLong))
SendResponse(InventoryStateMessage(item.AmmoSlot.Box.GUID, item.GUID, magazine.toLong))
)
target.LogActivity(
RepairFromEquipment(
@ -106,7 +107,7 @@ trait RepairableEntity extends Repairable {
//progress bar remains visible
events ! AvatarServiceMessage(
name,
AvatarAction.SendResponse(RepairMessage(target.GUID, updatedHealth * 100 / definition.MaxHealth))
SendResponse(RepairMessage(target.GUID, updatedHealth * 100 / definition.MaxHealth))
)
//if vehicle and vehicle is owned by another player, send repair chat message to the vehicle's owner
if (target.Zone.Vehicles.exists(_.GUID == target.GUID)) {

View file

@ -12,7 +12,8 @@ import net.psforever.objects.{GlobalDefinitions, Ntu, NtuContainer, NtuStorageBe
import net.psforever.types.{ExperienceType, PlanetSideEmpire}
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.services.vehicle.VehicleServiceMessage
import net.psforever.util.Config
import scala.concurrent.ExecutionContext.Implicits.global
@ -109,7 +110,7 @@ class ResourceSiloControl(resourceSilo: ResourceSilo)
building.Zone.AvatarEvents ! AvatarServiceMessage(
zone.id,
building.GUID,
AvatarAction.PlanetsideAttribute(47, if (resourceSilo.LowNtuWarningOn) 1 else 0)
PlanetsideAttribute(building.GUID, 47, if (resourceSilo.LowNtuWarningOn) 1 else 0)
)
}
@ -133,7 +134,7 @@ class ResourceSiloControl(resourceSilo: ResourceSilo)
zone.AvatarEvents ! AvatarServiceMessage(
zone.id,
resourceSilo.GUID,
AvatarAction.PlanetsideAttribute(45, resourceSilo.CapacitorDisplay)
PlanetsideAttribute(resourceSilo.GUID, 45, resourceSilo.CapacitorDisplay)
)
building.Actor ! BuildingActor.MapUpdate()
}
@ -233,7 +234,7 @@ class ResourceSiloControl(resourceSilo: ResourceSilo)
val zone = resourceSilo.Zone
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(resourceSilo.GUID, 49, 1)
PlanetsideAttribute(resourceSilo.GUID, 49, 1)
)
math.min(resourceSilo.MaxNtuCapacitor - currentlyHas, trigger)
} else if (trigger < 0) {
@ -244,7 +245,7 @@ class ResourceSiloControl(resourceSilo: ResourceSilo)
val zone = resourceSilo.Zone
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(resourceSilo.GUID, 49, 0)
PlanetsideAttribute(resourceSilo.GUID, 49, 0)
)
0
}) * 0.9f

View file

@ -8,8 +8,10 @@ import net.psforever.objects.serverobject.PlanetSideServerObject
import net.psforever.objects.serverobject.doors.Door
import net.psforever.objects.zones.Zone
import net.psforever.packet.game.ChatMsg
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.base.support.SupportActor
import net.psforever.services.local.{DoorMessage, LocalAction}
import net.psforever.services.hart.{HartTimer, HartTimerActions}
import net.psforever.services.{Service, ServiceManager}
import net.psforever.types.ChatMessageType
@ -48,8 +50,13 @@ class OrbitalShuttlePadControl(pad: OrbitalShuttlePad) extends Actor {
managedDoors.foreach { door =>
door.Actor ! Door.UpdateMechanism(OrbitalShuttlePadControl.lockedWaitingForShuttle)
val zone = pad.Zone
if(door.isOpen) {
zone.LocalEvents ! LocalServiceMessage(zone.id, LocalAction.DoorSlamsShut(door))
if (door.isOpen) {
door.Open = None
zone.LocalEvents ! DoorMessage(
zone.id,
LocalAction.DoorCloses(door.GUID),
SupportActor.ClearSpecific(List(door), zone)
)
}
}
@ -175,7 +182,7 @@ object OrbitalShuttlePadControl {
* Logic for door mechanism that keeps select doors shut when the shuttle is not ready for boarding.
* A message flashes onscreen to explain this reason.
* The message will not flash if the door has no expectation of ever opening for a user.
* @see `AvatarAction.SendResponse`
* @see `SendResponse`
* @see `AvatarServiceMessage`
* @see `ChatMessageType`
* @see `ChatMsg`
@ -192,12 +199,12 @@ object OrbitalShuttlePadControl {
case p: Player if p.Faction == door.Faction =>
zone.AvatarEvents ! AvatarServiceMessage(
p.Name,
AvatarAction.SendResponse(
SendResponse(
ChatMsg(ChatMessageType.UNK_225, wideContents=false, "", "@DoorWillOpenWhenShuttleReturns", None)
)
)
p.Name
case _ => ;
case _ => ()
}
false
}

View file

@ -4,6 +4,7 @@ package net.psforever.objects.serverobject.structures.participation
import net.psforever.objects.Player
import net.psforever.objects.avatar.scoring.Kill
import net.psforever.objects.sourcing.UniquePlayer
import net.psforever.services.base.messages.GenericObjectAction
import net.psforever.types.{PlanetSideEmpire, Vector3}
import scala.collection.mutable
@ -106,10 +107,10 @@ trait FacilityHackParticipation extends ParticipationLogic {
if (building.virusId != 8) {
import net.psforever.objects.serverobject.terminals.Terminal
import net.psforever.objects.GlobalDefinitions
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
val mainTerm = building.Amenities.filter(x => x.isInstanceOf[Terminal] && x.Definition == GlobalDefinitions.main_terminal).head.GUID
val msg1 = AvatarAction.GenericObjectAction(mainTerm, 61)
val msg2 = AvatarAction.GenericObjectAction(mainTerm, 58)
val msg1 = GenericObjectAction(mainTerm, 61)
val msg2 = GenericObjectAction(mainTerm, 58)
val events = building.Zone.AvatarEvents
list.foreach { p =>
events ! AvatarServiceMessage(p.Name, msg1)

View file

@ -15,7 +15,8 @@ import net.psforever.objects.avatar.scoring.Kill
import net.psforever.objects.serverobject.hackable.Hackable
import net.psforever.objects.zones.exp.ToDatabase
import net.psforever.packet.game.ChatMsg
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.local.LocalServiceMessage
import scala.collection.mutable
import scala.concurrent.duration._
@ -438,7 +439,7 @@ object MajorFacilityHackParticipation {
msg: ChatMsg
): Unit = {
val events = building.Zone.LocalEvents
val message = LocalAction.SendResponse(msg)
val message = SendResponse(msg)
targets.foreach { player =>
events ! LocalServiceMessage(player.Name, message)
}

View file

@ -6,7 +6,8 @@ import net.psforever.objects.serverobject.damage.Damageable
import net.psforever.objects.sourcing.AmenitySource
import net.psforever.objects.vital.interaction.DamageResult
import net.psforever.packet.game.HackState1
import net.psforever.services.local.ClearMessage
import net.psforever.services.base.messages.{PlanetsideAttribute, SendResponse}
import net.psforever.services.local.HackClearMessage
import net.psforever.services.local.support.HackClearActor
import org.log4s.Logger
@ -28,7 +29,7 @@ import net.psforever.objects.zones.ZoneAware
import net.psforever.packet.game.InventoryStateMessage
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.vehicle.VehicleServiceMessage
/**
* An `Actor` that handles messages being dispatched to a specific `ProximityTerminal`.
@ -148,7 +149,7 @@ class ProximityTerminalControl(term: Terminal with ProximityUnit)
tryAutoRepair()
if (term.HackedBy.nonEmpty) {
val zone = term.Zone
zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(term))
zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(term))
}
super.DestructionAwareness(target, cause)
}
@ -225,7 +226,7 @@ class ProximityTerminalControl(term: Terminal with ProximityUnit)
//clear hack state
if (term.HackedBy.nonEmpty) {
val zone = term.Zone
zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(term))
zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(term))
}
}
@ -378,7 +379,7 @@ object ProximityTerminalControl {
val zone = target.Zone
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(target.GUID, 0, target.Health)
PlanetsideAttribute(target.GUID, 0, target.Health)
)
}
@ -439,7 +440,7 @@ object ProximityTerminalControl {
slots.foreach { slot =>
events ! AvatarServiceMessage(
channel,
AvatarAction.SendResponse(InventoryStateMessage(slot.Box.GUID, weapon.GUID, slot.Box.Capacity))
SendResponse(InventoryStateMessage(slot.Box.GUID, weapon.GUID, slot.Box.Capacity))
)
}
}
@ -465,7 +466,7 @@ object ProximityTerminalControl {
slots.foreach { slot =>
events ! VehicleServiceMessage(
channel,
VehicleAction.SendResponse(InventoryStateMessage(slot.Box.GUID, weapon.GUID, slot.Box.Capacity))
SendResponse(InventoryStateMessage(slot.Box.GUID, weapon.GUID, slot.Box.Capacity))
)
}
}

View file

@ -13,7 +13,7 @@ import net.psforever.objects.serverobject.structures.{Building, PoweredAmenityCo
import net.psforever.objects.vital.interaction.DamageResult
import net.psforever.packet.game.HackState1
import net.psforever.services.local.support.HackClearActor
import net.psforever.services.local.ClearMessage
import net.psforever.services.local.HackClearMessage
/**
* An `Actor` that handles messages being dispatched to a specific `Terminal`.
@ -100,7 +100,7 @@ class TerminalControl(term: Terminal)
tryAutoRepair()
if (term.HackedBy.nonEmpty) {
val zone = term.Zone
zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(term))
zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(term))
}
super.DestructionAwareness(target, cause)
}
@ -122,7 +122,7 @@ class TerminalControl(term: Terminal)
//clear hack state
if (term.HackedBy.nonEmpty) {
val zone = term.Zone
zone.LocalEvents ! ClearMessage(HackClearActor.ObjectIsResecured(term))
zone.LocalEvents ! HackClearMessage(HackClearActor.ObjectIsResecured(term))
}
}

View file

@ -16,7 +16,8 @@ import net.psforever.objects.vital.interaction.DamageResult
import net.psforever.objects.zones.Zone
import net.psforever.objects.{GlobalDefinitions, Player, SimpleItem}
import net.psforever.packet.game.HackState1
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.base.messages.SetEmpire
import net.psforever.services.local.LocalServiceMessage
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.types.{PlanetSideEmpire, PlanetSideGUID}
@ -173,7 +174,7 @@ class ImplantTerminalMechControl(mech: ImplantTerminalMech)
if (player.Faction == localFaction) {
if (mech.Owner.asInstanceOf[Building].CaptureTerminalIsHacked) {
//this is actually futile, as a hacked base does not grant access to the terminal
events ! LocalServiceMessage(localFaction.toString, LocalAction.SetEmpire(guid, localFaction))
events ! LocalServiceMessage(localFaction.toString, SetEmpire(guid, localFaction))
}
kickAllOccupantsNotOfFaction(zone, guid, mech, localFaction)
} else {
@ -225,7 +226,7 @@ class ImplantTerminalMechControl(mech: ImplantTerminalMech)
): Unit = {
val events = zone.LocalEvents
opposingFactionsAre(setToFaction).foreach { faction =>
events ! LocalServiceMessage(faction.toString, LocalAction.SetEmpire(guid, faction))
events ! LocalServiceMessage(faction.toString, SetEmpire(guid, faction))
}
}
@ -236,7 +237,7 @@ class ImplantTerminalMechControl(mech: ImplantTerminalMech)
): Unit = {
val events = zone.LocalEvents
opposingFactionsAre(setToFaction).foreach { faction =>
events ! LocalServiceMessage(faction.toString, LocalAction.SetEmpire(guid, setToFaction))
events ! LocalServiceMessage(faction.toString, SetEmpire(guid, setToFaction))
}
}

View file

@ -13,6 +13,7 @@ import net.psforever.objects.serverobject.turret.auto.AutomatedTurret.Target
import net.psforever.objects.serverobject.turret.auto.{AffectedByAutomaticTurretFire, AutomatedTurret, AutomatedTurretBehavior}
import net.psforever.objects.vital.interaction.DamageResult
import net.psforever.packet.game.{ChangeFireModeMessage, HackState1}
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.vehicle.support.TurretUpgrader
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.types.{BailType, PlanetSideEmpire, PlanetSideGUID}
@ -238,7 +239,7 @@ class FacilityTurretControl(turret: FacilityTurret)
weapon.FireModeIndex = 0
events ! VehicleServiceMessage(
zoneid,
VehicleAction.SendResponse(ChangeFireModeMessage(weapon.GUID, 0))
SendResponse(ChangeFireModeMessage(weapon.GUID, 0))
)
}
}

View file

@ -5,7 +5,8 @@ import net.psforever.objects.avatar.Certification
import net.psforever.objects.ce.Deployable
import net.psforever.objects.{Player, Tool, TurretDeployable}
import net.psforever.packet.game.{HackMessage, HackState, HackState1, HackState7, InventoryStateMessage}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.{SendResponse, SetEmpire}
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.vehicle.support.TurretUpgrader
import net.psforever.services.vehicle.{TurretMessage, VehicleAction, VehicleServiceMessage}
@ -32,7 +33,7 @@ object WeaponTurrets {
tool.Magazine = 0
target.Zone.AvatarEvents ! AvatarServiceMessage(
user.Name,
AvatarAction.SendResponse(InventoryStateMessage(tool.AmmoSlot.Box.GUID, tool.GUID, 0))
SendResponse(InventoryStateMessage(tool.AmmoSlot.Box.GUID, tool.GUID, 0))
)
FinishUpgradingMannedTurret(target, upgrade)
}
@ -86,7 +87,7 @@ object WeaponTurrets {
}
turret.Zone.AvatarEvents ! AvatarServiceMessage(
tplayer.Name,
AvatarAction.SendResponse(
SendResponse(
HackMessage(progressType, turret.GUID, tplayer.GUID, progressGrade, -1f, progressState, HackState7.Unk8)
)
)
@ -117,7 +118,7 @@ object WeaponTurrets {
//convert faction
zone.AvatarEvents ! AvatarServiceMessage(
zone.id,
AvatarAction.SetEmpire(target.GUID, hacker.Faction)
SetEmpire(target.GUID, hacker.Faction)
)
zone.LocalEvents ! LocalServiceMessage(
zone.id,

View file

@ -18,7 +18,8 @@ import net.psforever.objects.zones.interaction.InteractsWithZone
import net.psforever.objects.{Default, PlanetSideGameObject, Player}
import net.psforever.packet.game.{ChangeFireStateMessage_Start, ChangeFireStateMessage_Stop, ObjectDetectedMessage}
import net.psforever.services.Service
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.local.LocalServiceMessage
import net.psforever.types.{PlanetSideGUID, Vector3}
import scala.concurrent.ExecutionContext.Implicits.global
@ -891,7 +892,7 @@ object AutomatedTurretBehavior {
def startTracking(zone: Zone, channel: String, turretGuid: PlanetSideGUID, list: List[PlanetSideGUID]): Unit = {
zone.LocalEvents ! LocalServiceMessage(
channel,
LocalAction.SendResponse(ObjectDetectedMessage(turretGuid, turretGuid, 0, list))
SendResponse(ObjectDetectedMessage(turretGuid, turretGuid, 0, list))
)
}
@ -904,7 +905,7 @@ object AutomatedTurretBehavior {
def stopTracking(zone: Zone, channel: String, turretGuid: PlanetSideGUID): Unit = {
zone.LocalEvents ! LocalServiceMessage(
channel,
LocalAction.SendResponse(ObjectDetectedMessage(turretGuid, turretGuid, 0, noTargets))
SendResponse(ObjectDetectedMessage(turretGuid, turretGuid, 0, noTargets))
)
}
@ -917,7 +918,7 @@ object AutomatedTurretBehavior {
def startShooting(zone: Zone, channel: String, weaponGuid: PlanetSideGUID): Unit = {
zone.LocalEvents ! LocalServiceMessage(
channel,
LocalAction.SendResponse(ChangeFireStateMessage_Start(weaponGuid))
SendResponse(ChangeFireStateMessage_Start(weaponGuid))
)
}
@ -930,7 +931,7 @@ object AutomatedTurretBehavior {
def stopShooting(zone: Zone, channel: String, weaponGuid: PlanetSideGUID): Unit = {
zone.LocalEvents ! LocalServiceMessage(
channel,
LocalAction.SendResponse(ChangeFireStateMessage_Stop(weaponGuid))
SendResponse(ChangeFireStateMessage_Stop(weaponGuid))
)
}

View file

@ -10,9 +10,10 @@ import net.psforever.objects.serverobject.structures.WarpGate
import net.psforever.objects.serverobject.transfer.{TransferBehavior, TransferContainer}
import net.psforever.objects.{NtuContainer, _}
import net.psforever.types.DriveState
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.vehicle.VehicleServiceMessage
import akka.actor.typed.scaladsl.adapter._
import net.psforever.objects.serverobject.transfer.TransferContainer.TransferMaterial
import net.psforever.services.base.messages.PlanetsideAttribute
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
@ -34,7 +35,7 @@ trait AntTransferBehavior extends TransferBehavior with NtuStorageBehavior {
val zone = obj.Zone
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(vehicle.GUID, 52, 1L)
PlanetsideAttribute(vehicle.GUID, 52, 1L)
) // panel glow on
}
@ -44,7 +45,7 @@ trait AntTransferBehavior extends TransferBehavior with NtuStorageBehavior {
val zone = obj.Zone
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(vehicle.GUID, 49, 1L)
PlanetsideAttribute(vehicle.GUID, 49, 1L)
) // orb particle effect on
}
@ -53,7 +54,7 @@ trait AntTransferBehavior extends TransferBehavior with NtuStorageBehavior {
val display = vehicle.NtuCapacitorScaled.toLong
vehicle.Zone.VehicleEvents ! VehicleServiceMessage(
vehicle.Actor.toString,
VehicleAction.PlanetsideAttribute(vehicle.GUID, 45, display)
PlanetsideAttribute(vehicle.GUID, 45, display)
)
}
}
@ -159,16 +160,16 @@ trait AntTransferBehavior extends TransferBehavior with NtuStorageBehavior {
if (transferEvent == TransferBehavior.Event.Charging) {
events ! VehicleServiceMessage(
zoneId,
VehicleAction.PlanetsideAttribute(vguid, 52, 0L)
PlanetsideAttribute(vguid, 52, 0L)
) // panel glow off
events ! VehicleServiceMessage(
zoneId,
VehicleAction.PlanetsideAttribute(vguid, 49, 0L)
PlanetsideAttribute(vguid, 49, 0L)
) // orb particle effect off
} else if (transferEvent == TransferBehavior.Event.Discharging) {
events ! VehicleServiceMessage(
zoneId,
VehicleAction.PlanetsideAttribute(vguid, 52, 0L)
PlanetsideAttribute(vguid, 52, 0L)
) // panel glow off
}
}

View file

@ -9,8 +9,9 @@ import net.psforever.objects.sourcing.VehicleSource
import net.psforever.objects.vital.VehicleCargoMountActivity
import net.psforever.packet.game.{CargoMountPointStatusMessage, ObjectAttachMessage, ObjectDetachMessage, PlanetsideAttributeMessage}
import net.psforever.types.{BailType, CargoStatus, PlanetSideGUID, Vector3}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.Service
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import scala.concurrent.duration._
@ -60,7 +61,7 @@ trait CarrierBehavior {
//open the cargo bay door
obj.Zone.AvatarEvents ! AvatarServiceMessage(
obj.Zone.id,
AvatarAction.SendResponse(
SendResponse(
CargoMountPointStatusMessage(
obj.GUID,
PlanetSideGUID(0),
@ -205,14 +206,10 @@ object CarrierBehavior {
log.debug(s"HandleCheckCargoMounting: mounting cargo vehicle in carrier at distance of $distance")
CargoMountAction(carrier, cargo, hold, carrierGUID)
cargo.Velocity = None
zone.VehicleEvents ! VehicleServiceMessage(
s"${cargo.Actor}",
VehicleAction.SendResponse(PlanetsideAttributeMessage(cargoGUID, 0, cargo.Health))
)
zone.VehicleEvents ! VehicleServiceMessage(
s"${cargo.Actor}",
VehicleAction.SendResponse(PlanetsideAttributeMessage(cargoGUID, cargo.Definition.shieldUiAttribute, cargo.Shields))
)
zone.VehicleEvents ! VehicleServiceMessage(s"${cargo.Actor}", SendResponse(Seq(
PlanetsideAttributeMessage(cargoGUID, 0, cargo.Health),
PlanetsideAttributeMessage(cargoGUID, cargo.Definition.shieldUiAttribute, cargo.Shields)
)))
CargoMountBehaviorForAll(carrier, cargo, mountPoint)
zone.actor ! ZoneActor.RemoveFromBlockMap(cargo)
false
@ -226,7 +223,7 @@ object CarrierBehavior {
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
cargoDriverGUID,
VehicleAction.SendResponse(CargoMountPointStatusMessage(
SendResponse(CargoMountPointStatusMessage(
carrierGUID,
PlanetSideGUID(0),
PlanetSideGUID(0),
@ -326,7 +323,7 @@ object CarrierBehavior {
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
cargoDriverGUID,
VehicleAction.SendResponse(CargoMountPointStatusMessage(
SendResponse(CargoMountPointStatusMessage(
carrierGUID,
PlanetSideGUID(0),
PlanetSideGUID(0),
@ -447,14 +444,10 @@ object CarrierBehavior {
val zoneId = zone.id
val events = zone.VehicleEvents
val cargoActor = cargo.Actor
events ! VehicleServiceMessage(
s"$cargoActor",
VehicleAction.SendResponse(PlanetsideAttributeMessage(cargoGUID, 0, cargo.Health))
)
events ! VehicleServiceMessage(
s"$cargoActor",
VehicleAction.SendResponse(PlanetsideAttributeMessage(cargoGUID, cargo.Definition.shieldUiAttribute, cargo.Shields))
)
events ! VehicleServiceMessage(s"$cargoActor", SendResponse(Seq(
PlanetsideAttributeMessage(cargoGUID, 0, cargo.Health),
PlanetsideAttributeMessage(cargoGUID, cargo.Definition.shieldUiAttribute, cargo.Shields)
)))
zone.actor ! ZoneActor.AddToBlockMap(cargo, carrier.Position)
if (carrier.isFlying) {
//the carrier vehicle is flying; eject the cargo vehicle
@ -463,9 +456,7 @@ object CarrierBehavior {
val detachCargoMsg = ObjectDetachMessage(carrierGUID, cargoGUID, cargoHoldPosition - Vector3.z(1), rotation)
val resetCargoMsg =
CargoMountPointStatusMessage(carrierGUID, GUID0, GUID0, cargoGUID, mountPoint, CargoStatus.Empty, 0)
events ! VehicleServiceMessage(zoneId, VehicleAction.SendResponse(ejectCargoMsg))
events ! VehicleServiceMessage(zoneId, VehicleAction.SendResponse(detachCargoMsg))
events ! VehicleServiceMessage(zoneId, VehicleAction.SendResponse(resetCargoMsg))
events ! VehicleServiceMessage(zoneId, SendResponse(Seq(ejectCargoMsg, detachCargoMsg, resetCargoMsg)))
log.debug(s"HandleVehicleCargoDismount: eject - $ejectCargoMsg, detach - $detachCargoMsg")
if (driverOpt.isEmpty) {
//TODO cargo should drop like a rock like normal; until then, deconstruct it
@ -478,8 +469,7 @@ object CarrierBehavior {
CargoMountPointStatusMessage(carrierGUID, GUID0, cargoGUID, GUID0, mountPoint, CargoStatus.InProgress, 0)
val cargoDetachMessage =
ObjectDetachMessage(carrierGUID, cargoGUID, cargoHoldPosition + Vector3.z(1f), rotation)
events ! VehicleServiceMessage(zoneId, VehicleAction.SendResponse(cargoStatusMessage))
events ! VehicleServiceMessage(zoneId, VehicleAction.SendResponse(cargoDetachMessage))
events ! VehicleServiceMessage(zoneId, SendResponse(Seq(cargoStatusMessage, cargoDetachMessage)))
driverOpt match {
case Some(driver) =>
events ! VehicleServiceMessage(
@ -489,7 +479,7 @@ object CarrierBehavior {
case None =>
val resetCargoMsg =
CargoMountPointStatusMessage(carrierGUID, GUID0, GUID0, cargoGUID, mountPoint, CargoStatus.Empty, 0)
events ! VehicleServiceMessage(zoneId, VehicleAction.SendResponse(resetCargoMsg)) //lazy
events ! VehicleServiceMessage(zoneId, SendResponse(resetCargoMsg)) //lazy
//TODO cargo should back out like normal; until then, deconstruct it
cargoActor ! Vehicle.Deconstruct()
}
@ -605,8 +595,7 @@ object CarrierBehavior {
attachMessage: ObjectAttachMessage,
mountPointStatusMessage: CargoMountPointStatusMessage
): Unit = {
zone.VehicleEvents ! VehicleServiceMessage(zone.id, exclude, VehicleAction.SendResponse(attachMessage))
zone.VehicleEvents ! VehicleServiceMessage(zone.id, exclude, VehicleAction.SendResponse(mountPointStatusMessage))
zone.VehicleEvents ! VehicleServiceMessage(zone.id, exclude, SendResponse(Seq(attachMessage, mountPointStatusMessage)))
}
/**
@ -626,14 +615,10 @@ object CarrierBehavior {
val zone = carrier.Zone
val zoneId = zone.id
val msgs @ (attachMessage, mountPointStatusMessage) = CargoMountMessages(carrier, cargo, mountPoint)
zone.VehicleEvents ! VehicleServiceMessage(
zoneId,
VehicleAction.SendResponse(attachMessage)
)
zone.VehicleEvents ! VehicleServiceMessage(
zoneId,
VehicleAction.SendResponse(mountPointStatusMessage)
)
zone.VehicleEvents ! VehicleServiceMessage(zoneId, SendResponse(Seq(
attachMessage,
mountPointStatusMessage
)))
msgs
}

View file

@ -2,6 +2,7 @@
package net.psforever.objects.vehicles.control
import net.psforever.objects._
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.types.DriveState
@ -29,7 +30,7 @@ class AmsControl(vehicle: Vehicle)
}
val events = zone.VehicleEvents
events ! VehicleServiceMessage(zone.id, VehicleAction.AMSDeploymentChange(zone))
events ! VehicleServiceMessage(driverChannel, VehicleAction.PlanetsideAttribute(vehicle.GUID, 81, 1))
events ! VehicleServiceMessage(driverChannel, PlanetsideAttribute(vehicle.GUID, 81, 1))
case _ => ;
}
}
@ -49,7 +50,7 @@ class AmsControl(vehicle: Vehicle)
}
val events = zone.VehicleEvents
events ! VehicleServiceMessage(zone.id, VehicleAction.AMSDeploymentChange(zone))
events ! VehicleServiceMessage(driverChannel, VehicleAction.PlanetsideAttribute(vehicle.GUID, 81, 0))
events ! VehicleServiceMessage(driverChannel, PlanetsideAttribute(vehicle.GUID, 81, 0))
case _ => ;
}
}

View file

@ -11,7 +11,8 @@ import net.psforever.objects.vital.prop.DamageWithPosition
import net.psforever.objects.zones.Zone
import net.psforever.packet.game.{TriggerEffectMessage, TriggeredEffectLocation}
import net.psforever.services.Service
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.vehicle.VehicleServiceMessage
import net.psforever.types.PlanetSideGUID
/**
@ -54,7 +55,7 @@ class ApcControl(vehicle: Vehicle)
//cause the emp
events ! VehicleServiceMessage(
zone.id,
VehicleAction.SendResponse(TriggerEffectMessage(
SendResponse(TriggerEffectMessage(
GUID0,
s"apc_explosion_emp_${faction.toString.toLowerCase}",
None,

View file

@ -17,7 +17,8 @@ import net.psforever.objects.vital.interaction.DamageResult
import net.psforever.objects.zones.Zone
import net.psforever.packet.game._
import net.psforever.services.Service
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.base.messages.{GenericObjectAction, PlanetsideAttribute, SendResponse}
import net.psforever.services.vehicle.VehicleServiceMessage
import net.psforever.types._
import scala.annotation.unused
@ -271,7 +272,7 @@ class BfrControl(vehicle: Vehicle)
val zone = vehicle.Zone
zone.VehicleEvents ! VehicleServiceMessage(
s"${zone.id}",
VehicleAction.SendResponse(GenericObjectActionMessage(vehicle.GUID, 45))
SendResponse(GenericObjectActionMessage(vehicle.GUID, 45))
)
}
@ -285,7 +286,7 @@ class BfrControl(vehicle: Vehicle)
val zone = vehicle.Zone
zone.VehicleEvents ! VehicleServiceMessage(
s"${zone.id}",
VehicleAction.SendResponse(GenericObjectActionMessage(vehicle.GUID, 44))
SendResponse(GenericObjectActionMessage(vehicle.GUID, 44))
)
}
@ -336,7 +337,7 @@ class BfrControl(vehicle: Vehicle)
val shields = vehicle.Shields
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
VehicleAction.PlanetsideAttribute(vguid, vehicle.Definition.shieldUiAttribute, shields)
PlanetsideAttribute(vguid, vehicle.Definition.shieldUiAttribute, shields)
)
}
@ -417,7 +418,7 @@ class BfrControl(vehicle: Vehicle)
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
doNotSendTo,
VehicleAction.GenericObjectAction(useThisGuid, action)
GenericObjectAction(useThisGuid, action)
)
case _ => ()
}
@ -566,7 +567,7 @@ class BfrControl(vehicle: Vehicle)
//TODO this is the apc emp effect; is there an ntu siphon emp effect?
events ! VehicleServiceMessage(
zone.id,
VehicleAction.SendResponse(TriggerEffectMessage(
SendResponse(TriggerEffectMessage(
GUID0,
s"apc_explosion_emp_${faction.toString.toLowerCase}",
None,
@ -588,7 +589,7 @@ class BfrControl(vehicle: Vehicle)
//it does not even dispatch the packet before that, making it rare if this precautionary message is seen
events ! VehicleServiceMessage(
obj.Seats(0).occupant.get.Name,
VehicleAction.SendResponse(ChatMsg(ChatMessageType.UNK_225, wideContents = false, "", s"@TimeUntilNextUse^${30000 - elapsedWait}", None))
SendResponse(ChatMsg(ChatMessageType.UNK_225, wideContents = false, "", s"@TimeUntilNextUse^${30000 - elapsedWait}", None))
)
}
case _ => ()

View file

@ -3,7 +3,8 @@ package net.psforever.objects.vehicles.control
import akka.actor.{Actor, Cancellable}
import net.psforever.objects._
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.base.messages.PlanetsideAttribute
import net.psforever.services.vehicle.VehicleServiceMessage
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._
@ -60,7 +61,7 @@ trait VehicleCapacitance {
val obj = CapacitanceObject
obj.Zone.VehicleEvents ! VehicleServiceMessage(
self.toString(),
VehicleAction.PlanetsideAttribute(obj.GUID, 113, obj.Capacitor)
PlanetsideAttribute(obj.GUID, 113, obj.Capacitor)
)
}

View file

@ -36,8 +36,8 @@ import net.psforever.packet.PlanetSideGamePacket
import net.psforever.packet.game._
import net.psforever.packet.game.objectcreate.ObjectCreateMessageParent
import net.psforever.types._
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.{ObjectDelete, PlanetsideAttribute, SendResponse}
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import scala.annotation.unused
@ -204,8 +204,7 @@ class VehicleControl(vehicle: Vehicle)
case Vehicle.UpdateSubsystemStates(toChannel, stateToResolve) =>
val events = vehicle.Zone.VehicleEvents
val guid0 = Service.defaultPlayerGUID
(stateToResolve match {
val pkts = (stateToResolve match {
case Some(state) =>
vehicle.Subsystems().filter { _.Enabled == state } //only subsystems that are enabled or are disabled
case None =>
@ -213,7 +212,7 @@ class VehicleControl(vehicle: Vehicle)
})
.flatMap { _.getMessage(vehicle) }
.foreach { pkt =>
events ! VehicleServiceMessage(toChannel, VehicleAction.SendResponse(pkt))
events ! VehicleServiceMessage(toChannel, SendResponse(pkt))
}
case FactionAffinity.ConvertFactionAffinity(faction) =>
@ -523,7 +522,7 @@ class VehicleControl(vehicle: Vehicle)
case Some(slot) =>
obj.Zone.AvatarEvents ! AvatarServiceMessage(
self.toString,
AvatarAction.SendResponse(ObjectAttachMessage(obj.GUID, item.GUID, slot))
SendResponse(ObjectAttachMessage(obj.GUID, item.GUID, slot))
)
case None => ()
}
@ -550,7 +549,7 @@ class VehicleControl(vehicle: Vehicle)
events ! VehicleServiceMessage(
//TODO when a new weapon, the equipment slot ui goes blank, but the weapon functions; remount vehicle to correct it
if (obj.VisibleSlots.contains(slot)) zone.id else channel,
VehicleAction.SendResponse(OCM.detailed(item, ObjectCreateMessageParent(oguid, slot)))
SendResponse(OCM.detailed(item, ObjectCreateMessageParent(oguid, slot)))
)
item match {
case box: AmmoBox =>
@ -575,7 +574,7 @@ class VehicleControl(vehicle: Vehicle)
val toChannel = if (obj.VisibleSlots.contains(fromSlot)) zone.id else self.toString
zone.VehicleEvents ! VehicleServiceMessage(
toChannel,
VehicleAction.ObjectDelete(item.GUID)
ObjectDelete(item.GUID)
)
}
@ -638,7 +637,7 @@ class VehicleControl(vehicle: Vehicle)
vehicle.Shields = vehicle.Shields + amount
vehicle.Zone.VehicleEvents ! VehicleServiceMessage(
s"${vehicle.Actor}",
VehicleAction.PlanetsideAttribute(vehicle.GUID, vehicle.Definition.shieldUiAttribute, vehicle.Shields)
PlanetsideAttribute(vehicle.GUID, vehicle.Definition.shieldUiAttribute, vehicle.Shields)
)
}
}
@ -754,15 +753,10 @@ class VehicleControl(vehicle: Vehicle)
def vehicleSubsystemMessages(messages: List[PlanetSideGamePacket]): Unit = {
val zone = vehicle.Zone
val zoneid = zone.id
val events = zone.VehicleEvents
val guid0 = Service.defaultPlayerGUID
messages.foreach { pkt =>
events ! VehicleServiceMessage(
zoneid,
VehicleAction.SendResponse(pkt)
)
}
zone.VehicleEvents ! VehicleServiceMessage(
zone.id,
SendResponse(messages)
)
}
override protected def canChangeVulnerability(state: Damageable.PersonalVulnerability): Boolean = {

View file

@ -6,6 +6,7 @@ import net.psforever.objects.avatar.interaction.WithEntrance
import net.psforever.objects.serverobject.doors.InteriorDoorPassage
import net.psforever.objects.serverobject.environment.PieceOfEnvironment
import net.psforever.objects.zones.interaction.InteractsWithZone
import net.psforever.services.base.messages.SendResponse
class WithEntranceInVehicle
extends WithEntrance() {
@ -39,11 +40,11 @@ class WithEntranceInVehicle
private def warnAboutProximity(obj: InteractsWithZone, msg: String): Unit = {
import net.psforever.packet.game.ChatMsg
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.types.ChatMessageType
obj.Zone.AvatarEvents ! AvatarServiceMessage(
obj.Actor.toString(),
AvatarAction.SendResponse(ChatMsg(ChatMessageType.UNK_227, msg))
SendResponse(ChatMsg(ChatMessageType.UNK_227, msg))
)
}
}

View file

@ -2,11 +2,12 @@ package net.psforever.objects.zones
import enumeratum.values.{StringEnum, StringEnumEntry}
import net.psforever.objects.{PlanetSideGameObject, Player, Vehicle}
import net.psforever.objects.serverobject.environment.{Pool, _}
import net.psforever.objects.serverobject.environment._
import net.psforever.packet.game.{ChatMsg, OffshoreVehicleMessage}
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.vehicle.VehicleServiceMessage
import net.psforever.types.{ChatMessageType, PlanetSideEmpire, PlanetSideGUID, Vector3}
sealed abstract class MapInfo(
@ -700,7 +701,7 @@ object MapEnvironment {
case v: Vehicle =>
v.Zone.VehicleEvents ! VehicleServiceMessage(
v.Actor.toString(),
VehicleAction.SendResponse(OffshoreVehicleMessage(v.Seats(0).occupant.get.GUID, v.GUID, msg))
SendResponse(OffshoreVehicleMessage(v.Seats(0).occupant.get.GUID, v.GUID, msg))
)
case _ => ;
}

View file

@ -10,7 +10,8 @@ import net.psforever.objects.sourcing.ObjectSource
import net.psforever.objects.vehicles.MountedWeapons
import net.psforever.objects.vital.SpawningActivity
import net.psforever.packet.game.ChatMsg
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.local.LocalServiceMessage
import net.psforever.types.ChatMessageType
import scala.annotation.tailrec
@ -109,7 +110,7 @@ object ZoneDeployableActor {
case _ if Interference.Test(zone, obj).nonEmpty =>
zone.LocalEvents ! LocalServiceMessage(
obj.OwnerName.getOrElse(""),
LocalAction.SendResponse(ChatMsg(ChatMessageType.UNK_227, "@nomove_intersecting"))
SendResponse(ChatMsg(ChatMessageType.UNK_227, "@nomove_intersecting"))
) //may not be the correct message but is sufficient at explaining why the deployable can not be built
false
case None =>

View file

@ -6,6 +6,7 @@ import net.psforever.objects.ballistics.Projectile
import net.psforever.objects.guid.{GUIDTask, StraightforwardTask, TaskBundle, TaskWorkflow}
import net.psforever.services.Service
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.ObjectDelete
import net.psforever.types.PlanetSideGUID
import scala.collection.mutable
@ -190,12 +191,12 @@ class ZoneProjectileActor(
zone.blockMap.removeFrom(projectile)
zone.AvatarEvents ! AvatarServiceMessage(
zone.id,
AvatarAction.ObjectDelete(projectile_guid, 2)
ObjectDelete(projectile_guid, 2)
)
} else if (projectile.Definition.RemoteClientData == (0,0)) {
zone.AvatarEvents ! AvatarServiceMessage(
zone.id,
AvatarAction.ObjectDelete(projectile_guid, 2)
ObjectDelete(projectile_guid, 2)
)
} else {
zone.AvatarEvents ! AvatarServiceMessage(

View file

@ -9,7 +9,8 @@ import net.psforever.objects.serverobject.structures.WarpGate
import net.psforever.objects.vital.InGameHistory
import net.psforever.objects.{Default, GlobalDefinitions, Vehicle}
import net.psforever.packet.game.ChatMsg
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.vehicle.VehicleServiceMessage
import net.psforever.types.{ChatMessageType, DriveState, PlanetSideEmpire, Vector3}
import scala.annotation.tailrec
@ -205,7 +206,7 @@ object ZoneVehicleActor {
msgOpt.foreach { msg =>
zone.VehicleEvents ! VehicleServiceMessage(
vehicle.Seats.headOption.flatMap(_._2.occupant).map(_.Name).getOrElse(""),
VehicleAction.SendResponse(ChatMsg(ChatMessageType.UNK_227, msg))
SendResponse(ChatMsg(ChatMessageType.UNK_227, msg))
)
}
msgOpt.isDefined

View file

@ -129,18 +129,6 @@ final case class HackMessage(
}
object HackMessage extends Marshallable[HackMessage] {
def apply(
unk1: HackState1,
target_guid: PlanetSideGUID,
player_guid: PlanetSideGUID,
progress: Int,
unk5: Int,
hack_state: HackState,
unk7: HackState7
): HackMessage = {
new HackMessage(unk1, target_guid, player_guid, progress, unk5.toFloat, hack_state, unk7)
}
implicit val codec: Codec[HackMessage] = (
("unk1" | HackState1.codec) ::
("object_guid" | PlanetSideGUID.codec) ::

View file

@ -12,6 +12,7 @@ import net.psforever.objects.Default
import net.psforever.objects.serverobject.structures.{Building, WarpGate}
import net.psforever.objects.zones.Zone
import net.psforever.packet.game.ChatMsg
import net.psforever.services.base.messages.SendResponse
import net.psforever.services.galaxy.{GalaxyAction, GalaxyServiceMessage, GalaxyServiceResponse}
import net.psforever.types.ChatMessageType
import net.psforever.util.Config
@ -89,7 +90,7 @@ object CavernRotationService {
*/
private def closedCavernWarning(zone: ZoneMonitor, counter: Int, galaxyService: ActorRef): Boolean = {
if (!zone.locked) {
galaxyService ! GalaxyServiceMessage(GalaxyAction.SendResponse(
galaxyService ! GalaxyServiceMessage(SendResponse(
ChatMsg(ChatMessageType.UNK_229, s"@cavern_closing_warning^@${zone.zone.id}~^@$counter~")
))
true
@ -664,7 +665,7 @@ class CavernRotationService(
lockTimerToDisplayWarning(hoursBetweenRotationsAsHours - firstClosingWarningAtMinutes.minutes)
//alert clients to change
if (lockingZone ne unlockingZone) {
galaxyService ! GalaxyServiceMessage(GalaxyAction.SendResponse(
galaxyService ! GalaxyServiceMessage(SendResponse(
ChatMsg(ChatMessageType.UNK_229, s"@cavern_switched^@${lockingZone.id}~^@${unlockingZone.id}")
))
//change warp gate statuses to reflect zone lock state

View file

@ -16,6 +16,7 @@ import net.psforever.persistence
import net.psforever.types.Vector3
import net.psforever.services.{Service, ServiceManager}
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.base.messages.ObjectDelete
import net.psforever.services.galaxy.{GalaxyAction, GalaxyServiceMessage}
import net.psforever.zones.Zones
@ -434,7 +435,7 @@ class PersistenceMonitor(
case _ => ;
}
inZone.Population.tell(Zone.Population.Release(avatar), parent)
inZone.AvatarEvents.tell(AvatarServiceMessage(inZone.id, pguid, AvatarAction.ObjectDelete(pguid)), parent)
inZone.AvatarEvents.tell(AvatarServiceMessage(inZone.id, pguid, ObjectDelete(pguid)), parent)
TaskWorkflow.execute(GUIDTask.unregisterPlayer(inZone.GUID, player))
//inZone.tasks.tell(GUIDTask.UnregisterPlayer(player)(inZone.GUID), parent)
AvatarLogout(avatar)

View file

@ -13,42 +13,30 @@ import net.psforever.objects.zones.Zone
import net.psforever.packet.PlanetSideGamePacket
import net.psforever.packet.game.{ImplantAction, ObjectCreateMessage}
import net.psforever.packet.game.objectcreate.{ConstructorData, DroppedItemData, ObjectCreateMessageParent, PlacementData}
import net.psforever.services.base.{EventMessage, EventResponse, SelfResponseMessage}
import net.psforever.types.{ExoSuitType, ExperienceType, PlanetSideEmpire, PlanetSideGUID, TransactionType, Vector3}
import net.psforever.services.base.messages.ObjectDelete
import net.psforever.services.base.{EventMessage, EventResponse, SelfRespondingEvent}
import net.psforever.types.{ExoSuitType, ExperienceType, PlanetSideGUID, TransactionType, Vector3}
import scala.concurrent.duration.FiniteDuration
object AvatarAction {
final case class ArmorChanged(suit: ExoSuitType.Value, subtype: Int) extends SelfResponseMessage
final case class ArmorChanged(suit: ExoSuitType.Value, subtype: Int) extends SelfRespondingEvent
final case class AvatarImplant(action: ImplantAction.Value, implantSlot: Int, status: Int) extends SelfResponseMessage
final case class AvatarImplant(action: ImplantAction.Value, implantSlot: Int, status: Int) extends SelfRespondingEvent
final case class ChangeAmmo(
weapon_guid: PlanetSideGUID,
weapon_slot: Int,
old_ammo_guid: PlanetSideGUID,
ammo_id: Int,
ammo_guid: PlanetSideGUID,
ammo_data: ConstructorData
) extends SelfResponseMessage
final case class ChangeFireMode(item_guid: PlanetSideGUID, mode: Int) extends SelfRespondingEvent
final case class ChangeFireMode(item_guid: PlanetSideGUID, mode: Int) extends SelfResponseMessage
final case class ConcealPlayer(player_guid: PlanetSideGUID) extends SelfRespondingEvent
final case class ChangeFireState_Start(weapon_guid: PlanetSideGUID) extends SelfResponseMessage
final case class EnvironmentalDamage(player_guid: PlanetSideGUID, source_guid: PlanetSideGUID, amount: Int) extends SelfRespondingEvent
final case class ChangeFireState_Stop(weapon_guid: PlanetSideGUID) extends SelfResponseMessage
final case class DeactivateImplantSlot(player_guid: PlanetSideGUID, slot: Int) extends SelfRespondingEvent
final case class ConcealPlayer(player_guid: PlanetSideGUID) extends SelfResponseMessage
final case class ActivateImplantSlot(player_guid: PlanetSideGUID, slot: Int) extends SelfRespondingEvent
final case class EnvironmentalDamage(player_guid: PlanetSideGUID, source_guid: PlanetSideGUID, amount: Int) extends SelfResponseMessage
final case class Destroy(victim: PlanetSideGUID, killer: PlanetSideGUID, weapon: PlanetSideGUID, pos: Vector3) extends SelfRespondingEvent
final case class DeactivateImplantSlot(player_guid: PlanetSideGUID, slot: Int) extends SelfResponseMessage
final case class ActivateImplantSlot(player_guid: PlanetSideGUID, slot: Int) extends SelfResponseMessage
final case class Destroy(victim: PlanetSideGUID, killer: PlanetSideGUID, weapon: PlanetSideGUID, pos: Vector3) extends SelfResponseMessage
final case class DestroyDisplay(killer: SourceEntry, victim: SourceEntry, method: Int, unk: Int = 121) extends SelfResponseMessage
final case class DestroyDisplay(killer: SourceEntry, victim: SourceEntry, method: Int, unk: Int = 121) extends SelfRespondingEvent
final case class DropCreatedItem(packet: ObjectCreateMessage) extends EventResponse
@ -73,18 +61,10 @@ object AvatarAction {
AvatarAction.EquipmentCreatedInHand(
ObjectCreateMessage(definition.ObjectId, item.GUID, containerData, objectData)
)
AvatarAction.DropCreatedItem(
ObjectCreateMessage(definition.ObjectId, item.GUID, containerData, objectData)
)
}
}
final case class GenericObjectAction(object_guid: PlanetSideGUID, action_code: Int) extends SelfResponseMessage
final case class HitHint(source_guid: PlanetSideGUID) extends SelfResponseMessage
final case class Killed(cause: DamageResult, mount_guid: Option[PlanetSideGUID]) extends SelfResponseMessage
final case class Killed(cause: DamageResult, mount_guid: Option[PlanetSideGUID]) extends SelfRespondingEvent
final case class LoadCreatedPlayer(pkt: ObjectCreateMessage) extends EventResponse
@ -117,19 +97,15 @@ object AvatarAction {
}
}
final case class ObjectDelete(item_guid: PlanetSideGUID, unk: Int = 0) extends SelfResponseMessage
final case class ObjectHeld(slot: Int, previousSLot: Int) extends SelfRespondingEvent
final case class ObjectHeld(slot: Int, previousSLot: Int) extends SelfResponseMessage
final case class OxygenState(player: OxygenStateTarget, vehicle: Option[OxygenStateTarget]) extends SelfRespondingEvent
final case class OxygenState(player: OxygenStateTarget, vehicle: Option[OxygenStateTarget]) extends SelfResponseMessage
final case class PlanetsideAttributeToAll(attribute_type: Int, attribute_value: Long) extends SelfRespondingEvent
final case class PlanetsideAttribute(attribute_type: Int, attribute_value: Long) extends SelfResponseMessage
final case class PlanetsideAttributeSelf(attribute_type: Int, attribute_value: Long) extends SelfRespondingEvent
final case class PlanetsideAttributeToAll(attribute_type: Int, attribute_value: Long) extends SelfResponseMessage
final case class PlanetsideAttributeSelf(attribute_type: Int, attribute_value: Long) extends SelfResponseMessage
final case class PlanetsideStringAttribute(attribute_type: Int, attribute_value: String) extends SelfResponseMessage
final case class PlanetsideStringAttribute(attribute_type: Int, attribute_value: String) extends SelfRespondingEvent
final case class PlayerState(
pos: Vector3,
@ -144,7 +120,7 @@ object AvatarAction {
is_cloaked: Boolean,
spectator: Boolean,
weaponInHand: Boolean
) extends SelfResponseMessage
) extends SelfRespondingEvent
final case class PickupItem(item: Equipment, unk: Int = 0) extends EventMessage {
def response(): EventResponse = {
@ -152,9 +128,9 @@ object AvatarAction {
}
}
final case class ProjectileAutoLockAwareness(mode: Int) extends SelfResponseMessage
final case class ProjectileAutoLockAwareness(mode: Int) extends SelfRespondingEvent
final case class ProjectileExplodes(projectile_guid: PlanetSideGUID, projectile: Projectile) extends SelfResponseMessage
final case class ProjectileExplodes(projectile_guid: PlanetSideGUID, projectile: Projectile) extends SelfRespondingEvent
final case class ProjectileState(
projectile_guid: PlanetSideGUID,
@ -164,9 +140,9 @@ object AvatarAction {
sequence: Int,
end: Boolean,
hit_target: PlanetSideGUID
) extends SelfResponseMessage
) extends SelfRespondingEvent
final case class PutDownFDU(player_guid: PlanetSideGUID) extends SelfResponseMessage
final case class PutDownFDU(player_guid: PlanetSideGUID) extends SelfRespondingEvent
final case class ReleasePlayer(player: Player) extends EventResponse
@ -176,25 +152,15 @@ object AvatarAction {
}
}
final case class Reload(weapon_guid: PlanetSideGUID) extends SelfResponseMessage
final case class Revive(target_guid: PlanetSideGUID) extends SelfResponseMessage
final case class SetEmpire(object_guid: PlanetSideGUID, faction: PlanetSideEmpire.Value)
extends SelfResponseMessage
final case class Revive(target_guid: PlanetSideGUID) extends SelfRespondingEvent
final case class StowEquipment(target_guid: PlanetSideGUID, slot: Int, item: Equipment)
extends SelfResponseMessage
extends SelfRespondingEvent
final case class WeaponDryFire(weapon_guid: PlanetSideGUID) extends SelfResponseMessage
final case class SendResponse(msg: PlanetSideGamePacket) extends SelfResponseMessage
final case class SendResponseTargeted(target_guid: PlanetSideGUID, msg: PlanetSideGamePacket) extends SelfResponseMessage
final case class SendResponseTargeted(target_guid: PlanetSideGUID, msg: PlanetSideGamePacket) extends SelfRespondingEvent
final case class TerminalOrderResult(terminal_guid: PlanetSideGUID, action: TransactionType.Value, result: Boolean)
extends SelfResponseMessage
extends SelfRespondingEvent
final case class ChangeExosuit(
target_guid: PlanetSideGUID,
@ -209,7 +175,7 @@ object AvatarAction {
inventory: List[InventoryItem],
drop: List[InventoryItem],
delete: List[(Equipment, PlanetSideGUID)]
) extends SelfResponseMessage
) extends SelfRespondingEvent
final case class ChangeLoadout(
target_guid: PlanetSideGUID,
@ -223,27 +189,27 @@ object AvatarAction {
old_inventory: List[(Equipment, PlanetSideGUID)],
inventory: List[InventoryItem],
drop: List[InventoryItem]
) extends SelfResponseMessage
) extends SelfRespondingEvent
final case class DropSpecialItem() extends SelfResponseMessage
final case class DropSpecialItem() extends SelfRespondingEvent
final case class UseKit(kit_guid: PlanetSideGUID, kit_objid: Int) extends SelfResponseMessage
final case class UseKit(kit_guid: PlanetSideGUID, kit_objid: Int) extends SelfRespondingEvent
final case class KitNotUsed(kit_guid: PlanetSideGUID, msg: String) extends SelfResponseMessage
final case class KitNotUsed(kit_guid: PlanetSideGUID, msg: String) extends SelfRespondingEvent
final case class UpdateKillsDeathsAssists(charId: Long, kda: KDAStat) extends SelfResponseMessage
final case class UpdateKillsDeathsAssists(charId: Long, kda: KDAStat) extends SelfRespondingEvent
final case class AwardBep(charId: Long, bep: Long, expType: ExperienceType) extends SelfResponseMessage
final case class AwardBep(charId: Long, bep: Long, expType: ExperienceType) extends SelfRespondingEvent
final case class AwardCep(charId: Long, bep: Long) extends SelfResponseMessage
final case class AwardCep(charId: Long, bep: Long) extends SelfRespondingEvent
final case class FacilityCaptureRewards(building_id: Int, zone_number: Int, exp: Long) extends SelfResponseMessage
final case class FacilityCaptureRewards(building_id: Int, zone_number: Int, exp: Long) extends SelfRespondingEvent
final case class ShareKillExperienceWithSquad(killer: Player, exp: Long) extends SelfResponseMessage
final case class ShareKillExperienceWithSquad(killer: Player, exp: Long) extends SelfRespondingEvent
final case class ShareAntExperienceWithSquad(owner: UniquePlayer, exp: Long, vehicle: Vehicle) extends SelfResponseMessage
final case class ShareAntExperienceWithSquad(owner: UniquePlayer, exp: Long, vehicle: Vehicle) extends SelfRespondingEvent
final case class RemoveFromOutfitChat(outfit_id: Long) extends SelfResponseMessage
final case class RemoveFromOutfitChat(outfit_id: Long) extends SelfRespondingEvent
final case class TeardownConnection() extends SelfResponseMessage
final case class TeardownConnection() extends SelfRespondingEvent
}

View file

@ -5,7 +5,8 @@ import net.psforever.objects.guid.{GUIDTask, TaskBundle}
import net.psforever.objects.Player
import net.psforever.types.ExoSuitType
import net.psforever.services.RemoverActor
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.ObjectDelete
import scala.concurrent.duration._
@ -25,7 +26,7 @@ class CorpseRemovalActor extends RemoverActor() {
entry.zone.Population ! Zone.Corpse.Remove(entry.obj.asInstanceOf[Player])
context.parent ! AvatarServiceMessage(
entry.zone.id,
AvatarAction.ObjectDelete(entry.obj.GUID, unk=1)
ObjectDelete(entry.obj.GUID, unk=1)
)
}

View file

@ -4,7 +4,8 @@ package net.psforever.services.avatar.support
import net.psforever.objects.equipment.Equipment
import net.psforever.objects.guid.{GUIDTask, TaskBundle}
import net.psforever.services.RemoverActor
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
import net.psforever.services.avatar.AvatarServiceMessage
import net.psforever.services.base.messages.ObjectDelete
import scala.concurrent.duration._
@ -24,7 +25,7 @@ class DroppedItemRemover extends RemoverActor() {
entry.zone.Ground ! Zone.Ground.RemoveItem(entry.obj.GUID)
context.parent ! AvatarServiceMessage(
entry.zone.id,
AvatarAction.ObjectDelete(entry.obj.GUID)
ObjectDelete(entry.obj.GUID)
)
}

View file

@ -9,7 +9,7 @@ trait EventMessage extends EventExchange {
def response(): EventResponse
}
trait SelfResponseMessage
trait SelfRespondingEvent
extends EventMessage
with EventResponse {
def response(): EventResponse = this

View file

@ -1,32 +0,0 @@
// Copyright (c) 2026 PSForever
package net.psforever.services.base.bus
import scala.annotation.unused
trait GenericEventBusResponseToSupport
extends GenericEventBusResponse {
def supportLabel: String
def supportMessage: Any
}
trait GenericEventBusResponseToSupportOnly
extends GenericEventBusResponseToSupport {
def channel: String = ""
}
trait GenericEventBusWithSupport[T <: GenericEventBusResponse] {
bus: GenericEventBus[T] =>
def handleMessageWithSupport(event: T): Unit = {
event match {
case msg: GenericEventBusResponseToSupportOnly =>
forwardToExternalSupport(msg)
case msg: GenericEventBusResponseToSupport =>
forwardToExternalSupport(msg)
bus.truePublish(event)
case _ =>
bus.truePublish(event)
}
}
def forwardToExternalSupport(@unused msg: GenericEventBusResponseToSupport): Unit
}

View file

@ -0,0 +1,15 @@
// Copyright (c) 2026 PSForever
package net.psforever.services.base.messages
import net.psforever.packet.game.objectcreate.ConstructorData
import net.psforever.services.base.SelfRespondingEvent
import net.psforever.types.PlanetSideGUID
final case class ChangeAmmo(
weapon_guid: PlanetSideGUID,
weapon_slot: Int,
old_ammo_guid: PlanetSideGUID,
ammo_id: Int,
ammo_guid: PlanetSideGUID,
ammo_data: ConstructorData
) extends SelfRespondingEvent

View file

@ -0,0 +1,7 @@
// Copyright (c) 2026 PSForever
package net.psforever.services.base.messages
import net.psforever.services.base.SelfRespondingEvent
import net.psforever.types.PlanetSideGUID
final case class ChangeFireState_Start(weapon_guid: PlanetSideGUID) extends SelfRespondingEvent

View file

@ -0,0 +1,7 @@
// Copyright (c) 2026 PSForever
package net.psforever.services.base.messages
import net.psforever.services.base.SelfRespondingEvent
import net.psforever.types.PlanetSideGUID
final case class ChangeFireState_Stop(weapon_guid: PlanetSideGUID) extends SelfRespondingEvent

View file

@ -0,0 +1,7 @@
// Copyright (c) 2026 PSForever
package net.psforever.services.base.messages
import net.psforever.services.base.SelfRespondingEvent
import net.psforever.types.PlanetSideGUID
final case class GenericObjectAction(object_guid: PlanetSideGUID, action_code: Int) extends SelfRespondingEvent

View file

@ -0,0 +1,8 @@
// Copyright (c) 2026 PSForever
package net.psforever.services.base.messages
import net.psforever.services.base.SelfRespondingEvent
import net.psforever.types.PlanetSideGUID
//analogue for HitHint
final case class HintsAtAttacker(source_guid: PlanetSideGUID) extends SelfRespondingEvent

View file

@ -0,0 +1,7 @@
// Copyright (c) 2026 PSForever
package net.psforever.services.base.messages
import net.psforever.services.base.SelfRespondingEvent
import net.psforever.types.PlanetSideGUID
final case class ObjectDelete(obj_guid: PlanetSideGUID, unk: Int = 0) extends SelfRespondingEvent

View file

@ -0,0 +1,11 @@
// Copyright (c) 2026 PSForever
package net.psforever.services.base.messages
import net.psforever.services.base.SelfRespondingEvent
import net.psforever.types.PlanetSideGUID
final case class PlanetsideAttribute(
target_guid: PlanetSideGUID,
attribute_type: Int,
attribute_value: Long
) extends SelfRespondingEvent

View file

@ -0,0 +1,7 @@
// Copyright (c) 2026 PSForever
package net.psforever.services.base.messages
import net.psforever.services.base.SelfRespondingEvent
import net.psforever.types.PlanetSideGUID
final case class ReloadTool(weapon_guid: PlanetSideGUID) extends SelfRespondingEvent

View file

@ -0,0 +1,11 @@
// Copyright (c) 2026 PSForever
package net.psforever.services.base.messages
import net.psforever.packet.PlanetSideGamePacket
import net.psforever.services.base.SelfRespondingEvent
final case class SendResponse(pkts: Seq[PlanetSideGamePacket]) extends SelfRespondingEvent
object SendResponse {
def apply(pkt: PlanetSideGamePacket): SendResponse = SendResponse(Seq(pkt))
}

View file

@ -0,0 +1,7 @@
// Copyright (c) 2026 PSForever
package net.psforever.services.base.messages
import net.psforever.services.base.SelfRespondingEvent
import net.psforever.types.{PlanetSideEmpire, PlanetSideGUID}
final case class SetEmpire(object_guid: PlanetSideGUID, faction: PlanetSideEmpire.Value) extends SelfRespondingEvent

Some files were not shown because too many files have changed in this diff Show more