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).

ParameterType
slotCPlayerSlot

IsInGame

virtual bool IsInGame(CPlayerSlot slot) = 0;

A slot's client is fully in game.

ParameterType
slotCPlayerSlot

IsFakeClient

virtual bool IsFakeClient(CPlayerSlot slot) = 0;
ParameterType
slotCPlayerSlot

IsAuthorized

virtual bool IsAuthorized(CPlayerSlot slot) = 0;

Steam has confirmed the client's SteamID.

ParameterType
slotCPlayerSlot

GetAuthId

virtual std::string GetAuthId(CPlayerSlot slot, ESource2ModAuthId form, bool validated = true) = 0;

A client's SteamID as text.

ParameterTypeDefaultDescription
slotCPlayerSlot
formESource2ModAuthId
validatedbooltrueOnly 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).

ParameterType
slotCPlayerSlot

GetConnectionTime

virtual float GetConnectionTime(CPlayerSlot slot) = 0;

Seconds connected (0 for a bot or no client).

ParameterType
slotCPlayerSlot

GetClientConVar

virtual std::string GetClientConVar(CPlayerSlot slot, const char* name) = 0;

A cvar the client sent (cl_language, ...); empty when it did not.

ParameterType
slotCPlayerSlot
nameconst 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.

ParameterType
slotCPlayerSlot
messageconst char*

GetClientCount

virtual int GetClientCount(bool inGameOnly = true) = 0;

Clients on the server, bots included.

ParameterTypeDefault
inGameOnlybooltrue

Enums

ESource2ModAuthId

enum ESource2ModAuthId

SteamID forms (SourceMod's AuthIdType values).

NameValueDescription
SOURCE2MOD_AUTHID_ENGINE0as the engine shows it
SOURCE2MOD_AUTHID_STEAM2STEAM_1:0:12345
SOURCE2MOD_AUTHID_STEAM3[U:1:24690]
SOURCE2MOD_AUTHID_STEAMID6476561197960290418

On this page