Files
LuaCsForBarotraumaEP/Subsurface/Source/Networking/INetSerializable.cs
Regalis c314b37029 Some classes for syncing entity state changes. Similar to the NetworkEvents in the old netcode, but the logic is split into separate classes which prevent the server from reading updates for entities that aren't IClientSerializable.
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)
2016-11-12 20:56:06 +02:00

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