Make raiselocalevent not broadcast by default (#8998)

This commit is contained in:
metalgearsloth
2022-06-22 09:53:41 +10:00
committed by GitHub
parent 360a6b8b00
commit 8905996cfc
76 changed files with 165 additions and 165 deletions

View File

@@ -251,7 +251,7 @@ public sealed class ClothingSystem : EntitySystem
if (ev.Layers.Count == 0)
{
RaiseLocalEvent(equipment, new EquipmentVisualsUpdatedEvent(equipee, slot, revealedLayers));
RaiseLocalEvent(equipment, new EquipmentVisualsUpdatedEvent(equipee, slot, revealedLayers), true);
return;
}
@@ -294,6 +294,6 @@ public sealed class ClothingSystem : EntitySystem
layer.Offset += slotDef.Offset;
}
RaiseLocalEvent(equipment, new EquipmentVisualsUpdatedEvent(equipee, slot, revealedLayers));
RaiseLocalEvent(equipment, new EquipmentVisualsUpdatedEvent(equipee, slot, revealedLayers), true);
}
}

View File

@@ -429,7 +429,7 @@ namespace Content.Client.DragDrop
// CanInteract() doesn't support checking a second "target" entity.
// Doing so manually:
var ev = new GettingInteractedWithAttemptEvent(eventArgs.User, eventArgs.Dragged);
RaiseLocalEvent(eventArgs.Dragged, ev);
RaiseLocalEvent(eventArgs.Dragged, ev, true);
if (ev.Cancelled)
return false;

View File

@@ -208,7 +208,7 @@ namespace Content.Client.Hands
if (hand.HeldEntity == null)
{
// the held item was removed.
RaiseLocalEvent(held, new HeldVisualsUpdatedEvent(uid, revealedLayers));
RaiseLocalEvent(held, new HeldVisualsUpdatedEvent(uid, revealedLayers), true);
return;
}
@@ -217,7 +217,7 @@ namespace Content.Client.Hands
if (ev.Layers.Count == 0)
{
RaiseLocalEvent(held, new HeldVisualsUpdatedEvent(uid, revealedLayers));
RaiseLocalEvent(held, new HeldVisualsUpdatedEvent(uid, revealedLayers), true);
return;
}
@@ -244,7 +244,7 @@ namespace Content.Client.Hands
sprite.LayerSetData(index, layerData);
}
RaiseLocalEvent(held, new HeldVisualsUpdatedEvent(uid, revealedLayers));
RaiseLocalEvent(held, new HeldVisualsUpdatedEvent(uid, revealedLayers), true);
}
private void OnVisualsChanged(EntityUid uid, HandsComponent component, VisualsChangedEvent args)

View File

@@ -33,7 +33,7 @@ public sealed class ItemSystem : SharedItemSystem
// if the item is in a container, it might be equipped to hands or inventory slots --> update visuals.
if (_containerSystem.TryGetContainingContainer(uid, out var container))
RaiseLocalEvent(container.Owner, new VisualsChangedEvent(uid, container.ID));
RaiseLocalEvent(container.Owner, new VisualsChangedEvent(uid, container.ID), true);
}
/// <summary>

View File

@@ -194,7 +194,7 @@ namespace Content.Client.Items.UI
}
var collectMsg = new ItemStatusCollectMessage();
_entityManager.EventBus.RaiseLocalEvent(_entity!.Value, collectMsg);
_entityManager.EventBus.RaiseLocalEvent(_entity!.Value, collectMsg, true);
foreach (var control in collectMsg.Controls)
{

View File

@@ -238,7 +238,7 @@ namespace Content.Client.Verbs
if (verb.ExecutionEventArgs != null)
{
if (verb.EventTarget.IsValid())
RaiseLocalEvent(verb.EventTarget, verb.ExecutionEventArgs);
RaiseLocalEvent(verb.EventTarget, verb.ExecutionEventArgs, true);
else
RaiseLocalEvent(verb.ExecutionEventArgs);
}

View File

@@ -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)

