Class Packet
Implements the exchange packetSystem.IDisposable
Inheritance
System.Object
Packet
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: TM
Assembly: TM.dll
Syntax
public class Packet : IDisposable
Constructors
| Improve this Doc View SourcePacket(EServerType, EPacketType, Byte)
Initializes a new instance of the Packet class.
Declaration
public Packet(EServerType server_type, EPacketType type, byte cmd)
Parameters
Type | Name | Description |
---|---|---|
EServerType | server_type | |
EPacketType | type | |
System.Byte | cmd |
Packet(EServerType, EPacketType, Byte, Byte, Byte[])
Initializes a new instance of the Packet class.
Declaration
public Packet(EServerType server_type, EPacketType type, byte cmd, byte value = 0, byte[] data = null)
Parameters
Type | Name | Description |
---|---|---|
EServerType | server_type | |
EPacketType | type | |
System.Byte | cmd | |
System.Byte | value | |
System.Byte[] | data |
Packet(EServerType, EPacketType, Byte, UInt32, Byte[])
Initializes a new instance of the Packet class.
Declaration
public Packet(EServerType server_type, EPacketType type, byte value, uint length, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
EServerType | server_type | |
EPacketType | type | |
System.Byte | value | |
System.UInt32 | length | |
System.Byte[] | data |
Packet(EServerType, EPacketType, String)
Initializes a new instance of the Packet class.
Declaration
public Packet(EServerType server_type, EPacketType type, string data)
Parameters
Type | Name | Description |
---|---|---|
EServerType | server_type | |
EPacketType | type | |
System.String | data |
Fields
| Improve this Doc View SourceHeader
The packet header
Declaration
public PacketHeader Header
Field Value
Type | Description |
---|---|
PacketHeader |
Properties
| Improve this Doc View SourceData
The array byte of TotalSize
Declaration
public BufferChunk Data { get; }
Property Value
Type | Description |
---|---|
BufferChunk |
PacketNumber
The absolute counter of packets
Declaration
public static int PacketNumber { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ServerType
Gets the type of the server.
Declaration
public EServerType ServerType { get; }
Property Value
Type | Description |
---|---|
EServerType |
TotalSize
The Total Size = sizeof(header) + sizeof(Data) + checksum
Declaration
public int TotalSize { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceDispose()
Declaration
public void Dispose()
IsChecksumOK(Byte[])
Checks the checksum.
Declaration
public bool IsChecksumOK(byte[] pdata)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | pdata | The pdata. |
Returns
Type | Description |
---|---|
System.Boolean | true if OK, false otherwise. |
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
System.Object.ToString()
Implements
System.IDisposable
See Also
System.IDisposable