todo: add NetEntityEventManagers to server & client, some logic to prevent sending events that don't need to be sent (e.g. duplicate event state updates)
30 lines
789 B
C#
30 lines
789 B
C#
using System;
|
|
using Lidgren.Network;
|
|
|
|
namespace Barotrauma.Networking
|
|
{
|
|
interface INetSerializable { }
|
|
|
|
/// <summary>
|
|
/// Interface for entities that the clients can send information of to the server
|
|
/// </summary>
|
|
interface IClientSerializable : INetSerializable
|
|
{
|
|
UInt32 NetStateID { get; }
|
|
|
|
void ClientWrite(NetBuffer msg);
|
|
void ServerRead(NetIncomingMessage msg, Client c);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Interface for entities that the server can send information of to the clients
|
|
/// </summary>
|
|
interface IServerSerializable : INetSerializable
|
|
{
|
|
UInt32 NetStateID { get; }
|
|
|
|
void ServerWrite(NetBuffer msg, Client c);
|
|
void ClientRead(NetIncomingMessage msg, float sendingTime);
|
|
}
|
|
}
|