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

NetworkWriter

Builds a message payload: write values in order, then pass the writer to a Network.Send method.

Kindclass
NamespaceKroys.EngineScripting
Members19
SourceNetwork.cs
DECLARATION

Declaration

Namespace Kroys.EngineScripting.

Declaration
public sealed class NetworkWriter
REFERENCE

Members

Constructors
#public NetworkWriter()
Creates an empty payload.
constructor
Properties
#public int Length { get; }
Bytes written so far.
property
Methods
#public void Write(bool value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(byte value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(short value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(ushort value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(int value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(uint value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(long value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(ulong value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(float value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(double value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(string value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(Vector2 value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(Vector3 value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(Quaternion value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void Write(Entity value)
Appends a value (bool, integers, float, double, string, vectors, quaternion or an entity handle); the reader reads the same types in the same order.
method
#public void WriteBytes(ReadOnlySpan<byte> bytes)
Appends a byte block (at most 65535 bytes), prefixed with its length; read it with ReadBytes.
method
#public byte[] ToArray()
The payload bytes written so far.
method
Signatures
public NetworkWriter()
public int Length { get; }
public void Write(bool value)
public void Write(byte value)
public void Write(short value)
public void Write(ushort value)
public void Write(int value)
public void Write(uint value)
public void Write(long value)
public void Write(ulong value)
public void Write(float value)
public void Write(double value)
public void Write(string value)
public void Write(Vector2 value)
public void Write(Vector3 value)
public void Write(Quaternion value)
public void Write(Entity value)
public void WriteBytes(ReadOnlySpan<byte> bytes)
public byte[] ToArray()

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