C# Class SocketLibrary.Packets.Packet

Afficher le fichier Open project: Wotuu/RTS_XNA_v2 Class Usage Examples

Private Properties

Свойство Type Description
Packet System

Méthodes publiques

Méthode Description
AddData ( byte data ) : void

Adds a byte of data to the list.

AddInt ( int value ) : void

Adds an int to this packet.

AddString ( String s ) : void

Adds a string to this packet

GetData ( ) : byte[]

Gets the data in this packet, excluding the header.

GetFullData ( ) : byte[]

Converts the data in this packet to a byte array, this includes the header.

GetHeader ( ) : byte

Gets the header of this packet.

GetPacketID ( ) : int

Gets the packetID of this packet.

Packet ( byte header ) : System
Packet ( byte header, byte data ) : System
SetHeader ( byte header ) : void

Sets the header of this byte. Also see ProtocolHeader.cs

SetPacketID ( byte bytes ) : void

Sets the packet ID. Must be a length of 4!.

SetPacketID ( int packetID ) : void

Sets the packet ID.

Private Methods

Méthode Description
Packet ( ) : System

Method Details

AddData() public méthode

Adds a byte of data to the list.
public AddData ( byte data ) : void
data byte The byte to add
Résultat void

AddInt() public méthode

Adds an int to this packet.
public AddInt ( int value ) : void
value int The int to add
Résultat void

AddString() public méthode

Adds a string to this packet
public AddString ( String s ) : void
s String The string
Résultat void

GetData() public méthode

Gets the data in this packet, excluding the header.
public GetData ( ) : byte[]
Résultat byte[]

GetFullData() public méthode

Converts the data in this packet to a byte array, this includes the header.
public GetFullData ( ) : byte[]
Résultat byte[]

GetHeader() public méthode

Gets the header of this packet.
public GetHeader ( ) : byte
Résultat byte

GetPacketID() public méthode

Gets the packetID of this packet.
public GetPacketID ( ) : int
Résultat int

Packet() public méthode

public Packet ( byte header ) : System
header byte
Résultat System

Packet() public méthode

public Packet ( byte header, byte data ) : System
header byte
data byte
Résultat System

SetHeader() public méthode

Sets the header of this byte. Also see ProtocolHeader.cs
public SetHeader ( byte header ) : void
header byte The header to give this packet
Résultat void

SetPacketID() public méthode

Sets the packet ID. Must be a length of 4!.
public SetPacketID ( byte bytes ) : void
bytes byte The bytes.
Résultat void

SetPacketID() public méthode

Sets the packet ID.
public SetPacketID ( int packetID ) : void
packetID int The packet id.
Résultat void