InternalMessage
A static class in Root.Township, Alta.Networking.
Network message for an entity's own message types (EntityMessageType), used by syncs to send data to an entity's handler on the other side.
- Listed in Networking and servers
Fields
3 private and internal fields
| Member | What it is |
|---|---|
private static Logger logger | NLog logger for this class. |
private static uint messageType | The entity message type being sent (8 bits). |
private static SerializeMethod writeMethod | Method that writes the message data. |
Methods
| Member | What it is |
|---|---|
static void SendToPlayers(INetworkEntity entity, EntityMessageType messageType, SerializeMethod writeMethod, ConnectionChannel channel, IEnumerable<IPlayer> players) | Sends an entity message to the given players. |
static void SendToServer(INetworkEntity entity, EntityMessageType messageType, SerializeMethod writeMethod, ConnectionChannel channel = null) | Client: sends an entity message to the server. Logs an error if called on the server. |
static void Serialize(IConnection connection, Stream stream) | Writes the entity, type and data, or on read passes the data to the entity's message handler, waiting for it to spawn if needed. |