Java SDK — Players

Player Management

Players.registerPlayer
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.

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

Players.authenticatePlayer
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.

Games.getAllPlayers
public static PlayerListResponse getAllPlayers(
    Client client
) throws IOException

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

Players.sendPlayerHeartbeat
public static PlayerHeartbeatResponse sendPlayerHeartbeat(
    Client client,
    String playerToken
) throws IOException

Updates player heartbeat to maintain online status. Call every 30-60 seconds.

Players.logoutPlayer
public static PlayerLogoutResponse logoutPlayer(
    Client client,
    String playerToken
) throws IOException

Logs out a player and updates their last logout timestamp.

Players.renamePlayer
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.

Players.banPlayer
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.

Players.unbanPlayer
public static PlayerUnbanResponse unbanPlayer(
    Client client,
    int playerId
) throws IOException

Unbans a previously banned player. Requires private API token.

Ban.isBanned
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".