Skip to content

Latest commit

 

History

History
3082 lines (1952 loc) · 145 KB

File metadata and controls

3082 lines (1952 loc) · 145 KB

Class Index

Class Documentation

EzchaPlugin

Inherits: EditorPlugin

A class for internal use.

Description

You should never need to use this directly. The "EzchaSingleton" class is a good starting point.

EzchaClient

Inherits: Object

A helper class to simplify Ezcha Network API integration within game clients.

Description

This should be accessed through the "Ezcha" singleton.

Properties

Type Name Default
EzchaUser user null
Array[EzchaTrophyObtained] trophies_obtained []
Array[EzchaLeaderboardEntry] leaderboard_entries []
int tipped_amount 0
bool moderation_tools false

Methods

Returns Name
bool authenticate()
EzchaPlatformAdapter get_adapter()
bool supports_native_login()
bool request_login()
bool request_logout()
void request_account_management()
bool is_authenticated()
bool is_guest()
String get_session_token()
bool has_trophy(String trophy_id, bool include_pending=true)
EzchaTrophyObtained get_trophy(String trophy_id)
bool grant_trophy(String trophy_id)
bool has_score(String leaderboard_id)
float get_score(String leaderboard_id, float defaults_to=0.0)
bool update_score(String leaderboard_id, float score, EzchaLeaderboardsAPI.UpdateMode mode=0)
String get_datastore(String key)
bool set_datastore(String key, String value)
Array[EzchaRelayServer] order_relay_servers()
EzchaRelayServer determine_relay_server()
EzchaLobbyListResponse get_relay_lobbies(int page=1, int game_mode=-1)

Signals

authentication_completed()

Emitted when the authentication process has completed.

login_completed()

Emitted when the login flow has completed. (not support on web).

logout_completed()

Emitted when the user logs out. (not support on web).

session_expired()

Emitted if the session has expired or is otherwise no longer valid.

trophy_grant_completed()

Emitted when a trophy grant is queued from the grant_trophy function. trophy_data will be null if the grant could not be queued.

leaderboard_update_completed()

Emitted when a leaderboard update is queued from the update_score function.

datastore_value_received()

Emitted after a datastore value is requested and received.

datastore_value_posted()

Emitted after a datastore value update is posted.

Property Descriptions

EzchaUser user = null

The user who is currently playing the game. Only available after authenticating.

Array[EzchaTrophyObtained] trophies_obtained = []

The trophies that the currently authenticated user has obtained from this game.

Array[EzchaLeaderboardEntry] leaderboard_entries = []

The leaderboard entries that the currently authenticated user has for this game.

int tipped_amount = 0

The total amount that the currently authenticated user has tipped for this game. This is measured in USD cents.

bool moderation_tools = false

If true the user should have access to any moderation tools.

Method Descriptions

bool authenticate()

Authenticates and loads the information of the current player if available. This should be ran at the start of the game. The authentication_completed signal is emitted on completion. (Async) Returns true if authentication was successful.

EzchaPlatformAdapter get_adapter()

Returns the current platform adapter.

bool supports_native_login()

Returns true if the current platform allows for native login/logout.

bool request_login()

Requests the native login flow for platforms that support it. This can be ran at the user's request if automatic authentication fails. The authentication_completed signal is emitted on completion. (Async) Returns true if authentication was successful.

bool request_logout()

Requests to logout the current user for platforms that support it. The logout_completed signal is emitted on completion. (Async) Returns true if logout was successful.

void request_account_management()

Opens the account management page for platforms that support it. (Async) Returns once the user closes the page.

bool is_authenticated()

Returns true if the client has authenticated and user data is available.

bool is_guest()

Returns true if the user has a guest profile loaded from a relay lobby.

String get_session_token()

Returns the player's session token if authenticated.

bool has_trophy(String trophy_id, bool include_pending=true)

Returns true if the currently authenticated player has the trophy specified.

EzchaTrophyObtained get_trophy(String trophy_id)

Returns the trophy if the player has obtained it, null otherwise.

bool grant_trophy(String trophy_id)

Grants a trophy to the currently authenticated player. The trophy must have the "allow clients" option enabled. The trophy_grant_completed signal is emitted on completion. (Async) Returns true if the trophy grant was queued.

bool has_score(String leaderboard_id)

Checks if the currently authenticated player has a score on a leaderboard.

float get_score(String leaderboard_id, float defaults_to=0.0)

Returns the currently authenticated player's score on a specific leaderboard.

bool update_score(String leaderboard_id, float score, EzchaLeaderboardsAPI.UpdateMode mode=0)

Updates a leaderboard entry belonging to the currently authenticated player. The leaderboard must have the "allow clients" option enabled. The leaderboard_update_completed signal is emitted on completion. (Async) Returns true if the score update was queued.

String get_datastore(String key)

Get a datastore value belonging to the currently authenticated player. The datastore_value_received signal is emitted when the value is received. (Async) Returns a string value. The value will be empty if unset.

bool set_datastore(String key, String value)

Update a datastore value belonging to the currently authenticated player. Limit of 5 keys per user, limit of 16384 characters per value. Set the value to an empty string to delete the key. The datastore_value_posted signal is emitted on completion. (Async) Returns true if the value was successfully updated.

Array[EzchaRelayServer] order_relay_servers()

Test relay servers and return them based on latency. (Async) Returns an array of available servers, sorted from lowest to highest latency.

EzchaRelayServer determine_relay_server()

Determines the ideal Ezcha Relay server for the user. (Async) Returns a server if available, null otherwise.

EzchaLobbyListResponse get_relay_lobbies(int page=1, int game_mode=-1)

Fetches a list of open Ezcha Relay lobbies for the current game and version. Returns an EzchaLobbyListResponse object.

EzchaOpts

Inherits: RefCounted

A class for internal use.

Description

You should never need to use this directly.

EzchaSingleton

Inherits: Node

The class representing the "Ezcha" singleton.

Description

This is where most of the plugin's functionality is accessed from.

Properties

Type Name Default
EzchaClient client EzchaClient.new(self)
EzchaDatastoresAPI datastores EzchaDatastoresAPI.new(self)
EzchaGamesAPI games EzchaGamesAPI.new(self)
EzchaGeneralAPI general EzchaGeneralAPI.new(self)
EzchaLeaderboardsAPI leaderboards EzchaLeaderboardsAPI.new(self)
EzchaNewsAPI news EzchaNewsAPI.new(self)
EzchaProductsAPI products EzchaProductsAPI.new(self)
EzchaRelayAPI relay EzchaRelayAPI.new(self)
EzchaSessionsAPI sessions EzchaSessionsAPI.new(self)
EzchaTrophiesAPI trophies EzchaTrophiesAPI.new(self)
EzchaUsersAPI users EzchaUsersAPI.new(self)

Methods

Returns Name
String get_game_id()
String get_api_key()
String get_signing_key()

Property Descriptions

EzchaClient client = EzchaClient.new(self)

