Referência de funções
Godot 4 · GDScript · Leaderboards & scores
get_pending
Returns the queued (not-yet-sent) score for a table, or {} if none.
Synchronous (returns directly)
Signature
get_pending(table_index: int) -> DictionaryWhat it does
Reads the in-memory/persisted pending-submission queue for that table. No network call; it just reports what submit_with_retry() has queued and not yet delivered.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| table_index | int | required | Table number to inspect (1-based: 1, 2, 3…). |
How to call it
Call any time to check whether a score is still waiting to be sent, e.g. to show a 'syncing…' badge.
Returns: Dictionary: {"score": int, "meta": Dictionary} for the queued submission, or {} if nothing is pending.
Example
var p := Gamdato.get_pending(1)
if not p.is_empty():
print("waiting to send: %d" % p.score)Use cases
- Show a 'pending upload' indicator while offline.
- Decide whether to warn the player about an unsent score before they quit.