View File

@@ -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;

View File

@@ -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);
}
}
}

View File

@@ -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
}

View File

@@ -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));

View File

@@ -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.

View File

@@ -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)

View File

@@ -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!);

View File

@@ -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);
}

View File

@@ -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)

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;
}
}

View File

@@ -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;
}

View File

@@ -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);
}
}

View File

@@ -157,7 +157,7 @@ namespace Content.Server.Fluids.EntitySystems
return false;
}
RaiseLocalEvent(puddleComponent.Owner, new SolutionChangedEvent());
RaiseLocalEvent(puddleComponent.Owner, new SolutionChangedEvent(), true);
if (!sound)
{

View File

@@ -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);
}
}

View File

@@ -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)

View File

@@ -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++;

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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)

View File

@@ -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)

View File

@@ -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);
}
}

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);

View File

@@ -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);
}
}

View File

@@ -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;
}
}

View File

@@ -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>

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -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);
}
}

View File

@@ -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);
}

View File

@@ -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)

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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)

View File

@@ -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));
}
}

View File

@@ -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);
}
}

View File

@@ -40,7 +40,7 @@ namespace Content.Shared.ActionBlocker
return false;
var ev = new UpdateCanMoveEvent(uid);
RaiseLocalEvent(uid, ev);
RaiseLocalEvent(uid, ev, true);
if (component.CanMove == ev.Cancelled && component is Component comp)
Dirty(comp);
@@ -63,7 +63,7 @@ namespace Content.Shared.ActionBlocker
public bool CanInteract(EntityUid user, EntityUid? target)
{
var ev = new InteractionAttemptEvent(user, target);
RaiseLocalEvent(user, ev);
RaiseLocalEvent(user, ev, true);
if (ev.Cancelled)
return false;
@@ -72,7 +72,7 @@ namespace Content.Shared.ActionBlocker
return true;
var targetEv = new GettingInteractedWithAttemptEvent(user, target);
RaiseLocalEvent(target.Value, targetEv);
RaiseLocalEvent(target.Value, targetEv, true);
return !targetEv.Cancelled;
}
@@ -88,7 +88,7 @@ namespace Content.Shared.ActionBlocker
public bool CanUseHeldEntity(EntityUid user)
{
var ev = new UseAttemptEvent(user);
RaiseLocalEvent(user, ev);
RaiseLocalEvent(user, ev, true);
return !ev.Cancelled;
}
@@ -96,7 +96,7 @@ namespace Content.Shared.ActionBlocker
public bool CanThrow(EntityUid user)
{
var ev = new ThrowAttemptEvent(user);
RaiseLocalEvent(user, ev);
RaiseLocalEvent(user, ev, true);
return !ev.Cancelled;
}
@@ -104,7 +104,7 @@ namespace Content.Shared.ActionBlocker
public bool CanSpeak(EntityUid uid)
{
var ev = new SpeakAttemptEvent(uid);
RaiseLocalEvent(uid, ev);
RaiseLocalEvent(uid, ev, true);
return !ev.Cancelled;
}
@@ -112,7 +112,7 @@ namespace Content.Shared.ActionBlocker
public bool CanDrop(EntityUid uid)
{
var ev = new DropAttemptEvent(uid);
RaiseLocalEvent(uid, ev);
RaiseLocalEvent(uid, ev, true);
return !ev.Cancelled;
}
@@ -134,7 +134,7 @@ namespace Content.Shared.ActionBlocker
public bool CanEmote(EntityUid uid)
{
var ev = new EmoteAttemptEvent(uid);
RaiseLocalEvent(uid, ev);
RaiseLocalEvent(uid, ev, true);
return !ev.Cancelled;
}
@@ -142,7 +142,7 @@ namespace Content.Shared.ActionBlocker
public bool CanAttack(EntityUid uid, EntityUid? target = null)
{
var ev = new AttackAttemptEvent(uid, target);
RaiseLocalEvent(uid, ev);
RaiseLocalEvent(uid, ev, true);
return !ev.Cancelled;
}
@@ -150,7 +150,7 @@ namespace Content.Shared.ActionBlocker
public bool CanChangeDirection(EntityUid uid)
{
var ev = new ChangeDirectionAttemptEvent(uid);
RaiseLocalEvent(uid, ev);
RaiseLocalEvent(uid, ev, true);
return !ev.Cancelled;
}
@@ -158,7 +158,7 @@ namespace Content.Shared.ActionBlocker
public bool CanShiver(EntityUid uid)
{
var ev = new ShiverAttemptEvent(uid);
RaiseLocalEvent(uid, ev);
RaiseLocalEvent(uid, ev, true);
return !ev.Cancelled;
}
@@ -166,7 +166,7 @@ namespace Content.Shared.ActionBlocker
public bool CanSweat(EntityUid uid)
{
var ev = new SweatAttemptEvent(uid);
RaiseLocalEvent(uid, ev);
RaiseLocalEvent(uid, ev, true);
return !ev.Cancelled;
}