A helper class to simplify Ezcha Network API integration within game clients.

EzchaDatastoresAPI datastores = EzchaDatastoresAPI.new(self)

A wrapper for the datastores section of the API.

EzchaGamesAPI games = EzchaGamesAPI.new(self)

A wrapper for the games section of the API.

EzchaGeneralAPI general = EzchaGeneralAPI.new(self)

A wrapper for the general section of the API.

EzchaLeaderboardsAPI leaderboards = EzchaLeaderboardsAPI.new(self)

A wrapper for the leaderboards section of the API.

EzchaNewsAPI news = EzchaNewsAPI.new(self)

A wrapper for the news section of the API.

EzchaProductsAPI products = EzchaProductsAPI.new(self)

A wrapper for the products section of the API.

EzchaRelayAPI relay = EzchaRelayAPI.new(self)

A wrapper for the relay section of the API.

EzchaSessionsAPI sessions = EzchaSessionsAPI.new(self)

A wrapper for the sessions section of the API.

EzchaTrophiesAPI trophies = EzchaTrophiesAPI.new(self)

A wrapper for the trophies section of the API.

EzchaUsersAPI users = EzchaUsersAPI.new(self)

A wrapper for the users section of the API.

Method Descriptions

String get_game_id()

A helper to return the currently configured game identifier.

String get_api_key()

A helper to return the currently configured API key.

String get_signing_key()

A helper to return the currently configured signing key.

EzchaUtil

Inherits: Object

Common utilities used across the plugin.

Methods

Returns Name
String get_game_version() static
String get_start_argument(String key) static
Variant unpack_data(Object target, Dictionary data, _UnpackState state=null) static

Method Descriptions

String get_game_version()

Returns the version as defined in the project settings.

String get_start_argument(String key)

Parse a start argument depending on the platform. Ezcha Network will pass the following URL query parameters as arguments: level, lobby, map, world

Variant unpack_data(Object target, Dictionary data, _UnpackState state=null)

Unpacks values from a dictionary to an object.

EzchaWebAdapter

Inherits: EzchaPlatformAdapter

A class to handle web specific logic.

Methods

Returns Name
void register_redirect()
void login_redirect()
void close_prompts()
bool avatar_prompt(Image avatar)
String captcha_prompt()
bool interstitial_ad_prompt()
bool rewarded_ad_prompt()
String purchase_product_prompt(String product_id)

Signals

avatar_prompt_completed()

Emitted once the avatar prompt is completed.

captcha_prompt_completed()

Emitted once the captcha prompt is completed.

ad_prompt_completed()

Emitted once the rewarded ad prompt is completed.

purchase_prompt_completed()

Emitted once the product purchase prompt is completed.

Method Descriptions

void register_redirect()

Redirects to the register page and back.

void login_redirect()

Redirects to the login page and back.

void close_prompts()

Closes all web embed prompts.

bool avatar_prompt(Image avatar)

Prompts the user to change their avatar. The provided image must be 256x256px. (Async) Returns true if user accepts and the upload is successful.

String captcha_prompt()

Prompts the user to solve a captcha. The response must be validated via the API. (Async) Returns the response if successful, otherwise an empty string.

bool interstitial_ad_prompt()

Shows the user an interstitial video advertisment. (Async) Returns the true if an advertisment was displayed.

bool rewarded_ad_prompt()

Shows the user a rewarded video advertisment. (Async) Returns the true if the player should be rewarded.

String purchase_product_prompt(String product_id)

Shows the user the purchase prompt for the specified product. Verification/consumption of the product should be completed afterwards. (Async) Returns the purchase ID if the player completed the purchase, otherwise an empty string.

EzchaDatastoresAPI

Inherits: EzchaAPI

A wrapper for the datastores section of the API.

Description

This should be accessed through the "Ezcha" singleton.

Methods

Returns Name
EzchaDatastoreValueResponse get_client(String key, String session_token)
EzchaResponse post_client(String key, String value, String session_token)
EzchaDatastoreValueResponse get_server(String user_id, String key)
EzchaResponse post_server(String user_id, String key, String value)

Method Descriptions

EzchaDatastoreValueResponse get_client(String key, String session_token)

Requests the value of a client-side datastore from its key.

EzchaResponse post_client(String key, String value, String session_token)

Updates the value of a client-side datastore by its key.

EzchaDatastoreValueResponse get_server(String user_id, String key)

Requests the value of a server-side datastore for a player from its key.

EzchaResponse post_server(String user_id, String key, String value)

Updates the value of a server-side datastore for a player by its key.

EzchaGamesAPI

Inherits: EzchaAPI

A wrapper for the games section of the API.

Description

This should be accessed through the "Ezcha" singleton.

Methods

Returns Name
EzchaGameResponse get_from_id(String game_id)
EzchaGameResponse get_from_slug(String game_slug)
EzchaGameListResponse get_many(PackedStringArray game_ids, PackedStringArray game_slugs=null)
EzchaGameResponse get_random(bool include_exclusives=false)
EzchaGameResponse get_game_of_the_day()
EzchaTrophyListResponse get_trophies(String game_id, String session_token="")
EzchaLeaderboardListResponse get_leaderboards(String game_id, String session_token="")
EzchaProductListResponse get_products(String game_id, String session_token="")

Method Descriptions

EzchaGameResponse get_from_id(String game_id)

Requests a game from its ID.

EzchaGameResponse get_from_slug(String game_slug)

Requests a game from its slug.

EzchaGameListResponse get_many(PackedStringArray game_ids, PackedStringArray game_slugs=null)

Requests several games at once.

EzchaGameResponse get_random(bool include_exclusives=false)

Requests a randomly chosen game.

EzchaGameResponse get_game_of_the_day()

Requests the current game of the day.

EzchaTrophyListResponse get_trophies(String game_id, String session_token="")

Requests the trophies belonging to a game. A session with sufficient permissions can be provided to include unlisted trophies, but is not required.

EzchaLeaderboardListResponse get_leaderboards(String game_id, String session_token="")

Requests the leaderboards belonging to a game. A session with sufficient permissions can be provided to include unlisted leaderboards, but is not required.

EzchaProductListResponse get_products(String game_id, String session_token="")

Requests the products belonging to a game. A session with sufficient permissions can be provided to include unlisted products, but is not required.

EzchaGeneralAPI

Inherits: EzchaAPI

A wrapper for the general section of the API.

Description

This should be accessed through the "Ezcha" singleton.

Methods

Returns Name
EzchaGeneralStatusResponse get_status()
EzchaGeneralTimeResponse get_time()
EzchaCaptchaResponse post_captcha(String response)

Method Descriptions

EzchaGeneralStatusResponse get_status()

Returns the current status of the API.

EzchaGeneralTimeResponse get_time()

Returns the current time from API.

EzchaCaptchaResponse post_captcha(String response)

Validates a captcha response.

EzchaLeaderboardsAPI

Inherits: EzchaAPI

