public static PlayerRegisterResponse registerPlayer(
Client client,
String name,
Object playerData
) throws IOException
Registers a new player with optional custom data. Uses generic type for player data with Jackson serialization.
public static PlayerRegisterResponse registerPlayerWithSteam(
Client client,
String steamTicket,
String steamIdentity,
String name,
Object playerData
) throws IOException
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. A ticket-only overload registerPlayerWithSteam(client, steamTicket) fills the rest with defaults. Response includes steam_id via getSteamId().
Ticket minting is out of scope for this SDK (server/tooling use): Java clients can mint via a Steamworks binding such as steamworks4j — SteamUser.getAuthTicketForWebApi(identity).
public static <T> PlayerAuthResponse<T> authenticatePlayer(
Client client,
String playerToken,
Class<T> dataType
) throws IOException
Authenticates a player using their private token. Returns player information with typed data support.
public static PlayerListResponse getAllPlayers(
Client client
) throws IOException
Retrieves a list of all players (requires private API token).
public static PlayerHeartbeatResponse sendPlayerHeartbeat(
Client client,
String playerToken
) throws IOException
Updates player heartbeat to maintain online status. Call every 30-60 seconds.
public static PlayerLogoutResponse logoutPlayer(
Client client,
String playerToken
) throws IOException
Logs out a player and updates their last logout timestamp.
public static PlayerRenameResponse renamePlayer(
Client client,
String playerToken,
String newName
) throws IOException
Renames a player to a new name. Validates name length (2-50 characters) and requires player authentication.
public static PlayerBanResponse banPlayer(
Client client,
int playerId,
EBanTime banDuration,
String banReason
) throws IOException
Bans a player from the game with specified duration (HOUR, DAY, WEEK, MONTH, QUARTER, YEAR, FOREVER) and optional reason. Requires private API token.
public static PlayerUnbanResponse unbanPlayer(
Client client,
int playerId
) throws IOException
Unbans a previously banned player. Requires private API token.
public static boolean isBanned(ApiResponse response)
Checks if an API response indicates the player is banned. Returns true if the error message contains "You are banned".