Python SDK — Players

Player Management — client.players

register
client.players.register(name: str, player_data: Any = None) -> PlayerRegisterResponse

Registers a new player with optional custom data. Returns player_id and private_key (the player token).

register_steam
client.players.register_steam(
    steam_ticket: str,
    steam_identity: str | None = None,
    name: str | None = None,
    player_data: Any = None
) -> PlayerRegisterResponse

Registers or logs in a player via a hex-encoded Steam auth ticket from ISteamUser::GetAuthTicketForWebApi (single-use — request a fresh ticket each login). Requires Steam enabled for the project in the API cabinet; the account persists via SteamID. Response includes steam_id.

Ticket minting is out of scope for this SDK (server-side tooling and tests): game clients use the built-in Steam helpers in the Unity/.NET/C++ SDKs.

authenticate
client.players.authenticate(player_token: str, data_cls: type | None = None) -> PlayerAuthResponse

Authenticates a player using their private token. Pass a dataclass as data_cls to deserialize player.player_data into it.

get_all_players
client.games.get_all_players() -> PlayerListResponse

Retrieves a list of all players (requires private API token).

heartbeat
client.players.heartbeat(player_token: str) -> PlayerHeartbeatResponse

Updates player heartbeat to maintain online status.

logout
client.players.logout(player_token: str) -> PlayerLogoutResponse

Logs out a player and updates their last logout timestamp.

rename
client.players.rename(player_token: str, new_name: str) -> PlayerRenameResponse

Renames a player (2-50 characters).

ban
client.players.ban(player_id: int, ban_duration: BanTime, ban_reason: str | None = None) -> PlayerBanResponse

Bans a player with a BanTime duration (HOUR, DAY, WEEK, MONTH, QUARTER, YEAR, FOREVER) and optional reason. Requires private API token.

unban
client.players.unban(player_id: int) -> PlayerUnbanResponse

Unbans a previously banned player. Requires private API token.

is_banned
from multiplayer import is_banned
is_banned(response: ApiResponse) -> bool

Checks if an API response indicates the player is banned (error contains "You are banned" or ban_info is present).