A wrapper for the leaderboards section of the API.

Description

This should be accessed through the "Ezcha" singleton.

Methods

Returns Name
EzchaLeaderboardEntryListResponse get_entries(String leaderboard_id, int page=1, int items_per_page=-1, String session_token="")
EzchaLeaderboardQueuedResponse post_entry_client(String leaderboard_id, String session_token, float score, EzchaLeaderboardsAPI.UpdateMode mode=0)
EzchaLeaderboardQueuedResponse post_entry_server(String leaderboard_id, String user_id, float score, EzchaLeaderboardsAPI.UpdateMode mode=0)

Enumerations

enum UpdateMode:

  • UpdateMode SET = 0
  • UpdateMode ADD = 1
  • UpdateMode SUBTRACT = 2

Method Descriptions

EzchaLeaderboardEntryListResponse get_entries(String leaderboard_id, int page=1, int items_per_page=-1, String session_token="")

Returns a paginated list of entries for a specific leaderboard. A session token is only required when attempting to access an unlisted leaderboard.

EzchaLeaderboardQueuedResponse post_entry_client(String leaderboard_id, String session_token, float score, EzchaLeaderboardsAPI.UpdateMode mode=0)

Updates a score from a game client using a session token. Requires a signing key to be configured.

EzchaLeaderboardQueuedResponse post_entry_server(String leaderboard_id, String user_id, float score, EzchaLeaderboardsAPI.UpdateMode mode=0)

Updates a score from a game server using an API key. Requires an API key to be configured.

EzchaNewsAPI

Inherits: EzchaAPI

A wrapper for the news section of the API.

Description

This should be accessed through the "Ezcha" singleton.

Methods

Returns Name
EzchaNewsListResponse get_list(int page=1, String category="", String series="", String order="")

Method Descriptions

EzchaNewsListResponse get_list(int page=1, String category="", String series="", String order="")

Returns a paginated list of news posts based on the criteria provided.

EzchaProductsAPI

Inherits: EzchaAPI

A wrapper for the products section of the API.

Description

This should be accessed through the "Ezcha" singleton.

Methods

Returns Name
EzchaProductVerifyResponse post_verify_client(String purchase_id, bool consume, String session_token)
EzchaProductVerifyResponse post_verify_server(String purchase_id, bool consume, String user_id)

Method Descriptions

EzchaProductVerifyResponse post_verify_client(String purchase_id, bool consume, String session_token)

Verifies and optionally consumes a product purchase client-side.

EzchaProductVerifyResponse post_verify_server(String purchase_id, bool consume, String user_id)

Verifies and optionally consumes a product purchase server-side.

EzchaRelayAPI

Inherits: EzchaAPI

A wrapper for the relay section of the API.

Description

This should be accessed through the "Ezcha" singleton.

Methods

Returns Name
EzchaRelayServerListResponse get_servers()
EzchaLobbyListResponse get_lobbies(String game_id, int page=1, String version="", int game_mode=-1, String region="", String server_id="")
EzchaRelayLobbyResponse resolve_lobby(String game_id, String join_code)

Method Descriptions

EzchaRelayServerListResponse get_servers()

Returns a list of available relay servers.

EzchaLobbyListResponse get_lobbies(String game_id, int page=1, String version="", int game_mode=-1, String region="", String server_id="")

Returns a list of available public lobbies.

EzchaRelayLobbyResponse resolve_lobby(String game_id, String join_code)

Resolves a lobby from its join code.

EzchaSessionsAPI

Inherits: EzchaAPI

A wrapper for the sessions section of the API.

Description

This should be accessed through the "Ezcha" singleton.

Methods

Returns Name
EzchaSessionValidationResponse post_validation(String session_token="", String game_id="")

Method Descriptions

EzchaSessionValidationResponse post_validation(String session_token="", String game_id="")

Validates a session token and returns user information related to the current game.

EzchaTrophiesAPI

Inherits: EzchaAPI

A wrapper for the trophies section of the API.

Description

This should be accessed through the "Ezcha" singleton.

Methods

Returns Name
EzchaTrophyQueuedResponse post_grant_client(String trophy_id, String session_token)
EzchaTrophyQueuedResponse post_grant_server(String trophy_id, String user_id)

Method Descriptions

EzchaTrophyQueuedResponse post_grant_client(String trophy_id, String session_token)

Grant a trophy from a game client using a session token. Requires a signing key to be configured.

EzchaTrophyQueuedResponse post_grant_server(String trophy_id, String user_id)

Grant a trophy from a game server using an API key. Requires an API key to be configured.

EzchaUsersAPI

Inherits: EzchaAPI

A wrapper for the users section of the API.

Description

This should be accessed through the "Ezcha" singleton.

Methods

Returns Name
EzchaUserResponse get_from_id(String user_id)
EzchaUserResponse get_from_name(String username)
EzchaUsersResponse get_many(PackedStringArray user_ids, PackedStringArray usernames=null)
EzchaUserListResponse get_list(int page=1, String category="", String order="")
EzchaTrophyObtainedListResponse get_trophies(String user_id, String game_id)
EzchaFriendsResponse check_friends(String user_id_a, String user_id_b)

Method Descriptions

EzchaUserResponse get_from_id(String user_id)

Requests a user from their ID.

EzchaUserResponse get_from_name(String username)

Requests a user from their name.

EzchaUsersResponse get_many(PackedStringArray user_ids, PackedStringArray usernames=null)

Requests several users at once.

EzchaUserListResponse get_list(int page=1, String category="", String order="")

Returns a paginated list of user based on the criteria provided.

EzchaTrophyObtainedListResponse get_trophies(String user_id, String game_id)

Lists the trophies a user has obtained for the specified game.

EzchaFriendsResponse check_friends(String user_id_a, String user_id_b)

Check if two users are friends.

EzchaAPI

Inherits: RefCounted

Inherited By: EzchaDatastoresAPI, EzchaGamesAPI, EzchaGeneralAPI, EzchaLeaderboardsAPI, EzchaNewsAPI, EzchaProductsAPI, EzchaRelayAPI, EzchaSessionsAPI, EzchaTrophiesAPI, EzchaUsersAPI

A base class for handling calls to the Ezcha Network API.

EzchaAsyncBatch

Inherits: RefCounted

A helper class to batch and watch multiple asynchronous coroutines.

Description

Tracks return values and emits a signal once all coroutines have completed. Provides its own async function that can be used to block execution.

Methods

Returns Name
EzchaAsyncBatch add(Callable coroutine, Array args=null)
int count()
int count_pending()
int count_completed()
bool is_completed()
bool is_processing()
Array get_results()
Array watch()

Method Descriptions

EzchaAsyncBatch add(Callable coroutine, Array args=null)

Add a coroutine to the batch.

int count()

Returns how many coroutines have been added.

int count_pending()

Returns how many coroutines are still pending.

int count_completed()

Returns how many coroutines have been completed.

