Stop network serializing prototypes (#38602)
* Stop network serializing prototypes Send the damn proto ID instead. * Fix sandbox violation
This commit is contained in:
committed by
GitHub
parent
bb7e7c3e5f
commit
73df3b1593
@@ -7,7 +7,6 @@ namespace Content.Shared.DeviceLinking;
|
||||
/// <summary>
|
||||
/// A prototype for a device port, for use with device linking.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public abstract class DevicePortPrototype
|
||||
{
|
||||
[IdDataField]
|
||||
@@ -28,13 +27,11 @@ public abstract class DevicePortPrototype
|
||||
}
|
||||
|
||||
[Prototype]
|
||||
[Serializable, NetSerializable]
|
||||
public sealed partial class SinkPortPrototype : DevicePortPrototype, IPrototype
|
||||
{
|
||||
}
|
||||
|
||||
[Prototype]
|
||||
[Serializable, NetSerializable]
|
||||
public sealed partial class SourcePortPrototype : DevicePortPrototype, IPrototype
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.DeviceLinking.Events;
|
||||
@@ -142,6 +143,11 @@ public abstract class SharedDeviceLinkSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
public ProtoId<SourcePortPrototype>[] GetSourcePortIds(Entity<DeviceLinkSourceComponent> source)
|
||||
{
|
||||
return source.Comp.Ports.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the available ports from a source
|
||||
/// </summary>
|
||||
@@ -160,6 +166,11 @@ public abstract class SharedDeviceLinkSystem : EntitySystem
|
||||
return sourcePorts;
|
||||
}
|
||||
|
||||
public ProtoId<SinkPortPrototype>[] GetSinkPortIds(Entity<DeviceLinkSinkComponent> source)
|
||||
{
|
||||
return source.Comp.Ports.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the available ports from a sink
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user