Class IncomingMessage
This class represent an incoming message.
Inherited Members
Namespace: Evergine.Networking.Connection.Messages
Assembly: Evergine.Networking.dll
Syntax
public class IncomingMessage
Constructors
IncomingMessage(NetIncomingMessage)
Initializes a new instance of the Incoming
Declaration
public IncomingMessage(NetIncomingMessage message)
Parameters
Type | Name | Description |
---|---|---|
Net |
message | The message. |
Properties
InnerMessage
Gets the inner NetIncomingMessage.
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
GetData()
Gets the message data.
Declaration
public byte[] GetData()
Returns
Type | Description |
---|---|
byte[] | The message byte[]. |
ReadBoolean()
Reads the next boolean.
Declaration
public bool ReadBoolean()
Returns
Type | Description |
---|---|
bool | The next boolean in the message. |
ReadByte(int)
Reads the next byte (or bits).
Declaration
public byte ReadByte(int numberOfBits = 8)
Parameters
Type | Name | Description |
---|---|---|
int | numberOfBits | The number of bits that should be read. By default 8 bits. |
Returns
Type | Description |
---|---|
byte | The next byte (or bits) in the message. |
Exceptions
Type | Condition |
---|---|
Argument |
ReadByte(bits) can only read between 1 and 8 bits. |
ReadBytes()
Reads the bytes of length of next int.
Declaration
public byte[] ReadBytes()
Returns
Type | Description |
---|---|
byte[] | The next byte array. |
ReadColor()
Reads the next Color.
Declaration
public Color ReadColor()
Returns
ReadDateTime()
Reads the next Date
Declaration
public DateTime ReadDateTime()
Returns
ReadInt16()
Reads the next int16.
Declaration
public short ReadInt16()
Returns
Type | Description |
---|---|
short | The next int16 in the message. |
ReadInt32()
Reads the next int32.
Declaration
public int ReadInt32()
Returns
Type | Description |
---|---|
int | The next int32 in the message. |
ReadInt64()
Reads the next int64.
Declaration
public long ReadInt64()
Returns
Type | Description |
---|---|
long | The next int64 in the message. |
ReadMatrix3x3()
Reads the next Matrix3x3.
Declaration
public Matrix3x3 ReadMatrix3x3()
Returns
ReadMatrix4x4()
Reads the next Matrix4x4.
Declaration
public Matrix4x4 ReadMatrix4x4()
Returns
ReadQuaternion()
Reads the next Quaternion.
Declaration
public Quaternion ReadQuaternion()
Returns
Type | Description |
---|---|
Quaternion | The next Quaternion in the message. |
ReadSingle()
Reads the next single.
Declaration
public float ReadSingle()
Returns
Type | Description |
---|---|
float | The next single in the message. |
ReadString()
Reads the next string.
Declaration
public string ReadString()
Returns
Type | Description |
---|---|
string | The next string in the message. |
ReadTimeSpan(bool)
Reads the next Time
Declaration
public TimeSpan ReadTimeSpan(bool highPrecision)
Parameters
Type | Name | Description |
---|---|---|
bool | highPrecision | Indicates whether the Time |
Returns
Remarks
High precision allows full Time
ReadVector2()
Reads the next Vector2.
Declaration
public Vector2 ReadVector2()
Returns
ReadVector3()
Reads the next Vector3.
Declaration
public Vector3 ReadVector3()
Returns
ReadVector4()
Reads the next Vector4.
Declaration
public Vector4 ReadVector4()
Returns
Seek(int)
Seeks the specified offset bytes.
Declaration
public void Seek(int offsetBytes)
Parameters
Type | Name | Description |
---|---|---|
int | offsetBytes | The offset bytes. |