bool is_completed()

Returns true if all coroutines have completed.

bool is_processing()

Returns true if any coroutines are processing.

Array get_results()

Returns the values returned from the coroutines. A value will be null if the coroutine is either pending or void. These will be in the same order as the corresponding coroutines were added.

Array watch()

Starts and watches all coroutines, waiting until each one is completed. (Async) Returns an array of coroutine results in the same order as they were added.

EzchaDto

Inherits: RefCounted

Inherited By: EzchaGame, EzchaLeaderboard, EzchaLeaderboardEntry, EzchaNewsPost, EzchaProduct, EzchaProductPurchase, EzchaRelayLobby, EzchaRelayServer, EzchaTrophy, EzchaUser

A base class for handling data returned by the Ezcha Network API.

EzchaMultiplayerSpawner

Inherits: MultiplayerSpawner

Extended MultiplayerSpawner that supports Ezcha Relay host migration. Works with other built-in multiplayer peers.

EzchaPlatformAdapter

Inherits: RefCounted

Inherited By: EzchaWebAdapter

A class for internal use.

Description

Handles platform specific logic.

Methods

Returns Name
bool supports_login()

Signals

auth_flow_completed()

login_flow_completed()

logout_completed()

session_expired()

EzchaRelayMultiplayerPeer

Inherits: MultiplayerPeerExtension

A lobby based MultiplayerPeer implementation which uses Ezcha Relay for networking.

Methods

Returns Name
void resolve_lobby(String join_code)
void join_lobby(EzchaRelayLobby lobby)
void create_lobby(EzchaRelayServer server, String name, int players, int game_mode=0, EzchaRelayMultiplayerPeer.Visibility visibility=0, bool host_migration=false)
void kick(int peer_id, String message="")
void ban(int peer_id, String message="")
String get_lobby_id()
String get_join_code()
String get_lobby_name()
int get_game_mode()
int get_player_limit()
EzchaRelayMultiplayerPeer.Visibility get_visibility_mode()
int get_host_id()
Array[int] get_peers()
EzchaUser get_user(int peer_id)
EzchaRelayMultiplayerPeer.Operation get_operation()
void set_lobby_name(String new_name)
void set_game_mode(int new_mode)
void set_player_limit(int new_limit)
void set_visibility(EzchaRelayMultiplayerPeer.Visibility new_visibility)
void migrate_host(int peer_id)
void close_lobby(String message="")
bool in_lobby()
bool is_host()
bool can_modify_lobby()

Signals

lobby_connected()

Emitted after connecting to a lobby.

lobby_created()

Emitted after creating a new lobby.

lobby_joined()

Emitted after joining an existing lobby.

user_connected()

Emitted when a peer joins the lobby. Mirrors peer_connected but includes user data and emits upon lobby creation.

user_disconnected()

Emitted when a peer leaves the lobby. Mirrors peer_disconnected but includes user data.

name_changed()

Emitted when the name of the lobby changes.

game_mode_changed()

Emitted when the current game mode changes.

player_limit_changed()

Emitted when the player limit changes.

visibility_changed()

Emitted when visibility of the lobby changes.

host_migrated()

Emitted when the lobby migrates hosts to a new peer.

error()

Emitted when an error occurs during relay operations.

kicked()

Emitted when kicked from the lobby.

Enumerations

enum ErrorCode:

  • ErrorCode CLIENT_EXCEPTION = -1
  • ErrorCode INVALID_REQUEST = 100
  • ErrorCode NO_PERMISSION = 101
  • ErrorCode RATE_LIMIT = 102
  • ErrorCode UNSUPPORTED_PROTOCOL = 200
  • ErrorCode AUTH_FAILED = 201
  • ErrorCode SERVER_MAX_CAPACITY = 202
  • ErrorCode LOBBY_NOT_FOUND = 300
  • ErrorCode GAME_ID_MISMATCH = 310
  • ErrorCode VERSION_MISMATCH = 311
  • ErrorCode LOBBY_FULL = 320
  • ErrorCode NOT_FRIENDS = 321
  • ErrorCode REFUSING_CONNECTIONS = 322
  • ErrorCode BANNED = 323
  • ErrorCode LOBBY_LIMIT_REACHED = 400
  • ErrorCode KICKED = 500
  • ErrorCode INVALID_PEER = 501
  • ErrorCode INTERNAL = 900

enum Visibility:

  • Visibility PUBLIC = 0
  • Visibility UNLISTED = 1
  • Visibility FRIENDS_ONLY = 2

enum Operation:

  • Operation NONE = 0
  • Operation CONNECT = 1
  • Operation HANDSHAKE = 2
  • Operation CREATE_LOBBY = 3
  • Operation JOIN_LOBBY = 4

Method Descriptions

void resolve_lobby(String join_code)

Resolve a join code, connect to the relay server, and then join the lobby. Do not call this function with await.

void join_lobby(EzchaRelayLobby lobby)

Connect to a relay server and join a lobby. Do not call this function with await.

void create_lobby(EzchaRelayServer server, String name, int players, int game_mode=0, EzchaRelayMultiplayerPeer.Visibility visibility=0, bool host_migration=false)

Request a new lobby from the relay server. Hosting requires the user to be authenticated. Do not call this function with await.

void kick(int peer_id, String message="")

Kick another player from the lobby. (host/moderator only)

void ban(int peer_id, String message="")

Ban another player from the lobby. (host/moderator only)

String get_lobby_id()

Returns the UUID of the lobby.

String get_join_code()

Returns the join code of the lobby.

String get_lobby_name()

Returns the name of the lobby.

int get_game_mode()

Returns the game mode of the lobby.

int get_player_limit()

Returns the player limit of the lobby.

EzchaRelayMultiplayerPeer.Visibility get_visibility_mode()

Returns the visibility mode of the lobby.

int get_host_id()

Returns the peer ID of the current host.

Array[int] get_peers()

Returns a list of connected peer IDs.

EzchaUser get_user(int peer_id)

Returns locally cached user data for a given peer ID. Prefer to use this over relaying information from the host.

EzchaRelayMultiplayerPeer.Operation get_operation()

Returns what the current pending operation is.

void set_lobby_name(String new_name)

Change the name of the lobby. (host/moderator only, requires migration to be enabled)

void set_game_mode(int new_mode)

Change the game mode of the lobby. (host/moderator only, requires migration to be enabled)

void set_player_limit(int new_limit)

Change the player limit of the lobby. (host/moderator only, requires migration to be enabled)

void set_visibility(EzchaRelayMultiplayerPeer.Visibility new_visibility)

Change the visibility of the lobby. (host/moderator only, requires migration to be enabled)

void migrate_host(int peer_id)

Manually migrate host to another peer. (host/moderator only, requires migration to be enabled)

void close_lobby(String message="")

Close the lobby and kick all players. (host/moderator only)

bool in_lobby()

Returns true if currently connected to a lobby

bool is_host()

Returns if the current peer is the host.

