mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-06-29 08:44:22 +00:00
rebase to master, after a while
This commit is contained in:
parent
4127f28a01
commit
df3eb4636e
9 changed files with 70 additions and 87 deletions
|
|
@ -7,7 +7,6 @@ import net.psforever.actors.zone.ZoneActor
|
|||
import net.psforever.objects.{GlobalDefinitions, PlanetSideGameObject, Player, Vehicle, Vehicles}
|
||||
import net.psforever.objects.serverobject.affinity.FactionAffinity
|
||||
import net.psforever.objects.serverobject.environment.interaction.ResetAllEnvironmentInteractions
|
||||
import net.psforever.objects.serverobject.hackable.GenericHackables
|
||||
import net.psforever.objects.serverobject.mount.Mountable
|
||||
import net.psforever.objects.serverobject.structures.WarpGate
|
||||
import net.psforever.objects.serverobject.terminals.implant.ImplantTerminalMech
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ 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
|
||||
import net.psforever.services.base.CachedEnvelope
|
||||
import net.psforever.services.base.envelope.MessageEnvelope
|
||||
import net.psforever.services.base.message.PlanetsideAttribute
|
||||
import net.psforever.services.local.support.CaptureFlagManager
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ class VehicleLogic(val ops: VehicleOperations, implicit val context: ActorContex
|
|||
obj.Position = position
|
||||
obj.Orientation = angle
|
||||
obj.DeploymentState = if (is_crouched || !notMountedState) DriveState.Kneeling else DriveState.Mobile
|
||||
continent.VehicleEvents ! VehicleServiceMessage(
|
||||
continent.VehicleEvents ! MessageEnvelope(
|
||||
continent.id,
|
||||
player.GUID,
|
||||
VehicleAction.FrameVehicleState(vehicle_guid, unk1, position, angle, velocity, unk2, unk3, unk4, is_crouched, is_airborne, ascending_flight, flight_time, unk9, unkA)
|
||||
|
|
@ -217,7 +217,7 @@ class VehicleLogic(val ops: VehicleOperations, implicit val context: ActorContex
|
|||
val angle = Vector3(0f, pitch, yaw)
|
||||
tool.Orientation = angle
|
||||
player.Orientation = angle
|
||||
continent.VehicleEvents ! VehicleServiceMessage(
|
||||
continent.VehicleEvents ! MessageEnvelope(
|
||||
continent.id,
|
||||
player.GUID,
|
||||
VehicleAction.ChildObjectState(object_guid, pitch, yaw)
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ import net.psforever.objects.sourcing.PlayerSource
|
|||
import net.psforever.objects.zones.{Zone, ZoneInfo}
|
||||
import net.psforever.packet.game.TimeOfDayMessage.GetTimeOfDayValue
|
||||
import net.psforever.packet.game.{SetChatFilterMessage, TimeOfDayMessage}
|
||||
import net.psforever.services.Service
|
||||
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
|
||||
import net.psforever.services.base.envelope.MessageEnvelope
|
||||
import net.psforever.services.base.message.SendResponse
|
||||
import net.psforever.services.chat.{DefaultChannel, OutfitChannel, SquadChannel}
|
||||
import net.psforever.services.local.support.{CaptureEnvelope, HackCaptureActor}
|
||||
import net.psforever.services.teamwork.{SquadResponse, SquadService, SquadServiceResponse}
|
||||
|
|
@ -1441,10 +1441,7 @@ class ChatOperations(
|
|||
val msg = TimeOfDayMessage(zone.GetTimeOfDay(), zone.GetTimeOfDaySpeed())
|
||||
|
||||
// update players in zone
|
||||
zone.AvatarEvents ! AvatarServiceMessage(
|
||||
zone.id,
|
||||
AvatarAction.SendResponse(Service.defaultPlayerGUID, msg)
|
||||
)
|
||||
zone.AvatarEvents ! MessageEnvelope(zone.id, SendResponse(msg))
|
||||
|
||||
sendResponse(ChatMsg(messageType = UNK_227, contents = f"@CMT_SETTIME_OK^$hh~^$mm%02d~"))
|
||||
case _ =>
|
||||
|
|
@ -1479,10 +1476,7 @@ class ChatOperations(
|
|||
val msg = TimeOfDayMessage(zone.GetTimeOfDay(), zone.GetTimeOfDaySpeed())
|
||||
|
||||
// update players in zone
|
||||
zone.AvatarEvents ! AvatarServiceMessage(
|
||||
zone.id,
|
||||
AvatarAction.SendResponse(Service.defaultPlayerGUID, msg)
|
||||
)
|
||||
zone.AvatarEvents ! MessageEnvelope(zone.id, SendResponse(msg))
|
||||
|
||||
sendResponse(ChatMsg(messageType = UNK_227, contents = s"@CMT_SETTIMESPEED_OK^$timeSpeed~"))
|
||||
case _ =>
|
||||
|
|
|
|||
|
|
@ -6,9 +6,10 @@ import net.psforever.objects.{Default, GlobalDefinitions, Tool, Vehicle}
|
|||
import net.psforever.objects.avatar.{AvatarBot, AvatarBotActor}
|
||||
import net.psforever.objects.guid.{GUIDTask, StraightforwardTask, TaskBundle, TaskWorkflow}
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
|
||||
import net.psforever.services.vehicle.{VehicleAction, VehicleServiceMessage}
|
||||
import net.psforever.types.{CharacterSex, CharacterVoice, ExoSuitType, PlanetSideEmpire, PlanetSideGUID, Vector3}
|
||||
import net.psforever.services.base.envelope.MessageEnvelope
|
||||
import net.psforever.services.local.LocalAction
|
||||
import net.psforever.services.vehicle.VehicleAction
|
||||
import net.psforever.types.{CharacterSex, CharacterVoice, ExoSuitType, PlanetSideEmpire, Vector3}
|
||||
import net.psforever.util.Config
|
||||
|
||||
import scala.collection.mutable.ListBuffer
|
||||
|
|
@ -282,7 +283,6 @@ class ShootingRangeTargetSpawnerActor(zone: Zone) extends Actor {
|
|||
* @param bot the bot to remove
|
||||
*/
|
||||
private def RemoveBot(bot: AvatarBot): Boolean = {
|
||||
import net.psforever.services.Service
|
||||
activeInfantryTargets.indexOf(bot) match {
|
||||
case -1 =>
|
||||
log.warn(s"Failed to remove bot with GUID ${bot.GUID} from ${zone.id}'s active targets list! This shouldn't happen... and probably just caused a leak.")
|
||||
|
|
@ -290,9 +290,9 @@ class ShootingRangeTargetSpawnerActor(zone: Zone) extends Actor {
|
|||
case index =>
|
||||
activeInfantryTargets.remove(index)
|
||||
}
|
||||
zone.LocalEvents ! LocalServiceMessage(
|
||||
zone.LocalEvents ! MessageEnvelope(
|
||||
zone.id,
|
||||
LocalAction.TriggerEffectLocation(Service.defaultPlayerGUID, "bot_destroyed_effect", bot.Position, bot.Orientation)
|
||||
LocalAction.TriggerEffectLocation("bot_destroyed_effect", bot.Position, bot.Orientation)
|
||||
)
|
||||
//spawn a replacement bot
|
||||
context.system.scheduler.scheduleOnce(
|
||||
|
|
@ -356,10 +356,9 @@ class ShootingRangeTargetSpawnerActor(zone: Zone) extends Actor {
|
|||
|
||||
def action(): Future[Any] = {
|
||||
zone.Transport ! Zone.Vehicle.Spawn(localVehicle)
|
||||
zone.VehicleEvents ! VehicleServiceMessage(
|
||||
zone.VehicleEvents ! MessageEnvelope(
|
||||
zone.id,
|
||||
VehicleAction.LoadVehicle(
|
||||
PlanetSideGUID(0),
|
||||
localVehicle,
|
||||
localVehicle.Definition.ObjectId,
|
||||
localVehicle.GUID,
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@ import net.psforever.services.base.envelope.MessageEnvelope
|
|||
import net.psforever.services.base.message.{GenericObjectAction, PlanetsideAttribute, SendResponse}
|
||||
import net.psforever.services.galaxy.GalaxyAction
|
||||
import net.psforever.services.local.support.{CaptureEnvelope, HackCaptureActor, HackClearActor, HackClearEnvelope}
|
||||
import net.psforever.services.local.LocalAction
|
||||
import net.psforever.types.{PlanetSideEmpire, PlanetSideGeneratorState}
|
||||
import net.psforever.types.PlanetSideEmpire
|
||||
|
||||
/**
|
||||
* A package class that conveys the important information for handling facility updates.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ package net.psforever.objects.avatar
|
|||
import akka.actor.{Actor, ActorRef}
|
||||
import net.psforever.actors.zone.ShootingRangeTargetSpawner
|
||||
import net.psforever.objects.{GlobalDefinitions, Tool}
|
||||
import net.psforever.objects.avatar.AvatarBot
|
||||
import net.psforever.objects.equipment._
|
||||
import net.psforever.objects.serverobject.aura.{Aura, AuraEffectBehavior}
|
||||
import net.psforever.objects.serverobject.CommonMessages
|
||||
|
|
@ -14,18 +13,17 @@ import net.psforever.objects.vital.resolution.ResolutionCalculations.Output
|
|||
import net.psforever.objects.zones._
|
||||
import net.psforever.packet.game._
|
||||
import net.psforever.types._
|
||||
import net.psforever.services.Service
|
||||
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
|
||||
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
|
||||
import net.psforever.services.avatar.AvatarAction
|
||||
import net.psforever.objects.serverobject.environment.interaction.RespondsToZoneEnvironment
|
||||
import net.psforever.objects.serverobject.repair.Repairable
|
||||
import net.psforever.objects.sourcing.PlayerSource
|
||||
import net.psforever.objects.vital.{HealFromEquipment, RepairFromEquipment}
|
||||
import net.psforever.objects.vital.etc.SuicideReason
|
||||
import net.psforever.objects.vital.interaction.{DamageInteraction, DamageResult}
|
||||
import net.psforever.services.base.envelope.MessageEnvelope
|
||||
import net.psforever.services.base.message.{PlanetsideAttribute, SendResponse}
|
||||
|
||||
import java.util.concurrent.{Executors, TimeUnit}
|
||||
|
||||
import scala.concurrent.ExecutionContext.Implicits.global
|
||||
import scala.concurrent.duration._
|
||||
import scala.util.Random
|
||||
|
|
@ -53,7 +51,7 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
|
||||
def InteractiveObject: AvatarBot = bot
|
||||
|
||||
private[this] val log = org.log4s.getLogger(bot.Name)
|
||||
//private[this] val log = org.log4s.getLogger(bot.Name)
|
||||
private[this] val damageLog = org.log4s.getLogger(Damageable.LogChannel)
|
||||
private val scheduler = Executors.newScheduledThreadPool(2)
|
||||
/** suffocating, or regaining breath? */
|
||||
|
|
@ -107,14 +105,13 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
if (!(bot.isMoving || user.isMoving)) { //only allow stationary heals
|
||||
val newHealth = bot.Health = originalHealth + 10
|
||||
val magazine = item.Discharge()
|
||||
events ! AvatarServiceMessage(
|
||||
events ! MessageEnvelope(
|
||||
uname,
|
||||
AvatarAction.SendResponse(
|
||||
Service.defaultPlayerGUID,
|
||||
SendResponse(
|
||||
InventoryStateMessage(item.AmmoSlot.Box.GUID, item.GUID, magazine.toLong)
|
||||
)
|
||||
)
|
||||
events ! AvatarServiceMessage(zone.id, AvatarAction.PlanetsideAttributeToAll(guid, 0, newHealth))
|
||||
events ! MessageEnvelope(zone.id, PlanetsideAttribute(guid, 0, newHealth))
|
||||
bot.LogActivity(
|
||||
HealFromEquipment(
|
||||
PlayerSource(user),
|
||||
|
|
@ -124,10 +121,9 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
)
|
||||
}
|
||||
//progress bar remains visible for all heal attempts
|
||||
events ! AvatarServiceMessage(
|
||||
events ! MessageEnvelope(
|
||||
uname,
|
||||
AvatarAction.SendResponse(
|
||||
Service.defaultPlayerGUID,
|
||||
SendResponse(
|
||||
RepairMessage(guid, bot.Health * 100 / definition.MaxHealth)
|
||||
)
|
||||
)
|
||||
|
|
@ -150,14 +146,13 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
val newArmor = bot.Armor =
|
||||
originalArmor + Repairable.applyLevelModifier(user, item, RepairToolValue(item)).toInt + definition.RepairMod
|
||||
val magazine = item.Discharge()
|
||||
events ! AvatarServiceMessage(
|
||||
events ! MessageEnvelope(
|
||||
uname,
|
||||
AvatarAction.SendResponse(
|
||||
Service.defaultPlayerGUID,
|
||||
SendResponse(
|
||||
InventoryStateMessage(item.AmmoSlot.Box.GUID, item.GUID, magazine.toLong)
|
||||
)
|
||||
)
|
||||
events ! AvatarServiceMessage(zone.id, AvatarAction.PlanetsideAttributeToAll(guid, 4, bot.Armor))
|
||||
events ! MessageEnvelope(zone.id, PlanetsideAttribute(guid, 4, bot.Armor))
|
||||
bot.LogActivity(
|
||||
RepairFromEquipment(
|
||||
PlayerSource(user),
|
||||
|
|
@ -167,10 +162,9 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
)
|
||||
}
|
||||
//progress bar remains visible for all repair attempts
|
||||
events ! AvatarServiceMessage(
|
||||
events ! MessageEnvelope(
|
||||
uname,
|
||||
AvatarAction
|
||||
.SendResponse(Service.defaultPlayerGUID, RepairMessage(guid, bot.Armor * 100 / bot.MaxArmor))
|
||||
SendResponse(RepairMessage(guid, bot.Armor * 100 / bot.MaxArmor))
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -231,9 +225,9 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
//always do armor update
|
||||
if (damageToArmor > 0) {
|
||||
val zone = target.Zone
|
||||
zone.AvatarEvents ! AvatarServiceMessage(
|
||||
zone.AvatarEvents ! MessageEnvelope(
|
||||
zone.id,
|
||||
AvatarAction.PlanetsideAttributeToAll(target.GUID, 4, target.Armor)
|
||||
PlanetsideAttribute(target.GUID, 4, target.Armor)
|
||||
)
|
||||
}
|
||||
//choose
|
||||
|
|
@ -280,16 +274,13 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
announceConfrontation = true //TODO should we?
|
||||
}
|
||||
if (damageToHealth > 0) {
|
||||
events ! AvatarServiceMessage(zoneId, AvatarAction.PlanetsideAttributeToAll(targetGUID, 0, health))
|
||||
events ! MessageEnvelope(zoneId, PlanetsideAttribute(targetGUID, 0, health))
|
||||
announceConfrontation = true
|
||||
}
|
||||
val countableDamage = damageToHealth + damageToArmor
|
||||
if(announceConfrontation) {
|
||||
if (aggravated) {
|
||||
events ! AvatarServiceMessage(
|
||||
zoneId,
|
||||
AvatarAction.SendResponse(targetGUID, AggravatedDamageMessage(targetGUID, countableDamage))
|
||||
)
|
||||
events ! MessageEnvelope(zoneId, targetGUID, SendResponse(AggravatedDamageMessage(targetGUID, countableDamage)))
|
||||
} else {
|
||||
//activity on map
|
||||
zone.Activity ! Zone.HotSpot.Activity(cause)
|
||||
|
|
@ -332,22 +323,22 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
cause.adversarial match {
|
||||
case Some(a) =>
|
||||
damageLog.info(s"${a.defender.Name} was killed by ${a.attacker.Name}")
|
||||
events ! AvatarServiceMessage(
|
||||
events ! MessageEnvelope(
|
||||
zoneChannel,
|
||||
AvatarAction.DestroyDisplay(a.attacker, a.defender, a.implement)
|
||||
)
|
||||
case _ =>
|
||||
damageLog.info(s"${bot.Name} killed ${bot.Sex.pronounObject}self")
|
||||
events ! AvatarServiceMessage(zoneChannel, AvatarAction.DestroyDisplay(cause.interaction.target, cause.interaction.target, 0))
|
||||
events ! MessageEnvelope(zoneChannel, AvatarAction.DestroyDisplay(cause.interaction.target, cause.interaction.target, 0))
|
||||
}
|
||||
|
||||
events ! AvatarServiceMessage(nameChannel, AvatarAction.Killed(bot_guid, cause, None)) //align client interface fields with state
|
||||
events ! AvatarServiceMessage(zoneChannel, AvatarAction.PlanetsideAttributeToAll(bot_guid, 0, 0)) //health
|
||||
events ! MessageEnvelope(nameChannel, bot_guid, AvatarAction.Killed(cause, None)) //align client interface fields with state
|
||||
events ! MessageEnvelope(zoneChannel, PlanetsideAttribute(bot_guid, 0, 0)) //health
|
||||
val attribute = DamageableEntity.attributionTo(cause, target.Zone, bot_guid)
|
||||
events ! AvatarServiceMessage(
|
||||
events ! MessageEnvelope(
|
||||
nameChannel,
|
||||
AvatarAction.SendResponse(
|
||||
bot_guid,
|
||||
bot_guid,
|
||||
SendResponse(
|
||||
DestroyMessage(bot_guid, attribute, bot_guid, pos)
|
||||
) //how many players get this message?
|
||||
)
|
||||
|
|
@ -402,13 +393,13 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
private def performEmote(): Unit = {
|
||||
val zone = bot.Zone
|
||||
zone.blockMap.sector(bot).livePlayerList.collect { t =>
|
||||
zone.LocalEvents ! LocalServiceMessage(t.Name, LocalAction.SendResponse(TriggerBotAction(bot.GUID)))
|
||||
zone.LocalEvents ! MessageEnvelope(t.Name, SendResponse(TriggerBotAction(bot.GUID)))
|
||||
}
|
||||
}
|
||||
|
||||
private def tickLogic(): Unit = {
|
||||
val zone = bot.Zone
|
||||
if (!bot.Destroyed && zone.AllPlayers.size > 0) {
|
||||
if (!bot.Destroyed && zone.AllPlayers.nonEmpty) {
|
||||
bot.zoneInteractions()
|
||||
val rotateRNG = Random.nextDouble()
|
||||
if (canRotate) {
|
||||
|
|
@ -424,10 +415,10 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
)
|
||||
}
|
||||
}
|
||||
zone.AvatarEvents ! AvatarServiceMessage(
|
||||
zone.AvatarEvents ! MessageEnvelope(
|
||||
zone.id,
|
||||
bot.GUID,
|
||||
AvatarAction.PlayerState(
|
||||
bot.GUID,
|
||||
bot.Position,
|
||||
bot.Velocity,
|
||||
bot.Orientation.z,
|
||||
|
|
@ -436,10 +427,10 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
0,
|
||||
bot.Crouching,
|
||||
bot.Jumping,
|
||||
false,
|
||||
bot.Cloaked,
|
||||
false,
|
||||
false
|
||||
jump_thrust = false,
|
||||
is_cloaked = bot.Cloaked,
|
||||
spectator = false,
|
||||
weaponInHand = false
|
||||
)
|
||||
)
|
||||
if (canEmote) {
|
||||
|
|
@ -469,9 +460,9 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
override def StartJammeredSound(target: Any, dur: Int): Unit =
|
||||
target match {
|
||||
case obj: AvatarBot if !jammedSound =>
|
||||
obj.Zone.AvatarEvents ! AvatarServiceMessage(
|
||||
obj.Zone.AvatarEvents ! MessageEnvelope(
|
||||
obj.Zone.id,
|
||||
AvatarAction.PlanetsideAttributeToAll(obj.GUID, 27, 1)
|
||||
PlanetsideAttribute(obj.GUID, 27, 1)
|
||||
)
|
||||
super.StartJammeredSound(obj, 3000)
|
||||
case _ => ;
|
||||
|
|
@ -502,9 +493,9 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
override def CancelJammeredSound(target: Any): Unit =
|
||||
target match {
|
||||
case obj: AvatarBot if jammedSound =>
|
||||
obj.Zone.AvatarEvents ! AvatarServiceMessage(
|
||||
obj.Zone.AvatarEvents ! MessageEnvelope(
|
||||
obj.Zone.id,
|
||||
AvatarAction.PlanetsideAttributeToAll(obj.GUID, 27, 0)
|
||||
PlanetsideAttribute(obj.GUID, 27, 0)
|
||||
)
|
||||
super.CancelJammeredSound(obj)
|
||||
case _ => ;
|
||||
|
|
@ -521,10 +512,9 @@ class AvatarBotActor(bot: AvatarBot, spawnerActor: ActorRef)
|
|||
}
|
||||
|
||||
def UpdateAuraEffect(target: AuraEffectBehavior.Target) : Unit = {
|
||||
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
|
||||
val zone = target.Zone
|
||||
val value = target.Aura.foldLeft(0)(_ + AvatarBotActor.auraEffectToAttributeValue(_))
|
||||
zone.AvatarEvents ! AvatarServiceMessage(zone.id, AvatarAction.PlanetsideAttributeToAll(target.GUID, 54, value))
|
||||
zone.AvatarEvents ! MessageEnvelope(zone.id, PlanetsideAttribute(target.GUID, 54, value))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,9 @@ import net.psforever.objects.vital.interaction.DamageInteraction
|
|||
import net.psforever.objects.vital.prop.DamageWithPosition
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.packet.game.ChatMsg
|
||||
import net.psforever.services.Service
|
||||
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
|
||||
import net.psforever.services.base.envelope.MessageEnvelope
|
||||
import net.psforever.services.base.message.SendResponse
|
||||
import net.psforever.services.local.LocalAction
|
||||
import net.psforever.types.{ChatMessageType, PlanetSideEmpire, PlanetSideGeneratorState, Vector3}
|
||||
|
||||
import scala.annotation.unused
|
||||
|
|
@ -45,9 +46,9 @@ object ForceDomeControl {
|
|||
val owner = dome.Owner
|
||||
val zone = owner.Zone
|
||||
owner.Actor ! BuildingActor.AmenityStateChange(dome)
|
||||
zone.LocalEvents ! LocalServiceMessage(
|
||||
zone.LocalEvents ! MessageEnvelope(
|
||||
zone.id,
|
||||
LocalAction.UpdateForceDomeStatus(Service.defaultPlayerGUID, owner.GUID, activationState)
|
||||
LocalAction.UpdateForceDomeStatus(owner.GUID, activationState)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -124,11 +125,11 @@ object ForceDomeControl {
|
|||
state: Boolean
|
||||
): Unit = {
|
||||
val zone = building.Zone
|
||||
val message = LocalAction.SendResponse(ChatMsg(
|
||||
val message = SendResponse(ChatMsg(
|
||||
ChatMessageType.UNK_229,
|
||||
s"The Capitol force dome at ${building.Name} will remain ${if (state) "activated" else "deactivated"}."
|
||||
))
|
||||
zone.LocalEvents ! LocalServiceMessage(zone.id, message)
|
||||
zone.LocalEvents ! MessageEnvelope(zone.id, message)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -138,12 +139,12 @@ object ForceDomeControl {
|
|||
*/
|
||||
def NormalDomeStateMessage(building: Building): Unit = {
|
||||
val events = building.Zone.LocalEvents
|
||||
val message = LocalAction.SendResponse(ChatMsg(
|
||||
val message = SendResponse(ChatMsg(
|
||||
ChatMessageType.UNK_227,
|
||||
"Expected capitol force dome state change will resume."
|
||||
))
|
||||
building.PlayersInSOI.foreach { player =>
|
||||
events ! LocalServiceMessage(player.Name, message)
|
||||
events ! MessageEnvelope(player.Name, message)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ import net.psforever.objects.avatar.{AvatarBot, CorpseControl, PlayerControl}
|
|||
import net.psforever.objects.sourcing.PlayerSource
|
||||
import net.psforever.objects.vital.{InGameHistory, SpawningActivity}
|
||||
import net.psforever.objects.{Default, Player}
|
||||
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
|
||||
import net.psforever.services.avatar.AvatarAction
|
||||
import net.psforever.services.base.envelope.MessageEnvelope
|
||||
import net.psforever.services.base.message.ObjectDelete
|
||||
import net.psforever.types.Vector3
|
||||
|
||||
import scala.collection.concurrent.TrieMap
|
||||
|
|
@ -88,9 +90,9 @@ class ZonePopulationActor(zone: Zone, playerMap: TrieMap[Int, Option[Player]], b
|
|||
if (BotSpawn(bot, botList)) {
|
||||
bot.Zone = zone
|
||||
zone.actor ! ZoneActor.AddToBlockMap(bot, bot.Position)
|
||||
zone.AvatarEvents ! AvatarServiceMessage(
|
||||
zone.id,
|
||||
AvatarAction.LoadPlayer(bot.GUID, bot.Definition.ObjectId, bot.GUID, bot.Definition.Packet.ConstructorData(bot).get, None)
|
||||
zone.AvatarEvents ! MessageEnvelope(
|
||||
zone.id, bot.GUID,
|
||||
AvatarAction.LoadPlayer(bot.Definition.ObjectId, bot.GUID, bot.Definition.Packet.ConstructorData(bot).get, None)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -99,9 +101,9 @@ class ZonePopulationActor(zone: Zone, playerMap: TrieMap[Int, Option[Player]], b
|
|||
if (bot.Actor != null) bot.Actor ! akka.actor.PoisonPill
|
||||
bot.Actor = Default.Actor
|
||||
zone.actor ! ZoneActor.RemoveFromBlockMap(bot)
|
||||
zone.AvatarEvents ! AvatarServiceMessage(
|
||||
zone.id,
|
||||
AvatarAction.ObjectDelete(bot.GUID, bot.GUID, unk=0)
|
||||
zone.AvatarEvents ! MessageEnvelope(
|
||||
zone.id, bot.GUID,
|
||||
ObjectDelete(bot.GUID, unk=0)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue