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
Source
Network.csDECLARATION
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.
#public uint SenderClientId { get; }Client id of the sender on the server (answer it with Network.SendToClient); zero for messages from the server.
#public Entity Sender { get; }Network object that sent the message, as an Entity handle (the server's script entities are net objects).
#public Entity Target { get; }Network object the message is addressed to, as an Entity handle.
#public NetId SenderNetId { get; }Network id of the object that sent the message.
#public NetId TargetNetId { get; }Network id of the object the message is addressed to.
#public byte[] Payload { get; }The raw message bytes; read them in order with CreateReader.
Methods
#public NetworkReader CreateReader()A reader over the payload, for reading the values in the order they were written.
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.