Class Client<TPlayer>
Representation of a client connected to the server
Inherited Members
Namespace: SlipeServer.Server.Clients
Assembly: SlipeServer.Server.dll
Syntax
public class Client<TPlayer> : IClient<TPlayer>, IClient where TPlayer : Player
Type Parameters
| Name | Description |
|---|---|
| TPlayer |
Constructors
| Edit this page View SourceClient(ulong, INetWrapper, TPlayer)
Creates a client
Declaration
public Client(ulong binaryAddress, INetWrapper netWrapper, TPlayer player)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | binaryAddress | The identifier using within the networking interface for the client |
| INetWrapper | netWrapper | The networking interface the client is connected to |
| TPlayer | player | The player this client is associated with |
Properties
| Edit this page View SourceConnectionState
The client's current connection state, indicating where in the connection process the client currently is
Declaration
public ClientConnectionState ConnectionState { get; protected set; }
Property Value
| Type | Description |
|---|---|
| ClientConnectionState |
Extra
Player's extra data (data received durring connection), this can be null early on in the connection process
Declaration
public string? Extra { get; }
Property Value
| Type | Description |
|---|---|
| string |
IPAddress
Players IP Address, this can be null early on in the connection process
Declaration
public IPAddress? IPAddress { get; set; }
Property Value
| Type | Description |
|---|---|
| IPAddress |
IsConnected
Indicates whether or not the client is currently connected
Declaration
public bool IsConnected { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Ping
The client's most recent ping
Declaration
public uint Ping { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
Player
Declaration
protected TPlayer Player { get; set; }
Property Value
| Type | Description |
|---|---|
| TPlayer |
Serial
Player serial, this can be null early on in the connection process
Declaration
public string? Serial { get; }
Property Value
| Type | Description |
|---|---|
| string |
Version
Player's MTA version, this can be null early on in the connection process
Declaration
public string? Version { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
| Edit this page View SourceFetchIp()
Fetches the client's IP address
Declaration
public void FetchIp()
FetchSerial()
Fetches the client's serial and MTA version
Declaration
public void FetchSerial()
ResendModPackets()
Requests the client to re-send mod information packets
Declaration
public void ResendModPackets()
ResendPlayerACInfo()
Requests the client to re-send anti cheat information packets.
Declaration
public void ResendPlayerACInfo()
ResetConnectionState()
Resets a client's connection state, allowing the client to be re-used for a new connection
Declaration
public void ResetConnectionState()
SendPacket(PacketId, byte[], PacketPriority, PacketReliability)
Sends a single packet to the client
Declaration
public void SendPacket(PacketId packetId, byte[] data, PacketPriority priority = PacketPriority.Medium, PacketReliability reliability = PacketReliability.Unreliable)
Parameters
| Type | Name | Description |
|---|---|---|
| PacketId | packetId | |
| byte[] | data | |
| PacketPriority | priority | |
| PacketReliability | reliability |
SendPacket(Packet)
Sends a single packet to the client
Declaration
public void SendPacket(Packet packet)
Parameters
| Type | Name | Description |
|---|---|---|
| Packet | packet |
SetDisconnected()
Sets a client's connection state to be Quit
Declaration
public void SetDisconnected()
SetVersion(ushort)
Sets the client's bitstream version
Declaration
public void SetVersion(ushort version)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort | version |