-Changed NetworkSync interfaces.

This commit is contained in:
Maplewheels
2026-02-06 23:50:43 -05:00
parent d47b75c778
commit 87dc9be10e
4 changed files with 11 additions and 11 deletions

View File

@@ -9,7 +9,7 @@ using OneOf;
namespace Barotrauma.LuaCs.Data;
public class SettingEntry<T> : SettingBase, ISettingBase<T>, INetworkSyncEntity where T : IEquatable<T>, IConvertible
public class SettingEntry<T> : SettingBase, ISettingBase<T>, INetworkSyncVar where T : IEquatable<T>, IConvertible
{
public class Factory : ISettingBase.IFactory<ISettingBase<T>>
{
@@ -109,7 +109,7 @@ public class SettingEntry<T> : SettingBase, ISettingBase<T>, 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;

View File

@@ -5,12 +5,12 @@ using Barotrauma.Networking;
namespace Barotrauma.LuaCs;
public interface INetworkSyncEntity
public interface INetworkSyncVar
{
/// <summary>
/// Network-synchronized object ID. Used for networking send/receive message events.
/// </summary>
ulong InstanceId { get; }
Guid InstanceId { get; }
/// <summary>
/// Sets the <see cref="IEntityNetworkingService"/> that is currently managing this instance. The <see cref="InstanceId"/>

View File

@@ -22,7 +22,7 @@ internal partial class NetworkingService : INetworkingService
ReceiveIds
}
private Dictionary<Guid, INetworkSyncEntity> netVars = new Dictionary<Guid, INetworkSyncEntity>();
private Dictionary<Guid, INetworkSyncVar> netVars = new Dictionary<Guid, INetworkSyncVar>();
private Dictionary<Guid, NetMessageReceived> netReceives = new Dictionary<Guid, NetMessageReceived>();
private Dictionary<ushort, Guid> packetToId = new Dictionary<ushort, Guid>();
private Dictionary<Guid, ushort> idToPacket = new Dictionary<Guid, ushort>();
@@ -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();
}

View File

@@ -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);
}