Stop network serializing prototypes (#38602)

* Stop network serializing prototypes

Send the damn proto ID instead.

* Fix sandbox violation
This commit is contained in:
Pieter-Jan Briers
2025-06-27 01:27:23 +02:00
committed by GitHub
parent bb7e7c3e5f
commit 73df3b1593
28 changed files with 120 additions and 59 deletions

View File

@@ -18,6 +18,7 @@ using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Map.Events;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
@@ -496,14 +497,15 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
return;
var sources = _deviceLinkSystem.GetSourcePorts(sourceUid, sourceComponent);
var sinks = _deviceLinkSystem.GetSinkPorts(sinkUid, sinkComponent);
var sinks = _deviceLinkSystem.GetSinkPortIds((sinkUid, sinkComponent));
var links = _deviceLinkSystem.GetLinks(sourceUid, sinkUid, sourceComponent);
var defaults = _deviceLinkSystem.GetDefaults(sources);
var sourceIds = sources.Select(s => (ProtoId<SourcePortPrototype>)s.ID).ToArray();
var sourceAddress = Resolve(sourceUid, ref sourceNetworkComponent, false) ? sourceNetworkComponent.Address : "";
var sinkAddress = Resolve(sinkUid, ref sinkNetworkComponent, false) ? sinkNetworkComponent.Address : "";
var state = new DeviceLinkUserInterfaceState(sources, sinks, links, sourceAddress, sinkAddress, defaults);
var state = new DeviceLinkUserInterfaceState(sourceIds, sinks, links, sourceAddress, sinkAddress, defaults);
_uiSystem.SetUiState(configuratorUid, NetworkConfiguratorUiKey.Link, state);
}