View File

@@ -182,13 +182,13 @@ public abstract class AlertsSystem : EntitySystem
protected virtual void HandleComponentShutdown(EntityUid uid, AlertsComponent component, ComponentShutdown args)
{
RaiseLocalEvent(uid, new AlertSyncEvent(uid));
RaiseLocalEvent(uid, new AlertSyncEvent(uid), true);
_metaSystem.RemoveFlag(uid, MetaDataFlags.EntitySpecific);
}
private void HandleComponentStartup(EntityUid uid, AlertsComponent component, ComponentStartup args)
{
RaiseLocalEvent(uid, new AlertSyncEvent(uid));
RaiseLocalEvent(uid, new AlertSyncEvent(uid), true);
_metaSystem.AddFlag(uid, MetaDataFlags.EntitySpecific);
}

View File

@@ -29,11 +29,11 @@ namespace Content.Shared.Body.Components
{
if (old.Body == null)
{
_entMan.EventBus.RaiseLocalEvent(Owner, new RemovedFromPartEvent(old));
_entMan.EventBus.RaiseLocalEvent(Owner, new RemovedFromPartEvent(old), true);
}
else
{
_entMan.EventBus.RaiseLocalEvent(Owner, new RemovedFromPartInBodyEvent(old.Body, old));
_entMan.EventBus.RaiseLocalEvent(Owner, new RemovedFromPartInBodyEvent(old.Body, old), true);
}
}
@@ -41,11 +41,11 @@ namespace Content.Shared.Body.Components
{
if (value.Body == null)
{
_entMan.EventBus.RaiseLocalEvent(Owner, new AddedToPartEvent(value));
_entMan.EventBus.RaiseLocalEvent(Owner, new AddedToPartEvent(value), true);
}
else
{
_entMan.EventBus.RaiseLocalEvent(Owner, new AddedToPartInBodyEvent(value.Body, value));
_entMan.EventBus.RaiseLocalEvent(Owner, new AddedToPartInBodyEvent(value.Body, value), true);
}
}
}

View File

@@ -261,7 +261,7 @@ namespace Content.Shared.Body.Components
foreach (var mechanism in _mechanisms)
{
_entMan.EventBus.RaiseLocalEvent(mechanism.Owner, new AddedToBodyEvent(body));
_entMan.EventBus.RaiseLocalEvent(mechanism.Owner, new AddedToBodyEvent(body), true);
}
}
@@ -276,7 +276,7 @@ namespace Content.Shared.Body.Components
foreach (var mechanism in _mechanisms)
{
_entMan.EventBus.RaiseLocalEvent(mechanism.Owner, new RemovedFromBodyEvent(old));
_entMan.EventBus.RaiseLocalEvent(mechanism.Owner, new RemovedFromBodyEvent(old), true);
}
}

View File

