From 87dc9be10ea43967d4a58b6bf632d7add4f54408 Mon Sep 17 00:00:00 2001 From: Maplewheels Date: Fri, 6 Feb 2026 23:50:43 -0500 Subject: [PATCH] -Changed NetworkSync interfaces. --- .../SharedSource/LuaCs/Data/SettingEntry.cs | 4 ++-- .../SharedSource/LuaCs/_Networking/INetworkSyncEntity.cs | 4 ++-- .../SharedSource/LuaCs/_Services/NetworkingService.cs | 8 ++++---- .../LuaCs/_Services/_Interfaces/INetworkingService.cs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Data/SettingEntry.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Data/SettingEntry.cs index 76d6e4d91..40709b429 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Data/SettingEntry.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Data/SettingEntry.cs @@ -9,7 +9,7 @@ using OneOf; namespace Barotrauma.LuaCs.Data; -public class SettingEntry : SettingBase, ISettingBase, INetworkSyncEntity where T : IEquatable, IConvertible +public class SettingEntry : SettingBase, ISettingBase, INetworkSyncVar where T : IEquatable, IConvertible { public class Factory : ISettingBase.IFactory> { @@ -109,7 +109,7 @@ public class SettingEntry : SettingBase, ISettingBase, INetworkSyncEntity // -- Networking protected IEntityNetworkingService NetworkingService; - public ulong InstanceId => NetworkingService?.GetNetworkIdForInstance(this) ?? 0ul; + public Guid InstanceId => NetworkingService?.GetNetworkIdForInstance(this) ?? Guid.Empty; public void SetNetworkOwner(IEntityNetworkingService networkingService) { NetworkingService = networkingService; diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Networking/INetworkSyncEntity.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Networking/INetworkSyncEntity.cs index c9c5e3851..75ec9d865 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Networking/INetworkSyncEntity.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Networking/INetworkSyncEntity.cs @@ -5,12 +5,12 @@ using Barotrauma.Networking; namespace Barotrauma.LuaCs; -public interface INetworkSyncEntity +public interface INetworkSyncVar { /// /// Network-synchronized object ID. Used for networking send/receive message events. /// - ulong InstanceId { get; } + Guid InstanceId { get; } /// /// Sets the that is currently managing this instance. The diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/NetworkingService.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/NetworkingService.cs index 455f02138..baf09ecd1 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/NetworkingService.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/NetworkingService.cs @@ -22,7 +22,7 @@ internal partial class NetworkingService : INetworkingService ReceiveIds } - private Dictionary netVars = new Dictionary(); + private Dictionary netVars = new Dictionary(); private Dictionary netReceives = new Dictionary(); private Dictionary packetToId = new Dictionary(); private Dictionary idToPacket = new Dictionary(); @@ -104,17 +104,17 @@ internal partial class NetworkingService : INetworkingService IsDisposed = true; } - public ulong GetNetworkIdForInstance(INetworkSyncEntity entity) + public Guid GetNetworkIdForInstance(INetworkSyncVar var) { throw new NotImplementedException(); } - public void RegisterNetVar(INetworkSyncEntity netVar) + public void RegisterNetVar(INetworkSyncVar netVar) { throw new NotImplementedException(); } - public void SendNetVar(INetworkSyncEntity netVar) + public void SendNetVar(INetworkSyncVar netVar) { throw new NotImplementedException(); } diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/_Interfaces/INetworkingService.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/_Interfaces/INetworkingService.cs index 76543ea07..bd1957d23 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/_Interfaces/INetworkingService.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/_Services/_Interfaces/INetworkingService.cs @@ -25,7 +25,7 @@ internal partial interface INetworkingService : IReusableService, ILuaCsNetworki public interface IEntityNetworkingService { - public ulong GetNetworkIdForInstance(INetworkSyncEntity entity); - public void RegisterNetVar(INetworkSyncEntity netVar); - public void SendNetVar(INetworkSyncEntity netVar); + public Guid GetNetworkIdForInstance(INetworkSyncVar var); + public void RegisterNetVar(INetworkSyncVar netVar); + public void SendNetVar(INetworkSyncVar netVar); }