bool can_modify_lobby()

Returns if the current peer can modify the lobby.

EzchaRelayPacket

Inherits: RefCounted

A class for internal use.

Description

A class representing a packet received via Ezcha Relay. Stores engine metadata extracted from payload.

Properties

Type Name Default
PackedByteArray data PackedByteArray()
int from -1
MultiplayerPeer.TransferMode transfer_mode 2
int channel 0

EzchaRequestBuilder

Inherits: RefCounted

A class for building and making requests to the Ezcha Network API.

Methods

Returns Name
EzchaRequestBuilder set_hostname(String value)
EzchaRequestBuilder set_endpoint(String value)
EzchaRequestBuilder set_method(HTTPClient.Method value)
EzchaRequestBuilder set_authentication(String token)
EzchaRequestBuilder set_signing_key(String key)
EzchaRequestBuilder set_parse_response(bool enabled)
EzchaRequestBuilder set_response_object(EzchaResponse obj)
EzchaRequestBuilder set_timeout(float time)
EzchaRequestBuilder add_query_parameter(String key, Variant value)
EzchaRequestBuilder add_body_data(String key, Variant value)
EzchaResponse fetch()

Method Descriptions

EzchaRequestBuilder set_hostname(String value)

Sets the target hostname.

EzchaRequestBuilder set_endpoint(String value)

Sets the target endpoint.

EzchaRequestBuilder set_method(HTTPClient.Method value)

Sets the method to be used.

EzchaRequestBuilder set_authentication(String token)

Sets the authentication header for the request.

EzchaRequestBuilder set_signing_key(String key)

Enables request signing and defines the signing key to use. Requires authentication to be set to a session token.

EzchaRequestBuilder set_parse_response(bool enabled)

Enable/disable response parsing for performance.

EzchaRequestBuilder set_response_object(EzchaResponse obj)

Set the response object.

EzchaRequestBuilder set_timeout(float time)

Set the request timeout. Defaults to 10 seconds.

EzchaRequestBuilder add_query_parameter(String key, Variant value)

Adds a parameter to the query string. The value should either be a string or an array of strings.

EzchaRequestBuilder add_body_data(String key, Variant value)

Adds a value to the body data.

EzchaResponse fetch()

Makes the request.

EzchaResponse

Inherits: RefCounted

Inherited By: EzchaCaptchaResponse, EzchaDatastoreValueResponse, EzchaFriendsResponse, EzchaGameListResponse, EzchaGameResponse, EzchaGeneralStatusResponse, EzchaGeneralTimeResponse, EzchaLeaderboardListResponse, EzchaLeaderboardQueuedResponse, EzchaPaginatedResponse, EzchaProductListResponse, EzchaProductVerifyResponse, EzchaRelayLobbyResponse, EzchaRelayServerListResponse, EzchaSessionValidationResponse, EzchaTrophyListResponse, EzchaTrophyObtainedListResponse, EzchaTrophyQueuedResponse, EzchaUserResponse, EzchaUsersResponse

The base class for handling Ezcha Network API responses.

Methods

Returns Name
EzchaResponse async()
bool is_successful()
int get_status()
String get_error()
bool is_pending()

Signals

completed()

Emitted once the response has been received and processed or upon failure.

Method Descriptions

EzchaResponse async()

(Async) Wait for the request to be completed.

bool is_successful()

Returns if the response is okay and is not an error.

int get_status()

Returns the status code.

String get_error()

Returns the error message if available.

bool is_pending()

Returns if the response is pending or not.

EzchaServerPlayer

Inherits: RefCounted

A helper class for managing players on dedicated servers.

Description

You shouldn't use this client-side or when making a singleplayer/relay based game. In those cases you should use Ezcha.client instead.

Properties

Type Name Default
EzchaUser user null
Array[EzchaTrophyObtained] trophies_obtained []
Array[EzchaLeaderboardEntry] leaderboard_entries []
int tipped_amount 0
bool moderation_tools false

Methods

Returns Name
bool authenticate(String session_token)
bool is_authenticated()
bool has_trophy(String trophy_id, bool include_pending=true)
EzchaTrophyObtained get_trophy(String trophy_id)
bool grant_trophy(String trophy_id)
bool has_score(String leaderboard_id)
float get_score(String leaderboard_id, float defaults_to=0.0)
bool update_score(String leaderboard_id, float score, EzchaLeaderboardsAPI.UpdateMode mode=0)
String get_datastore(String key)
bool set_datastore(String key, String value)

Signals

authentication_completed()

Emitted once a session token has been authenticated.

trophy_grant_completed()

Emitted when a trophy grant is queued from the grant_trophy function. trophy_data will be null if the grant could not be queued.

leaderboard_update_completed()

Emitted when a leaderboard update is queued from the update_score function.

datastore_value_received()

Emitted after a datastore value is requested and received

datastore_value_posted()

Emitted after a datastore value update is posted.

Property Descriptions

EzchaUser user = null

The user data of the player. Only available after authenticating.

Array[EzchaTrophyObtained] trophies_obtained = []

The trophies that the user has obtained from this game.

Array[EzchaLeaderboardEntry] leaderboard_entries = []

The leaderboard entries that the currently authenticated user has for this game.

int tipped_amount = 0

The total amount that the currently authenticated user has tipped for this game. This is measured in USD cents.

bool moderation_tools = false

If true the user should have access to any moderation tools.

Method Descriptions

bool authenticate(String session_token)

Authenticates a session token and loads player information. (Async) Returns true if authentication was successful. The authentication_completed signal is emitted on completion.

bool is_authenticated()

Returns true if the player has authenticated and user data is available.

bool has_trophy(String trophy_id, bool include_pending=true)

Returns true if the player has the trophy specified.

EzchaTrophyObtained get_trophy(String trophy_id)

Returns the trophy if the player has obtained it, null otherwise.

bool grant_trophy(String trophy_id)

Grants a trophy to the currently authenticated user. (Async) Returns true if the trophy grant was queued.

bool has_score(String leaderboard_id)

Checks if the player has a score on a leaderboard.

float get_score(String leaderboard_id, float defaults_to=0.0)

Returns the players's score on a specific leaderboard.

bool update_score(String leaderboard_id, float score, EzchaLeaderboardsAPI.UpdateMode mode=0)

Updates a leaderboard entry belonging to the player. (Async) Returns true if the score update was queued.

String get_datastore(String key)

Get a datastore value belonging to the currently authenticated player. The datastore_value_received signal is emitted when the value is received. (Async) Returns a string value. The value will be empty if deleted or not yet set.

bool set_datastore(String key, String value)

Update a datastore value belonging to the currently authenticated player. Limit of 5 keys per user, limit of 16384 characters per value. Set the value to an empty string to delete the key. The datastore_value_posted signal is emitted on completion. (Async) Returns true if the value was successfully updated.

EzchaUploader

Inherits: RefCounted

A class that manages a file upload stream over HTTPS.

Methods