@@ -43,7 +43,7 @@ namespace Content.Shared.CharacterAppearance.Systems
component.Dirty();
RaiseLocalEvent(uid, new ChangedHumanoidAppearanceEvent(appearance, sex, gender, species));
RaiseLocalEvent(uid, new ChangedHumanoidAppearanceEvent(appearance, sex, gender, species), true);
}
public void UpdateAppearance(EntityUid uid, HumanoidCharacterAppearance appearance, HumanoidAppearanceComponent? component = null)
@@ -54,7 +54,7 @@ namespace Content.Shared.CharacterAppearance.Systems
component.Dirty();
RaiseLocalEvent(uid, new ChangedHumanoidAppearanceEvent(appearance, component.Sex, component.Gender, component.Species));
RaiseLocalEvent(uid, new ChangedHumanoidAppearanceEvent(appearance, component.Sex, component.Gender, component.Species), true);
}
private void OnAppearanceGetState(EntityUid uid, HumanoidAppearanceComponent component, ref ComponentGetState args)

View File

@@ -205,7 +205,7 @@ namespace Content.Shared.Containers.ItemSlots
PlaySound(uid, slot.InsertSound, slot.SoundOptions, excludeUserAudio ? user : null);
var ev = new ItemSlotChangedEvent();
RaiseLocalEvent(uid, ref ev);
RaiseLocalEvent(uid, ref ev, true);
}
/// <summary>
@@ -330,7 +330,7 @@ namespace Content.Shared.Containers.ItemSlots
PlaySound(uid, slot.EjectSound, slot.SoundOptions, excludeUserAudio ? user : null);
var ev = new ItemSlotChangedEvent();
RaiseLocalEvent(uid, ref ev);
RaiseLocalEvent(uid, ref ev, true);
}
/// <summary>

View File

@@ -257,7 +257,7 @@ namespace Content.Shared.Examine
// Raise the event and let things that subscribe to it change the message...
var isInDetailsRange = IsInDetailsRange(examiner.Value, entity);
var examinedEvent = new ExaminedEvent(message, entity, examiner.Value, isInDetailsRange, doNewline);
RaiseLocalEvent(entity, examinedEvent);
RaiseLocalEvent(entity, examinedEvent, true);
message.Pop();

View File

@@ -79,7 +79,7 @@ public sealed class FollowerSystem : EntitySystem
var followerEv = new StartedFollowingEntityEvent(entity, follower);
var entityEv = new EntityStartedFollowingEvent(entity, follower);
RaiseLocalEvent(follower, followerEv);
RaiseLocalEvent(follower, followerEv, true);
RaiseLocalEvent(entity, entityEv, false);
}
@@ -107,7 +107,7 @@ public sealed class FollowerSystem : EntitySystem
var uidEv = new StoppedFollowingEntityEvent(target, uid);
var targetEv = new EntityStoppedFollowingEvent(target, uid);
RaiseLocalEvent(uid, uidEv);
RaiseLocalEvent(uid, uidEv, true);
RaiseLocalEvent(target, targetEv, false);
}

View File

@@ -158,7 +158,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
RaiseLocalEvent(entity, gotUnequipped, false);
var didUnequip = new DidUnequipHandEvent(uid, entity, hand);
RaiseLocalEvent(uid, didUnequip);
RaiseLocalEvent(uid, didUnequip, true);
if (hand == handsComp.ActiveHand)
RaiseLocalEvent(entity, new HandDeselectedEvent(uid), false);

View File

@@ -145,7 +145,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
RaiseLocalEvent(uid, didEquip, false);
var gotEquipped = new GotEquippedHandEvent(uid, entity, hand);
RaiseLocalEvent(entity, gotEquipped);
RaiseLocalEvent(entity, gotEquipped, true);
// TODO this should REALLY be a cancellable thing, not a handled event.
// If one of the interactions resulted in the item being dropped, return early.

View File

