diff --git a/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs b/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs index 039eba03f9..7adc08b7af 100644 --- a/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs +++ b/Content.Client/GameObjects/Components/IconSmoothing/IconSmoothComponent.cs @@ -81,7 +81,7 @@ namespace Content.Client.GameObjects.Components.IconSmoothing base.Startup(); SnapGrid.OnPositionChanged += SnapGridOnPositionChanged; - Owner.EntityManager.EventBus.RaiseEvent(new IconSmoothDirtyEvent(Owner,null, SnapGrid.Offset, Mode)); + Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner,null, SnapGrid.Offset, Mode)); if (Mode == IconSmoothingMode.Corners) { var state0 = $"{StateBase}0"; @@ -203,12 +203,12 @@ namespace Content.Client.GameObjects.Components.IconSmoothing base.Shutdown(); SnapGrid.OnPositionChanged -= SnapGridOnPositionChanged; - Owner.EntityManager.EventBus.RaiseEvent(new IconSmoothDirtyEvent(Owner, _lastPosition, SnapGrid.Offset, Mode)); + Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, _lastPosition, SnapGrid.Offset, Mode)); } private void SnapGridOnPositionChanged() { - Owner.EntityManager.EventBus.RaiseEvent(new IconSmoothDirtyEvent(Owner, _lastPosition, SnapGrid.Offset, Mode)); + Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new IconSmoothDirtyEvent(Owner, _lastPosition, SnapGrid.Offset, Mode)); _lastPosition = (Owner.Transform.GridID, SnapGrid.Position); } diff --git a/Content.Client/GameObjects/Components/SubFloorHideComponent.cs b/Content.Client/GameObjects/Components/SubFloorHideComponent.cs index cf8d72f286..bed55a84be 100644 --- a/Content.Client/GameObjects/Components/SubFloorHideComponent.cs +++ b/Content.Client/GameObjects/Components/SubFloorHideComponent.cs @@ -33,7 +33,7 @@ namespace Content.Client.GameObjects.Components base.Startup(); _snapGridComponent.OnPositionChanged += SnapGridOnPositionChanged; - Owner.EntityManager.EventBus.RaiseEvent(new SubFloorHideDirtyEvent(Owner)); + Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new SubFloorHideDirtyEvent(Owner)); } /// @@ -45,12 +45,12 @@ namespace Content.Client.GameObjects.Components return; _snapGridComponent.OnPositionChanged -= SnapGridOnPositionChanged; - Owner.EntityManager.EventBus.RaiseEvent(new SubFloorHideDirtyEvent(Owner)); + Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new SubFloorHideDirtyEvent(Owner)); } private void SnapGridOnPositionChanged() { - Owner.EntityManager.EventBus.RaiseEvent(new SubFloorHideDirtyEvent(Owner)); + Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new SubFloorHideDirtyEvent(Owner)); } } diff --git a/Content.Client/GameObjects/Components/WindowComponent.cs b/Content.Client/GameObjects/Components/WindowComponent.cs index f3f807c75d..b06ae08028 100644 --- a/Content.Client/GameObjects/Components/WindowComponent.cs +++ b/Content.Client/GameObjects/Components/WindowComponent.cs @@ -31,7 +31,7 @@ namespace Content.Client.GameObjects.Components base.Startup(); _snapGrid.OnPositionChanged += SnapGridOnPositionChanged; - Owner.EntityManager.EventBus.RaiseEvent(new WindowSmoothDirtyEvent(Owner)); + Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new WindowSmoothDirtyEvent(Owner)); var state0 = $"{_stateBase}0"; _sprite.LayerMapSet(CornerLayers.SE, _sprite.AddLayerState(state0)); @@ -54,7 +54,7 @@ namespace Content.Client.GameObjects.Components private void SnapGridOnPositionChanged() { - Owner.EntityManager.EventBus.RaiseEvent(new WindowSmoothDirtyEvent(Owner)); + Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new WindowSmoothDirtyEvent(Owner)); } public void UpdateSprite() diff --git a/Content.Client/GameObjects/EntitySystems/ExamineSystem.cs b/Content.Client/GameObjects/EntitySystems/ExamineSystem.cs index 6b5792b6fc..ab07851402 100644 --- a/Content.Client/GameObjects/EntitySystems/ExamineSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/ExamineSystem.cs @@ -111,7 +111,7 @@ namespace Content.Client.GameObjects.EntitySystems { _requestCancelTokenSource = new CancellationTokenSource(); response = - await AwaitNetMessage(_requestCancelTokenSource + await AwaitNetworkEvent(_requestCancelTokenSource .Token); } catch (TaskCanceledException) diff --git a/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs b/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs index 3b6aece8be..9cd35a72f4 100644 --- a/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/IconSmoothSystem.cs @@ -30,7 +30,7 @@ namespace Content.Client.GameObjects.EntitySystems /// public override void Initialize() { - SubscribeEvent(HandleDirtyEvent); + SubscribeLocalEvent(HandleDirtyEvent); IoCManager.InjectDependencies(this); } diff --git a/Content.Client/GameObjects/EntitySystems/MeleeWeaponSystem.cs b/Content.Client/GameObjects/EntitySystems/MeleeWeaponSystem.cs index 2f3c04e7a7..9691ecafb3 100644 --- a/Content.Client/GameObjects/EntitySystems/MeleeWeaponSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/MeleeWeaponSystem.cs @@ -23,7 +23,7 @@ namespace Content.Client.GameObjects.EntitySystems public override void Initialize() { - SubscribeEvent(PlayWeaponArc); + SubscribeNetworkEvent(PlayWeaponArc); EntityQuery = new TypeEntityQuery(typeof(MeleeWeaponArcAnimationComponent)); } diff --git a/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs b/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs index b15e887080..ebcd847818 100644 --- a/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/SubFloorHideSystem.cs @@ -28,7 +28,7 @@ namespace Content.Client.GameObjects.EntitySystems _mapManager.GridChanged += MapManagerOnGridChanged; _mapManager.TileChanged += MapManagerOnTileChanged; - SubscribeEvent(HandleDirtyEvent); + SubscribeLocalEvent(HandleDirtyEvent); } private void HandleDirtyEvent(SubFloorHideDirtyEvent ev) diff --git a/Content.Client/GameObjects/EntitySystems/VerbSystem.cs b/Content.Client/GameObjects/EntitySystems/VerbSystem.cs index 155a3900cc..c6f5ae5d36 100644 --- a/Content.Client/GameObjects/EntitySystems/VerbSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/VerbSystem.cs @@ -40,7 +40,7 @@ namespace Content.Client.GameObjects.EntitySystems { base.Initialize(); - SubscribeEvent(FillEntityPopup); + SubscribeNetworkEvent(FillEntityPopup); IoCManager.InjectDependencies(this); diff --git a/Content.Client/GameObjects/EntitySystems/WindowSystem.cs b/Content.Client/GameObjects/EntitySystems/WindowSystem.cs index 4e0ee313f5..bf4a7c4819 100644 --- a/Content.Client/GameObjects/EntitySystems/WindowSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/WindowSystem.cs @@ -16,7 +16,7 @@ namespace Content.Client.GameObjects.EntitySystems { base.Initialize(); - SubscribeEvent(HandleDirtyEvent); + SubscribeLocalEvent(HandleDirtyEvent); } private void HandleDirtyEvent(WindowSmoothDirtyEvent ev) diff --git a/Content.Server/GameObjects/Components/Mobs/SpeciesComponent.cs b/Content.Server/GameObjects/Components/Mobs/SpeciesComponent.cs index bf9bdfc413..9fbc10f84c 100644 --- a/Content.Server/GameObjects/Components/Mobs/SpeciesComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/SpeciesComponent.cs @@ -168,7 +168,8 @@ namespace Content.Server.GameObjects currentstate = threshold; - Owner.RaiseEvent(new MobDamageStateChangedMessage(this)); + EntityEventArgs toRaise = new MobDamageStateChangedMessage(this); + Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, toRaise); } void IExAct.OnExplosion(ExplosionEventArgs eventArgs) diff --git a/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs index 2164cf3357..2f67454a90 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs @@ -35,7 +35,7 @@ namespace Content.Server.GameObjects.EntitySystems { base.Initialize(); - SubscribeEvent(ExamineInfoRequest); + SubscribeNetworkEvent(ExamineInfoRequest); IoCManager.InjectDependencies(this); } diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index 0b3ead0a58..e8297572f2 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -333,7 +333,7 @@ namespace Content.Server.GameObjects.EntitySystems private void InteractionActivate(IEntity user, IEntity used) { var activateMsg = new ActivateInWorldMessage(user, used); - RaiseEvent(activateMsg); + RaiseLocalEvent(activateMsg); if (activateMsg.Handled) { return; @@ -509,7 +509,7 @@ namespace Content.Server.GameObjects.EntitySystems private void InteractAfterAttack(IEntity user, IEntity weapon, GridCoordinates clickLocation) { var message = new AfterAttackMessage(user, weapon, null, clickLocation); - RaiseEvent(message); + RaiseLocalEvent(message); if (message.Handled) { return; @@ -531,7 +531,7 @@ namespace Content.Server.GameObjects.EntitySystems public void Interaction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clickLocation) { var attackMsg = new AttackByMessage(user, weapon, attacked, clickLocation); - RaiseEvent(attackMsg); + RaiseLocalEvent(attackMsg); if (attackMsg.Handled) { return; @@ -553,7 +553,7 @@ namespace Content.Server.GameObjects.EntitySystems } var afterAtkMsg = new AfterAttackMessage(user, weapon, attacked, clickLocation); - RaiseEvent(afterAtkMsg); + RaiseLocalEvent(afterAtkMsg); if (afterAtkMsg.Handled) { return; @@ -579,7 +579,7 @@ namespace Content.Server.GameObjects.EntitySystems public void Interaction(IEntity user, IEntity attacked) { var message = new AttackHandMessage(user, attacked); - RaiseEvent(message); + RaiseLocalEvent(message); if (message.Handled) { return; @@ -630,7 +630,7 @@ namespace Content.Server.GameObjects.EntitySystems } var useMsg = new UseInHandMessage(user, used); - RaiseEvent(useMsg); + RaiseLocalEvent(useMsg); if (useMsg.Handled) { return; @@ -668,7 +668,7 @@ namespace Content.Server.GameObjects.EntitySystems public void ThrownInteraction(IEntity user, IEntity thrown) { var throwMsg = new ThrownMessage(user, thrown); - RaiseEvent(throwMsg); + RaiseLocalEvent(throwMsg); if (throwMsg.Handled) { return; @@ -690,7 +690,7 @@ namespace Content.Server.GameObjects.EntitySystems public void LandInteraction(IEntity user, IEntity landing, GridCoordinates landLocation) { var landMsg = new LandMessage(user, landing, landLocation); - RaiseEvent(landMsg); + RaiseLocalEvent(landMsg); if (landMsg.Handled) { return; @@ -724,7 +724,7 @@ namespace Content.Server.GameObjects.EntitySystems public void DroppedInteraction(IEntity user, IEntity item) { var dropMsg = new DroppedMessage(user, item); - RaiseEvent(dropMsg); + RaiseLocalEvent(dropMsg); if (dropMsg.Handled) { return; @@ -746,7 +746,7 @@ namespace Content.Server.GameObjects.EntitySystems public void HandSelectedInteraction(IEntity user, IEntity item) { var handSelectedMsg = new HandSelectedMessage(user, item); - RaiseEvent(handSelectedMsg); + RaiseLocalEvent(handSelectedMsg); if (handSelectedMsg.Handled) { return; @@ -768,7 +768,7 @@ namespace Content.Server.GameObjects.EntitySystems public void HandDeselectedInteraction(IEntity user, IEntity item) { var handDeselectedMsg = new HandDeselectedMessage(user, item); - RaiseEvent(handDeselectedMsg); + RaiseLocalEvent(handDeselectedMsg); if (handDeselectedMsg.Handled) { return; @@ -791,7 +791,7 @@ namespace Content.Server.GameObjects.EntitySystems public void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clickLocation) { var rangedMsg = new RangedAttackMessage(user, weapon, attacked, clickLocation); - RaiseEvent(rangedMsg); + RaiseLocalEvent(rangedMsg); if (rangedMsg.Handled) return; @@ -812,7 +812,7 @@ namespace Content.Server.GameObjects.EntitySystems } var afterAtkMsg = new AfterAttackMessage(user, weapon, attacked, clickLocation); - RaiseEvent(afterAtkMsg); + RaiseLocalEvent(afterAtkMsg); if (afterAtkMsg.Handled) return; diff --git a/Content.Server/GameObjects/EntitySystems/CombatModeSystem.cs b/Content.Server/GameObjects/EntitySystems/CombatModeSystem.cs index e81509a53c..ec560d9295 100644 --- a/Content.Server/GameObjects/EntitySystems/CombatModeSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/CombatModeSystem.cs @@ -23,8 +23,8 @@ namespace Content.Server.GameObjects.EntitySystems { base.Initialize(); - SubscribeEvent(SetTargetZoneHandler); - SubscribeEvent(SetCombatModeActiveHandler); + SubscribeNetworkEvent(SetTargetZoneHandler); + SubscribeNetworkEvent(SetCombatModeActiveHandler); var inputSystem = EntitySystemManager.GetEntitySystem(); inputSystem.BindMap.BindFunction(ContentKeyFunctions.ToggleCombatMode, diff --git a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs index 2bf290a69a..c9d27f0ce3 100644 --- a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs @@ -41,8 +41,8 @@ namespace Content.Server.GameObjects.EntitySystems { base.Initialize(); - SubscribeEvent(HandleContainerModified); - SubscribeEvent(HandleContainerModified); + SubscribeLocalEvent(HandleContainerModified); + SubscribeLocalEvent(HandleContainerModified); var input = EntitySystemManager.GetEntitySystem(); input.BindMap.BindFunction(ContentKeyFunctions.SwapHands, InputCmdHandler.FromDelegate(HandleSwapHands)); diff --git a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs index b6310d8f86..1530112eaf 100644 --- a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs @@ -74,8 +74,8 @@ namespace Content.Server.GameObjects.EntitySystems input.BindMap.BindFunction(EngineKeyFunctions.MoveDown, moveDownCmdHandler); input.BindMap.BindFunction(EngineKeyFunctions.Run, runCmdHandler); - SubscribeEvent(PlayerAttached); - SubscribeEvent(PlayerDetached); + SubscribeLocalEvent(PlayerAttached); + SubscribeLocalEvent(PlayerDetached); _audioSystem = EntitySystemManager.GetEntitySystem(); } diff --git a/Content.Server/GameObjects/EntitySystems/StorageSystem.cs b/Content.Server/GameObjects/EntitySystems/StorageSystem.cs index 98a84aab51..9a57e99fe9 100644 --- a/Content.Server/GameObjects/EntitySystems/StorageSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/StorageSystem.cs @@ -14,8 +14,8 @@ namespace Content.Server.GameObjects.EntitySystems /// public override void Initialize() { - SubscribeEvent(HandleEntityRemovedFromContainer); - SubscribeEvent(HandleEntityInsertedIntoContainer); + SubscribeLocalEvent(HandleEntityRemovedFromContainer); + SubscribeLocalEvent(HandleEntityInsertedIntoContainer); EntityQuery = new TypeEntityQuery(typeof(ServerStorageComponent)); } diff --git a/Content.Server/GameObjects/EntitySystems/VerbSystem.cs b/Content.Server/GameObjects/EntitySystems/VerbSystem.cs index 778a8c35d8..d9c44a1cd6 100644 --- a/Content.Server/GameObjects/EntitySystems/VerbSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/VerbSystem.cs @@ -20,8 +20,8 @@ namespace Content.Server.GameObjects.EntitySystems { base.Initialize(); - SubscribeEvent(RequestVerbs); - SubscribeEvent(UseVerb); + SubscribeNetworkEvent(RequestVerbs); + SubscribeNetworkEvent(UseVerb); IoCManager.InjectDependencies(this); } diff --git a/Content.Server/GameTicking/GameRules/RuleDeathMatch.cs b/Content.Server/GameTicking/GameRules/RuleDeathMatch.cs index f27ad9e793..ee841b599d 100644 --- a/Content.Server/GameTicking/GameRules/RuleDeathMatch.cs +++ b/Content.Server/GameTicking/GameRules/RuleDeathMatch.cs @@ -34,7 +34,7 @@ namespace Content.Server.GameTicking.GameRules { _chatManager.DispatchServerAnnouncement("The game is now a death match. Kill everybody else to win!"); - _entityManager.EventBus.SubscribeEvent(_onMobDamageStateChanged, this); + _entityManager.EventBus.SubscribeEvent(EventSource.Local, this, _onMobDamageStateChanged); _playerManager.PlayerStatusChanged += PlayerManagerOnPlayerStatusChanged; } @@ -42,7 +42,7 @@ namespace Content.Server.GameTicking.GameRules { base.Removed(); - _entityManager.EventBus.UnsubscribeEvent(this); + _entityManager.EventBus.UnsubscribeEvent(EventSource.Local, this); _playerManager.PlayerStatusChanged -= PlayerManagerOnPlayerStatusChanged; }