Returns Name
EzchaUploader set_hostname(String value)
EzchaUploader set_port(int value)
EzchaUploader set_endpoint(String value)
EzchaUploader set_authentication(String token)
EzchaUploader add_file(String field, String type, String path)
EzchaUploader set_timeout(float time)
EzchaUploader add_progress_callback(Callable cb)
EzchaUploader set_response_object(EzchaResponse obj)
EzchaUploader add_query_parameter(String key, Variant value)
EzchaResponse start()

Signals

progress()

Emitted as the upload progresses.

Method Descriptions

EzchaUploader set_hostname(String value)

Sets the target hostname.

EzchaUploader set_port(int value)

Sets the target port.

EzchaUploader set_endpoint(String value)

Sets the target endpoint.

EzchaUploader set_authentication(String token)

Sets the authentication header.

EzchaUploader add_file(String field, String type, String path)

Adds a file to the upload.

EzchaUploader set_timeout(float time)

Sets the upload timeout.

EzchaUploader add_progress_callback(Callable cb)

Adds a callback function to be called when the upload progresses.

EzchaUploader set_response_object(EzchaResponse obj)

Set the response object.

EzchaUploader add_query_parameter(String key, Variant value)

Adds a parameter to the query string.

EzchaResponse start()

Starts the upload and returns the response object to await.

EzchaWebTexture

Inherits: Texture2D

A helper texture resource that loads an image from the internet.

Properties

Type Name Default
String url ""
Texture2D placeholder null
String assume_type ""
bool generate_mipmaps true

Methods

Returns Name
bool is_successful()

Signals

loaded()

Emitted when the image is downloaded and ready to be displayed.

error()

Emitted if the image could not be loaded.

Property Descriptions

String url = ""

The URL to download the image from.

Texture2D placeholder = null

The placeholder image to display before/while the URL is downloaded.

String assume_type = ""

If the image type cannot be determined it will set it to this value.

bool generate_mipmaps = true

Generate mipmaps for the downloaded image.

Method Descriptions

bool is_successful()

Returns true if the image has been downloaded and parsed.

EzchaGame

Inherits: EzchaDto

Properties

Type Name Default
String id ""
String slug ""
String name ""
String description ""
String version ""
bool elite_exclusive false
String pricing_model ""
int price 0
EzchaUser developer null
String url ""
String banner_url ""
String thumbnail_url ""
String released_timestamp ""
String original_released_timestamp ""

Methods

Returns Name
bool equals(EzchaGame other)
EzchaTrophyListResponse get_trophies(String session_token="")
EzchaLeaderboardListResponse get_leaderboards(String session_token="")
EzchaProductListResponse get_products(String session_token="")

Property Descriptions

String id = ""

The game's unique identifier.

String slug = ""

The user-friendly identifier for the game in URLs.

String name = ""

The display name of the game.

String description = ""

The description for the game.

String version = ""

The version the game is specified to be at. This does not follow any specific format.

bool elite_exclusive = false

If true the game can only be accessed by users who have elite membership.

String pricing_model = ""

The pricing model for the game. free, elite_exclusive, select_price_suggested, select_price_minimum, fixed_price

int price = 0

The price of the game in USD cents.

EzchaUser developer = null

The developer for the game.

String url = ""

The URL the game can be viewed and played at.

String banner_url = ""

The URL for the game's banner image. This will be a png file.

String thumbnail_url = ""

The URL for the game's thumbnail image. This will be a png file.

String released_timestamp = ""

The timestamp for when the game was released on Ezcha.

String original_released_timestamp = ""

The timestamp for when the game was published on other platforms before Ezcha. Not all games will have this.

Method Descriptions

bool equals(EzchaGame other)

Check if two instances represent the same game. Data can vary if requested at different times.

EzchaTrophyListResponse get_trophies(String session_token="")

Requests the trophies belonging to this game. A session with sufficient permissions can be provided to include unlisted trophies, but is not required.

EzchaLeaderboardListResponse get_leaderboards(String session_token="")

Requests the leaderboards belonging to this game. A session with sufficient permissions can be provided to include unlisted leaderboards, but is not required.

EzchaProductListResponse get_products(String session_token="")

Requests the products belonging to this game. A session with sufficient permissions can be provided to include unlisted products, but is not required.

EzchaLeaderboard

Inherits: EzchaDto

Properties

Type Name Default
String id ""
String name ""
bool unlisted false
String sorting ""
String value_type ""
String value_prefix ""
String value_suffix ""
String created_timestamp ""

Methods

Returns Name
bool equals(EzchaLeaderboard other)
EzchaLeaderboardEntryListResponse get_entries(int page=1, int items_per_page=-1, String session_token="")

Property Descriptions

String id = ""

The leaderboard's unique identifier.

String name = ""

The display name of the leaderboard.

bool unlisted = false

Indicates if the leaderboard is hidden from public view.

String sorting = ""

The sort mode of the leaderboard. ("asc" or "desc")

String value_type = ""

The value type the leaderboard represents. (Score, Points, Wins, etc)

String value_prefix = ""

The prefix to show before the values when displayed.

String value_suffix = ""

The suffix to show after the values when displayed.

String created_timestamp = ""

The timestamp of when the leaderboard was created.

Method Descriptions

bool equals(EzchaLeaderboard other)

Check if two instances represent the same leaderboard. Data can vary if requested at different times.

EzchaLeaderboardEntryListResponse get_entries(int page=1, int items_per_page=-1, String session_token="")

Returns a paginated list of entries for this leaderboard. A session token is only required when attempting to access an unlisted leaderboard.

EzchaLeaderboardEntry

Inherits: EzchaDto

Properties

Type Name Default
float score 0.0
int ranking -1
EzchaLeaderboard leaderboard null
EzchaUser user null
String created_timestamp ""
String last_updated_timestamp ""

Property Descriptions

float score = 0.0

The entry's current score.

int ranking = -1

The player's current ranking if available.

EzchaLeaderboard leaderboard = null

The leaderboard that the entry belongs to. Not all responses will included this data.

EzchaUser user = null

The user that the entry belongs to. Not all responses will included this data.

String created_timestamp = ""

The timestamp of when this entry was first created.

String last_updated_timestamp = ""

The timestamp of when this entry was last updated.

EzchaNewsPost

Inherits: EzchaDto

Properties

Type Name Default
String id ""
String slug ""
String title ""
String summary ""
bool elite_exclusive false
EzchaUser author null
String published_timestamp ""
String edited_timestamp ""
String url ""
String image_url ""

Methods

Returns Name
bool equals(EzchaNewsPost other)

Property Descriptions

String id = ""

The news post's unique identifier.

String slug = ""

The user-friendly identifier for the news post in URLs.

String title = ""

The title of the news post.

String summary = ""

A short summary of the news post.

bool elite_exclusive = false

If true the news post can only be accessed by users who have elite membership.

EzchaUser author = null

The author of the news post.

String published_timestamp = ""