@@ -280,7 +280,7 @@ namespace Content.Shared.Interaction
{
// all interactions should only happen when in range / unobstructed, so no range check is needed
var message = new InteractHandEvent(user, target);
RaiseLocalEvent(target, message);
RaiseLocalEvent(target, message, true);
_adminLogger.Add(LogType.InteractHand, LogImpact.Low, $"{ToPrettyString(user):user} interacted with {ToPrettyString(target):target}");
if (message.Handled)
return;
@@ -307,7 +307,7 @@ namespace Content.Shared.Interaction
if (target != null)
{
var rangedMsg = new RangedInteractEvent(user, used, target.Value, clickLocation);
RaiseLocalEvent(target.Value, rangedMsg);
RaiseLocalEvent(target.Value, rangedMsg, true);
if (rangedMsg.Handled)
return;
@@ -619,7 +619,7 @@ namespace Content.Shared.Interaction
// all interactions should only happen when in range / unobstructed, so no range check is needed
var interactUsingEvent = new InteractUsingEvent(user, used, target, clickLocation);
RaiseLocalEvent(target, interactUsingEvent);
RaiseLocalEvent(target, interactUsingEvent, true);
if (interactUsingEvent.Handled)
return;
@@ -717,7 +717,7 @@ namespace Content.Shared.Interaction
return false;
var activateMsg = new ActivateInWorldEvent(user, used);
RaiseLocalEvent(used, activateMsg);
RaiseLocalEvent(used, activateMsg, true);
if (activateMsg.Handled)
{
_useDelay.BeginDelay(used, delayComponent);
@@ -766,7 +766,7 @@ namespace Content.Shared.Interaction
return false;
var useMsg = new UseInHandEvent(user);
RaiseLocalEvent(used, useMsg);
RaiseLocalEvent(used, useMsg, true);
if (useMsg.Handled)
{
_useDelay.BeginDelay(used, delayComponent);
@@ -805,7 +805,7 @@ namespace Content.Shared.Interaction
public void ThrownInteraction(EntityUid user, EntityUid thrown)
{
var throwMsg = new ThrownEvent(user, thrown);
RaiseLocalEvent(thrown, throwMsg);
RaiseLocalEvent(thrown, throwMsg, true);
if (throwMsg.Handled)
{
_adminLogger.Add(LogType.Throw, LogImpact.Low,$"{ToPrettyString(user):user} threw {ToPrettyString(thrown):entity}");
@@ -819,7 +819,7 @@ namespace Content.Shared.Interaction
public void DroppedInteraction(EntityUid user, EntityUid item)
{
var dropMsg = new DroppedEvent(user);
RaiseLocalEvent(item, dropMsg);
RaiseLocalEvent(item, dropMsg, true);
if (dropMsg.Handled)
_adminLogger.Add(LogType.Drop, LogImpact.Low, $"{ToPrettyString(user):user} dropped {ToPrettyString(item):entity}");
Transform(item).LocalRotation = Angle.Zero;

View File

@@ -82,10 +82,10 @@ public abstract partial class InventorySystem
return;
var unequippedEvent = new DidUnequipEvent(uid, args.Entity, slotDef);
RaiseLocalEvent(uid, unequippedEvent);
RaiseLocalEvent(uid, unequippedEvent, true);
var gotUnequippedEvent = new GotUnequippedEvent(uid, args.Entity, slotDef);
RaiseLocalEvent(args.Entity, gotUnequippedEvent);
RaiseLocalEvent(args.Entity, gotUnequippedEvent, true);
}
private void OnEntInserted(EntityUid uid, InventoryComponent component, EntInsertedIntoContainerMessage args)
@@ -94,10 +94,10 @@ public abstract partial class InventorySystem
return;
var equippedEvent = new DidEquipEvent(uid, args.Entity, slotDef);
RaiseLocalEvent(uid, equippedEvent);
RaiseLocalEvent(uid, equippedEvent, true);
var gotEquippedEvent = new GotEquippedEvent(uid, args.Entity, slotDef);
RaiseLocalEvent(args.Entity, gotEquippedEvent);
RaiseLocalEvent(args.Entity, gotEquippedEvent, true);
}
/// <summary>
@@ -151,7 +151,7 @@ public abstract partial class InventorySystem
var gotUnequipped = new GotUnequippedHandEvent(actor, held.Value, hands.ActiveHand!);
var didUnequip = new DidUnequipHandEvent(actor, held.Value, hands.ActiveHand!);
RaiseLocalEvent(held.Value, gotUnequipped, false);
RaiseLocalEvent(actor, didUnequip);
RaiseLocalEvent(actor, didUnequip, true);
RaiseLocalEvent(held.Value, new HandDeselectedEvent(actor), false);
TryEquip(actor, actor, held.Value, ev.Slot, predicted: true, inventory: inventory, force: true);
@@ -274,7 +274,7 @@ public abstract partial class InventorySystem
}
var attemptEvent = new IsEquippingAttemptEvent(actor, target, itemUid, slotDefinition);
RaiseLocalEvent(target, attemptEvent);
RaiseLocalEvent(target, attemptEvent, true);
if (attemptEvent.Cancelled)
{
reason = attemptEvent.Reason ?? reason;
@@ -285,7 +285,7 @@ public abstract partial class InventorySystem
{
//reuse the event. this is gucci, right?
attemptEvent.Reason = null;
RaiseLocalEvent(actor, attemptEvent);
RaiseLocalEvent(actor, attemptEvent, true);
if (attemptEvent.Cancelled)
{
reason = attemptEvent.Reason ?? reason;
@@ -294,7 +294,7 @@ public abstract partial class InventorySystem
}
var itemAttemptEvent = new BeingEquippedAttemptEvent(actor, target, itemUid, slotDefinition);
RaiseLocalEvent(itemUid, itemAttemptEvent);
RaiseLocalEvent(itemUid, itemAttemptEvent, true);
if (itemAttemptEvent.Cancelled)
{
reason = itemAttemptEvent.Reason ?? reason;
@@ -426,7 +426,7 @@ public abstract partial class InventorySystem
}
var attemptEvent = new IsUnequippingAttemptEvent(actor, target, itemUid, slotDefinition);
RaiseLocalEvent(target, attemptEvent);
RaiseLocalEvent(target, attemptEvent, true);
if (attemptEvent.Cancelled)
{
reason = attemptEvent.Reason ?? reason;
@@ -437,7 +437,7 @@ public abstract partial class InventorySystem
{
//reuse the event. this is gucci, right?
attemptEvent.Reason = null;
RaiseLocalEvent(actor, attemptEvent);
RaiseLocalEvent(actor, attemptEvent, true);
if (attemptEvent.Cancelled)
{
reason = attemptEvent.Reason ?? reason;
@@ -446,7 +446,7 @@ public abstract partial class InventorySystem
}
var itemAttemptEvent = new BeingUnequippedAttemptEvent(actor, target, itemUid, slotDefinition);
RaiseLocalEvent(itemUid, itemAttemptEvent);
RaiseLocalEvent(itemUid, itemAttemptEvent, true);
if (itemAttemptEvent.Cancelled)
{
reason = attemptEvent.Reason ?? reason;

View File

@@ -305,7 +305,7 @@ namespace Content.Shared.MobState.Components
state.UpdateState(Owner, threshold, entMan);
var message = new MobStateChangedEvent(this, old, state);
entMan.EventBus.RaiseLocalEvent(Owner, message);
entMan.EventBus.RaiseLocalEvent(Owner, message, true);
Dirty();
}
}

View File

@@ -48,7 +48,7 @@ namespace Content.Shared.Movement.EntitySystems
if (owner != null && session != null)
{
EntityManager.EventBus.RaiseLocalEvent(owner.Value, new RelayMoveInputEvent(session));
EntityManager.EventBus.RaiseLocalEvent(owner.Value, new RelayMoveInputEvent(session), true);
// For stuff like "Moving out of locker" or the likes
if (owner.Value.IsInContainer() &&
@@ -56,7 +56,7 @@ namespace Content.Shared.Movement.EntitySystems
mobState.IsAlive()))
{
var relayMoveEvent = new RelayMovementEntityEvent(owner.Value);
EntityManager.EventBus.RaiseLocalEvent(EntityManager.GetComponent<TransformComponent>(owner.Value).ParentUid, relayMoveEvent);
EntityManager.EventBus.RaiseLocalEvent(EntityManager.GetComponent<TransformComponent>(owner.Value).ParentUid, relayMoveEvent, true);
}
// Pass the rider's inputs to the vehicle (the rider itself is on the ignored list in C.S/MoverController.cs)
if (TryComp<RiderComponent>(owner.Value, out var rider) && rider.Vehicle != null && rider.Vehicle.HasKey)

View File

@@ -61,7 +61,7 @@ namespace Content.Shared.Pulling
RaiseLocalEvent(puller.Owner, message, broadcast: false);
if (Initialized(pullable.Owner))
RaiseLocalEvent(pullable.Owner, message);
RaiseLocalEvent(pullable.Owner, message, true);
// Networking
puller.Dirty();
@@ -117,7 +117,7 @@ namespace Content.Shared.Pulling
var message = new PullStartedMessage(pullerPhysics, pullablePhysics);
RaiseLocalEvent(puller.Owner, message, broadcast: false);
RaiseLocalEvent(pullable.Owner, message);
RaiseLocalEvent(pullable.Owner, message, true);
// Networking
Dirty(puller);
@@ -157,11 +157,11 @@ namespace Content.Shared.Pulling
if (movingTo == null)
{
RaiseLocalEvent(pullable.Owner, new PullableStopMovingMessage());
RaiseLocalEvent(pullable.Owner, new PullableStopMovingMessage(), true);
}
else
{
RaiseLocalEvent(pullable.Owner, new PullableMoveMessage());
RaiseLocalEvent(pullable.Owner, new PullableMoveMessage(), true);
}
}
}

View File

@@ -63,9 +63,9 @@ namespace Content.Shared.Pulling
}
var getPulled = new BeingPulledAttemptEvent(puller, pulled);
RaiseLocalEvent(pulled, getPulled);
RaiseLocalEvent(pulled, getPulled, true);
var startPull = new StartPullAttemptEvent(puller, pulled);
RaiseLocalEvent(puller, startPull);
RaiseLocalEvent(puller, startPull, true);
return (!startPull.Cancelled && !getPulled.Cancelled);
}
@@ -88,7 +88,7 @@ namespace Content.Shared.Pulling
}
var msg = new StopPullingEvent(user);
RaiseLocalEvent(pullable.Owner, msg);
RaiseLocalEvent(pullable.Owner, msg, true);
if (msg.Cancelled) return false;
@@ -183,7 +183,7 @@ namespace Content.Shared.Pulling
return false;
}
RaiseLocalEvent(pullable.Owner, pullAttempt);
RaiseLocalEvent(pullable.Owner, pullAttempt, true);
if (pullAttempt.Cancelled)
return false;

View File

@@ -77,7 +77,7 @@ public sealed class StepTriggerSystem : EntitySystem
return false;
var ev = new StepTriggeredEvent { Source = component.Owner, Tripper = otherUid };
RaiseLocalEvent(component.Owner, ref ev);
RaiseLocalEvent(component.Owner, ref ev, true);
component.CurrentlySteppedOn.Add(otherUid);
Dirty(component);
@@ -91,7 +91,7 @@ public sealed class StepTriggerSystem : EntitySystem
var msg = new StepTriggerAttemptEvent { Source = uid, Tripper = otherUid };
RaiseLocalEvent(uid, ref msg);
RaiseLocalEvent(uid, ref msg, true);
return msg.Continue;
}

