Class OutgoingMessage
This class represent an outgoing message.
Inherited Members
Namespace: Evergine.Networking.Connection.Messages
Assembly: Evergine.Networking.dll
Syntax
public class OutgoingMessage
Constructors
OutgoingMessage(NetOutgoingMessage)
Initializes a new instance of the OutgoingMessage class.
Declaration
public OutgoingMessage(NetOutgoingMessage message)
Parameters
Type | Name | Description |
---|---|---|
NetOutgoingMessage | message | The message. |
Properties
InnerMessage
Gets the inner NetOutgoingMessage.
Declaration
public object InnerMessage { get; }
Property Value
Type | Description |
---|---|
object |
LengthBits
Gets the length of the used portion of the buffer in bits.
Declaration
public int LengthBits { get; }
Property Value
Type | Description |
---|---|
int |
LengthBytes
Gets the length of the used portion of the buffer in bytes.
Declaration
public int LengthBytes { get; }
Property Value
Type | Description |
---|---|
int |
Methods
Write(Color)
Writes the specified value.
Declaration
public void Write(Color value)
Parameters
Type | Name | Description |
---|---|---|
Color | value | The value. |
Write(Matrix3x3)
Writes the specified value.
Declaration
public void Write(Matrix3x3 value)
Parameters
Type | Name | Description |
---|---|---|
Matrix3x3 | value | The value. |
Write(Matrix4x4)
Writes the specified value.
Declaration
public void Write(Matrix4x4 value)
Parameters
Type | Name | Description |
---|---|---|
Matrix4x4 | value | The value. |
Write(Quaternion)
Writes the specified value.
Declaration
public void Write(Quaternion value)
Parameters
Type | Name | Description |
---|---|---|
Quaternion | value | The value. |
Write(Vector2)
Writes the specified value.
Declaration
public void Write(Vector2 value)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | value | The value. |
Write(Vector3)
Writes the specified value.
Declaration
public void Write(Vector3 value)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | value | The value. |
Write(Vector4)
Writes the specified value.
Declaration
public void Write(Vector4 value)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | value | The value. |
Write(OutgoingMessage)
Append all the bits of message to this message.
Declaration
public void Write(OutgoingMessage message)
Parameters
Type | Name | Description |
---|---|---|
OutgoingMessage | message | The message. |
Write(bool)
Writes the specified value.
Declaration
public void Write(bool value)
Parameters
Type | Name | Description |
---|---|---|
bool | value | The value. |
Write(byte, int)
Writes the specified byte (or bits).
Declaration
public void Write(byte source, int numberOfBits = 8)
Parameters
Type | Name | Description |
---|---|---|
byte | source | The value. |
int | numberOfBits | The number of bits that should be read. By default 8 bits. |
Exceptions
Type | Condition |
---|---|
ArgumentException | ReadByte(bits) can only read between 1 and 8 bits. |
Write(byte[])
Writes all bytes in an array, preceded with the length as an integer.
Declaration
public void Write(byte[] value)
Parameters
Type | Name | Description |
---|---|---|
byte[] | value | The value. |
Write(byte[], int, int)
Writes the specified number of bytes from an array, preceded with the length as an integer.
Declaration
public void Write(byte[] value, int offsetInBytes, int numberOfBytes)
Parameters
Type | Name | Description |
---|---|---|
byte[] | value | The value. |
int | offsetInBytes | Offset in bytes. |
int | numberOfBytes | Numbers of bytes to write. |
Write(DateTime)
Writes the specified value.
Declaration
public void Write(DateTime value)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | The value. |
Write(short)
Writes the specified value.
Declaration
public void Write(short value)
Parameters
Type | Name | Description |
---|---|---|
short | value | The value. |
Write(int)
Writes the specified value.
Declaration
public void Write(int value)
Parameters
Type | Name | Description |
---|---|---|
int | value | The value. |
Write(long)
Writes the specified value.
Declaration
public void Write(long value)
Parameters
Type | Name | Description |
---|---|---|
long | value | The value. |
Write(float)
Writes the specified value.
Declaration
public void Write(float value)
Parameters
Type | Name | Description |
---|---|---|
float | value | The value. |
Write(string)
Writes the specified value.
Declaration
public void Write(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | The value. |
Write(TimeSpan, bool)
Writes the specified value.
Declaration
public void Write(TimeSpan value, bool highPrecision)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | value | The value. |
bool | highPrecision | Indicates whether the TimeSpan will be written using high precision (ticks) or not (milliseconds). |
Remarks
High precision allows full TimeSpan range, otherwise it will be limited to "+-24.20:31:23.647" (+-24 days, 20 hours, 31 minutes, 23 seconds and 647 milliseconds).