Remove obsolete system event unsubscriptions (#4190)

This commit is contained in:
DrSmugleaf
2021-06-16 15:54:00 +02:00
committed by GitHub
parent e9d8c56ad1
commit e44663e99f
31 changed files with 0 additions and 206 deletions

View File

@@ -52,9 +52,6 @@ namespace Content.Client.Construction
{
base.Shutdown();
UnsubscribeLocalEvent<PlayerAttachSysMessage>();
UnsubscribeNetworkEvent<AckStructureConstructionMessage>();
CommandBinds.Unregister<ConstructionSystem>();
}

View File

@@ -39,12 +39,6 @@ namespace Content.Client.DoAfter
SubscribeLocalEvent<PlayerAttachSysMessage>(HandlePlayerAttached);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<PlayerAttachSysMessage>();
}
private void HandlePlayerAttached(PlayerAttachSysMessage message)
{
_attachedEntity = message.AttachedEntity;

View File

@@ -47,13 +47,6 @@ namespace Content.Client.HealthOverlay
SubscribeLocalEvent<PlayerAttachSysMessage>(HandlePlayerAttached);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<PlayerAttachSysMessage>();
}
public void Reset()
{
foreach (var gui in _guis.Values)

View File

@@ -29,16 +29,6 @@ namespace Content.Client.IconSmoothing
SubscribeLocalEvent<IconSmoothComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<IconSmoothDirtyEvent>();
UnsubscribeLocalEvent<IconSmoothComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
}
public override void FrameUpdate(float frameTime)
{
base.FrameUpdate(frameTime);

View File

@@ -16,13 +16,5 @@ namespace Content.Client.Pulling
SubscribeLocalEvent<PullableComponent, PullableMoveMessage>(OnPullableMove);
SubscribeLocalEvent<PullableComponent, PullableStopMovingMessage>(OnPullableStopMove);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<PullableComponent, PullableMoveMessage>(OnPullableMove);
UnsubscribeLocalEvent<PullableComponent, PullableStopMovingMessage>(OnPullableStopMove);
}
}
}

View File

@@ -63,9 +63,6 @@ namespace Content.Client.Verbs
{
base.Shutdown();
UnsubscribeNetworkEvent<VerbSystemMessages.VerbsResponseMessage>();
UnsubscribeNetworkEvent<PlayerContainerVisibilityMessage>();
UnsubscribeLocalEvent<MoveEvent>();
_contextMenuPresenter?.Dispose();
CommandBinds.Unregister<VerbSystem>();

View File

@@ -17,14 +17,6 @@ namespace Content.Client.Window
SubscribeLocalEvent<WindowComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<WindowSmoothDirtyEvent>();
UnsubscribeLocalEvent<WindowComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
}
private void HandleDirtyEvent(WindowSmoothDirtyEvent ev)
{
if (ev.Sender.HasComponent<WindowComponent>())

View File

@@ -455,13 +455,6 @@ namespace Content.IntegrationTests.Tests.Networking
SubscribeLocalEvent<SetFooMessage>(HandleMessage);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeNetworkEvent<SetFooMessage>();
UnsubscribeLocalEvent<SetFooMessage>();
}
private void HandleMessage(SetFooMessage message, EntitySessionEventArgs args)
{
var entity = EntityManager.GetEntity(message.Uid);

View File

@@ -42,13 +42,6 @@ namespace Content.Server.AI.EntitySystems
SubscribeLocalEvent<MobStateChangedMessage>(MobStateChanged);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<SleepAiMessage>();
UnsubscribeLocalEvent<MobStateChangedMessage>();
}
/// <inheritdoc />
public override void Update(float frameTime)
{

View File

@@ -99,10 +99,6 @@ namespace Content.Server.AI.Pathfinding.Accessible
_queuedCacheDeletions.Clear();
_mapManager.OnGridRemoved -= GridRemoved;
UnsubscribeLocalEvent<PathfindingChunkUpdateMessage>();
UnsubscribeNetworkEvent<SharedAiDebug.SubscribeReachableMessage>();
UnsubscribeNetworkEvent<SharedAiDebug.UnsubscribeReachableMessage>();
}
private void GridRemoved(MapId mapId, GridId gridId)

View File