View File

@@ -111,7 +111,7 @@ namespace Content.Shared.Throwing
}
}
EntityManager.EventBus.RaiseLocalEvent(uid, new StopThrowEvent {User = thrownItemComponent.Thrower});
EntityManager.EventBus.RaiseLocalEvent(uid, new StopThrowEvent {User = thrownItemComponent.Thrower}, true);
EntityManager.RemoveComponent<ThrownItemComponent>(uid);
}
@@ -146,8 +146,8 @@ namespace Content.Shared.Throwing
_adminLogger.Add(LogType.ThrowHit, LogImpact.Low,
$"{ToPrettyString(thrown.Owner):thrown} thrown by {ToPrettyString(user.Value):thrower} hit {ToPrettyString(target.Owner):target}.");
// TODO: Just pass in the bodies directly
RaiseLocalEvent(target.Owner, new ThrowHitByEvent(user, thrown.Owner, target.Owner));
RaiseLocalEvent(thrown.Owner, new ThrowDoHitEvent(user, thrown.Owner, target.Owner));
RaiseLocalEvent(target.Owner, new ThrowHitByEvent(user, thrown.Owner, target.Owner), true);
RaiseLocalEvent(thrown.Owner, new ThrowDoHitEvent(user, thrown.Owner, target.Owner), true);
}
}
}

