Rejig Device networks (#7380)
This commit is contained in:
@@ -51,7 +51,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
SubscribeLocalEvent<PoweredLightComponent, DamageChangedEvent>(HandleLightDamaged);
|
||||
|
||||
SubscribeLocalEvent<PoweredLightComponent, SignalReceivedEvent>(OnSignalReceived);
|
||||
SubscribeLocalEvent<PoweredLightComponent, PacketSentEvent>(OnPacketReceived);
|
||||
SubscribeLocalEvent<PoweredLightComponent, DeviceNetworkPacketEvent>(OnPacketReceived);
|
||||
|
||||
SubscribeLocalEvent<PoweredLightComponent, PowerChangedEvent>(OnPowerChanged);
|
||||
}
|
||||
@@ -346,7 +346,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
/// Turns the light on or of when receiving a <see cref="DeviceNetworkConstants.CmdSetState"/> command.
|
||||
/// The light is turned on or of according to the <see cref="DeviceNetworkConstants.StateEnabled"/> value
|
||||
/// </summary>
|
||||
private void OnPacketReceived(EntityUid uid, PoweredLightComponent component, PacketSentEvent args)
|
||||
private void OnPacketReceived(EntityUid uid, PoweredLightComponent component, DeviceNetworkPacketEvent args)
|
||||
{
|
||||
if (!args.Data.TryGetValue(DeviceNetworkConstants.Command, out string? command) || command != DeviceNetworkConstants.CmdSetState) return;
|
||||
if (!args.Data.TryGetValue(DeviceNetworkConstants.StateEnabled, out bool enabled)) return;
|
||||
|
||||
Reference in New Issue
Block a user