Minor device network changes (#2499)

* Device network changes

* Update too

* Update Content.Server/GameObjects/EntitySystems/DeviceNetworkSystem.cs

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
metalgearsloth
2020-11-06 04:04:21 +11:00
committed by GitHub
parent e62df15ef9
commit 864fa0a57c
7 changed files with 53 additions and 51 deletions

View File

@@ -13,6 +13,7 @@ using Content.Server.GameObjects.EntitySystems.DoAfter;
using Content.Server.Interfaces;
using Content.Server.Interfaces.GameObjects.Components.Items;
using Content.Server.Utility;
using Content.Shared.GameObjects.Components;
using Content.Shared.GameObjects.Components.Body;
using Content.Shared.GameObjects.Components.Disposal;
using Content.Shared.GameObjects.EntitySystems;
@@ -603,12 +604,7 @@ namespace Content.Server.GameObjects.Components.Disposal
UserInterface.OnReceiveMessage += OnUiReceiveMessage;
}
var network = IoCManager.Resolve<IDeviceNetwork>();
_connection = new WiredNetworkConnection(OnReceiveNetMessage, false, Owner);
if (Owner.TryGetComponent<ConfigurationComponent>(out var configuration))
configuration.OnConfigUpdate += OnConfigUpdate;
UpdateInterface();
}
@@ -673,6 +669,9 @@ namespace Content.Server.GameObjects.Components.Disposal
switch (message)
{
case SharedConfigurationComponent.ConfigUpdatedComponentMessage msg:
OnConfigUpdate(msg.Config);
break;
case RelayMovementEntityMessage msg:
if (!msg.Entity.TryGetComponent(out HandsComponent? hands) ||
hands.Count == 0 ||
@@ -745,7 +744,7 @@ namespace Content.Server.GameObjects.Components.Disposal
return false;
}
// Duplicated code here, not sure how else to get actor inside to make UserInterface happy.
// Duplicated code here, not sure how else to get actor inside to make UserInterface happy.
if (IsValidInteraction(eventArgs))
{