Class Vcmp
Vice City Multiplayer Protocol
public class Vcmp : ProtocolBase
- Inheritance
-
Vcmp
- Derived
- Inherited Members
Constructors
Vcmp(string, int, int)
Initializes a new instance of the Vcmp class.
public Vcmp(string host, int port, int timeout = 5000)
Parameters
hoststringThe host address of the server.
portintThe port number of the server.
timeoutintThe timeout for the connection in milliseconds.
Fields
RequestHeader
The request header to be sent to the remote host.
protected byte[] RequestHeader
Field Value
- byte[]
ResponseHeader
The expected response header from the remote host.
protected byte[] ResponseHeader
Field Value
- byte[]
Properties
FullName
Gets the full name of the protocol.
public override string FullName { get; }
Property Value
Methods
GetPlayers()
Asynchronously gets the list of players from the server.
public Task<List<Player>> GetPlayers()
Returns
- Task<List<Player>>
A task that represents the asynchronous operation. The task result contains a list of Player objects.
Exceptions
- TimeoutException
Thrown when the operation times out.
GetResponse(byte)
Sends data to a remote host and receives a response.
protected Task<byte[]> GetResponse(byte data)
Parameters
databyteThe data to be sent.
Returns
Exceptions
- TimeoutException
Thrown when the operation times out.
GetStatus()
Asynchronously gets the status of the server.
public Task<Status> GetStatus()
Returns
- Task<Status>
A task that represents the asynchronous operation. The task result contains a StatusResponse object with the server status.
Exceptions
- TimeoutException
Thrown when the operation times out.
ReadString(BinaryReader, int)
Reads a string from a binary reader.
protected static string ReadString(BinaryReader br, int readOffset = 1)
Parameters
brBinaryReaderThe binary reader.
readOffsetintThe read offset. Default is 1.
Returns
- string
The string read from the binary reader.