Skip to main content

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.

Fields​

3 private and internal fields
MemberWhat it is
private static Logger loggerNLog logger for this class.
private static uint messageTypeThe entity message type being sent (8 bits).
private static SerializeMethod writeMethodMethod that writes the message data.

Methods​

MemberWhat 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.