View File

@@ -89,7 +89,7 @@ namespace Content.Shared.Verbs
if (types.Contains(typeof(InteractionVerb)))
{
var verbEvent = new GetVerbsEvent<InteractionVerb>(user, target, @using, hands, canInteract, canAccess);
RaiseLocalEvent(target, verbEvent);
RaiseLocalEvent(target, verbEvent, true);
verbs.UnionWith(verbEvent.Verbs);
}
@@ -98,35 +98,35 @@ namespace Content.Shared.Verbs
&& @using != target)
{
var verbEvent = new GetVerbsEvent<UtilityVerb>(user, target, @using, hands, canInteract, canAccess);
RaiseLocalEvent(@using.Value, verbEvent); // directed at used, not at target
RaiseLocalEvent(@using.Value, verbEvent, true); // directed at used, not at target
verbs.UnionWith(verbEvent.Verbs);
}
if (types.Contains(typeof(InnateVerb)))
{
var verbEvent = new GetVerbsEvent<InnateVerb>(user, target, @using, hands, canInteract, canAccess);
RaiseLocalEvent(user, verbEvent);
RaiseLocalEvent(user, verbEvent, true);
verbs.UnionWith(verbEvent.Verbs);
}
if (types.Contains(typeof(AlternativeVerb)))
{
var verbEvent = new GetVerbsEvent<AlternativeVerb>(user, target, @using, hands, canInteract, canAccess);
RaiseLocalEvent(target, verbEvent);
RaiseLocalEvent(target, verbEvent, true);
verbs.UnionWith(verbEvent.Verbs);
}
if (types.Contains(typeof(ActivationVerb)))
{
var verbEvent = new GetVerbsEvent<ActivationVerb>(user, target, @using, hands, canInteract, canAccess);
RaiseLocalEvent(target, verbEvent);
RaiseLocalEvent(target, verbEvent, true);
verbs.UnionWith(verbEvent.Verbs);
}
if (types.Contains(typeof(ExamineVerb)))
{
var verbEvent = new GetVerbsEvent<ExamineVerb>(user, target, @using, hands, canInteract, canAccess);
RaiseLocalEvent(target, verbEvent);
RaiseLocalEvent(target, verbEvent, true);
verbs.UnionWith(verbEvent.Verbs);
}
@@ -134,7 +134,7 @@ namespace Content.Shared.Verbs
if (types.Contains(typeof(Verb)))
{
var verbEvent = new GetVerbsEvent<Verb>(user, target, @using, hands, canInteract, canAccess);
RaiseLocalEvent(target, verbEvent);
RaiseLocalEvent(target, verbEvent, true);
verbs.UnionWith(verbEvent.Verbs);
}