Fix entity-specific component states networking (#7410)
This commit is contained in:
@@ -42,7 +42,7 @@ namespace Content.Server.Actions
|
|||||||
private void OnPlayerAttached(EntityUid uid, ActionsComponent component, PlayerAttachedEvent args)
|
private void OnPlayerAttached(EntityUid uid, ActionsComponent component, PlayerAttachedEvent args)
|
||||||
{
|
{
|
||||||
// need to send state to new player.
|
// need to send state to new player.
|
||||||
component.Dirty();
|
Dirty(component);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool PerformBasicActions(EntityUid user, ActionType action)
|
protected override bool PerformBasicActions(EntityUid user, ActionType action)
|
||||||
|
|||||||
@@ -1,7 +1,19 @@
|
|||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
|
using Robust.Server.GameObjects;
|
||||||
|
|
||||||
namespace Content.Server.Alert;
|
namespace Content.Server.Alert;
|
||||||
|
|
||||||
// The only reason this exists is because the DI system requires the shared AlertsSystem
|
internal sealed class ServerAlertsSystem : AlertsSystem
|
||||||
// to be abstract.
|
{
|
||||||
internal sealed class ServerAlertsSystem : AlertsSystem { }
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
SubscribeLocalEvent<AlertsComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPlayerAttached(EntityUid uid, AlertsComponent component, PlayerAttachedEvent args)
|
||||||
|
{
|
||||||
|
Dirty(component);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -41,6 +41,12 @@ namespace Content.Server.Flash
|
|||||||
SubscribeLocalEvent<FlashableComponent, ComponentStartup>(OnFlashableStartup);
|
SubscribeLocalEvent<FlashableComponent, ComponentStartup>(OnFlashableStartup);
|
||||||
SubscribeLocalEvent<FlashableComponent, ComponentShutdown>(OnFlashableShutdown);
|
SubscribeLocalEvent<FlashableComponent, ComponentShutdown>(OnFlashableShutdown);
|
||||||
SubscribeLocalEvent<FlashableComponent, MetaFlagRemoveAttemptEvent>(OnMetaFlagRemoval);
|
SubscribeLocalEvent<FlashableComponent, MetaFlagRemoveAttemptEvent>(OnMetaFlagRemoval);
|
||||||
|
SubscribeLocalEvent<FlashableComponent, PlayerAttachedEvent>(OnPlayerAttached);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnPlayerAttached(EntityUid uid, FlashableComponent component, PlayerAttachedEvent args)
|
||||||
|
{
|
||||||
|
Dirty(component);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnMetaFlagRemoval(EntityUid uid, FlashableComponent component, ref MetaFlagRemoveAttemptEvent args)
|
private void OnMetaFlagRemoval(EntityUid uid, FlashableComponent component, ref MetaFlagRemoveAttemptEvent args)
|
||||||
|
|||||||
Reference in New Issue
Block a user