Functions Reference
Godot 4 · GDScript · Players
load_player_info
Loads another player's public profile and their best scores by their player_key.
Asynchronous (result via signal)
Signature
load_player_info(player_key: String) -> voidWhat it does
POSTs /players/info with the given player_key. player is a Dictionary of the player's public profile fields; scores is an Array of Dictionaries, one per leaderboard table the player has a best score on. On no session or an empty player_key it emits player_info_loaded({}, []) immediately.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| player_key | String | required | The target player's key (e.g. from search_players results or a friends list). An empty string yields an immediate empty result. |
How to call it
Connect player_info_loaded first, then call load_player_info(). A typical flow is search_players() -> players_search_completed -> load_player_info(player_key).
Result signal: player_info_loaded(player: Dictionary, scores: Array)
Example
Gamdato.player_info_loaded.connect(_on_player_info)
Gamdato.load_player_info(player_key)
func _on_player_info(player: Dictionary, scores: Array) -> void:
if player.is_empty():
print("player not found")
return
print("%s has %d ranked scores" % [player.get("player_name", "?"), scores.size()])Use cases
- Show another player's profile after picking them from search results.
- Display a friend's best scores across your leaderboard tables.