ISync
An interface in Root.Township, Alta.Networking.
Fluent helper for one entity message type, with separate server and client read and write methods. Made by SyncFactory.Create; only ExampleBehaviour uses it in this build. The server and client versions ignore the other side's methods.
- Listed in Networking and servers
- Derived types
ClientSync,ServerSync
Methods
| Member | What it is |
|---|---|
ISync OnClientRead(SerializeMethod reader) | Sets the method that reads the message on a client. |
ISync OnClientWrite(SerializeMethod writer) | Sets the method that writes the message from a client. |
ISync OnServerRead(SerializeMethod reader) | Sets the method that reads the message on the server. |
ISync OnServerReadAndRelay(SerializeMethod reader, SerializeMethod writer) | Sets both the server read and write methods. It does not relay by itself in this build. |
ISync OnServerWrite(SerializeMethod writer) | Sets the method that writes the message from the server. |
void SendToChunks(params IPlayer[] exceptPlayers) | Sends the message to everyone in the entity's chunks, except the given players. |
void SendToPlayer(IPlayer player) | Server: sends the message to one player. The client version only logs an error. |
ISync SetOwner(IPlayer player) | Server: only accept the message from this player. |
Used in
Members of other types that take, return or hold a ISync:
ClientSync.OnClientRead, ClientSync.OnClientWrite, ClientSync.OnServerRead, ClientSync.OnServerReadAndRelay, ClientSync.OnServerWrite, ClientSync.SetOwner, ExampleBehaviour.healthSync, ExampleBehaviour.lookDirectionSync, ServerSync.OnClientRead, ServerSync.OnClientWrite, ServerSync.OnServerRead, ServerSync.OnServerReadAndRelay, ServerSync.OnServerWrite, ServerSync.SetOwner, SyncFactory.Create.