mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-06 17:58:05 +02:00
Backport some arch comp net changes (#4408)
Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
This commit is contained in:
co-authored by
ElectroJr
parent
196028b619
commit
1ea7071ffb
@@ -7,6 +7,7 @@ namespace Robust.Server.GameObjects;
|
||||
public sealed class ServerMetaDataSystem : MetaDataSystem
|
||||
{
|
||||
[Dependency] private readonly PvsSystem _pvsSystem = default!;
|
||||
private EntityQuery<MetaDataComponent> _mQuery;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -16,6 +17,7 @@ public sealed class ServerMetaDataSystem : MetaDataSystem
|
||||
|
||||
EntityManager.ComponentAdded += OnComponentAdded;
|
||||
EntityManager.ComponentRemoved += OnComponentRemoved;
|
||||
_mQuery = GetEntityQuery<MetaDataComponent>();
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
@@ -45,7 +47,7 @@ public sealed class ServerMetaDataSystem : MetaDataSystem
|
||||
if (obj.Terminating || !removed.NetSyncEnabled || (!removed.SessionSpecific && !removed.SendOnlyToOwner))
|
||||
return;
|
||||
|
||||
foreach (var (_, comp) in EntityManager.GetNetComponents(obj.BaseArgs.Owner))
|
||||
foreach (var comp in obj.Meta.NetComponents.Values)
|
||||
{
|
||||
if (comp.LifeStage >= ComponentLifeStage.Removing)
|
||||
continue;
|
||||
@@ -55,7 +57,7 @@ public sealed class ServerMetaDataSystem : MetaDataSystem
|
||||
}
|
||||
|
||||
// remove the flag
|
||||
MetaData(obj.BaseArgs.Owner).Flags &= ~MetaDataFlags.SessionSpecific;
|
||||
obj.Meta.Flags &= ~MetaDataFlags.SessionSpecific;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -67,7 +69,7 @@ public sealed class ServerMetaDataSystem : MetaDataSystem
|
||||
if ((meta.Flags & MetaDataFlags.SessionSpecific) == 0)
|
||||
return;
|
||||
|
||||
foreach (var (_, comp) in EntityManager.GetNetComponents(uid))
|
||||
foreach (var (_, comp) in meta.NetComponents)
|
||||
{
|
||||
if (comp.SessionSpecific || comp.SendOnlyToOwner)
|
||||
Dirty(uid, comp);
|
||||
|
||||
Reference in New Issue
Block a user