Make raiselocalevent not broadcast by default (#8998)
This commit is contained in:
@@ -86,7 +86,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
airtight.CurrentAirBlockedDirection = (int) Rotate((AtmosDirection)airtight.InitialAirBlockedDirection, ev.NewRotation);
|
||||
UpdatePosition(airtight);
|
||||
RaiseLocalEvent(uid, new AirtightChanged(airtight));
|
||||
RaiseLocalEvent(uid, new AirtightChanged(airtight), true);
|
||||
}
|
||||
|
||||
public void SetAirblocked(AirtightComponent airtight, bool airblocked, TransformComponent? xform = null)
|
||||
@@ -95,7 +95,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
airtight.AirBlocked = airblocked;
|
||||
UpdatePosition(airtight, xform);
|
||||
RaiseLocalEvent(airtight.Owner, new AirtightChanged(airtight));
|
||||
RaiseLocalEvent(airtight.Owner, new AirtightChanged(airtight), true);
|
||||
}
|
||||
|
||||
public void UpdatePosition(AirtightComponent airtight, TransformComponent? xform = null)
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
continue;
|
||||
|
||||
var updateEvent = new AtmosExposedUpdateEvent(transform.Coordinates, airEvent.Gas);
|
||||
RaiseLocalEvent(exposed.Owner, ref updateEvent);
|
||||
RaiseLocalEvent(exposed.Owner, ref updateEvent, true);
|
||||
}
|
||||
|
||||
_exposedTimer -= ExposedUpdateDelay;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
{
|
||||
component.LastAlarmState = state;
|
||||
component.HighestNetworkState = netMax;
|
||||
RaiseLocalEvent(component.Owner, new AtmosMonitorAlarmEvent(state, netMax));
|
||||
RaiseLocalEvent(component.Owner, new AtmosMonitorAlarmEvent(state, netMax), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ namespace Content.Server.Atmos.Monitor.Systems
|
||||
|
||||
if (EntityManager.TryGetComponent(monitor.Owner, out AtmosAlarmableComponent? alarmable)
|
||||
&& !alarmable.IgnoreAlarms)
|
||||
RaiseLocalEvent(monitor.Owner, new AtmosMonitorAlarmEvent(monitor.LastAlarmState, monitor.HighestAlarmInNetwork));
|
||||
RaiseLocalEvent(monitor.Owner, new AtmosMonitorAlarmEvent(monitor.LastAlarmState, monitor.HighestAlarmInNetwork), true);
|
||||
// TODO: Central system that grabs *all* alarms from wired network
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Content.Server.Body.Components
|
||||
// These have already been forcefully removed from containers so run it here.
|
||||
foreach (var part in gibs)
|
||||
{
|
||||
_entMan.EventBus.RaiseLocalEvent(part, new PartGibbedEvent(Owner, gibs));
|
||||
_entMan.EventBus.RaiseLocalEvent(part, new PartGibbedEvent(Owner, gibs), true);
|
||||
}
|
||||
|
||||
SoundSystem.Play(_gibSound.GetSound(), Filter.Pvs(Owner, entityManager: _entMan), coordinates, AudioHelpers.WithVariation(0.025f));
|
||||
|
||||
@@ -123,7 +123,7 @@ public sealed class PricingSystem : EntitySystem
|
||||
public double GetPrice(EntityUid uid)
|
||||
{
|
||||
var ev = new PriceCalculationEvent();
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
RaiseLocalEvent(uid, ref ev, true);
|
||||
|
||||
//TODO: Add an OpaqueToAppraisal component or similar for blocking the recursive descent into containers, or preventing material pricing.
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public sealed partial class SolutionContainerSystem : EntitySystem
|
||||
}
|
||||
|
||||
UpdateAppearance(uid, solutionHolder);
|
||||
RaiseLocalEvent(uid, new SolutionChangedEvent());
|
||||
RaiseLocalEvent(uid, new SolutionChangedEvent(), true);
|
||||
}
|
||||
|
||||
public void RemoveAllSolution(EntityUid uid, Solution solutionHolder)
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
var transferAttempt = new SolutionTransferAttemptEvent(sourceEntity, targetEntity);
|
||||
|
||||
// Check if the source is cancelling the transfer
|
||||
RaiseLocalEvent(sourceEntity, transferAttempt);
|
||||
RaiseLocalEvent(sourceEntity, transferAttempt, true);
|
||||
if (transferAttempt.Cancelled)
|
||||
{
|
||||
sourceEntity.PopupMessage(user, transferAttempt.CancelReason!);
|
||||
@@ -92,7 +92,7 @@ namespace Content.Server.Chemistry.EntitySystems
|
||||
}
|
||||
|
||||
// Check if the target is cancelling the transfer
|
||||
RaiseLocalEvent(targetEntity, transferAttempt);
|
||||
RaiseLocalEvent(targetEntity, transferAttempt, true);
|
||||
if (transferAttempt.Cancelled)
|
||||
{
|
||||
sourceEntity.PopupMessage(user, transferAttempt.CancelReason!);
|
||||
|
||||
@@ -63,9 +63,9 @@ namespace Content.Server.CombatMode
|
||||
|
||||
if (inTargetHand != null)
|
||||
{
|
||||
RaiseLocalEvent(inTargetHand.Value, attemptEvent);
|
||||
RaiseLocalEvent(inTargetHand.Value, attemptEvent, true);
|
||||
}
|
||||
RaiseLocalEvent(args.Target, attemptEvent);
|
||||
RaiseLocalEvent(args.Target, attemptEvent, true);
|
||||
if (attemptEvent.Cancelled)
|
||||
return;
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Content.Server.CombatMode
|
||||
_adminLogger.Add(LogType.DisarmedAction, $"{ToPrettyString(args.Performer):user} used disarm on {ToPrettyString(args.Target):target}");
|
||||
|
||||
var eventArgs = new DisarmedEvent() { Target = args.Target, Source = args.Performer, PushProbability = chance };
|
||||
RaiseLocalEvent(args.Target, eventArgs);
|
||||
RaiseLocalEvent(args.Target, eventArgs, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public sealed partial class ConstructionSystem
|
||||
EntityManager.EventBus.RaiseLocalEvent(component.Owner, new RefreshPartsEvent()
|
||||
{
|
||||
Parts = GetAllParts(component),
|
||||
});
|
||||
}, true);
|
||||
}
|
||||
|
||||
public void CreateBoardAndStockParts(MachineComponent component)
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace Content.Server.Cuffs.Components
|
||||
_sysMan.GetEntitySystem<ActionBlockerSystem>().UpdateCanMove(Owner);
|
||||
|
||||
var ev = new CuffedStateChangeEvent();
|
||||
_entMan.EventBus.RaiseLocalEvent(Owner, ref ev);
|
||||
_entMan.EventBus.RaiseLocalEvent(Owner, ref ev, true);
|
||||
UpdateAlert();
|
||||
UpdateHeldItems();
|
||||
Dirty(_entMan);
|
||||
@@ -119,7 +119,7 @@ namespace Content.Server.Cuffs.Components
|
||||
{
|
||||
UpdateAlert();
|
||||
var ev = new CuffedStateChangeEvent();
|
||||
_entMan.EventBus.RaiseLocalEvent(Owner, ref ev);
|
||||
_entMan.EventBus.RaiseLocalEvent(Owner, ref ev, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -199,7 +199,7 @@ namespace Content.Server.Cuffs.Components
|
||||
}
|
||||
|
||||
var attempt = new UncuffAttemptEvent(user, Owner);
|
||||
_entMan.EventBus.RaiseLocalEvent(user, attempt);
|
||||
_entMan.EventBus.RaiseLocalEvent(user, attempt, true);
|
||||
|
||||
if (attempt.Cancelled)
|
||||
{
|
||||
@@ -264,7 +264,7 @@ namespace Content.Server.Cuffs.Components
|
||||
CanStillInteract = _entMan.TryGetComponent(Owner, out HandsComponent? handsComponent) && handsComponent.SortedHands.Count() > CuffedHandCount;
|
||||
_sysMan.GetEntitySystem<ActionBlockerSystem>().UpdateCanMove(Owner);
|
||||
var ev = new CuffedStateChangeEvent();
|
||||
_entMan.EventBus.RaiseLocalEvent(Owner, ref ev);
|
||||
_entMan.EventBus.RaiseLocalEvent(Owner, ref ev, true);
|
||||
UpdateAlert();
|
||||
Dirty(_entMan);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public sealed class DamageOnTriggerSystem : EntitySystem
|
||||
|
||||
var damage = new DamageSpecifier(component.Damage);
|
||||
var ev = new BeforeDamageOnTriggerEvent(damage, target);
|
||||
RaiseLocalEvent(source, ev);
|
||||
RaiseLocalEvent(source, ev, true);
|
||||
|
||||
_damageableSystem.TryChangeDamage(target, ev.Damage, component.IgnoreResistances);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Content.Server.Destructible
|
||||
{
|
||||
if (threshold.Reached(args.Damageable, this))
|
||||
{
|
||||
RaiseLocalEvent(uid, new DamageThresholdReached(component, threshold));
|
||||
RaiseLocalEvent(uid, new DamageThresholdReached(component, threshold), true);
|
||||
|
||||
threshold.Execute(uid, this, EntityManager);
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace Content.Server.DeviceNetwork.Systems
|
||||
return true;
|
||||
|
||||
var beforeBroadcastAttemptEvent = new BeforeBroadcastAttemptEvent(recipients);
|
||||
RaiseLocalEvent(packet.Sender, beforeBroadcastAttemptEvent);
|
||||
RaiseLocalEvent(packet.Sender, beforeBroadcastAttemptEvent, true);
|
||||
|
||||
if (beforeBroadcastAttemptEvent.Cancelled || beforeBroadcastAttemptEvent.ModifiedRecipients == null)
|
||||
return false;
|
||||
|
||||
@@ -261,7 +261,7 @@ namespace Content.Server.Electrocution
|
||||
|| !DoCommonElectrocution(uid, sourceUid, shockDamage, time, refresh, siemensCoefficient, statusEffects))
|
||||
return false;
|
||||
|
||||
RaiseLocalEvent(uid, new ElectrocutedEvent(uid, sourceUid, siemensCoefficient));
|
||||
RaiseLocalEvent(uid, new ElectrocutedEvent(uid, sourceUid, siemensCoefficient), true);
|
||||
return true;
|
||||
|
||||
}
|
||||
@@ -306,7 +306,7 @@ namespace Content.Server.Electrocution
|
||||
electrocutionComponent.TimeLeft = 1f;
|
||||
electrocutionComponent.Electrocuting = uid;
|
||||
|
||||
RaiseLocalEvent(uid, new ElectrocutedEvent(uid, sourceUid, siemensCoefficient));
|
||||
RaiseLocalEvent(uid, new ElectrocutedEvent(uid, sourceUid, siemensCoefficient), true);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -314,7 +314,7 @@ namespace Content.Server.Electrocution
|
||||
private bool DoCommonElectrocutionAttempt(EntityUid uid, EntityUid? sourceUid, ref float siemensCoefficient)
|
||||
{
|
||||
var attemptEvent = new ElectrocutionAttemptEvent(uid, sourceUid, siemensCoefficient);
|
||||
RaiseLocalEvent(uid, attemptEvent);
|
||||
RaiseLocalEvent(uid, attemptEvent, true);
|
||||
|
||||
// Cancel the electrocution early, so we don't recursively electrocute anything.
|
||||
if (attemptEvent.Cancelled)
|
||||
|
||||
@@ -46,7 +46,7 @@ public sealed partial class TriggerSystem
|
||||
triggerOnTimedCollide.Colliding[collidingEntity] += frameTime;
|
||||
if (collidingTimer > triggerOnTimedCollide.Threshold)
|
||||
{
|
||||
RaiseLocalEvent(activeTrigger.Owner, new TriggerEvent(activeTrigger.Owner, collidingEntity));
|
||||
RaiseLocalEvent(activeTrigger.Owner, new TriggerEvent(activeTrigger.Owner, collidingEntity), true);
|
||||
triggerOnTimedCollide.Colliding[collidingEntity] -= triggerOnTimedCollide.Threshold;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
public bool Trigger(EntityUid trigger, EntityUid? user = null)
|
||||
{
|
||||
var triggerEvent = new TriggerEvent(trigger, user);
|
||||
EntityManager.EventBus.RaiseLocalEvent(trigger, triggerEvent);
|
||||
EntityManager.EventBus.RaiseLocalEvent(trigger, triggerEvent, true);
|
||||
return triggerEvent.Handled;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Content.Server.Flash
|
||||
public void Flash(EntityUid target, EntityUid? user, EntityUid? used, float flashDuration, float slowTo, bool displayPopup = true)
|
||||
{
|
||||
var attempt = new FlashAttemptEvent(target, user, used);
|
||||
RaiseLocalEvent(target, attempt);
|
||||
RaiseLocalEvent(target, attempt, true);
|
||||
|
||||
if (attempt.Cancelled)
|
||||
return;
|
||||
@@ -200,7 +200,7 @@ namespace Content.Server.Flash
|
||||
if (args.Cancelled)
|
||||
break;
|
||||
if (_inventorySystem.TryGetSlotEntity(uid, slot, out var item, component))
|
||||
RaiseLocalEvent(item.Value, args);
|
||||
RaiseLocalEvent(item.Value, args, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace Content.Server.Fluids.EntitySystems
|
||||
return false;
|
||||
}
|
||||
|
||||
RaiseLocalEvent(puddleComponent.Owner, new SolutionChangedEvent());
|
||||
RaiseLocalEvent(puddleComponent.Owner, new SolutionChangedEvent(), true);
|
||||
|
||||
if (!sound)
|
||||
{
|
||||
|
||||
@@ -116,7 +116,7 @@ public sealed class SpraySystem : EntitySystem
|
||||
SoundSystem.Play(component.SpraySound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.125f));
|
||||
|
||||
RaiseLocalEvent(uid,
|
||||
new RefreshItemCooldownEvent(curTime, curTime + TimeSpan.FromSeconds(component.CooldownTime)));
|
||||
new RefreshItemCooldownEvent(curTime, curTime + TimeSpan.FromSeconds(component.CooldownTime)), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace Content.Server.GameTicking
|
||||
|
||||
// We raise this event directed to the mob, but also broadcast it so game rules can do something now.
|
||||
var aev = new PlayerSpawnCompleteEvent(mob, player, jobId, lateJoin, station, character);
|
||||
RaiseLocalEvent(mob, aev);
|
||||
RaiseLocalEvent(mob, aev, true);
|
||||
}
|
||||
|
||||
public void Respawn(IPlayerSession player)
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Content.Server.Ghost
|
||||
foreach (var ent in ents)
|
||||
{
|
||||
var ghostBoo = new GhostBooEvent();
|
||||
RaiseLocalEvent(ent, ghostBoo);
|
||||
RaiseLocalEvent(ent, ghostBoo, true);
|
||||
|
||||
if (ghostBoo.Handled)
|
||||
booCounter++;
|
||||
|
||||
@@ -93,7 +93,7 @@ public sealed class HealthExaminableSystem : EntitySystem
|
||||
}
|
||||
|
||||
// Anything else want to add on to this?
|
||||
RaiseLocalEvent(uid, new HealthBeingExaminedEvent(msg));
|
||||
RaiseLocalEvent(uid, new HealthBeingExaminedEvent(msg), true);
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace Content.Server.Interaction
|
||||
return;
|
||||
|
||||
// trigger dragdrops on the dropped entity
|
||||
RaiseLocalEvent(msg.Dropped, interactionArgs);
|
||||
RaiseLocalEvent(msg.Dropped, interactionArgs, true);
|
||||
|
||||
if (interactionArgs.Handled)
|
||||
return;
|
||||
@@ -212,7 +212,7 @@ namespace Content.Server.Interaction
|
||||
if (!Deleted(item))
|
||||
{
|
||||
var meleeVee = new MeleeAttackAttemptEvent();
|
||||
RaiseLocalEvent(item.Value, ref meleeVee);
|
||||
RaiseLocalEvent(item.Value, ref meleeVee, true);
|
||||
|
||||
if (meleeVee.Cancelled) return;
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ namespace Content.Server.Kitchen.EntitySystems
|
||||
var juiceEvent = new ExtractableScalingEvent(); // default of scalar is always 1.0
|
||||
if (EntityManager.HasComponent<StackComponent>(item))
|
||||
{
|
||||
RaiseLocalEvent(item, juiceEvent);
|
||||
RaiseLocalEvent(item, juiceEvent, true);
|
||||
}
|
||||
|
||||
if (component.BeakerSolution.CurrentVolume + juiceMe.JuiceSolution.TotalVolume * juiceEvent.Scalar > component.BeakerSolution.MaxVolume)
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
if (component.State == state) return;
|
||||
|
||||
component.State = state;
|
||||
RaiseLocalEvent(component.Owner, new EmergencyLightEvent(component, state));
|
||||
RaiseLocalEvent(component.Owner, new EmergencyLightEvent(component, state), true);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
|
||||
SoundSystem.Play(flashlight.ToggleSound.GetSound(), Filter.Pvs(light.Owner), flashlight.Owner);
|
||||
|
||||
RaiseLocalEvent(flashlight.Owner, new LightToggleEvent(flashlight.LightOn));
|
||||
RaiseLocalEvent(flashlight.Owner, new LightToggleEvent(flashlight.LightOn), true);
|
||||
_actionsSystem.SetToggled(flashlight.ToggleAction, flashlight.LightOn);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Content.Server.Lock
|
||||
appearanceComp.SetData(StorageVisuals.Locked, true);
|
||||
}
|
||||
|
||||
RaiseLocalEvent(lockComp.Owner, new LockToggledEvent(true));
|
||||
RaiseLocalEvent(lockComp.Owner, new LockToggledEvent(true), true);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -113,7 +113,7 @@ namespace Content.Server.Lock
|
||||
appearanceComp.SetData(StorageVisuals.Locked, false);
|
||||
}
|
||||
|
||||
RaiseLocalEvent(lockComp.Owner, new LockToggledEvent(false));
|
||||
RaiseLocalEvent(lockComp.Owner, new LockToggledEvent(false), true);
|
||||
}
|
||||
|
||||
public bool TryUnlock(EntityUid uid, EntityUid user, LockComponent? lockComp = null)
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace Content.Server.MachineLinking.System
|
||||
|
||||
// allow other systems to refuse the connection
|
||||
var linkAttempt = new LinkAttemptEvent(user, transmitter.Owner, args.TransmitterPort, receiver.Owner, args.ReceiverPort);
|
||||
RaiseLocalEvent(transmitter.Owner, linkAttempt);
|
||||
RaiseLocalEvent(transmitter.Owner, linkAttempt, true);
|
||||
if (linkAttempt.Cancelled)
|
||||
{
|
||||
if (!quiet)
|
||||
@@ -309,7 +309,7 @@ namespace Content.Server.MachineLinking.System
|
||||
Filter.Entities(user));
|
||||
return false;
|
||||
}
|
||||
RaiseLocalEvent(receiver.Owner, linkAttempt);
|
||||
RaiseLocalEvent(receiver.Owner, linkAttempt, true);
|
||||
if (linkAttempt.Cancelled)
|
||||
{
|
||||
if (!quiet)
|
||||
@@ -346,8 +346,8 @@ namespace Content.Server.MachineLinking.System
|
||||
if (receivers.Remove(new(receiver.Owner, args.ReceiverPort)) &&
|
||||
transmitters.Remove(new(transmitter.Owner, args.TransmitterPort)))
|
||||
{
|
||||
RaiseLocalEvent(receiver.Owner, new PortDisconnectedEvent(args.ReceiverPort));
|
||||
RaiseLocalEvent(transmitter.Owner, new PortDisconnectedEvent(args.TransmitterPort));
|
||||
RaiseLocalEvent(receiver.Owner, new PortDisconnectedEvent(args.ReceiverPort), true);
|
||||
RaiseLocalEvent(transmitter.Owner, new PortDisconnectedEvent(args.TransmitterPort), true);
|
||||
_popupSystem.PopupCursor(Loc.GetString("signal-linker-component-unlinked-port",
|
||||
("machine1", transmitter.Owner), ("port1", PortName<TransmitterPortPrototype>(args.TransmitterPort)),
|
||||
("machine2", receiver.Owner), ("port2", PortName<ReceiverPortPrototype>(args.ReceiverPort))),
|
||||
@@ -387,11 +387,11 @@ namespace Content.Server.MachineLinking.System
|
||||
|
||||
foreach (var (port, receivers) in transmitter.Outputs)
|
||||
if (receivers.RemoveAll(id => id.Uid == receiver.Owner) > 0)
|
||||
RaiseLocalEvent(transmitter.Owner, new PortDisconnectedEvent(port));
|
||||
RaiseLocalEvent(transmitter.Owner, new PortDisconnectedEvent(port), true);
|
||||
|
||||
foreach (var (port, transmitters) in receiver.Inputs)
|
||||
if (transmitters.RemoveAll(id => id.Uid == transmitter.Owner) > 0)
|
||||
RaiseLocalEvent(receiver.Owner, new PortDisconnectedEvent(port));
|
||||
RaiseLocalEvent(receiver.Owner, new PortDisconnectedEvent(port), true);
|
||||
|
||||
TryUpdateUI(linker, transmitter, receiver);
|
||||
}
|
||||
@@ -427,11 +427,11 @@ namespace Content.Server.MachineLinking.System
|
||||
// First, disconnect existing links.
|
||||
foreach (var (port, receivers) in transmitter.Outputs)
|
||||
if (receivers.RemoveAll(id => id.Uid == receiver.Owner) > 0)
|
||||
RaiseLocalEvent(transmitter.Owner, new PortDisconnectedEvent(port));
|
||||
RaiseLocalEvent(transmitter.Owner, new PortDisconnectedEvent(port), true);
|
||||
|
||||
foreach (var (port, transmitters) in receiver.Inputs)
|
||||
if (transmitters.RemoveAll(id => id.Uid == transmitter.Owner) > 0)
|
||||
RaiseLocalEvent(receiver.Owner, new PortDisconnectedEvent(port));
|
||||
RaiseLocalEvent(receiver.Owner, new PortDisconnectedEvent(port), true);
|
||||
|
||||
// Then make any valid default connections.
|
||||
foreach (var outPort in transmitter.Outputs.Keys)
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace Content.Server.Mind
|
||||
var message = new RoleAddedEvent(role);
|
||||
if (OwnedEntity != null)
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(OwnedEntity.Value, message);
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(OwnedEntity.Value, message, true);
|
||||
}
|
||||
|
||||
return role;
|
||||
@@ -207,7 +207,7 @@ namespace Content.Server.Mind
|
||||
|
||||
if (OwnedEntity != null)
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(OwnedEntity.Value, message);
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(OwnedEntity.Value, message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ namespace Content.Server.Mind
|
||||
|
||||
var entities = IoCManager.Resolve<IEntityManager>();
|
||||
entities.RemoveComponent<VisitingMindComponent>(oldVisitingEnt);
|
||||
entities.EventBus.RaiseLocalEvent(oldVisitingEnt, new MindUnvisitedMessage());
|
||||
entities.EventBus.RaiseLocalEvent(oldVisitingEnt, new MindUnvisitedMessage(), true);
|
||||
}
|
||||
|
||||
public bool TryGetSession([NotNullWhen(true)] out IPlayerSession? session)
|
||||
|
||||
@@ -42,7 +42,7 @@ public sealed class MindSystem : EntitySystem
|
||||
return;
|
||||
|
||||
mind.Mind = value;
|
||||
RaiseLocalEvent(uid, new MindAddedMessage());
|
||||
RaiseLocalEvent(uid, new MindAddedMessage(), true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -56,7 +56,7 @@ public sealed class MindSystem : EntitySystem
|
||||
return;
|
||||
|
||||
if (!Deleted(uid))
|
||||
RaiseLocalEvent(uid, new MindRemovedMessage());
|
||||
RaiseLocalEvent(uid, new MindRemovedMessage(), true);
|
||||
|
||||
mind.Mind = null;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
return;
|
||||
|
||||
var isHotEvent = new IsHotEvent();
|
||||
RaiseLocalEvent(targetEntity.Value, isHotEvent);
|
||||
RaiseLocalEvent(targetEntity.Value, isHotEvent, true);
|
||||
|
||||
if (!isHotEvent.IsHot)
|
||||
return;
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace Content.Server.Nutrition.EntitySystems
|
||||
|
||||
if (solution.TotalVolume == FixedPoint2.Zero)
|
||||
{
|
||||
RaiseLocalEvent(uid, new SmokableSolutionEmptyEvent());
|
||||
RaiseLocalEvent(uid, new SmokableSolutionEmptyEvent(), true);
|
||||
}
|
||||
|
||||
if (inhaledSolution.TotalVolume == FixedPoint2.Zero)
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Content.Server.Polymorph.Systems
|
||||
var comp = EnsureComp<PolymorphedEntityComponent>(child);
|
||||
comp.Parent = target;
|
||||
comp.Prototype = proto;
|
||||
RaiseLocalEvent(child, new PolymorphComponentSetupEvent());
|
||||
RaiseLocalEvent(child, new PolymorphComponentSetupEvent(), true);
|
||||
|
||||
var childXform = Transform(child);
|
||||
childXform.LocalRotation = targetTransformComp.LocalRotation;
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
|
||||
apcReceiver.PoweredLastUpdate = powered;
|
||||
|
||||
RaiseLocalEvent(apcReceiver.Owner, new PowerChangedEvent(apcReceiver.Powered, apcReceiver.NetworkLoad.ReceivingPower));
|
||||
RaiseLocalEvent(apcReceiver.Owner, new PowerChangedEvent(apcReceiver.Powered, apcReceiver.NetworkLoad.ReceivingPower), true);
|
||||
|
||||
if (appearanceQuery.TryGetComponent(apcReceiver.Owner, out var appearance))
|
||||
appearance.SetData(PowerDeviceVisuals.Powered, powered);
|
||||
@@ -262,7 +262,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
{
|
||||
lastRecv = newRecv;
|
||||
var msg = new PowerConsumerReceivedChanged(newRecv, consumer.DrawRate);
|
||||
RaiseLocalEvent(consumer.Owner, msg);
|
||||
RaiseLocalEvent(consumer.Owner, msg, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,11 +273,11 @@ namespace Content.Server.Power.EntitySystems
|
||||
|
||||
if (lastSupply == 0f && currentSupply != 0f)
|
||||
{
|
||||
RaiseLocalEvent(powerNetBattery.Owner, new PowerNetBatterySupplyEvent {Supply = true});
|
||||
RaiseLocalEvent(powerNetBattery.Owner, new PowerNetBatterySupplyEvent {Supply = true}, true);
|
||||
}
|
||||
else if (lastSupply > 0f && currentSupply == 0f)
|
||||
{
|
||||
RaiseLocalEvent(powerNetBattery.Owner, new PowerNetBatterySupplyEvent {Supply = false});
|
||||
RaiseLocalEvent(powerNetBattery.Owner, new PowerNetBatterySupplyEvent {Supply = false}, true);
|
||||
}
|
||||
|
||||
powerNetBattery.LastSupply = currentSupply;
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Content.Server.Power.EntitySystems
|
||||
{
|
||||
receiver.NetworkLoad.LinkedNetwork = default;
|
||||
|
||||
RaiseLocalEvent(receiver.Owner, new PowerChangedEvent(receiver.Powered, receiver.NetworkLoad.ReceivingPower));
|
||||
RaiseLocalEvent(receiver.Owner, new PowerChangedEvent(receiver.Powered, receiver.NetworkLoad.ReceivingPower), true);
|
||||
|
||||
if (TryComp(receiver.Owner, out AppearanceComponent? appearance))
|
||||
appearance.SetData(PowerDeviceVisuals.Powered, receiver.Powered);
|
||||
|
||||
@@ -22,6 +22,6 @@ public sealed class RadiationSystem : EntitySystem
|
||||
public void IrradiateEntity(EntityUid uid, float radsPerSecond, float time)
|
||||
{
|
||||
var msg = new OnIrradiatedEvent(time, radsPerSecond);
|
||||
RaiseLocalEvent(uid, msg);
|
||||
RaiseLocalEvent(uid, msg, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Content.Server.Speech
|
||||
{
|
||||
var accentEvent = new AccentGetEvent(args.Sender, args.Message);
|
||||
|
||||
RaiseLocalEvent(args.Sender, accentEvent);
|
||||
RaiseLocalEvent(args.Sender, accentEvent, true);
|
||||
args.Message = accentEvent.Message;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ public sealed class StationSystem : EntitySystem
|
||||
stationMember.Station = station;
|
||||
stationData.Grids.Add(gridComponent.Owner);
|
||||
|
||||
RaiseLocalEvent(station, new StationGridAddedEvent(gridComponent.Owner, false));
|
||||
RaiseLocalEvent(station, new StationGridAddedEvent(gridComponent.Owner, false), true);
|
||||
|
||||
_sawmill.Info($"Adding grid {mapGrid}:{gridComponent.Owner} to station {Name(station)} ({station})");
|
||||
}
|
||||
@@ -247,7 +247,7 @@ public sealed class StationSystem : EntitySystem
|
||||
RemComp<StationMemberComponent>(mapGrid);
|
||||
stationData.Grids.Remove(gridComponent.Owner);
|
||||
|
||||
RaiseLocalEvent(station, new StationGridRemovedEvent(gridComponent.Owner));
|
||||
RaiseLocalEvent(station, new StationGridRemovedEvent(gridComponent.Owner), true);
|
||||
_sawmill.Info($"Removing grid {mapGrid}:{gridComponent.Owner} from station {Name(station)} ({station})");
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ public sealed class StationSystem : EntitySystem
|
||||
_chatSystem.DispatchStationAnnouncement(station, $"The station {oldName} has been renamed to {name}.");
|
||||
}
|
||||
|
||||
RaiseLocalEvent(station, new StationRenamedEvent(oldName, name));
|
||||
RaiseLocalEvent(station, new StationRenamedEvent(oldName, name), true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -175,7 +175,7 @@ public sealed class StickySystem : EntitySystem
|
||||
}
|
||||
|
||||
component.StuckTo = target;
|
||||
RaiseLocalEvent(uid, new EntityStuckEvent(target, user));
|
||||
RaiseLocalEvent(uid, new EntityStuckEvent(target, user), true);
|
||||
}
|
||||
|
||||
public void UnstickFromEntity(EntityUid uid, EntityUid user, StickyComponent? component = null)
|
||||
@@ -210,7 +210,7 @@ public sealed class StickySystem : EntitySystem
|
||||
}
|
||||
|
||||
component.StuckTo = null;
|
||||
RaiseLocalEvent(uid, new EntityUnstuckEvent(target, user));
|
||||
RaiseLocalEvent(uid, new EntityUnstuckEvent(target, user), true);
|
||||
}
|
||||
|
||||
private sealed class StickSuccessfulEvent : EntityEventArgs
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Content.Server.Storage.Components
|
||||
}
|
||||
|
||||
var @event = new StorageOpenAttemptEvent();
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(Owner, @event);
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(Owner, @event, true);
|
||||
|
||||
return !@event.Cancelled;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ namespace Content.Server.Storage.Components
|
||||
public virtual bool CanClose(EntityUid user, bool silent = false)
|
||||
{
|
||||
var @event = new StorageCloseAttemptEvent();
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(Owner, @event);
|
||||
IoCManager.Resolve<IEntityManager>().EventBus.RaiseLocalEvent(Owner, @event, true);
|
||||
|
||||
return !@event.Cancelled;
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ namespace Content.Server.Strip
|
||||
if (_inventorySystem.TryGetSlotEntity(component.Owner, slot, out var item) && _inventorySystem.TryUnequip(user, component.Owner, slot))
|
||||
{
|
||||
// Raise a dropped event, so that things like gas tank internals properly deactivate when stripping
|
||||
RaiseLocalEvent(item.Value, new DroppedEvent(user));
|
||||
RaiseLocalEvent(item.Value, new DroppedEvent(user), true);
|
||||
|
||||
_handsSystem.PickupOrDrop(user, item.Value);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ public sealed class SurveillanceCameraSystem : EntitySystem
|
||||
// Send a targetted event to all monitors.
|
||||
foreach (var monitor in component.ActiveMonitors)
|
||||
{
|
||||
RaiseLocalEvent(monitor, ev);
|
||||
RaiseLocalEvent(monitor, ev, true);
|
||||
}
|
||||
|
||||
component.ActiveMonitors.Clear();
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Content.Server.Temperature.Systems
|
||||
float lastTemp = temperature.CurrentTemperature;
|
||||
float delta = temperature.CurrentTemperature - temp;
|
||||
temperature.CurrentTemperature = temp;
|
||||
RaiseLocalEvent(uid, new OnTemperatureChangeEvent(temperature.CurrentTemperature, lastTemp, delta));
|
||||
RaiseLocalEvent(uid, new OnTemperatureChangeEvent(temperature.CurrentTemperature, lastTemp, delta), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Content.Server.Temperature.Systems
|
||||
temperature.CurrentTemperature += heatAmount / temperature.HeatCapacity;
|
||||
float delta = temperature.CurrentTemperature - lastTemp;
|
||||
|
||||
RaiseLocalEvent(uid, new OnTemperatureChangeEvent(temperature.CurrentTemperature, lastTemp, delta));
|
||||
RaiseLocalEvent(uid, new OnTemperatureChangeEvent(temperature.CurrentTemperature, lastTemp, delta), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public sealed class WeldableSystem : EntitySystem
|
||||
|
||||
// Other component systems
|
||||
var attempt = new WeldableAttemptEvent(user, tool);
|
||||
RaiseLocalEvent(uid, attempt);
|
||||
RaiseLocalEvent(uid, attempt, true);
|
||||
if (attempt.Cancelled)
|
||||
return false;
|
||||
|
||||
@@ -77,7 +77,7 @@ public sealed class WeldableSystem : EntitySystem
|
||||
return;
|
||||
|
||||
component.IsWelded = !component.IsWelded;
|
||||
RaiseLocalEvent(uid, new WeldableChangedEvent(component.IsWelded));
|
||||
RaiseLocalEvent(uid, new WeldableChangedEvent(component.IsWelded), true);
|
||||
|
||||
UpdateAppearance(uid, component);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Content.Server.Traitor.Uplink
|
||||
|
||||
private void OnInit(EntityUid uid, UplinkComponent component, ComponentInit args)
|
||||
{
|
||||
RaiseLocalEvent(uid, new UplinkInitEvent(component));
|
||||
RaiseLocalEvent(uid, new UplinkInitEvent(component), true);
|
||||
|
||||
// if component has a preset info (probably spawn by admin)
|
||||
// create a new account and register it for this uplink
|
||||
@@ -67,7 +67,7 @@ namespace Content.Server.Traitor.Uplink
|
||||
|
||||
private void OnRemove(EntityUid uid, UplinkComponent component, ComponentRemove args)
|
||||
{
|
||||
RaiseLocalEvent(uid, new UplinkRemovedEvent());
|
||||
RaiseLocalEvent(uid, new UplinkRemovedEvent(), true);
|
||||
}
|
||||
|
||||
private void OnActivate(EntityUid uid, UplinkComponent component, ActivateInWorldEvent args)
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Content.Server.Verbs
|
||||
if (verb.ExecutionEventArgs != null)
|
||||
{
|
||||
if (verb.EventTarget.IsValid())
|
||||
RaiseLocalEvent(verb.EventTarget, verb.ExecutionEventArgs);
|
||||
RaiseLocalEvent(verb.EventTarget, verb.ExecutionEventArgs, true);
|
||||
else
|
||||
RaiseLocalEvent(verb.ExecutionEventArgs);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Content.Server.Weapon.Melee
|
||||
var targets = new[] { target };
|
||||
SendAnimation(comp.ClickArc, angle, args.User, owner, targets, comp.ClickAttackEffect, false);
|
||||
|
||||
RaiseLocalEvent(target, new AttackedEvent(args.Used, args.User, args.ClickLocation));
|
||||
RaiseLocalEvent(target, new AttackedEvent(args.Used, args.User, args.ClickLocation), true);
|
||||
|
||||
var modifiedDamage = DamageSpecifier.ApplyModifierSets(comp.Damage + hitEvent.BonusDamage, hitEvent.ModifiersList);
|
||||
var damageResult = _damageableSystem.TryChangeDamage(target, modifiedDamage);
|
||||
@@ -176,7 +176,7 @@ namespace Content.Server.Weapon.Melee
|
||||
|
||||
foreach (var entity in hitEntities)
|
||||
{
|
||||
RaiseLocalEvent(entity, new AttackedEvent(args.Used, args.User, args.ClickLocation));
|
||||
RaiseLocalEvent(entity, new AttackedEvent(args.Used, args.User, args.ClickLocation), true);
|
||||
|
||||
var damageResult = _damageableSystem.TryChangeDamage(entity, modifiedDamage);
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace Content.Server.Wieldable
|
||||
{
|
||||
if (!component.Wielded || component.Owner != args.Unequipped)
|
||||
return;
|
||||
RaiseLocalEvent(uid, new ItemUnwieldedEvent(args.User, force: true));
|
||||
RaiseLocalEvent(uid, new ItemUnwieldedEvent(args.User, force: true), true);
|
||||
}
|
||||
|
||||
private void OnVirtualItemDeleted(EntityUid uid, WieldableComponent component, VirtualItemDeletedEvent args)
|
||||
|
||||
@@ -314,7 +314,7 @@ public sealed class WiresSystem : EntitySystem
|
||||
{
|
||||
if (wire.CancelToken.IsCancellationRequested)
|
||||
{
|
||||
RaiseLocalEvent(owner, wire.OnFinish);
|
||||
RaiseLocalEvent(owner, wire.OnFinish, true);
|
||||
_finishedWires.Add((owner, wire));
|
||||
}
|
||||
else
|
||||
@@ -322,7 +322,7 @@ public sealed class WiresSystem : EntitySystem
|
||||
wire.TimeLeft -= frameTime;
|
||||
if (wire.TimeLeft <= 0)
|
||||
{
|
||||
RaiseLocalEvent(owner, wire.OnFinish);
|
||||
RaiseLocalEvent(owner, wire.OnFinish, true);
|
||||
_finishedWires.Add((owner, wire));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public sealed class ArtifactSystem : EntitySystem
|
||||
}
|
||||
|
||||
EntityManager.AddComponent(uid, trigger);
|
||||
RaiseLocalEvent(uid, new RandomizeTriggerEvent());
|
||||
RaiseLocalEvent(uid, new RandomizeTriggerEvent(), true);
|
||||
}
|
||||
|
||||
public bool TryActivateArtifact(EntityUid uid, EntityUid? user = null,
|
||||
@@ -74,6 +74,6 @@ public sealed class ArtifactSystem : EntitySystem
|
||||
{
|
||||
Activator = user
|
||||
};
|
||||
RaiseLocalEvent(uid, ev);
|
||||
RaiseLocalEvent(uid, ev, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user