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.
- Listed in Networking and servers
- Derived types
ClientSync,ServerSync
Constructors
| Member | What it is |
|---|---|
protected BaseSync(INetworkEntity entity, EntityMessageType type) | Creates a BaseSync from entity and type. |
Fields
| Member | What it is |
|---|---|
protected readonly INetworkEntity entity | The entity the message belongs to. |
protected static Logger logger | Shared logger, set by the static constructors of ClientSync and ServerSync. |
protected SerializeMethod reader | Method that reads the message. |
protected readonly EntityMessageType type | The entity message type. |
protected SerializeMethod writer | Method that writes the message. |
Methods
| Member | What 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. |