-Changed NetworkSync interfaces.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user