The timestamp of when the news post was published.

String edited_timestamp = ""

The timestamp of when the news post was last edited. Not all news posts will have this.

String url = ""

The URL that the news post can be viewed at.

String image_url = ""

The URL of the news post's featured image. Not all news posts will have this.

Method Descriptions

bool equals(EzchaNewsPost other)

Check if two instances represent the same news post. Data can vary if requested at different times.

EzchaProduct

Inherits: EzchaDto

Properties

Type Name Default
String id ""
String name ""
String description ""
bool unlisted false
bool consumable false
int price -1
String created_timestamp ""
String icon_url ""

Methods

Returns Name
bool equals(EzchaProduct other)

Property Descriptions

String id = ""

The product's unique identifier.

String name = ""

The display name of the product.

String description = ""

The description of the product. This typically includes its criteria.

bool unlisted = false

Indicates if the product is hidden from public view.

bool consumable = false

Indicates if the product is consumable or permanent.

int price = -1

The price of the product in USD cents.

String created_timestamp = ""

The timestamp of when the product was created.

String icon_url = ""

The URL for the product's icon image. This will be a png file.

Method Descriptions

bool equals(EzchaProduct other)

Check if two instances represent the same product. Data can vary if requested at different times.

EzchaProductPurchase

Inherits: EzchaDto

Properties

Type Name Default
String id ""
EzchaProduct product null
String completed_timestamp ""
bool consumed false

Property Descriptions

String id = ""

The unique identifier of the purchase.

EzchaProduct product = null

The product associated with the purchase.

String completed_timestamp = ""

The time when the purchase was completed.

bool consumed = false

Indicates if the purchase was consumed.

EzchaRelayLobby

Inherits: EzchaDto

Properties

Type Name Default
String id ""
String join_code ""
String name ""
String version ""
int game_mode -1
Variant player_count -1
Variant player_limit -1
String created_at ""
EzchaUser host null
EzchaRelayServer server null

Methods

Returns Name
bool equals(EzchaRelayLobby other)

Property Descriptions

String id = ""

The UUID of the lobby.

String join_code = ""

The 6 character join code of the lobby.

String name = ""

The name of the lobby.

String version = ""

The game version the lobby supports.

int game_mode = -1

The game mode the lobby currently is in.

Variant player_count = -1

The current player count.

Variant player_limit = -1

The lobby's player limit.

String created_at = ""

A timestamp of when the lobby was created.

EzchaUser host = null

The current host of the lobby.

EzchaRelayServer server = null

The server which the lobby is hosted on.

Method Descriptions

bool equals(EzchaRelayLobby other)

Check if two instances represent the same lobby. Data can vary if requested at different times.

EzchaRelayServer

Inherits: EzchaDto

Properties

Type Name Default
String id ""
String name ""
String region ""
String address ""
bool elite_exclusive false
int lobby_count -1
Variant player_count -1

Methods

Returns Name
int ping()
bool equals(EzchaRelayServer other)

Property Descriptions

String id = ""

The server's unique identifier.

String name = ""

The user friendly name of the region.

String region = ""

The region the server is in.

String address = ""

The address of the relay server.

bool elite_exclusive = false

Whether or not the server is elite exclusive.

int lobby_count = -1

The cached lobby count.

Variant player_count = -1

The cached player count.

Method Descriptions

int ping()

Attempt to ping the server. (Async) Returns the time spent in milliseconds or -1 if failed.

bool equals(EzchaRelayServer other)

Check if two instances represent the same server. Data can vary if requested at different times.

EzchaTrophy

Inherits: EzchaDto

Inherited By: EzchaTrophyObtained

Properties

Type Name Default
String id ""
String name ""
String description ""
bool unlisted false
int experience_points 0
String created_timestamp ""
String icon_url ""

Methods

Returns Name
bool equals(EzchaTrophy other)

Property Descriptions

String id = ""

The trophy's unique identifier.

String name = ""

The display name of the trophy.

String description = ""

The description of the trophy. This typically includes its criteria.

bool unlisted = false

Indicates if the trophy is hidden from public view.

int experience_points = 0

The number of experience points the trophy rewards once received.

String created_timestamp = ""

The timestamp of when the trophy was created.

String icon_url = ""

The URL for the trophy's icon image. This will be a png file.

Method Descriptions

bool equals(EzchaTrophy other)

Check if two instances represent the same trophy. Data can vary if requested at different times.

EzchaTrophyObtained

Inherits: EzchaTrophy

Properties

Type Name Default
String obtained_timestamp ""

Property Descriptions

String obtained_timestamp = ""

The timestamp for when the user obtained the trophy.

EzchaUser

Inherits: EzchaDto

Properties

Type Name Default
String id ""
String name ""
String bio ""
String role ""
String title ""
int level -1
bool elite false
bool guest false
String registered_timestamp ""
String last_seen_timestamp ""
String url ""
String avatar_url ""

Methods

Returns Name
bool equals(EzchaUser other)
EzchaTrophyObtainedListResponse get_trophies(String game_id)
EzchaFriendsResponse check_friends(String user_id)

Property Descriptions

String id = ""

The user's unique identifier.

String name = ""

The user's unique username.

String bio = ""

A description provided by the user. This is displayed in the "about me" section on Ezcha profiles.

String role = ""

The user's role if they currently have one.

String title = ""

The user's title if they currently have one.

int level = -1

The total level the user is currently at.

bool elite = false

If true the user currently has elite membership.

bool guest = false

If true the user represents an Ezcha Relay guest.

String registered_timestamp = ""

The timestamp of when the user registered their account.

String last_seen_timestamp = ""

The timestamp of when the user was last seen online.

String url = ""

The URL to view the user's profile.

String avatar_url = ""

The URL for the user's avatar/profile picture. This will be a png file.

Method Descriptions

bool equals(EzchaUser other)

Check if two instances represent the same user. Data can vary if requested at different times.

EzchaTrophyObtainedListResponse get_trophies(String game_id)

Lists the trophies this user has obtained for the specified game.

EzchaFriendsResponse check_friends(String user_id)

Check if this user is friends with another specific user.

EzchaCaptchaResponse

Inherits: EzchaResponse

A response from the API that returns if a captcha response was valid or not.

Properties

Type Name Default
bool valid false

Property Descriptions

bool valid = false

Returns true if the captcha response was valid.

EzchaDatastoreValueResponse

Inherits: EzchaResponse

A response from the API containing a datastore value.

Properties

Type Name Default
String value ""

Property Descriptions

String value = ""

The value of the requested key. Returns an empty string if deleted or not set.

EzchaFriendsResponse

Inherits: EzchaResponse

A response from the API that returns whether or not two users are friends.

Properties

Type Name Default
bool friends false

Property Descriptions

bool friends = false

Returns true if the two users are friends.

EzchaGameListResponse

Inherits: EzchaResponse

A response from the API containing a list of games.

Properties

Type Name Default
Array[EzchaGame] games []

