Skip to main content

BaseSync

An abstract class in Root.Township, Alta.Networking.

Base of the MethodSync family. Registers a handler for one entity message type and sends that message to everyone in the entity's chunks.

Constructors​

MemberWhat it is
protected BaseSync(INetworkEntity entity, EntityMessageType type)Creates a BaseSync from entity and type.

Fields​

MemberWhat it is
protected readonly INetworkEntity entityThe entity the message belongs to.
protected static Logger loggerShared logger, set by the static constructors of ClientSync and ServerSync.
protected SerializeMethod readerMethod that reads the message.
protected readonly EntityMessageType typeThe entity message type.
protected SerializeMethod writerMethod that writes the message.

Methods​

MemberWhat it is
virtual void SendToChunks(params IPlayer[] except)Sends the message to players in the entity's chunks, except the ones given.
protected virtual void MessageHandler(IPlayer player, Stream stream)Runs reader for a received message. Logs an error if there is none.