Class Quake1
Quake1 Query Protocol
public class Quake1 : ProtocolBase
- Inheritance
-
Quake1
- Derived
- Inherited Members
Constructors
Quake1(string, int, int)
Initializes a new instance of the Quake1 class.
public Quake1(string host, int port, int timeout = 5000)
Parameters
host
stringThe IP address of the server.
port
intThe port number of the server.
timeout
intThe timeout for the connection in milliseconds.
Fields
Delimiter1
The ASCII value of the backslash character used as a delimiter.
protected byte Delimiter1
Field Value
Delimiter2
The ASCII value of the newline character used as a delimiter.
protected byte Delimiter2
Field Value
RequestHeader
The header of the request.
protected string RequestHeader
Field Value
ResponseHeader
The header of the response.
protected string ResponseHeader
Field Value
Properties
FullName
Gets the full name of the protocol.
public override string FullName { get; }
Property Value
Methods
ConnectAndSend(string)
Connects to the server and sends a request.
protected Task<byte[]> ConnectAndSend(string request)
Parameters
request
stringThe request to send.
Returns
Exceptions
- TimeoutException
Thrown when the operation times out.
GetPlayerMatchCollections(BinaryReader)
Gets a list of MatchCollection objects for each player.
protected List<MatchCollection> GetPlayerMatchCollections(BinaryReader br)
Parameters
br
BinaryReaderThe BinaryReader containing the player information.
Returns
- List<MatchCollection>
A list of MatchCollection objects for each player.
GetResponseBinaryReader()
Gets a BinaryReader for the response data.
protected Task<BinaryReader> GetResponseBinaryReader()
Returns
- Task<BinaryReader>
A BinaryReader for the response data.
Exceptions
- InvalidPacketException
Thrown when the packet header does not match the expected header.
GetStatus()
Gets the status of the server including information and players.
public Task<Status> GetStatus()
Returns
Exceptions
- InvalidPacketException
Thrown when the packet header does not match the expected header.
- TimeoutException
Thrown when the operation times out.
ParseInfo(BinaryReader)
Parses the server information from the BinaryReader.
protected Dictionary<string, string> ParseInfo(BinaryReader br)
Parameters
br
BinaryReaderThe BinaryReader containing the server information.
Returns
- Dictionary<string, string>
A dictionary containing the server information.
ParsePlayers(BinaryReader)
Parses the player information from the BinaryReader.
protected List<Player> ParsePlayers(BinaryReader br)
Parameters
br
BinaryReaderThe BinaryReader containing the player information.