@@ -215,9 +215,6 @@ namespace Content.Server.AI.Pathfinding
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<CollisionChangeMessage>();
UnsubscribeLocalEvent<MoveEvent>();
UnsubscribeLocalEvent<AccessReaderChangeMessage>();
_mapManager.OnGridRemoved -= HandleGridRemoval;
_mapManager.GridChanged -= QueueGridChange;

View File

@@ -21,14 +21,6 @@ namespace Content.Server.Body.Surgery.Components
SubscribeLocalEvent<SurgeryWindowCloseMessage>(OnSurgeryWindowClose);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<SurgeryWindowOpenMessage>();
UnsubscribeLocalEvent<SurgeryWindowCloseMessage>();
}
public void Reset()
{
_openSurgeryUIs.Clear();

View File

@@ -33,14 +33,6 @@ namespace Content.Server.Cloning
SubscribeLocalEvent<BeingClonedComponent, MindAddedMessage>(HandleMindAdded);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<CloningPodComponent, ActivateInWorldEvent>(HandleActivate);
UnsubscribeLocalEvent<BeingClonedComponent, MindAddedMessage>(HandleMindAdded);
}
internal void TransferMindToClone(Mind.Mind mind)
{
if (!ClonesWaitingForMind.TryGetValue(mind, out var entityUid) ||

View File

@@ -11,13 +11,6 @@ namespace Content.Server.Disposal.Mailing
SubscribeLocalEvent<DisposalMailingUnitComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<DisposalMailingUnitComponent, PhysicsBodyTypeChangedEvent>();
}
private static void BodyTypeChanged(
EntityUid uid,
DisposalMailingUnitComponent component,

View File

@@ -12,13 +12,6 @@ namespace Content.Server.Disposal.Tube
SubscribeLocalEvent<DisposalTubeComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<DisposalTubeComponent, PhysicsBodyTypeChangedEvent>();
}
private static void BodyTypeChanged(
EntityUid uid,
DisposalTubeComponent component,

View File

@@ -12,13 +12,6 @@ namespace Content.Server.Disposal.Unit.EntitySystems
SubscribeLocalEvent<DisposalUnitComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<DisposalUnitComponent, PhysicsBodyTypeChangedEvent>();
}
private static void BodyTypeChanged(
EntityUid uid,
DisposalUnitComponent component,

View File

@@ -19,13 +19,6 @@ namespace Content.Server.Engineering.EntitySystems
SubscribeLocalEvent<DisassembleOnActivateComponent, ActivateInWorldEvent>(HandleActivateInWorld);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<DisassembleOnActivateComponent, ActivateInWorldEvent>(HandleActivateInWorld);
}
private async void HandleActivateInWorld(EntityUid uid, DisassembleOnActivateComponent component, ActivateInWorldEvent args)
{
if (string.IsNullOrEmpty(component.Prototype))

View File

@@ -25,13 +25,6 @@ namespace Content.Server.Engineering.EntitySystems
SubscribeLocalEvent<SpawnAfterInteractComponent, AfterInteractEvent>(HandleAfterInteract);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<SpawnAfterInteractComponent, AfterInteractEvent>(HandleAfterInteract);
}
private async void HandleAfterInteract(EntityUid uid, SpawnAfterInteractComponent component, AfterInteractEvent args)
{
if (string.IsNullOrEmpty(component.Prototype))

View File

@@ -120,9 +120,6 @@ namespace Content.Server.GameObjects.EntitySystems
base.Shutdown();
_mapManager.MapCreated -= OnMapCreated;
UnsubscribeLocalEvent<RotateEvent>();
UnsubscribeLocalEvent<AirtightComponent, SnapGridPositionChangedEvent>(HandleSnapGridMove);
}
private void RotateEvent(RotateEvent ev)

View File

@@ -14,13 +14,6 @@ namespace Content.Server.GameObjects.EntitySystems
SubscribeLocalEvent<GasCanisterComponent, PhysicsBodyTypeChangedEvent>(OnBodyTypeChanged);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<GasCanisterComponent, PhysicsBodyTypeChangedEvent>();
}
private static void OnBodyTypeChanged(
EntityUid uid,
GasCanisterComponent component,

View File

@@ -16,14 +16,6 @@ namespace Content.Server.Ghost
SubscribeLocalEvent<GhostComponent, MindUnvisitedMessage>(OnMindUnvisitedMessage);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<GhostComponent, MindRemovedMessage>(OnMindRemovedMessage);
UnsubscribeLocalEvent<GhostComponent, MindUnvisitedMessage>(OnMindUnvisitedMessage);
}
private void OnMindRemovedMessage(EntityUid uid, GhostComponent component, MindRemovedMessage args)
{
DeleteEntity(uid);

View File

@@ -36,13 +36,6 @@ namespace Content.Server.Ghost.Roles
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<PlayerAttachedEvent>();
}
private uint GetNextRoleIdentifier()
{
return unchecked(_nextRoleIdentifier++);

View File

@@ -26,14 +26,6 @@ namespace Content.Server.Gravity.EntitySystems
SubscribeLocalEvent<EntParentChangedMessage>(EntParentChanged);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<GravityChangedMessage>();
UnsubscribeLocalEvent<EntParentChangedMessage>();
}
public void Reset()
{
_alerts.Clear();

View File

@@ -24,8 +24,6 @@ namespace Content.Server.Light.EntitySystems
{
base.Shutdown();
_activeLights.Clear();
UnsubscribeLocalEvent<ActivateHandheldLightMessage>();
UnsubscribeLocalEvent<DeactivateHandheldLightMessage>();
}
private void HandleActivate(ActivateHandheldLightMessage message)

View File

@@ -19,14 +19,6 @@ namespace Content.Server.Light.EntitySystems
SubscribeLocalEvent<LightReplacerComponent, AfterInteractEvent>(HandleAfterInteract);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<LightReplacerComponent, InteractUsingEvent>(HandleInteract);
UnsubscribeLocalEvent<LightReplacerComponent, AfterInteractEvent>(HandleAfterInteract);
}
private void HandleAfterInteract(EntityUid uid, LightReplacerComponent component, AfterInteractEvent eventArgs)
{
// standard interaction checks

View File

@@ -15,15 +15,6 @@ namespace Content.Server.NodeContainer.EntitySystems
SubscribeLocalEvent<NodeContainerComponent, RotateEvent>(OnRotateEvent);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<NodeContainerComponent, PhysicsBodyTypeChangedEvent>(OnBodyTypeChanged);
UnsubscribeLocalEvent<NodeContainerComponent, RotateEvent>(OnRotateEvent);
}
private void OnBodyTypeChanged(EntityUid uid, NodeContainerComponent component, PhysicsBodyTypeChangedEvent args)
{
component.AnchorUpdate();

View File

@@ -16,13 +16,6 @@ namespace Content.Server.ParticleAccelerator
SubscribeLocalEvent<ParticleAcceleratorPartComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<ParticleAcceleratorPartComponent, PhysicsBodyTypeChangedEvent>();
}
private static void BodyTypeChanged(
EntityUid uid,
ParticleAcceleratorPartComponent component,

View File

@@ -12,13 +12,6 @@ namespace Content.Server.Power.EntitySystems
SubscribeLocalEvent<PowerReceiverComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<PowerReceiverComponent, PhysicsBodyTypeChangedEvent>();
}
private static void BodyTypeChanged(
EntityUid uid,
PowerReceiverComponent component,

View File

@@ -16,13 +16,5 @@ namespace Content.Server.Pulling
SubscribeLocalEvent<PullableComponent, PullableMoveMessage>(OnPullableMove);
SubscribeLocalEvent<PullableComponent, PullableStopMovingMessage>(OnPullableStopMove);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<PullableComponent, PullableMoveMessage>(OnPullableMove);
UnsubscribeLocalEvent<PullableComponent, PullableStopMovingMessage>(OnPullableStopMove);
}
}
}

View File

@@ -12,13 +12,6 @@ namespace Content.Server.Singularity.EntitySystems
SubscribeLocalEvent<ContainmentFieldGeneratorComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<ContainmentFieldGeneratorComponent, PhysicsBodyTypeChangedEvent>();
}
private static void BodyTypeChanged(
EntityUid uid,
ContainmentFieldGeneratorComponent component,

View File

@@ -22,14 +22,6 @@ namespace Content.Server.Storage
SubscribeLocalEvent<EntInsertedIntoContainerMessage>(HandleEntityInsertedIntoContainer);
}
public override void Shutdown()
{
base.Shutdown();
UnsubscribeLocalEvent<EntRemovedFromContainerMessage>();
UnsubscribeLocalEvent<EntInsertedIntoContainerMessage>();
}
/// <inheritdoc />
public override void Update(float frameTime)
{