using System;
using Barotrauma.LuaCs.Configuration;
using Barotrauma.LuaCs.Data;
using Barotrauma.LuaCs.Services;
using Barotrauma.Networking;
namespace Barotrauma.LuaCs.Services;
public interface INetworkSyncEntity
{
///
/// Network-synchronized object ID. Used for networking send/receive message events.
///
Guid InstanceId { get; }
///
/// Synchronization type. See for more information.
///
NetSync SyncType { get; }
///
/// Permissions needed by clients to send net-events and/or receive net messages.
///
ClientPermissions WritePermissions { get; }
///
/// Called when an incoming net message has data for this network object, typically from the same entity on another
/// machine.
///
/// Wrapper for the internal type:
void ReadNetMessage(INetReadMessage message);
///
/// Called when a network send-event involving this entity is triggered. Any data expected to be read by the recipient
/// network object on the other instance(s) should be written to the packet.
///
/// Wrapper for the internal type:
void WriteNetMessage(INetWriteMessage message);
}
///
/// Specifies the networking send/receive relationship for network object. Objects implementing this interface are
/// expected to adhere to the contract or de-sync may occur.
///
public enum NetSync
{
///
/// No network synchronization.
///
None,
///
/// Both the client and the server have 'send' and 'receive' permissions (limited by ). Can also be used to allow two-way communication
/// with the server.
///
TwoWay,
///
/// Only the host/server has the authority to change this value.
///
ServerAuthority,
///
/// Only clients (with the required by ) may change the value and all value changes are communicated to the server/host.
///
[Important] The host/server will not send the value to other connected clients.
/// Intended to allow clients to send one-way messages to the server.
///
ClientOneWay
}