API reference
GD.online
Manage matchmaking destinations for online games. Online and Secret in gd-godot handle game synchronization and guest authentication.
Methods
match
match(opts: Dictionary = { }) -> GDOnlineMatch, ErrCreate a matchmaking endpoint.
Create a matchmaking endpoint. key authenticates room announcements; redis shares the directory between processes.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
opts | Dictionary | { } | key (announcement key, empty refuses announcements), alive (seconds an announcement is kept, default 5.0), key-value client GD.database.redis (an opened client sharing the directory), and prefix (key prefix, default "match"). |
Return value
GDOnlineMatch, Err
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.