Справочник функций
Godot 4 · GDScript · Rewards
get_rewards_status
Fetches this player's reward status (what's claimable now and when each unlocks next).
Asynchronous (result via signal)
Signature
get_rewards_status() -> voidWhat it does
GETs /rewards (session-auth). rewards is an Array of Dictionary, one per configured reward: id, key, display_name, cadence_type, claimable_now, next_claimable_at (ISO string or null), payload_keys, and more. server_now is an ISO timestamp string you can use to correct for client clock skew. Emits an empty Array and "" on failure or with no active session.
Parameters
This function takes no parameters.
How to call it
Connect rewards_status_loaded first, then call get_rewards_status().
Result signal: rewards_status_loaded(rewards: Array, server_now: String)
Example
Gamdato.rewards_status_loaded.connect(_on_rewards)
Gamdato.get_rewards_status()
func _on_rewards(rewards: Array, _server_now: String) -> void:
for r in rewards:
if r.claimable_now:
print("ready: %s" % r.key)Use cases
- Build a daily/weekly rewards screen showing which rewards are claimable now.
- Show a countdown to the next claim using next_claimable_at and server_now.