|
Network Library Documentation
|
Packet class used for data representation - used for reading and writing data that will be send or were received, includes methods for de-/serialization of different data types. More...
Public Types | |
| enum | ServerPackets { welcome = 1 , SpawnUser , DisconnectUser , Latency , Message , HmacKey , AuthToken , MessageAll , TransformUpdate , AnimationUpdate , BandwidthReply , ThroughputReply } |
| Defined packets sent to Clients by Server. More... | |
| enum | ClientPackets { welcomeReceived = 1 , MeassureRequest , DisconnectRequest , MessageToUserRequest , MessageToAllRequest , HmacKey , AutToken , TransformChange , AnimationChange , BandwidthRequest , ThroughputRequest } |
| Defined packets sent to Server by Client. More... | |
Public Member Functions | |
| Packet () | |
| Packet (int packetId) | |
| Packet (byte[] data) | |
| void | Write (string text) |
| Write string data. | |
| string | ReadString (bool ChangeReadPosition=true) |
| Read string data. | |
| void | Write (int data) |
| Write int data. | |
| int | ReadInt (bool changeReadPosition=true) |
| Read int data. | |
| void | Write (float data) |
| Write float data. | |
| float | ReadFloat (bool changeReadPosition=true) |
| Read float data. | |
| void | Write (bool data) |
| Write bool data. | |
| bool | ReadBool (bool changeReadPosition=true) |
| Read bool data. | |
| void | Write (byte data) |
| Write byte data. | |
| byte | ReadByte (bool changeReadPosition=true) |
| Read byte data. | |
| void | Write (byte[] data) |
| Write byte array data. | |
| byte[] | ReadBytes (int arrayLength, bool changeReadPosition=true) |
| read byte array data | |
| void | Write (short data) |
| Write short data. | |
| short | ReadShort (bool changeReadPos=true) |
| Read short data. | |
| void | Write (Vector3 vector) |
| Write Vector3 data. | |
| Vector3 | ReadVector3 (bool changeReadPos=true) |
| Read Vector3 data. | |
| void | Write (Quaternion data) |
| Write Quaternion data. | |
| Quaternion | ReadQuaternion (bool changeReadPos=true) |
| Read Quaternion data. | |
| void | ClearPacket (bool clear) |
| byte[] | ConvertToArray () |
| void | AddIntAtStart (int number) |
| void | SizeOfDataAtStart () |
| int | DataLength () |
| int | UnreadLength () |
| void | AddBytesToBuffers (byte[] Data) |
| byte[] | GetDataWithoutHmac () |
| Return data without HMAC. | |
| byte[] | GetHmac () |
| return HMAC from data | |
Private Attributes | |
| List< byte > | packetDataBuffer |
| Dynamic data list. | |
| byte[] | dataBuffer |
| Byte array for reading data. | |
| int | readPosition |
Packet class used for data representation - used for reading and writing data that will be send or were received, includes methods for de-/serialization of different data types.
| enum Packet.ClientPackets |
Defined packets sent to Server by Client.
| Enumerator | |
|---|---|
| welcomeReceived | |
| MeassureRequest | |
| DisconnectRequest | |
| MessageToUserRequest | |
| MessageToAllRequest | |
| HmacKey | |
| AutToken | |
| TransformChange | |
| AnimationChange | |
| BandwidthRequest | |
| ThroughputRequest | |
Definition at line 351 of file Packet.cs.
| enum Packet.ServerPackets |
Defined packets sent to Clients by Server.
| Enumerator | |
|---|---|
| welcome | |
| SpawnUser | |
| DisconnectUser | |
| Latency | |
| Message | |
| HmacKey | |
| AuthToken | |
| MessageAll | |
| TransformUpdate | |
| AnimationUpdate | |
| BandwidthReply | |
| ThroughputReply | |
Definition at line 332 of file Packet.cs.
| Packet.Packet | ( | ) |
| Packet.Packet | ( | int | packetId | ) |
| Packet.Packet | ( | byte[] | data | ) |
| void Packet.AddBytesToBuffers | ( | byte[] | Data | ) |
| void Packet.AddIntAtStart | ( | int | number | ) |
| void Packet.ClearPacket | ( | bool | clear | ) |
Definition at line 274 of file Packet.cs.
| byte[] Packet.ConvertToArray | ( | ) |
| int Packet.DataLength | ( | ) |
| byte[] Packet.GetDataWithoutHmac | ( | ) |
Return data without HMAC.
| byte[] Packet.GetHmac | ( | ) |
return HMAC from data
| bool Packet.ReadBool | ( | bool | changeReadPosition = true | ) |
Read bool data.
Definition at line 134 of file Packet.cs.
| byte Packet.ReadByte | ( | bool | changeReadPosition = true | ) |
Read byte data.
Definition at line 161 of file Packet.cs.
| byte[] Packet.ReadBytes | ( | int | arrayLength, |
| bool | changeReadPosition = true ) |
read byte array data
Definition at line 188 of file Packet.cs.
| float Packet.ReadFloat | ( | bool | changeReadPosition = true | ) |
Read float data.
Definition at line 107 of file Packet.cs.
| int Packet.ReadInt | ( | bool | changeReadPosition = true | ) |
Read int data.
Definition at line 80 of file Packet.cs.
| Quaternion Packet.ReadQuaternion | ( | bool | changeReadPos = true | ) |
Read Quaternion data.
Definition at line 263 of file Packet.cs.
| short Packet.ReadShort | ( | bool | changeReadPos = true | ) |
Read short data.
Definition at line 215 of file Packet.cs.
| string Packet.ReadString | ( | bool | ChangeReadPosition = true | ) |
Read string data.
Definition at line 52 of file Packet.cs.
| Vector3 Packet.ReadVector3 | ( | bool | changeReadPos = true | ) |
| void Packet.SizeOfDataAtStart | ( | ) |
| void Packet.Write | ( | bool | data | ) |
Write bool data.
| void Packet.Write | ( | byte | data | ) |
Write byte data.
| void Packet.Write | ( | byte[] | data | ) |
Write byte array data.
| void Packet.Write | ( | float | data | ) |
Write float data.
| void Packet.Write | ( | int | data | ) |
Write int data.
| void Packet.Write | ( | Quaternion | data | ) |
| void Packet.Write | ( | short | data | ) |
Write short data.
| void Packet.Write | ( | string | text | ) |
Write string data.
| void Packet.Write | ( | Vector3 | vector | ) |
|
private |
|
private |