KROYSDOCS
HomeWhat's newv0.1.0
SCRIPTING API / Multiplayer / NetworkMessage

NetworkMessage

A custom script message received from the server (on a client) or from a client (on the server).

Kindstruct
NamespaceKroys.EngineScripting
Members8
SourceNetwork.cs
DECLARATION

Declaration

Namespace Kroys.EngineScripting.

Declaration
public readonly struct NetworkMessage
REFERENCE

Members

Properties
#public string Name { get; }
The message name the sender used (for example "Craft.Start"). Names starting with "Kroys." belong to the engine.
property
#public uint SenderClientId { get; }
Client id of the sender on the server (answer it with Network.SendToClient); zero for messages from the server.
property
#public Entity Sender { get; }
Network object that sent the message, as an Entity handle (the server's script entities are net objects).
property
#public Entity Target { get; }
Network object the message is addressed to, as an Entity handle.
property
#public NetId SenderNetId { get; }
Network id of the object that sent the message.
property
#public NetId TargetNetId { get; }
Network id of the object the message is addressed to.
property
#public byte[] Payload { get; }
The raw message bytes; read them in order with CreateReader.
property
Methods
#public NetworkReader CreateReader()
A reader over the payload, for reading the values in the order they were written.
method
Signatures
public string Name { get; }
public uint SenderClientId { get; }
public Entity Sender { get; }
public Entity Target { get; }
public NetId SenderNetId { get; }
public NetId TargetNetId { get; }
public byte[] Payload { get; }
public NetworkReader CreateReader()

KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.