Property Descriptions

Array[EzchaGame] games = []

The list of games returned by the API request.

EzchaGameResponse

Inherits: EzchaResponse

A response from the API containing a single game.

Properties

Type Name Default
EzchaGame game null

Property Descriptions

EzchaGame game = null

The game returned by the API request.

EzchaGeneralStatusResponse

Inherits: EzchaResponse

A response from the API containing the status of the API.

Properties

Type Name Default
bool online false

Property Descriptions

bool online = false

Indicates if the Ezcha Network API is online and accessible.

EzchaGeneralTimeResponse

Inherits: EzchaResponse

A response from the API containing the current time.

Properties

Type Name Default
String timestamp ""
int epoch -1

Property Descriptions

String timestamp = ""

The server's current time as an ISO 8601 datestring.

int epoch = -1

The server's current time as a unix epoch measured in milliseconds.

EzchaLeaderboardEntryListResponse

Inherits: EzchaPaginatedResponse

A response from the API containing a paginated list of leaderboard entries.

Properties

Type Name Default
Array[EzchaLeaderboardEntry] entries []

Property Descriptions

Array[EzchaLeaderboardEntry] entries = []

The list of leaderboard entries returned by the API request.

EzchaLeaderboardListResponse

Inherits: EzchaResponse

A response from the API containing a list of leaderboards.

Properties

Type Name Default
Array[EzchaLeaderboard] leaderboards []

Property Descriptions

Array[EzchaLeaderboard] leaderboards = []

The list of leaderboards returned by the API request.

EzchaLeaderboardQueuedResponse

Inherits: EzchaResponse

A response from the API that returns if a leaderboard update has been queued.

Properties

Type Name Default
bool queued false

Property Descriptions

bool queued = false

Returns true if an update has been queued.

EzchaLobbyListResponse

Inherits: EzchaPaginatedResponse

A response from the relay API containing a list of lobbies.

Properties

Type Name Default
Array[EzchaRelayLobby] lobbies []

Property Descriptions

Array[EzchaRelayLobby] lobbies = []

The list of lobbies returned by the API request.

EzchaNewsListResponse

Inherits: EzchaPaginatedResponse

A response from the API containing a paginated list of news posts.

Properties

Type Name Default
Array[EzchaNewsPost] posts []

Property Descriptions

Array[EzchaNewsPost] posts = []

The list of news posts returned by the API request.

EzchaPaginatedResponse

Inherits: EzchaResponse

Inherited By: EzchaLeaderboardEntryListResponse, EzchaLobbyListResponse, EzchaNewsListResponse, EzchaUserListResponse

A paginated response from the API.

Properties

Type Name Default
int page -1
int page_count -1
int items_per_page -1
int total_results -1

Property Descriptions

int page = -1

The current page.

int page_count = -1

The total number of pages available.

int items_per_page = -1

The limit of how many items can be displayed on each page.

int total_results = -1

The total number of results returned.

EzchaProductListResponse

Inherits: EzchaResponse

A response from the API containing a list of products.

Properties

Type Name Default
Array[EzchaProduct] products []

Property Descriptions

Array[EzchaProduct] products = []

The list of products returned by the API request.

EzchaProductVerifyResponse

Inherits: EzchaResponse

A response from the API revealing if a purchase is legitimate.

Properties

Type Name Default
String id ""
EzchaProduct product null
String completed_timestamp ""
bool consumed false

Property Descriptions

String id = ""

The ID of the purchase.

EzchaProduct product = null

The product associated with the purchase.

String completed_timestamp = ""

The time when the purchase was completed.

bool consumed = false

Indicates if the purchase was consumed.

EzchaRelayLobbyResponse

Inherits: EzchaResponse

A response from the API containing a single relay lobby.

Properties

Type Name Default
EzchaRelayLobby lobby null

Property Descriptions

EzchaRelayLobby lobby = null

The lobby returned by the API request.

EzchaRelayServerListResponse

Inherits: EzchaResponse

A response from the API containing a list of available relay servers.

Properties

Type Name Default
Array[EzchaRelayServer] servers []
Array[String] countries []

Property Descriptions

Array[EzchaRelayServer] servers = []

The list of relay servers returned by the API request.

Array[String] countries = []

The country codes of available relay servers.

EzchaSessionValidationResponse

Inherits: EzchaResponse

A response from the API containing the information related to a validated session.

Properties

Type Name Default
EzchaUser user null
Array[EzchaTrophyObtained] trophies_obtained []
Array[EzchaLeaderboardEntry] leaderboard_entries []
Array[EzchaProductPurchase] products_purchased []
Array[EzchaProductPurchase] products_unconsumed []
int tipped_amount 0
bool moderation_tools false

Property Descriptions

EzchaUser user = null

The user associated with the session.

Array[EzchaTrophyObtained] trophies_obtained = []

The trophies that the user has obtained from this game.

Array[EzchaLeaderboardEntry] leaderboard_entries = []

The leaderboard entries the user has for this game.

Array[EzchaProductPurchase] products_purchased = []

The permanent/non-consumable product purchases the user has made.

Array[EzchaProductPurchase] products_unconsumed = []

The product purchases the user has made which are pending consumption.

int tipped_amount = 0

The total amount the user has tipped for this game. This is measured in USD cents.

bool moderation_tools = false

If true the user should have access to any available moderation tools.

EzchaTrophyListResponse

Inherits: EzchaResponse

A response from the API containing a list of trophies.

Properties

Type Name Default
Array[EzchaTrophy] trophies []

Property Descriptions

Array[EzchaTrophy] trophies = []

The list of trophies returned by the API request.

EzchaTrophyObtainedListResponse

Inherits: EzchaResponse

A response from the API containing a list of trophies.

Properties

Type Name Default
Array[EzchaTrophyObtained] trophies []

Property Descriptions

Array[EzchaTrophyObtained] trophies = []

The list of trophies returned by the API request.

EzchaTrophyQueuedResponse

Inherits: EzchaResponse

A response from the API that returns from a trophy grant.

Properties

Type Name Default
bool queued false
EzchaTrophyObtained trophy null

Property Descriptions

bool queued = false

Returns true if the grant was successful.

EzchaTrophyObtained trophy = null

The data of the granted trophy.

EzchaUserListResponse

Inherits: EzchaPaginatedResponse

A response from the API containing a paginated list of users.

Properties

Type Name Default
Array[EzchaUser] users []

Property Descriptions

Array[EzchaUser] users = []

The list of users returned by the API request.

EzchaUserResponse

Inherits: EzchaResponse

A response from the API containing a single user.

Properties

Type Name Default
EzchaUser user null

Property Descriptions

EzchaUser user = null

The user returned by the API request.

EzchaUsersResponse

Inherits: EzchaResponse

A response from the API containing multiple users.

Properties

Type Name Default
Array[EzchaUser] users []

Property Descriptions

Array[EzchaUser] users = []

The users returned by the API request.