SubscribeEvent() has been split into SubscribeNetworkEvent() and SubscribeLocalEvent() methods on EntitySystem.
Most methods on EntityEventBus now require callers to specify the source (Local or Network) of the events.
This commit is contained in:
@@ -81,7 +81,7 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
|
|||||||
base.Startup();
|
base.Startup();
|
||||||
|
|
||||||
SnapGrid.OnPositionChanged += SnapGridOnPositionChanged;
|
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)
|
if (Mode == IconSmoothingMode.Corners)
|
||||||
{
|
{
|
||||||
var state0 = $"{StateBase}0";
|
var state0 = $"{StateBase}0";
|
||||||
@@ -203,12 +203,12 @@ namespace Content.Client.GameObjects.Components.IconSmoothing
|
|||||||
base.Shutdown();
|
base.Shutdown();
|
||||||
|
|
||||||
SnapGrid.OnPositionChanged -= SnapGridOnPositionChanged;
|
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()
|
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);
|
_lastPosition = (Owner.Transform.GridID, SnapGrid.Position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Content.Client.GameObjects.Components
|
|||||||
base.Startup();
|
base.Startup();
|
||||||
|
|
||||||
_snapGridComponent.OnPositionChanged += SnapGridOnPositionChanged;
|
_snapGridComponent.OnPositionChanged += SnapGridOnPositionChanged;
|
||||||
Owner.EntityManager.EventBus.RaiseEvent(new SubFloorHideDirtyEvent(Owner));
|
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new SubFloorHideDirtyEvent(Owner));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -45,12 +45,12 @@ namespace Content.Client.GameObjects.Components
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_snapGridComponent.OnPositionChanged -= SnapGridOnPositionChanged;
|
_snapGridComponent.OnPositionChanged -= SnapGridOnPositionChanged;
|
||||||
Owner.EntityManager.EventBus.RaiseEvent(new SubFloorHideDirtyEvent(Owner));
|
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new SubFloorHideDirtyEvent(Owner));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SnapGridOnPositionChanged()
|
private void SnapGridOnPositionChanged()
|
||||||
{
|
{
|
||||||
Owner.EntityManager.EventBus.RaiseEvent(new SubFloorHideDirtyEvent(Owner));
|
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new SubFloorHideDirtyEvent(Owner));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Content.Client.GameObjects.Components
|
|||||||
base.Startup();
|
base.Startup();
|
||||||
|
|
||||||
_snapGrid.OnPositionChanged += SnapGridOnPositionChanged;
|
_snapGrid.OnPositionChanged += SnapGridOnPositionChanged;
|
||||||
Owner.EntityManager.EventBus.RaiseEvent(new WindowSmoothDirtyEvent(Owner));
|
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new WindowSmoothDirtyEvent(Owner));
|
||||||
|
|
||||||
var state0 = $"{_stateBase}0";
|
var state0 = $"{_stateBase}0";
|
||||||
_sprite.LayerMapSet(CornerLayers.SE, _sprite.AddLayerState(state0));
|
_sprite.LayerMapSet(CornerLayers.SE, _sprite.AddLayerState(state0));
|
||||||
@@ -54,7 +54,7 @@ namespace Content.Client.GameObjects.Components
|
|||||||
|
|
||||||
private void SnapGridOnPositionChanged()
|
private void SnapGridOnPositionChanged()
|
||||||
{
|
{
|
||||||
Owner.EntityManager.EventBus.RaiseEvent(new WindowSmoothDirtyEvent(Owner));
|
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, new WindowSmoothDirtyEvent(Owner));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateSprite()
|
public void UpdateSprite()
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
_requestCancelTokenSource = new CancellationTokenSource();
|
_requestCancelTokenSource = new CancellationTokenSource();
|
||||||
response =
|
response =
|
||||||
await AwaitNetMessage<ExamineSystemMessages.ExamineInfoResponseMessage>(_requestCancelTokenSource
|
await AwaitNetworkEvent<ExamineSystemMessages.ExamineInfoResponseMessage>(_requestCancelTokenSource
|
||||||
.Token);
|
.Token);
|
||||||
}
|
}
|
||||||
catch (TaskCanceledException)
|
catch (TaskCanceledException)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
SubscribeEvent<IconSmoothDirtyEvent>(HandleDirtyEvent);
|
SubscribeLocalEvent<IconSmoothDirtyEvent>(HandleDirtyEvent);
|
||||||
|
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
SubscribeEvent<PlayMeleeWeaponAnimationMessage>(PlayWeaponArc);
|
SubscribeNetworkEvent<PlayMeleeWeaponAnimationMessage>(PlayWeaponArc);
|
||||||
EntityQuery = new TypeEntityQuery(typeof(MeleeWeaponArcAnimationComponent));
|
EntityQuery = new TypeEntityQuery(typeof(MeleeWeaponArcAnimationComponent));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
_mapManager.GridChanged += MapManagerOnGridChanged;
|
_mapManager.GridChanged += MapManagerOnGridChanged;
|
||||||
_mapManager.TileChanged += MapManagerOnTileChanged;
|
_mapManager.TileChanged += MapManagerOnTileChanged;
|
||||||
|
|
||||||
SubscribeEvent<SubFloorHideDirtyEvent>(HandleDirtyEvent);
|
SubscribeLocalEvent<SubFloorHideDirtyEvent>(HandleDirtyEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleDirtyEvent(SubFloorHideDirtyEvent ev)
|
private void HandleDirtyEvent(SubFloorHideDirtyEvent ev)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeEvent<VerbSystemMessages.VerbsResponseMessage>(FillEntityPopup);
|
SubscribeNetworkEvent<VerbSystemMessages.VerbsResponseMessage>(FillEntityPopup);
|
||||||
|
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeEvent<WindowSmoothDirtyEvent>(HandleDirtyEvent);
|
SubscribeLocalEvent<WindowSmoothDirtyEvent>(HandleDirtyEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleDirtyEvent(WindowSmoothDirtyEvent ev)
|
private void HandleDirtyEvent(WindowSmoothDirtyEvent ev)
|
||||||
|
|||||||
@@ -168,7 +168,8 @@ namespace Content.Server.GameObjects
|
|||||||
|
|
||||||
currentstate = threshold;
|
currentstate = threshold;
|
||||||
|
|
||||||
Owner.RaiseEvent(new MobDamageStateChangedMessage(this));
|
EntityEventArgs toRaise = new MobDamageStateChangedMessage(this);
|
||||||
|
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, toRaise);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IExAct.OnExplosion(ExplosionEventArgs eventArgs)
|
void IExAct.OnExplosion(ExplosionEventArgs eventArgs)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeEvent<ExamineSystemMessages.RequestExamineInfoMessage>(ExamineInfoRequest);
|
SubscribeNetworkEvent<ExamineSystemMessages.RequestExamineInfoMessage>(ExamineInfoRequest);
|
||||||
|
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
private void InteractionActivate(IEntity user, IEntity used)
|
private void InteractionActivate(IEntity user, IEntity used)
|
||||||
{
|
{
|
||||||
var activateMsg = new ActivateInWorldMessage(user, used);
|
var activateMsg = new ActivateInWorldMessage(user, used);
|
||||||
RaiseEvent(activateMsg);
|
RaiseLocalEvent(activateMsg);
|
||||||
if (activateMsg.Handled)
|
if (activateMsg.Handled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -509,7 +509,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
private void InteractAfterAttack(IEntity user, IEntity weapon, GridCoordinates clickLocation)
|
private void InteractAfterAttack(IEntity user, IEntity weapon, GridCoordinates clickLocation)
|
||||||
{
|
{
|
||||||
var message = new AfterAttackMessage(user, weapon, null, clickLocation);
|
var message = new AfterAttackMessage(user, weapon, null, clickLocation);
|
||||||
RaiseEvent(message);
|
RaiseLocalEvent(message);
|
||||||
if (message.Handled)
|
if (message.Handled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -531,7 +531,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
public void Interaction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clickLocation)
|
public void Interaction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clickLocation)
|
||||||
{
|
{
|
||||||
var attackMsg = new AttackByMessage(user, weapon, attacked, clickLocation);
|
var attackMsg = new AttackByMessage(user, weapon, attacked, clickLocation);
|
||||||
RaiseEvent(attackMsg);
|
RaiseLocalEvent(attackMsg);
|
||||||
if (attackMsg.Handled)
|
if (attackMsg.Handled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -553,7 +553,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
}
|
}
|
||||||
|
|
||||||
var afterAtkMsg = new AfterAttackMessage(user, weapon, attacked, clickLocation);
|
var afterAtkMsg = new AfterAttackMessage(user, weapon, attacked, clickLocation);
|
||||||
RaiseEvent(afterAtkMsg);
|
RaiseLocalEvent(afterAtkMsg);
|
||||||
if (afterAtkMsg.Handled)
|
if (afterAtkMsg.Handled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -579,7 +579,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
public void Interaction(IEntity user, IEntity attacked)
|
public void Interaction(IEntity user, IEntity attacked)
|
||||||
{
|
{
|
||||||
var message = new AttackHandMessage(user, attacked);
|
var message = new AttackHandMessage(user, attacked);
|
||||||
RaiseEvent(message);
|
RaiseLocalEvent(message);
|
||||||
if (message.Handled)
|
if (message.Handled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -630,7 +630,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
}
|
}
|
||||||
|
|
||||||
var useMsg = new UseInHandMessage(user, used);
|
var useMsg = new UseInHandMessage(user, used);
|
||||||
RaiseEvent(useMsg);
|
RaiseLocalEvent(useMsg);
|
||||||
if (useMsg.Handled)
|
if (useMsg.Handled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -668,7 +668,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
public void ThrownInteraction(IEntity user, IEntity thrown)
|
public void ThrownInteraction(IEntity user, IEntity thrown)
|
||||||
{
|
{
|
||||||
var throwMsg = new ThrownMessage(user, thrown);
|
var throwMsg = new ThrownMessage(user, thrown);
|
||||||
RaiseEvent(throwMsg);
|
RaiseLocalEvent(throwMsg);
|
||||||
if (throwMsg.Handled)
|
if (throwMsg.Handled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -690,7 +690,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
public void LandInteraction(IEntity user, IEntity landing, GridCoordinates landLocation)
|
public void LandInteraction(IEntity user, IEntity landing, GridCoordinates landLocation)
|
||||||
{
|
{
|
||||||
var landMsg = new LandMessage(user, landing, landLocation);
|
var landMsg = new LandMessage(user, landing, landLocation);
|
||||||
RaiseEvent(landMsg);
|
RaiseLocalEvent(landMsg);
|
||||||
if (landMsg.Handled)
|
if (landMsg.Handled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -724,7 +724,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
public void DroppedInteraction(IEntity user, IEntity item)
|
public void DroppedInteraction(IEntity user, IEntity item)
|
||||||
{
|
{
|
||||||
var dropMsg = new DroppedMessage(user, item);
|
var dropMsg = new DroppedMessage(user, item);
|
||||||
RaiseEvent(dropMsg);
|
RaiseLocalEvent(dropMsg);
|
||||||
if (dropMsg.Handled)
|
if (dropMsg.Handled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -746,7 +746,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
public void HandSelectedInteraction(IEntity user, IEntity item)
|
public void HandSelectedInteraction(IEntity user, IEntity item)
|
||||||
{
|
{
|
||||||
var handSelectedMsg = new HandSelectedMessage(user, item);
|
var handSelectedMsg = new HandSelectedMessage(user, item);
|
||||||
RaiseEvent(handSelectedMsg);
|
RaiseLocalEvent(handSelectedMsg);
|
||||||
if (handSelectedMsg.Handled)
|
if (handSelectedMsg.Handled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -768,7 +768,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
public void HandDeselectedInteraction(IEntity user, IEntity item)
|
public void HandDeselectedInteraction(IEntity user, IEntity item)
|
||||||
{
|
{
|
||||||
var handDeselectedMsg = new HandDeselectedMessage(user, item);
|
var handDeselectedMsg = new HandDeselectedMessage(user, item);
|
||||||
RaiseEvent(handDeselectedMsg);
|
RaiseLocalEvent(handDeselectedMsg);
|
||||||
if (handDeselectedMsg.Handled)
|
if (handDeselectedMsg.Handled)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -791,7 +791,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
public void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clickLocation)
|
public void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clickLocation)
|
||||||
{
|
{
|
||||||
var rangedMsg = new RangedAttackMessage(user, weapon, attacked, clickLocation);
|
var rangedMsg = new RangedAttackMessage(user, weapon, attacked, clickLocation);
|
||||||
RaiseEvent(rangedMsg);
|
RaiseLocalEvent(rangedMsg);
|
||||||
if (rangedMsg.Handled)
|
if (rangedMsg.Handled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -812,7 +812,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
}
|
}
|
||||||
|
|
||||||
var afterAtkMsg = new AfterAttackMessage(user, weapon, attacked, clickLocation);
|
var afterAtkMsg = new AfterAttackMessage(user, weapon, attacked, clickLocation);
|
||||||
RaiseEvent(afterAtkMsg);
|
RaiseLocalEvent(afterAtkMsg);
|
||||||
if (afterAtkMsg.Handled)
|
if (afterAtkMsg.Handled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeEvent<SetTargetZoneMessage>(SetTargetZoneHandler);
|
SubscribeNetworkEvent<SetTargetZoneMessage>(SetTargetZoneHandler);
|
||||||
SubscribeEvent<SetCombatModeActiveMessage>(SetCombatModeActiveHandler);
|
SubscribeNetworkEvent<SetCombatModeActiveMessage>(SetCombatModeActiveHandler);
|
||||||
|
|
||||||
var inputSystem = EntitySystemManager.GetEntitySystem<InputSystem>();
|
var inputSystem = EntitySystemManager.GetEntitySystem<InputSystem>();
|
||||||
inputSystem.BindMap.BindFunction(ContentKeyFunctions.ToggleCombatMode,
|
inputSystem.BindMap.BindFunction(ContentKeyFunctions.ToggleCombatMode,
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeEvent<EntRemovedFromContainerMessage>(HandleContainerModified);
|
SubscribeLocalEvent<EntRemovedFromContainerMessage>(HandleContainerModified);
|
||||||
SubscribeEvent<EntInsertedIntoContainerMessage>(HandleContainerModified);
|
SubscribeLocalEvent<EntInsertedIntoContainerMessage>(HandleContainerModified);
|
||||||
|
|
||||||
var input = EntitySystemManager.GetEntitySystem<InputSystem>();
|
var input = EntitySystemManager.GetEntitySystem<InputSystem>();
|
||||||
input.BindMap.BindFunction(ContentKeyFunctions.SwapHands, InputCmdHandler.FromDelegate(HandleSwapHands));
|
input.BindMap.BindFunction(ContentKeyFunctions.SwapHands, InputCmdHandler.FromDelegate(HandleSwapHands));
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
input.BindMap.BindFunction(EngineKeyFunctions.MoveDown, moveDownCmdHandler);
|
input.BindMap.BindFunction(EngineKeyFunctions.MoveDown, moveDownCmdHandler);
|
||||||
input.BindMap.BindFunction(EngineKeyFunctions.Run, runCmdHandler);
|
input.BindMap.BindFunction(EngineKeyFunctions.Run, runCmdHandler);
|
||||||
|
|
||||||
SubscribeEvent<PlayerAttachSystemMessage>(PlayerAttached);
|
SubscribeLocalEvent<PlayerAttachSystemMessage>(PlayerAttached);
|
||||||
SubscribeEvent<PlayerDetachedSystemMessage>(PlayerDetached);
|
SubscribeLocalEvent<PlayerDetachedSystemMessage>(PlayerDetached);
|
||||||
|
|
||||||
_audioSystem = EntitySystemManager.GetEntitySystem<AudioSystem>();
|
_audioSystem = EntitySystemManager.GetEntitySystem<AudioSystem>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
SubscribeEvent<EntRemovedFromContainerMessage>(HandleEntityRemovedFromContainer);
|
SubscribeLocalEvent<EntRemovedFromContainerMessage>(HandleEntityRemovedFromContainer);
|
||||||
SubscribeEvent<EntInsertedIntoContainerMessage>(HandleEntityInsertedIntoContainer);
|
SubscribeLocalEvent<EntInsertedIntoContainerMessage>(HandleEntityInsertedIntoContainer);
|
||||||
|
|
||||||
EntityQuery = new TypeEntityQuery(typeof(ServerStorageComponent));
|
EntityQuery = new TypeEntityQuery(typeof(ServerStorageComponent));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeEvent<RequestVerbsMessage>(RequestVerbs);
|
SubscribeNetworkEvent<RequestVerbsMessage>(RequestVerbs);
|
||||||
SubscribeEvent<UseVerbMessage>(UseVerb);
|
SubscribeNetworkEvent<UseVerbMessage>(UseVerb);
|
||||||
|
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Content.Server.GameTicking.GameRules
|
|||||||
{
|
{
|
||||||
_chatManager.DispatchServerAnnouncement("The game is now a death match. Kill everybody else to win!");
|
_chatManager.DispatchServerAnnouncement("The game is now a death match. Kill everybody else to win!");
|
||||||
|
|
||||||
_entityManager.EventBus.SubscribeEvent<MobDamageStateChangedMessage>(_onMobDamageStateChanged, this);
|
_entityManager.EventBus.SubscribeEvent<MobDamageStateChangedMessage>(EventSource.Local, this, _onMobDamageStateChanged);
|
||||||
_playerManager.PlayerStatusChanged += PlayerManagerOnPlayerStatusChanged;
|
_playerManager.PlayerStatusChanged += PlayerManagerOnPlayerStatusChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ namespace Content.Server.GameTicking.GameRules
|
|||||||
{
|
{
|
||||||
base.Removed();
|
base.Removed();
|
||||||
|
|
||||||
_entityManager.EventBus.UnsubscribeEvent<MobDamageStateChangedMessage>(this);
|
_entityManager.EventBus.UnsubscribeEvent<MobDamageStateChangedMessage>(EventSource.Local, this);
|
||||||
_playerManager.PlayerStatusChanged -= PlayerManagerOnPlayerStatusChanged;
|
_playerManager.PlayerStatusChanged -= PlayerManagerOnPlayerStatusChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user