-
Notifications
You must be signed in to change notification settings - Fork 0
eh_GJUsersAuth
Node to manage requests to the users/auth
endpoint. It wil instantiate and remove
eh_GJUsersAuthRequest nodes as needed.
It is able to read credentials from gamejolt's ".gj-credentials" the game launcher creates, has methods to facilitate login, and auto-saving user credentials.
type | property | default value |
---|---|---|
bool | is_logged_in | False |
return type | method signature |
---|---|
String | get_player_username() |
String | get_player_user_token() |
bool | has_player_credentials() |
null | self_login(String p_username, String p_user_token) |
null | request(String p_username, String p_user_token) |
- gj_auth_completed(eh_gj_users_auth_data)
Signal emitted when auth request is successfuly completed. Sends an eh_GJUsersAuthData resource as parameter
- gj_auth_failed(error_dictionary)
Signal emitted when auth request fails. The dictionary format can vary according to the type of error
- USER_CREDENTIALS_PATH = res://addons/eh_jogos_game_jolt_api/gj_user_credentials.res --- Path where user credentials are saved as a binary file custom resource.
- bool is_logged_in
_Default_ | `False` |
---|
- String get_player_username()
Returns player username retrieved either from saved credentials, or from ".gj-credentials" file generated by gamejolt launcher.
- String get_player_user_token()
Returns player game token retrieved either from saved credentials, or from ".gj-credentials" file generated by gamejolt launcher.
- bool has_player_credentials()
Returns true if player credentials has already been found and/or saved.
Auto Auth request for the player. It's a helper for login in the current player without needing to whory about username and game token, but it accepts them as optional parameters, and in case they're used it will save them as the new default credentials. Emits [gj_auth_completed] signal if completed successfully or [gj_auth_failed] if not.
Sends auth request for the username and token passsed. Will not overwrite default credentials. Emits [gj_auth_completed] signal if completed successfully or [gj_auth_failed] if not.
Quick Reference
eh_GJBaseRequest
-
Resources
-
Credentials
eh_GJGameCredentials
eh_GJUserCredentials
-
Credentials
-
User
eh_GJUsersAuth
eh_GJUsersFetch-
Requests
eh_GJUsersAuthRequest
eh_GJUsersFetchRequest -
ResponseData
eh_GJUsersAuthData
eh_GJUsersFetchData
-
Requests