ISource2ModClients
Player helpers the controller classes do not have: SteamIDs in every form, connection details, client cvars, kicking with a message.
What a CBasePlayerController already does (name, IP, SteamID64, user id, console commands, team changes, Disconnect) stays there.
Interface id ISource2ModClients001 (SOURCE2MOD_CLIENTS_INTERFACE) · Global g_pSource2ModClients · Header source2mod/ISource2ModClients.h
Methods
IsConnected
virtual bool IsConnected(CPlayerSlot slot) = 0;A slot has a client (connecting or in game).
| Parameter | Type |
|---|---|
slot | CPlayerSlot |
IsInGame
virtual bool IsInGame(CPlayerSlot slot) = 0;A slot's client is fully in game.
| Parameter | Type |
|---|---|
slot | CPlayerSlot |
IsFakeClient
virtual bool IsFakeClient(CPlayerSlot slot) = 0;| Parameter | Type |
|---|---|
slot | CPlayerSlot |
IsAuthorized
virtual bool IsAuthorized(CPlayerSlot slot) = 0;Steam has confirmed the client's SteamID.
| Parameter | Type |
|---|---|
slot | CPlayerSlot |
GetAuthId
virtual std::string GetAuthId(CPlayerSlot slot, ESource2ModAuthId form, bool validated = true) = 0;A client's SteamID as text.
| Parameter | Type | Default | Description |
|---|---|---|---|
slot | CPlayerSlot | ||
form | ESource2ModAuthId | ||
validated | bool | true | Only once Steam has confirmed it (else empty). |
Returns std::string — Empty for a bot or no client.
GetLatency
virtual float GetLatency(CPlayerSlot slot) = 0;Average round trip in seconds (0 for a bot or no client).
| Parameter | Type |
|---|---|
slot | CPlayerSlot |
GetConnectionTime
virtual float GetConnectionTime(CPlayerSlot slot) = 0;Seconds connected (0 for a bot or no client).
| Parameter | Type |
|---|---|
slot | CPlayerSlot |
GetClientConVar
virtual std::string GetClientConVar(CPlayerSlot slot, const char* name) = 0;A cvar the client sent (cl_language, ...); empty when it did not.
| Parameter | Type |
|---|---|
slot | CPlayerSlot |
name | const char* |
Kick
virtual void Kick(CPlayerSlot slot, const char* message) = 0;Disconnects a client. CS2 shows them the kick reason's own text; @p message is the reason the server logs.
| Parameter | Type |
|---|---|
slot | CPlayerSlot |
message | const char* |
GetClientCount
virtual int GetClientCount(bool inGameOnly = true) = 0;Clients on the server, bots included.
| Parameter | Type | Default |
|---|---|---|
inGameOnly | bool | true |
Enums
ESource2ModAuthId
enum ESource2ModAuthIdSteamID forms (SourceMod's AuthIdType values).
| Name | Value | Description |
|---|---|---|
SOURCE2MOD_AUTHID_ENGINE | 0 | as the engine shows it |
SOURCE2MOD_AUTHID_STEAM2 | STEAM_1:0:12345 | |
SOURCE2MOD_AUTHID_STEAM3 | [U:1:24690] | |
SOURCE2MOD_AUTHID_STEAMID64 | 76561197960290418 |