From c1b1339f1447bddde0259a279139dad671c75f7e Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:23:47 +0000 Subject: [PATCH 01/33] Update reference name -> RefCounted --- addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd | 2 +- addons/com.heroiclabs.nakama/api/NakamaStorageObjectId.gd | 2 +- addons/com.heroiclabs.nakama/api/NakamaWriteStorageObject.gd | 2 +- addons/com.heroiclabs.nakama/client/NakamaClient.gd | 2 +- addons/com.heroiclabs.nakama/socket/NakamaSocket.gd | 2 +- addons/com.heroiclabs.nakama/utils/NakamaAsyncResult.gd | 2 +- addons/com.heroiclabs.nakama/utils/NakamaException.gd | 2 +- addons/com.heroiclabs.nakama/utils/NakamaLogger.gd | 2 +- addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd b/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd index 74dc175..a56e645 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd @@ -1,4 +1,4 @@ -extends Reference +extends RefCounted class_name NakamaRTMessage # Send a channel join message to the server. diff --git a/addons/com.heroiclabs.nakama/api/NakamaStorageObjectId.gd b/addons/com.heroiclabs.nakama/api/NakamaStorageObjectId.gd index 658ea42..d157af6 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaStorageObjectId.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaStorageObjectId.gd @@ -1,4 +1,4 @@ -extends Reference +extends RefCounted class_name NakamaStorageObjectId # The collection which stores the object. diff --git a/addons/com.heroiclabs.nakama/api/NakamaWriteStorageObject.gd b/addons/com.heroiclabs.nakama/api/NakamaWriteStorageObject.gd index af8bc8b..c1fdb6c 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaWriteStorageObject.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaWriteStorageObject.gd @@ -1,4 +1,4 @@ -extends Reference +extends RefCounted class_name NakamaWriteStorageObject var collection : String diff --git a/addons/com.heroiclabs.nakama/client/NakamaClient.gd b/addons/com.heroiclabs.nakama/client/NakamaClient.gd index 2859949..314944f 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaClient.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaClient.gd @@ -1,4 +1,4 @@ -extends Reference +extends RefCounted # A client for the API in Nakama server. class_name NakamaClient diff --git a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd index b2cab8f..58838d5 100644 --- a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd +++ b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd @@ -1,4 +1,4 @@ -extends Reference +extends RefCounted # A socket to interact with Nakama server. class_name NakamaSocket diff --git a/addons/com.heroiclabs.nakama/utils/NakamaAsyncResult.gd b/addons/com.heroiclabs.nakama/utils/NakamaAsyncResult.gd index ab13832..3eb4b62 100644 --- a/addons/com.heroiclabs.nakama/utils/NakamaAsyncResult.gd +++ b/addons/com.heroiclabs.nakama/utils/NakamaAsyncResult.gd @@ -1,4 +1,4 @@ -extends Reference +extends RefCounted class_name NakamaAsyncResult var exception : NakamaException setget _no_set, get_exception diff --git a/addons/com.heroiclabs.nakama/utils/NakamaException.gd b/addons/com.heroiclabs.nakama/utils/NakamaException.gd index 0ae09d0..65ec3a2 100644 --- a/addons/com.heroiclabs.nakama/utils/NakamaException.gd +++ b/addons/com.heroiclabs.nakama/utils/NakamaException.gd @@ -1,4 +1,4 @@ -extends Reference +extends RefCounted # An exception generated during a request. # Usually contains at least an error message. diff --git a/addons/com.heroiclabs.nakama/utils/NakamaLogger.gd b/addons/com.heroiclabs.nakama/utils/NakamaLogger.gd index 59b56d7..4f01830 100644 --- a/addons/com.heroiclabs.nakama/utils/NakamaLogger.gd +++ b/addons/com.heroiclabs.nakama/utils/NakamaLogger.gd @@ -1,4 +1,4 @@ -extends Reference +extends RefCounted class_name NakamaLogger enum LOG_LEVEL {NONE, ERROR, WARNING, INFO, VERBOSE, DEBUG} diff --git a/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd b/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd index 60cd4f7..7462be0 100644 --- a/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd +++ b/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd @@ -1,4 +1,4 @@ -extends Reference +extends RefCounted class_name NakamaSerializer static func serialize(p_obj : Object) -> Dictionary: From 0c97747e2a8e9cea140c584918493dbb693048aa Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:25:00 +0000 Subject: [PATCH 02/33] * Update Reference name -> RefCounted * Update getsets to properties * Update yields -> await * update super --- addons/com.heroiclabs.nakama/api/NakamaAPI.gd | 2511 +++++++++-------- 1 file changed, 1263 insertions(+), 1248 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd index 85c8521..39ec1c5 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd @@ -1,6 +1,6 @@ ### Code generated by codegen/main.go. DO NOT EDIT. ### -extends Reference +extends RefCounted class_name NakamaAPI # A single user-role pair. @@ -12,19 +12,19 @@ class GroupUserListGroupUser extends NakamaAsyncResult: } # Their relationship to the group. - var state : int setget , _get_state - var _state = null - func _get_state() -> int: - return 0 if not _state is int else int(_state) + var _state: int = null + var state : int: + get: + return 0 if not _state is int else int(_state) # User. - var user : ApiUser setget , _get_user - var _user = null - func _get_user() -> ApiUser: - return _user as ApiUser + var _user: ApiUser = null + var user : ApiUser: + get: + return _user as ApiUser - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> GroupUserListGroupUser: return _safe_ret(NakamaSerializer.deserialize(p_ns, "GroupUserListGroupUser", p_dict), GroupUserListGroupUser) as GroupUserListGroupUser @@ -49,19 +49,19 @@ class UserGroupListUserGroup extends NakamaAsyncResult: } # Group. - var group : ApiGroup setget , _get_group - var _group = null - func _get_group() -> ApiGroup: - return _group as ApiGroup + var _group: ApiGroup = null + var group : ApiGroup: + get: + return _group as ApiGroup # The user's relationship to the group. - var state : int setget , _get_state - var _state = null - func _get_state() -> int: - return 0 if not _state is int else int(_state) + var _state: int = null + var state : int: + get: + return 0 if not _state is int else int(_state) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> UserGroupListUserGroup: return _safe_ret(NakamaSerializer.deserialize(p_ns, "UserGroupListUserGroup", p_dict), UserGroupListUserGroup) as UserGroupListUserGroup @@ -100,31 +100,31 @@ class WriteLeaderboardRecordRequestLeaderboardRecordWrite extends NakamaAsyncRes } # Optional record metadata. - var metadata : String setget , _get_metadata - var _metadata = null - func _get_metadata() -> String: - return "" if not _metadata is String else String(_metadata) + var _metadata: String = null + var metadata : String: + get: + return "" if not _metadata is String else String(_metadata) # Operator override. - var operator : int setget , _get_operator - var _operator = null - func _get_operator() -> int: - return ApiOperator.values()[0] if not ApiOperator.values().has(_operator) else _operator + var _operator: int = null + var operator : int: + get: + return ApiOperator.values()[0] if not ApiOperator.values().has(_operator) else _operator # The score value to submit. - var score : String setget , _get_score - var _score = null - func _get_score() -> String: - return "" if not _score is String else String(_score) + var _score: String = null + var score : String: + get: + return "" if not _score is String else String(_score) # An optional secondary value. - var subscore : String setget , _get_subscore - var _subscore = null - func _get_subscore() -> String: - return "" if not _subscore is String else String(_subscore) + var _subscore: String = null + var subscore : String: + get: + return "" if not _subscore is String else String(_subscore) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> WriteLeaderboardRecordRequestLeaderboardRecordWrite: return _safe_ret(NakamaSerializer.deserialize(p_ns, "WriteLeaderboardRecordRequestLeaderboardRecordWrite", p_dict), WriteLeaderboardRecordRequestLeaderboardRecordWrite) as WriteLeaderboardRecordRequestLeaderboardRecordWrite @@ -153,31 +153,31 @@ class WriteTournamentRecordRequestTournamentRecordWrite extends NakamaAsyncResul } # A JSON object of additional properties (optional). - var metadata : String setget , _get_metadata - var _metadata = null - func _get_metadata() -> String: - return "" if not _metadata is String else String(_metadata) + var _metadata: String = null + var metadata : String: + get: + return "" if not _metadata is String else String(_metadata) # Operator override. - var operator : int setget , _get_operator - var _operator = null - func _get_operator() -> int: - return ApiOperator.values()[0] if not ApiOperator.values().has(_operator) else _operator + var _operator: int = null + var operator : int: + get: + return ApiOperator.values()[0] if not ApiOperator.values().has(_operator) else _operator # The score value to submit. - var score : String setget , _get_score - var _score = null - func _get_score() -> String: - return "" if not _score is String else String(_score) + var _score: String = null + var score : String: + get: + return "" if not _score is String else String(_score) # An optional secondary value. - var subscore : String setget , _get_subscore - var _subscore = null - func _get_subscore() -> String: - return "" if not _subscore is String else String(_subscore) + var _subscore: String = null + var subscore : String: + get: + return "" if not _subscore is String else String(_subscore) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> WriteTournamentRecordRequestTournamentRecordWrite: return _safe_ret(NakamaSerializer.deserialize(p_ns, "WriteTournamentRecordRequestTournamentRecordWrite", p_dict), WriteTournamentRecordRequestTournamentRecordWrite) as WriteTournamentRecordRequestTournamentRecordWrite @@ -209,59 +209,59 @@ class ApiAccount extends NakamaAsyncResult: } # The custom id in the user's account. - var custom_id : String setget , _get_custom_id - var _custom_id = null - func _get_custom_id() -> String: - return "" if not _custom_id is String else String(_custom_id) + var _custom_id: String = null + var custom_id : String: + get: + return "" if not _custom_id is String else String(_custom_id) # The devices which belong to the user's account. - var devices : Array setget , _get_devices - var _devices = null - func _get_devices() -> Array: - return Array() if not _devices is Array else Array(_devices) + var _devices: Array = null + var devices : Array: + get: + return Array() if not _devices is Array else Array(_devices) # The UNIX time when the user's account was disabled/banned. - var disable_time : String setget , _get_disable_time - var _disable_time = null - func _get_disable_time() -> String: - return "" if not _disable_time is String else String(_disable_time) + var _disable_time: String = null + var disable_time : String: + get: + return "" if not _disable_time is String else String(_disable_time) # The email address of the user. - var email : String setget , _get_email - var _email = null - func _get_email() -> String: - return "" if not _email is String else String(_email) + var _email: String = null + var email : String: + get: + return "" if not _email is String else String(_email) # The user object. - var user : ApiUser setget , _get_user - var _user = null - func _get_user() -> ApiUser: - return _user as ApiUser + var _user: ApiUser = null + var user : ApiUser: + get: + return _user as ApiUser # The UNIX time when the user's email was verified. - var verify_time : String setget , _get_verify_time - var _verify_time = null - func _get_verify_time() -> String: - return "" if not _verify_time is String else String(_verify_time) + var _verify_time: String = null + var verify_time : String: + get: + return "" if not _verify_time is String else String(_verify_time) # The user's wallet data. - var wallet : String setget , _get_wallet - var _wallet = null - func _get_wallet() -> String: - return "" if not _wallet is String else String(_wallet) + var _wallet: String = null + var wallet : String: + get: + return "" if not _wallet is String else String(_wallet) var _wallet_dict = null - var wallet_dict : Dictionary setget , _get_wallet_dict - func _get_wallet_dict() -> Dictionary: - if _wallet_dict == null: + var wallet_dict : Dictionary: + get: if _wallet == null or validate_json(_wallet): return {} + _wallet_dict = parse_json(_wallet) - return _wallet_dict as Dictionary + return _wallet_dict as Dictionary - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiAccount: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiAccount", p_dict), ApiAccount) as ApiAccount @@ -291,19 +291,19 @@ class ApiAccountApple extends NakamaAsyncResult: } # The ID token received from Apple to validate. - var token : String setget , _get_token - var _token = null - func _get_token() -> String: - return "" if not _token is String else String(_token) + var _token: String = null + var token : String: + get: + return "" if not _token is String else String(_token) # Extra information that will be bundled in the session token. - var vars : Dictionary setget , _get_vars - var _vars = null - func _get_vars() -> Dictionary: - return Dictionary() if not _vars is Dictionary else _vars.duplicate() + var _vars: Dictionary = null + var vars : Dictionary: + get: + return Dictionary() if not _vars is Dictionary else _vars.duplicate() - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiAccountApple: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiAccountApple", p_dict), ApiAccountApple) as ApiAccountApple @@ -332,19 +332,19 @@ class ApiAccountCustom extends NakamaAsyncResult: } # A custom identifier. - var id : String setget , _get_id - var _id = null - func _get_id() -> String: - return "" if not _id is String else String(_id) + var _id: String = null + var id : String: + get: + return "" if not _id is String else String(_id) # Extra information that will be bundled in the session token. - var vars : Dictionary setget , _get_vars - var _vars = null - func _get_vars() -> Dictionary: - return Dictionary() if not _vars is Dictionary else _vars.duplicate() + var _vars: Dictionary = null + var vars : Dictionary: + get: + return Dictionary() if not _vars is Dictionary else _vars.duplicate() - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiAccountCustom: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiAccountCustom", p_dict), ApiAccountCustom) as ApiAccountCustom @@ -373,19 +373,19 @@ class ApiAccountDevice extends NakamaAsyncResult: } # A device identifier. Should be obtained by a platform-specific device API. - var id : String setget , _get_id - var _id = null - func _get_id() -> String: - return "" if not _id is String else String(_id) + var _id: String = null + var id : String: + get: + return "" if not _id is String else String(_id) # Extra information that will be bundled in the session token. - var vars : Dictionary setget , _get_vars - var _vars = null - func _get_vars() -> Dictionary: - return Dictionary() if not _vars is Dictionary else _vars.duplicate() + var _vars: Dictionary = null + var vars : Dictionary: + get: + return Dictionary() if not _vars is Dictionary else _vars.duplicate() - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiAccountDevice: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiAccountDevice", p_dict), ApiAccountDevice) as ApiAccountDevice @@ -415,25 +415,25 @@ class ApiAccountEmail extends NakamaAsyncResult: } # A valid RFC-5322 email address. - var email : String setget , _get_email - var _email = null - func _get_email() -> String: - return "" if not _email is String else String(_email) + var _email: String = null + var email : String: + get: + return "" if not _email is String else String(_email) # A password for the user account. - var password : String setget , _get_password - var _password = null - func _get_password() -> String: - return "" if not _password is String else String(_password) + var _password: String = null + var password : String: + get: + return "" if not _password is String else String(_password) # Extra information that will be bundled in the session token. - var vars : Dictionary setget , _get_vars - var _vars = null - func _get_vars() -> Dictionary: - return Dictionary() if not _vars is Dictionary else _vars.duplicate() + var _vars: Dictionary = null + var vars : Dictionary: + get: + return Dictionary() if not _vars is Dictionary else _vars.duplicate() - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiAccountEmail: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiAccountEmail", p_dict), ApiAccountEmail) as ApiAccountEmail @@ -463,19 +463,19 @@ class ApiAccountFacebook extends NakamaAsyncResult: } # The OAuth token received from Facebook to access their profile API. - var token : String setget , _get_token - var _token = null - func _get_token() -> String: - return "" if not _token is String else String(_token) + var _token: String = null + var token : String: + get: + return "" if not _token is String else String(_token) # Extra information that will be bundled in the session token. - var vars : Dictionary setget , _get_vars - var _vars = null - func _get_vars() -> Dictionary: - return Dictionary() if not _vars is Dictionary else _vars.duplicate() + var _vars: Dictionary = null + var vars : Dictionary: + get: + return Dictionary() if not _vars is Dictionary else _vars.duplicate() - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiAccountFacebook: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiAccountFacebook", p_dict), ApiAccountFacebook) as ApiAccountFacebook @@ -504,19 +504,19 @@ class ApiAccountFacebookInstantGame extends NakamaAsyncResult: } # - var signed_player_info : String setget , _get_signed_player_info - var _signed_player_info = null - func _get_signed_player_info() -> String: - return "" if not _signed_player_info is String else String(_signed_player_info) + var _signed_player_info: String = null + var signed_player_info : String: + get: + return "" if not _signed_player_info is String else String(_signed_player_info) # Extra information that will be bundled in the session token. - var vars : Dictionary setget , _get_vars - var _vars = null - func _get_vars() -> Dictionary: - return Dictionary() if not _vars is Dictionary else _vars.duplicate() + var _vars: Dictionary = null + var vars : Dictionary: + get: + return Dictionary() if not _vars is Dictionary else _vars.duplicate() - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiAccountFacebookInstantGame: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiAccountFacebookInstantGame", p_dict), ApiAccountFacebookInstantGame) as ApiAccountFacebookInstantGame @@ -550,49 +550,49 @@ class ApiAccountGameCenter extends NakamaAsyncResult: } # Bundle ID (generated by GameCenter). - var bundle_id : String setget , _get_bundle_id - var _bundle_id = null - func _get_bundle_id() -> String: - return "" if not _bundle_id is String else String(_bundle_id) + var _bundle_id: String = null + var bundle_id : String: + get: + return "" if not _bundle_id is String else String(_bundle_id) # Player ID (generated by GameCenter). - var player_id : String setget , _get_player_id - var _player_id = null - func _get_player_id() -> String: - return "" if not _player_id is String else String(_player_id) + var _player_id: String = null + var player_id : String: + get: + return "" if not _player_id is String else String(_player_id) # The URL for the public encryption key. - var public_key_url : String setget , _get_public_key_url - var _public_key_url = null - func _get_public_key_url() -> String: - return "" if not _public_key_url is String else String(_public_key_url) + var _public_key_url: String = null + var public_key_url : String: + get: + return "" if not _public_key_url is String else String(_public_key_url) # A random "NSString" used to compute the hash and keep it randomized. - var salt : String setget , _get_salt - var _salt = null - func _get_salt() -> String: - return "" if not _salt is String else String(_salt) + var _salt: String = null + var salt : String: + get: + return "" if not _salt is String else String(_salt) # The verification signature data generated. - var signature : String setget , _get_signature - var _signature = null - func _get_signature() -> String: - return "" if not _signature is String else String(_signature) + var _signature: String = null + var signature : String: + get: + return "" if not _signature is String else String(_signature) # Time since UNIX epoch when the signature was created. - var timestamp_seconds : String setget , _get_timestamp_seconds - var _timestamp_seconds = null - func _get_timestamp_seconds() -> String: - return "" if not _timestamp_seconds is String else String(_timestamp_seconds) + var _timestamp_seconds: String = null + var timestamp_seconds : String: + get: + return "" if not _timestamp_seconds is String else String(_timestamp_seconds) # Extra information that will be bundled in the session token. - var vars : Dictionary setget , _get_vars - var _vars = null - func _get_vars() -> Dictionary: - return Dictionary() if not _vars is Dictionary else _vars.duplicate() + var _vars: Dictionary = null + var vars : Dictionary: + get: + return Dictionary() if not _vars is Dictionary else _vars.duplicate() - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiAccountGameCenter: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiAccountGameCenter", p_dict), ApiAccountGameCenter) as ApiAccountGameCenter @@ -626,19 +626,19 @@ class ApiAccountGoogle extends NakamaAsyncResult: } # The OAuth token received from Google to access their profile API. - var token : String setget , _get_token - var _token = null - func _get_token() -> String: - return "" if not _token is String else String(_token) + var _token: String = null + var token : String: + get: + return "" if not _token is String else String(_token) # Extra information that will be bundled in the session token. - var vars : Dictionary setget , _get_vars - var _vars = null - func _get_vars() -> Dictionary: - return Dictionary() if not _vars is Dictionary else _vars.duplicate() + var _vars: Dictionary = null + var vars : Dictionary: + get: + return Dictionary() if not _vars is Dictionary else _vars.duplicate() - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiAccountGoogle: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiAccountGoogle", p_dict), ApiAccountGoogle) as ApiAccountGoogle @@ -667,19 +667,19 @@ class ApiAccountSteam extends NakamaAsyncResult: } # The account token received from Steam to access their profile API. - var token : String setget , _get_token - var _token = null - func _get_token() -> String: - return "" if not _token is String else String(_token) + var _token: String = null + var token : String: + get: + return "" if not _token is String else String(_token) # Extra information that will be bundled in the session token. - var vars : Dictionary setget , _get_vars - var _vars = null - func _get_vars() -> Dictionary: - return Dictionary() if not _vars is Dictionary else _vars.duplicate() + var _vars: Dictionary = null + var vars : Dictionary: + get: + return Dictionary() if not _vars is Dictionary else _vars.duplicate() - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiAccountSteam: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiAccountSteam", p_dict), ApiAccountSteam) as ApiAccountSteam @@ -719,85 +719,85 @@ class ApiChannelMessage extends NakamaAsyncResult: } # The channel this message belongs to. - var channel_id : String setget , _get_channel_id - var _channel_id = null - func _get_channel_id() -> String: - return "" if not _channel_id is String else String(_channel_id) + var _channel_id: String = null + var channel_id : String: + get: + return "" if not _channel_id is String else String(_channel_id) # The code representing a message type or category. - var code : int setget , _get_code - var _code = null - func _get_code() -> int: - return 0 if not _code is int else int(_code) + var _code: int = null + var code : int: + get: + return 0 if not _code is int else int(_code) # The content payload. - var content : String setget , _get_content - var _content = null - func _get_content() -> String: - return "" if not _content is String else String(_content) + var _content: String = null + var content : String: + get: + return "" if not _content is String else String(_content) # The UNIX time when the message was created. - var create_time : String setget , _get_create_time - var _create_time = null - func _get_create_time() -> String: - return "" if not _create_time is String else String(_create_time) + var _create_time: String = null + var create_time : String: + get: + return "" if not _create_time is String else String(_create_time) # The ID of the group, or an empty string if this message was not sent through a group channel. - var group_id : String setget , _get_group_id - var _group_id = null - func _get_group_id() -> String: - return "" if not _group_id is String else String(_group_id) + var _group_id: String = null + var group_id : String: + get: + return "" if not _group_id is String else String(_group_id) # The unique ID of this message. - var message_id : String setget , _get_message_id - var _message_id = null - func _get_message_id() -> String: - return "" if not _message_id is String else String(_message_id) + var _message_id: String = null + var message_id : String: + get: + return "" if not _message_id is String else String(_message_id) # True if the message was persisted to the channel's history, false otherwise. - var persistent : bool setget , _get_persistent - var _persistent = null - func _get_persistent() -> bool: - return false if not _persistent is bool else bool(_persistent) + var _persistent: bool = null + var persistent : bool: + get: + return false if not _persistent is bool else bool(_persistent) # The name of the chat room, or an empty string if this message was not sent through a chat room. - var room_name : String setget , _get_room_name - var _room_name = null - func _get_room_name() -> String: - return "" if not _room_name is String else String(_room_name) + var _room_name: String = null + var room_name : String: + get: + return "" if not _room_name is String else String(_room_name) # Message sender, usually a user ID. - var sender_id : String setget , _get_sender_id - var _sender_id = null - func _get_sender_id() -> String: - return "" if not _sender_id is String else String(_sender_id) + var _sender_id: String = null + var sender_id : String: + get: + return "" if not _sender_id is String else String(_sender_id) # The UNIX time when the message was last updated. - var update_time : String setget , _get_update_time - var _update_time = null - func _get_update_time() -> String: - return "" if not _update_time is String else String(_update_time) + var _update_time: String = null + var update_time : String: + get: + return "" if not _update_time is String else String(_update_time) # The ID of the first DM user, or an empty string if this message was not sent through a DM chat. - var user_id_one : String setget , _get_user_id_one - var _user_id_one = null - func _get_user_id_one() -> String: - return "" if not _user_id_one is String else String(_user_id_one) + var _user_id_one: String = null + var user_id_one : String: + get: + return "" if not _user_id_one is String else String(_user_id_one) # The ID of the second DM user, or an empty string if this message was not sent through a DM chat. - var user_id_two : String setget , _get_user_id_two - var _user_id_two = null - func _get_user_id_two() -> String: - return "" if not _user_id_two is String else String(_user_id_two) + var _user_id_two: String = null + var user_id_two : String: + get: + return "" if not _user_id_two is String else String(_user_id_two) # The username of the message sender, if any. - var username : String setget , _get_username - var _username = null - func _get_username() -> String: - return "" if not _username is String else String(_username) + var _username: String = null + var username : String: + get: + return "" if not _username is String else String(_username) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiChannelMessage: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiChannelMessage", p_dict), ApiChannelMessage) as ApiChannelMessage @@ -835,31 +835,31 @@ class ApiChannelMessageList extends NakamaAsyncResult: } # Cacheable cursor to list newer messages. Durable and designed to be stored, unlike next/prev cursors. - var cacheable_cursor : String setget , _get_cacheable_cursor - var _cacheable_cursor = null - func _get_cacheable_cursor() -> String: - return "" if not _cacheable_cursor is String else String(_cacheable_cursor) + var _cacheable_cursor: String = null + var cacheable_cursor : String: + get: + return "" if not _cacheable_cursor is String else String(_cacheable_cursor) # A list of messages. - var messages : Array setget , _get_messages - var _messages = null - func _get_messages() -> Array: - return Array() if not _messages is Array else Array(_messages) + var _messages: Array = null + var messages : Array: + get: + return Array() if not _messages is Array else Array(_messages) # The cursor to send when retrieving the next page, if any. - var next_cursor : String setget , _get_next_cursor - var _next_cursor = null - func _get_next_cursor() -> String: - return "" if not _next_cursor is String else String(_next_cursor) + var _next_cursor: String = null + var next_cursor : String: + get: + return "" if not _next_cursor is String else String(_next_cursor) # The cursor to send when retrieving the previous page, if any. - var prev_cursor : String setget , _get_prev_cursor - var _prev_cursor = null - func _get_prev_cursor() -> String: - return "" if not _prev_cursor is String else String(_prev_cursor) + var _prev_cursor: String = null + var prev_cursor : String: + get: + return "" if not _prev_cursor is String else String(_prev_cursor) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiChannelMessageList: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiChannelMessageList", p_dict), ApiChannelMessageList) as ApiChannelMessageList @@ -890,43 +890,43 @@ class ApiCreateGroupRequest extends NakamaAsyncResult: } # A URL for an avatar image. - var avatar_url : String setget , _get_avatar_url - var _avatar_url = null - func _get_avatar_url() -> String: - return "" if not _avatar_url is String else String(_avatar_url) + var _avatar_url: String = null + var avatar_url : String: + get: + return "" if not _avatar_url is String else String(_avatar_url) # A description for the group. - var description : String setget , _get_description - var _description = null - func _get_description() -> String: - return "" if not _description is String else String(_description) + var _description: String = null + var description : String: + get: + return "" if not _description is String else String(_description) # The language expected to be a tag which follows the BCP-47 spec. - var lang_tag : String setget , _get_lang_tag - var _lang_tag = null - func _get_lang_tag() -> String: - return "" if not _lang_tag is String else String(_lang_tag) + var _lang_tag: String = null + var lang_tag : String: + get: + return "" if not _lang_tag is String else String(_lang_tag) # Maximum number of group members. - var max_count : int setget , _get_max_count - var _max_count = null - func _get_max_count() -> int: - return 0 if not _max_count is int else int(_max_count) + var _max_count: int = null + var max_count : int: + get: + return 0 if not _max_count is int else int(_max_count) # A unique name for the group. - var name : String setget , _get_name - var _name = null - func _get_name() -> String: - return "" if not _name is String else String(_name) + var _name: String = null + var name : String: + get: + return "" if not _name is String else String(_name) # Mark a group as open or not where only admins can accept members. - var open : bool setget , _get_open - var _open = null - func _get_open() -> bool: - return false if not _open is bool else bool(_open) + var _open: bool = null + var open : bool: + get: + return false if not _open is bool else bool(_open) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiCreateGroupRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiCreateGroupRequest", p_dict), ApiCreateGroupRequest) as ApiCreateGroupRequest @@ -956,25 +956,25 @@ class ApiDeleteStorageObjectId extends NakamaAsyncResult: } # The collection which stores the object. - var collection : String setget , _get_collection - var _collection = null - func _get_collection() -> String: - return "" if not _collection is String else String(_collection) + var _collection: String = null + var collection : String: + get: + return "" if not _collection is String else String(_collection) # The key of the object within the collection. - var key : String setget , _get_key - var _key = null - func _get_key() -> String: - return "" if not _key is String else String(_key) + var _key: String = null + var key : String: + get: + return "" if not _key is String else String(_key) # The version hash of the object. - var version : String setget , _get_version - var _version = null - func _get_version() -> String: - return "" if not _version is String else String(_version) + var _version: String = null + var version : String: + get: + return "" if not _version is String else String(_version) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiDeleteStorageObjectId: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiDeleteStorageObjectId", p_dict), ApiDeleteStorageObjectId) as ApiDeleteStorageObjectId @@ -999,13 +999,13 @@ class ApiDeleteStorageObjectsRequest extends NakamaAsyncResult: } # Batch of storage objects. - var object_ids : Array setget , _get_object_ids - var _object_ids = null - func _get_object_ids() -> Array: - return Array() if not _object_ids is Array else Array(_object_ids) + var _object_ids: Array = null + var object_ids : Array: + get: + return Array() if not _object_ids is Array else Array(_object_ids) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiDeleteStorageObjectsRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiDeleteStorageObjectsRequest", p_dict), ApiDeleteStorageObjectsRequest) as ApiDeleteStorageObjectsRequest @@ -1031,31 +1031,31 @@ class ApiEvent extends NakamaAsyncResult: } # True if the event came directly from a client call, false otherwise. - var external : bool setget , _get_external - var _external = null - func _get_external() -> bool: - return false if not _external is bool else bool(_external) + var _external: bool = null + var external : bool: + get: + return false if not _external is bool else bool(_external) # An event name, type, category, or identifier. - var name : String setget , _get_name - var _name = null - func _get_name() -> String: - return "" if not _name is String else String(_name) + var _name: String = null + var name : String: + get: + return "" if not _name is String else String(_name) # Arbitrary event property values. - var properties : Dictionary setget , _get_properties - var _properties = null - func _get_properties() -> Dictionary: - return Dictionary() if not _properties is Dictionary else _properties.duplicate() + var _properties: Dictionary = null + var properties : Dictionary: + get: + return Dictionary() if not _properties is Dictionary else _properties.duplicate() # The time when the event was triggered. - var timestamp : String setget , _get_timestamp - var _timestamp = null - func _get_timestamp() -> String: - return "" if not _timestamp is String else String(_timestamp) + var _timestamp: String = null + var timestamp : String: + get: + return "" if not _timestamp is String else String(_timestamp) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiEvent: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiEvent", p_dict), ApiEvent) as ApiEvent @@ -1087,25 +1087,25 @@ class ApiFriend extends NakamaAsyncResult: } # The friend status. - var state : int setget , _get_state - var _state = null - func _get_state() -> int: - return 0 if not _state is int else int(_state) + var _state: int = null + var state : int: + get: + return 0 if not _state is int else int(_state) # Time of the latest relationship update. - var update_time : String setget , _get_update_time - var _update_time = null - func _get_update_time() -> String: - return "" if not _update_time is String else String(_update_time) + var _update_time: String = null + var update_time : String: + get: + return "" if not _update_time is String else String(_update_time) # The user object. - var user : ApiUser setget , _get_user - var _user = null - func _get_user() -> ApiUser: - return _user as ApiUser + var _user: ApiUser = null + var user : ApiUser: + get: + return _user as ApiUser - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiFriend: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiFriend", p_dict), ApiFriend) as ApiFriend @@ -1131,19 +1131,19 @@ class ApiFriendList extends NakamaAsyncResult: } # Cursor for the next page of results, if any. - var cursor : String setget , _get_cursor - var _cursor = null - func _get_cursor() -> String: - return "" if not _cursor is String else String(_cursor) + var _cursor: String = null + var cursor : String: + get: + return "" if not _cursor is String else String(_cursor) # The Friend objects. - var friends : Array setget , _get_friends - var _friends = null - func _get_friends() -> Array: - return Array() if not _friends is Array else Array(_friends) + var _friends: Array = null + var friends : Array: + get: + return Array() if not _friends is Array else Array(_friends) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiFriendList: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiFriendList", p_dict), ApiFriendList) as ApiFriendList @@ -1178,79 +1178,79 @@ class ApiGroup extends NakamaAsyncResult: } # A URL for an avatar image. - var avatar_url : String setget , _get_avatar_url - var _avatar_url = null - func _get_avatar_url() -> String: - return "" if not _avatar_url is String else String(_avatar_url) + var _avatar_url: String = null + var avatar_url : String: + get: + return "" if not _avatar_url is String else String(_avatar_url) # The UNIX time when the group was created. - var create_time : String setget , _get_create_time - var _create_time = null - func _get_create_time() -> String: - return "" if not _create_time is String else String(_create_time) + var _create_time: String = null + var create_time : String: + get: + return "" if not _create_time is String else String(_create_time) # The id of the user who created the group. - var creator_id : String setget , _get_creator_id - var _creator_id = null - func _get_creator_id() -> String: - return "" if not _creator_id is String else String(_creator_id) + var _creator_id: String = null + var creator_id : String: + get: + return "" if not _creator_id is String else String(_creator_id) # A description for the group. - var description : String setget , _get_description - var _description = null - func _get_description() -> String: - return "" if not _description is String else String(_description) + var _description: String = null + var description : String: + get: + return "" if not _description is String else String(_description) # The current count of all members in the group. - var edge_count : int setget , _get_edge_count - var _edge_count = null - func _get_edge_count() -> int: - return 0 if not _edge_count is int else int(_edge_count) + var _edge_count: int = null + var edge_count : int: + get: + return 0 if not _edge_count is int else int(_edge_count) # The id of a group. - var id : String setget , _get_id - var _id = null - func _get_id() -> String: - return "" if not _id is String else String(_id) + var _id: String = null + var id : String: + get: + return "" if not _id is String else String(_id) # The language expected to be a tag which follows the BCP-47 spec. - var lang_tag : String setget , _get_lang_tag - var _lang_tag = null - func _get_lang_tag() -> String: - return "" if not _lang_tag is String else String(_lang_tag) + var _lang_tag: String = null + var lang_tag : String: + get: + return "" if not _lang_tag is String else String(_lang_tag) # The maximum number of members allowed. - var max_count : int setget , _get_max_count - var _max_count = null - func _get_max_count() -> int: - return 0 if not _max_count is int else int(_max_count) + var _max_count: int = null + var max_count : int: + get: + return 0 if not _max_count is int else int(_max_count) # Additional information stored as a JSON object. - var metadata : String setget , _get_metadata - var _metadata = null - func _get_metadata() -> String: - return "" if not _metadata is String else String(_metadata) + var _metadata: String = null + var metadata : String: + get: + return "" if not _metadata is String else String(_metadata) # The unique name of the group. - var name : String setget , _get_name - var _name = null - func _get_name() -> String: - return "" if not _name is String else String(_name) + var _name: String = null + var name : String: + get: + return "" if not _name is String else String(_name) # Anyone can join open groups, otherwise only admins can accept members. - var open : bool setget , _get_open - var _open = null - func _get_open() -> bool: - return false if not _open is bool else bool(_open) + var _open: bool = null + var open : bool: + get: + return false if not _open is bool else bool(_open) # The UNIX time when the group was last updated. - var update_time : String setget , _get_update_time - var _update_time = null - func _get_update_time() -> String: - return "" if not _update_time is String else String(_update_time) + var _update_time: String = null + var update_time : String: + get: + return "" if not _update_time is String else String(_update_time) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiGroup: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiGroup", p_dict), ApiGroup) as ApiGroup @@ -1285,19 +1285,19 @@ class ApiGroupList extends NakamaAsyncResult: } # A cursor used to get the next page. - var cursor : String setget , _get_cursor - var _cursor = null - func _get_cursor() -> String: - return "" if not _cursor is String else String(_cursor) + var _cursor: String = null + var cursor : String: + get: + return "" if not _cursor is String else String(_cursor) # One or more groups. - var groups : Array setget , _get_groups - var _groups = null - func _get_groups() -> Array: - return Array() if not _groups is Array else Array(_groups) + var _groups: Array = null + var groups : Array: + get: + return Array() if not _groups is Array else Array(_groups) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiGroupList: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiGroupList", p_dict), ApiGroupList) as ApiGroupList @@ -1322,19 +1322,19 @@ class ApiGroupUserList extends NakamaAsyncResult: } # Cursor for the next page of results, if any. - var cursor : String setget , _get_cursor - var _cursor = null - func _get_cursor() -> String: - return "" if not _cursor is String else String(_cursor) + var _cursor: String = null + var cursor : String: + get: + return "" if not _cursor is String else String(_cursor) # User-role pairs for a group. - var group_users : Array setget , _get_group_users - var _group_users = null - func _get_group_users() -> Array: - return Array() if not _group_users is Array else Array(_group_users) + var _group_users: Array = null + var group_users : Array: + get: + return Array() if not _group_users is Array else Array(_group_users) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiGroupUserList: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiGroupUserList", p_dict), ApiGroupUserList) as ApiGroupUserList @@ -1369,79 +1369,79 @@ class ApiLeaderboardRecord extends NakamaAsyncResult: } # The UNIX time when the leaderboard record was created. - var create_time : String setget , _get_create_time - var _create_time = null - func _get_create_time() -> String: - return "" if not _create_time is String else String(_create_time) + var _create_time: String = null + var create_time : String: + get: + return "" if not _create_time is String else String(_create_time) # The UNIX time when the leaderboard record expires. - var expiry_time : String setget , _get_expiry_time - var _expiry_time = null - func _get_expiry_time() -> String: - return "" if not _expiry_time is String else String(_expiry_time) + var _expiry_time: String = null + var expiry_time : String: + get: + return "" if not _expiry_time is String else String(_expiry_time) # The ID of the leaderboard this score belongs to. - var leaderboard_id : String setget , _get_leaderboard_id - var _leaderboard_id = null - func _get_leaderboard_id() -> String: - return "" if not _leaderboard_id is String else String(_leaderboard_id) + var _leaderboard_id: String = null + var leaderboard_id : String: + get: + return "" if not _leaderboard_id is String else String(_leaderboard_id) # The maximum number of score updates allowed by the owner. - var max_num_score : int setget , _get_max_num_score - var _max_num_score = null - func _get_max_num_score() -> int: - return 0 if not _max_num_score is int else int(_max_num_score) + var _max_num_score: int = null + var max_num_score : int: + get: + return 0 if not _max_num_score is int else int(_max_num_score) # Metadata. - var metadata : String setget , _get_metadata - var _metadata = null - func _get_metadata() -> String: - return "" if not _metadata is String else String(_metadata) + var _metadata: String = null + var metadata : String: + get: + return "" if not _metadata is String else String(_metadata) # The number of submissions to this score record. - var num_score : int setget , _get_num_score - var _num_score = null - func _get_num_score() -> int: - return 0 if not _num_score is int else int(_num_score) + var _num_score: int = null + var num_score : int: + get: + return 0 if not _num_score is int else int(_num_score) # The ID of the score owner, usually a user or group. - var owner_id : String setget , _get_owner_id - var _owner_id = null - func _get_owner_id() -> String: - return "" if not _owner_id is String else String(_owner_id) + var _owner_id: String = null + var owner_id : String: + get: + return "" if not _owner_id is String else String(_owner_id) # The rank of this record. - var rank : String setget , _get_rank - var _rank = null - func _get_rank() -> String: - return "" if not _rank is String else String(_rank) + var _rank: String = null + var rank : String: + get: + return "" if not _rank is String else String(_rank) # The score value. - var score : String setget , _get_score - var _score = null - func _get_score() -> String: - return "" if not _score is String else String(_score) + var _score: String = null + var score : String: + get: + return "" if not _score is String else String(_score) # An optional subscore value. - var subscore : String setget , _get_subscore - var _subscore = null - func _get_subscore() -> String: - return "" if not _subscore is String else String(_subscore) + var _subscore: String = null + var subscore : String: + get: + return "" if not _subscore is String else String(_subscore) # The UNIX time when the leaderboard record was updated. - var update_time : String setget , _get_update_time - var _update_time = null - func _get_update_time() -> String: - return "" if not _update_time is String else String(_update_time) + var _update_time: String = null + var update_time : String: + get: + return "" if not _update_time is String else String(_update_time) # The username of the score owner, if the owner is a user. - var username : String setget , _get_username - var _username = null - func _get_username() -> String: - return "" if not _username is String else String(_username) + var _username: String = null + var username : String: + get: + return "" if not _username is String else String(_username) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiLeaderboardRecord: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiLeaderboardRecord", p_dict), ApiLeaderboardRecord) as ApiLeaderboardRecord @@ -1478,31 +1478,31 @@ class ApiLeaderboardRecordList extends NakamaAsyncResult: } # The cursor to send when retrieving the next page, if any. - var next_cursor : String setget , _get_next_cursor - var _next_cursor = null - func _get_next_cursor() -> String: - return "" if not _next_cursor is String else String(_next_cursor) + var _next_cursor: String = null + var next_cursor : String: + get: + return "" if not _next_cursor is String else String(_next_cursor) # A batched set of leaderboard records belonging to specified owners. - var owner_records : Array setget , _get_owner_records - var _owner_records = null - func _get_owner_records() -> Array: - return Array() if not _owner_records is Array else Array(_owner_records) + var _owner_records: Array = null + var owner_records : Array: + get: + return Array() if not _owner_records is Array else Array(_owner_records) # The cursor to send when retrieving the previous page, if any. - var prev_cursor : String setget , _get_prev_cursor - var _prev_cursor = null - func _get_prev_cursor() -> String: - return "" if not _prev_cursor is String else String(_prev_cursor) + var _prev_cursor: String = null + var prev_cursor : String: + get: + return "" if not _prev_cursor is String else String(_prev_cursor) # A list of leaderboard records. - var records : Array setget , _get_records - var _records = null - func _get_records() -> Array: - return Array() if not _records is Array else Array(_records) + var _records: Array = null + var records : Array: + get: + return Array() if not _records is Array else Array(_records) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiLeaderboardRecordList: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiLeaderboardRecordList", p_dict), ApiLeaderboardRecordList) as ApiLeaderboardRecordList @@ -1529,19 +1529,19 @@ class ApiLinkSteamRequest extends NakamaAsyncResult: } # The Facebook account details. - var account : ApiAccountSteam setget , _get_account - var _account = null - func _get_account() -> ApiAccountSteam: - return _account as ApiAccountSteam + var _account: ApiAccountSteam = null + var account : ApiAccountSteam: + get: + return _account as ApiAccountSteam # Import Steam friends for the user. - var sync : bool setget , _get_sync - var _sync = null - func _get_sync() -> bool: - return false if not _sync is bool else bool(_sync) + var _sync: bool = null + var sync : bool: + get: + return false if not _sync is bool else bool(_sync) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiLinkSteamRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiLinkSteamRequest", p_dict), ApiLinkSteamRequest) as ApiLinkSteamRequest @@ -1570,43 +1570,43 @@ class ApiMatch extends NakamaAsyncResult: } # True if it's an server-managed authoritative match, false otherwise. - var authoritative : bool setget , _get_authoritative - var _authoritative = null - func _get_authoritative() -> bool: - return false if not _authoritative is bool else bool(_authoritative) + var _authoritative: bool = null + var authoritative : bool: + get: + return false if not _authoritative is bool else bool(_authoritative) # - var handler_name : String setget , _get_handler_name - var _handler_name = null - func _get_handler_name() -> String: - return "" if not _handler_name is String else String(_handler_name) + var _handler_name: String = null + var handler_name : String: + get: + return "" if not _handler_name is String else String(_handler_name) # Match label, if any. - var label : String setget , _get_label - var _label = null - func _get_label() -> String: - return "" if not _label is String else String(_label) + var _label: String = null + var label : String: + get: + return "" if not _label is String else String(_label) # The ID of the match, can be used to join. - var match_id : String setget , _get_match_id - var _match_id = null - func _get_match_id() -> String: - return "" if not _match_id is String else String(_match_id) + var _match_id: String = null + var match_id : String: + get: + return "" if not _match_id is String else String(_match_id) # Current number of users in the match. - var size : int setget , _get_size - var _size = null - func _get_size() -> int: - return 0 if not _size is int else int(_size) + var _size: int = null + var size : int: + get: + return 0 if not _size is int else int(_size) # - var tick_rate : int setget , _get_tick_rate - var _tick_rate = null - func _get_tick_rate() -> int: - return 0 if not _tick_rate is int else int(_tick_rate) + var _tick_rate: int = null + var tick_rate : int: + get: + return 0 if not _tick_rate is int else int(_tick_rate) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiMatch: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiMatch", p_dict), ApiMatch) as ApiMatch @@ -1634,13 +1634,13 @@ class ApiMatchList extends NakamaAsyncResult: } # A number of matches corresponding to a list operation. - var matches : Array setget , _get_matches - var _matches = null - func _get_matches() -> Array: - return Array() if not _matches is Array else Array(_matches) + var _matches: Array = null + var matches : Array: + get: + return Array() if not _matches is Array else Array(_matches) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiMatchList: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiMatchList", p_dict), ApiMatchList) as ApiMatchList @@ -1669,49 +1669,49 @@ class ApiNotification extends NakamaAsyncResult: } # Category code for this notification. - var code : int setget , _get_code - var _code = null - func _get_code() -> int: - return 0 if not _code is int else int(_code) + var _code: int = null + var code : int: + get: + return 0 if not _code is int else int(_code) # Content of the notification in JSON. - var content : String setget , _get_content - var _content = null - func _get_content() -> String: - return "" if not _content is String else String(_content) + var _content: String = null + var content : String: + get: + return "" if not _content is String else String(_content) # The UNIX time when the notification was created. - var create_time : String setget , _get_create_time - var _create_time = null - func _get_create_time() -> String: - return "" if not _create_time is String else String(_create_time) + var _create_time: String = null + var create_time : String: + get: + return "" if not _create_time is String else String(_create_time) # ID of the Notification. - var id : String setget , _get_id - var _id = null - func _get_id() -> String: - return "" if not _id is String else String(_id) + var _id: String = null + var id : String: + get: + return "" if not _id is String else String(_id) # True if this notification was persisted to the database. - var persistent : bool setget , _get_persistent - var _persistent = null - func _get_persistent() -> bool: - return false if not _persistent is bool else bool(_persistent) + var _persistent: bool = null + var persistent : bool: + get: + return false if not _persistent is bool else bool(_persistent) # ID of the sender, if a user. Otherwise 'null'. - var sender_id : String setget , _get_sender_id - var _sender_id = null - func _get_sender_id() -> String: - return "" if not _sender_id is String else String(_sender_id) + var _sender_id: String = null + var sender_id : String: + get: + return "" if not _sender_id is String else String(_sender_id) # Subject of the notification. - var subject : String setget , _get_subject - var _subject = null - func _get_subject() -> String: - return "" if not _subject is String else String(_subject) + var _subject: String = null + var subject : String: + get: + return "" if not _subject is String else String(_subject) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiNotification: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiNotification", p_dict), ApiNotification) as ApiNotification @@ -1741,19 +1741,19 @@ class ApiNotificationList extends NakamaAsyncResult: } # Use this cursor to paginate notifications. Cache this to catch up to new notifications. - var cacheable_cursor : String setget , _get_cacheable_cursor - var _cacheable_cursor = null - func _get_cacheable_cursor() -> String: - return "" if not _cacheable_cursor is String else String(_cacheable_cursor) + var _cacheable_cursor: String = null + var cacheable_cursor : String: + get: + return "" if not _cacheable_cursor is String else String(_cacheable_cursor) # Collection of notifications. - var notifications : Array setget , _get_notifications - var _notifications = null - func _get_notifications() -> Array: - return Array() if not _notifications is Array else Array(_notifications) + var _notifications: Array = null + var notifications : Array: + get: + return Array() if not _notifications is Array else Array(_notifications) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiNotificationList: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiNotificationList", p_dict), ApiNotificationList) as ApiNotificationList @@ -1787,25 +1787,25 @@ class ApiReadStorageObjectId extends NakamaAsyncResult: } # The collection which stores the object. - var collection : String setget , _get_collection - var _collection = null - func _get_collection() -> String: - return "" if not _collection is String else String(_collection) + var _collection: String = null + var collection : String: + get: + return "" if not _collection is String else String(_collection) # The key of the object within the collection. - var key : String setget , _get_key - var _key = null - func _get_key() -> String: - return "" if not _key is String else String(_key) + var _key: String = null + var key : String: + get: + return "" if not _key is String else String(_key) # The user owner of the object. - var user_id : String setget , _get_user_id - var _user_id = null - func _get_user_id() -> String: - return "" if not _user_id is String else String(_user_id) + var _user_id: String = null + var user_id : String: + get: + return "" if not _user_id is String else String(_user_id) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiReadStorageObjectId: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiReadStorageObjectId", p_dict), ApiReadStorageObjectId) as ApiReadStorageObjectId @@ -1830,13 +1830,13 @@ class ApiReadStorageObjectsRequest extends NakamaAsyncResult: } # Batch of storage objects. - var object_ids : Array setget , _get_object_ids - var _object_ids = null - func _get_object_ids() -> Array: - return Array() if not _object_ids is Array else Array(_object_ids) + var _object_ids: Array = null + var object_ids : Array: + get: + return Array() if not _object_ids is Array else Array(_object_ids) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiReadStorageObjectsRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiReadStorageObjectsRequest", p_dict), ApiReadStorageObjectsRequest) as ApiReadStorageObjectsRequest @@ -1861,25 +1861,25 @@ class ApiRpc extends NakamaAsyncResult: } # The authentication key used when executed as a non-client HTTP request. - var http_key : String setget , _get_http_key - var _http_key = null - func _get_http_key() -> String: - return "" if not _http_key is String else String(_http_key) + var _http_key: String = null + var http_key : String: + get: + return "" if not _http_key is String else String(_http_key) # The identifier of the function. - var id : String setget , _get_id - var _id = null - func _get_id() -> String: - return "" if not _id is String else String(_id) + var _id: String = null + var id : String: + get: + return "" if not _id is String else String(_id) # The payload of the function which must be a JSON object. - var payload : String setget , _get_payload - var _payload = null - func _get_payload() -> String: - return "" if not _payload is String else String(_payload) + var _payload: String = null + var payload : String: + get: + return "" if not _payload is String else String(_payload) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiRpc: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiRpc", p_dict), ApiRpc) as ApiRpc @@ -1906,25 +1906,25 @@ class ApiSession extends NakamaAsyncResult: } # True if the corresponding account was just created, false otherwise. - var created : bool setget , _get_created - var _created = null - func _get_created() -> bool: - return false if not _created is bool else bool(_created) + var _created: bool = null + var created : bool: + get: + return false if not _created is bool else bool(_created) # Refresh token that can be used for session token renewal. - var refresh_token : String setget , _get_refresh_token - var _refresh_token = null - func _get_refresh_token() -> String: - return "" if not _refresh_token is String else String(_refresh_token) + var _refresh_token: String = null + var refresh_token : String: + get: + return "" if not _refresh_token is String else String(_refresh_token) # Authentication credentials. - var token : String setget , _get_token - var _token = null - func _get_token() -> String: - return "" if not _token is String else String(_token) + var _token: String = null + var token : String: + get: + return "" if not _token is String else String(_token) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiSession: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiSession", p_dict), ApiSession) as ApiSession @@ -1950,19 +1950,19 @@ class ApiSessionLogoutRequest extends NakamaAsyncResult: } # Refresh token to invalidate. - var refresh_token : String setget , _get_refresh_token - var _refresh_token = null - func _get_refresh_token() -> String: - return "" if not _refresh_token is String else String(_refresh_token) + var _refresh_token: String = null + var refresh_token : String: + get: + return "" if not _refresh_token is String else String(_refresh_token) # Session token to log out. - var token : String setget , _get_token - var _token = null - func _get_token() -> String: - return "" if not _token is String else String(_token) + var _token: String = null + var token : String: + get: + return "" if not _token is String else String(_token) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiSessionLogoutRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiSessionLogoutRequest", p_dict), ApiSessionLogoutRequest) as ApiSessionLogoutRequest @@ -1987,19 +1987,19 @@ class ApiSessionRefreshRequest extends NakamaAsyncResult: } # Refresh token. - var token : String setget , _get_token - var _token = null - func _get_token() -> String: - return "" if not _token is String else String(_token) + var _token: String = null + var token : String: + get: + return "" if not _token is String else String(_token) # Extra information that will be bundled in the session token. - var vars : Dictionary setget , _get_vars - var _vars = null - func _get_vars() -> Dictionary: - return Dictionary() if not _vars is Dictionary else _vars.duplicate() + var _vars: Dictionary = null + var vars : Dictionary: + get: + return Dictionary() if not _vars is Dictionary else _vars.duplicate() - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiSessionRefreshRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiSessionRefreshRequest", p_dict), ApiSessionRefreshRequest) as ApiSessionRefreshRequest @@ -2035,61 +2035,61 @@ class ApiStorageObject extends NakamaAsyncResult: } # The collection which stores the object. - var collection : String setget , _get_collection - var _collection = null - func _get_collection() -> String: - return "" if not _collection is String else String(_collection) + var _collection: String = null + var collection : String: + get: + return "" if not _collection is String else String(_collection) # The UNIX time when the object was created. - var create_time : String setget , _get_create_time - var _create_time = null - func _get_create_time() -> String: - return "" if not _create_time is String else String(_create_time) + var _create_time: String = null + var create_time : String: + get: + return "" if not _create_time is String else String(_create_time) # The key of the object within the collection. - var key : String setget , _get_key - var _key = null - func _get_key() -> String: - return "" if not _key is String else String(_key) + var _key: String = null + var key : String: + get: + return "" if not _key is String else String(_key) # The read access permissions for the object. - var permission_read : int setget , _get_permission_read - var _permission_read = null - func _get_permission_read() -> int: - return 0 if not _permission_read is int else int(_permission_read) + var _permission_read: int = null + var permission_read : int: + get: + return 0 if not _permission_read is int else int(_permission_read) # The write access permissions for the object. - var permission_write : int setget , _get_permission_write - var _permission_write = null - func _get_permission_write() -> int: - return 0 if not _permission_write is int else int(_permission_write) + var _permission_write: int = null + var permission_write : int: + get: + return 0 if not _permission_write is int else int(_permission_write) # The UNIX time when the object was last updated. - var update_time : String setget , _get_update_time - var _update_time = null - func _get_update_time() -> String: - return "" if not _update_time is String else String(_update_time) + var _update_time: String = null + var update_time : String: + get: + return "" if not _update_time is String else String(_update_time) # The user owner of the object. - var user_id : String setget , _get_user_id - var _user_id = null - func _get_user_id() -> String: - return "" if not _user_id is String else String(_user_id) + var _user_id: String = null + var user_id : String: + get: + return "" if not _user_id is String else String(_user_id) # The value of the object. - var value : String setget , _get_value - var _value = null - func _get_value() -> String: - return "" if not _value is String else String(_value) + var _value: String = null + var value : String: + get: + return "" if not _value is String else String(_value) # The version hash of the object. - var version : String setget , _get_version - var _version = null - func _get_version() -> String: - return "" if not _version is String else String(_version) + var _version: String = null + var version : String: + get: + return "" if not _version is String else String(_version) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiStorageObject: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiStorageObject", p_dict), ApiStorageObject) as ApiStorageObject @@ -2123,31 +2123,31 @@ class ApiStorageObjectAck extends NakamaAsyncResult: } # The collection which stores the object. - var collection : String setget , _get_collection - var _collection = null - func _get_collection() -> String: - return "" if not _collection is String else String(_collection) + var _collection: String = null + var collection : String: + get: + return "" if not _collection is String else String(_collection) # The key of the object within the collection. - var key : String setget , _get_key - var _key = null - func _get_key() -> String: - return "" if not _key is String else String(_key) + var _key: String = null + var key : String: + get: + return "" if not _key is String else String(_key) # The owner of the object. - var user_id : String setget , _get_user_id - var _user_id = null - func _get_user_id() -> String: - return "" if not _user_id is String else String(_user_id) + var _user_id: String = null + var user_id : String: + get: + return "" if not _user_id is String else String(_user_id) # The version hash of the object. - var version : String setget , _get_version - var _version = null - func _get_version() -> String: - return "" if not _version is String else String(_version) + var _version: String = null + var version : String: + get: + return "" if not _version is String else String(_version) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiStorageObjectAck: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiStorageObjectAck", p_dict), ApiStorageObjectAck) as ApiStorageObjectAck @@ -2173,13 +2173,13 @@ class ApiStorageObjectAcks extends NakamaAsyncResult: } # Batch of storage write acknowledgements. - var acks : Array setget , _get_acks - var _acks = null - func _get_acks() -> Array: - return Array() if not _acks is Array else Array(_acks) + var _acks: Array = null + var acks : Array: + get: + return Array() if not _acks is Array else Array(_acks) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiStorageObjectAcks: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiStorageObjectAcks", p_dict), ApiStorageObjectAcks) as ApiStorageObjectAcks @@ -2203,19 +2203,19 @@ class ApiStorageObjectList extends NakamaAsyncResult: } # The cursor for the next page of results, if any. - var cursor : String setget , _get_cursor - var _cursor = null - func _get_cursor() -> String: - return "" if not _cursor is String else String(_cursor) + var _cursor: String = null + var cursor : String: + get: + return "" if not _cursor is String else String(_cursor) # The list of storage objects. - var objects : Array setget , _get_objects - var _objects = null - func _get_objects() -> Array: - return Array() if not _objects is Array else Array(_objects) + var _objects: Array = null + var objects : Array: + get: + return Array() if not _objects is Array else Array(_objects) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiStorageObjectList: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiStorageObjectList", p_dict), ApiStorageObjectList) as ApiStorageObjectList @@ -2239,13 +2239,13 @@ class ApiStorageObjects extends NakamaAsyncResult: } # The batch of storage objects. - var objects : Array setget , _get_objects - var _objects = null - func _get_objects() -> Array: - return Array() if not _objects is Array else Array(_objects) + var _objects: Array = null + var objects : Array: + get: + return Array() if not _objects is Array else Array(_objects) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiStorageObjects: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiStorageObjects", p_dict), ApiStorageObjects) as ApiStorageObjects @@ -2286,121 +2286,121 @@ class ApiTournament extends NakamaAsyncResult: } # True if the tournament is active and can enter. A computed value. - var can_enter : bool setget , _get_can_enter - var _can_enter = null - func _get_can_enter() -> bool: - return false if not _can_enter is bool else bool(_can_enter) + var _can_enter: bool = null + var can_enter : bool: + get: + return false if not _can_enter is bool else bool(_can_enter) # The category of the tournament. e.g. "vip" could be category 1. - var category : int setget , _get_category - var _category = null - func _get_category() -> int: - return 0 if not _category is int else int(_category) + var _category: int = null + var category : int: + get: + return 0 if not _category is int else int(_category) # The UNIX time when the tournament was created. - var create_time : String setget , _get_create_time - var _create_time = null - func _get_create_time() -> String: - return "" if not _create_time is String else String(_create_time) + var _create_time: String = null + var create_time : String: + get: + return "" if not _create_time is String else String(_create_time) # The description of the tournament. May be blank. - var description : String setget , _get_description - var _description = null - func _get_description() -> String: - return "" if not _description is String else String(_description) + var _description: String = null + var description : String: + get: + return "" if not _description is String else String(_description) # Duration of the tournament in seconds. - var duration : int setget , _get_duration - var _duration = null - func _get_duration() -> int: - return 0 if not _duration is int else int(_duration) + var _duration: int = null + var duration : int: + get: + return 0 if not _duration is int else int(_duration) # The UNIX time when the tournament stops being active until next reset. A computed value. - var end_active : int setget , _get_end_active - var _end_active = null - func _get_end_active() -> int: - return 0 if not _end_active is int else int(_end_active) + var _end_active: int = null + var end_active : int: + get: + return 0 if not _end_active is int else int(_end_active) # The UNIX time when the tournament will be stopped. - var end_time : String setget , _get_end_time - var _end_time = null - func _get_end_time() -> String: - return "" if not _end_time is String else String(_end_time) + var _end_time: String = null + var end_time : String: + get: + return "" if not _end_time is String else String(_end_time) # The ID of the tournament. - var id : String setget , _get_id - var _id = null - func _get_id() -> String: - return "" if not _id is String else String(_id) + var _id: String = null + var id : String: + get: + return "" if not _id is String else String(_id) # The maximum score updates allowed per player for the current tournament. - var max_num_score : int setget , _get_max_num_score - var _max_num_score = null - func _get_max_num_score() -> int: - return 0 if not _max_num_score is int else int(_max_num_score) + var _max_num_score: int = null + var max_num_score : int: + get: + return 0 if not _max_num_score is int else int(_max_num_score) # The maximum number of players for the tournament. - var max_size : int setget , _get_max_size - var _max_size = null - func _get_max_size() -> int: - return 0 if not _max_size is int else int(_max_size) + var _max_size: int = null + var max_size : int: + get: + return 0 if not _max_size is int else int(_max_size) # Additional information stored as a JSON object. - var metadata : String setget , _get_metadata - var _metadata = null - func _get_metadata() -> String: - return "" if not _metadata is String else String(_metadata) + var _metadata: String = null + var metadata : String: + get: + return "" if not _metadata is String else String(_metadata) # The UNIX time when the tournament is next playable. A computed value. - var next_reset : int setget , _get_next_reset - var _next_reset = null - func _get_next_reset() -> int: - return 0 if not _next_reset is int else int(_next_reset) + var _next_reset: int = null + var next_reset : int: + get: + return 0 if not _next_reset is int else int(_next_reset) # Operator. - var operator : int setget , _get_operator - var _operator = null - func _get_operator() -> int: - return ApiOperator.values()[0] if not ApiOperator.values().has(_operator) else _operator + var _operator: int = null + var operator : int: + get: + return ApiOperator.values()[0] if not ApiOperator.values().has(_operator) else _operator # The UNIX time when the tournament was last reset. A computed value. - var prev_reset : int setget , _get_prev_reset - var _prev_reset = null - func _get_prev_reset() -> int: - return 0 if not _prev_reset is int else int(_prev_reset) + var _prev_reset: int = null + var prev_reset : int: + get: + return 0 if not _prev_reset is int else int(_prev_reset) # The current number of players in the tournament. - var size : int setget , _get_size - var _size = null - func _get_size() -> int: - return 0 if not _size is int else int(_size) + var _size: int = null + var size : int: + get: + return 0 if not _size is int else int(_size) # ASC (0) or DESC (1) sort mode of scores in the tournament. - var sort_order : int setget , _get_sort_order - var _sort_order = null - func _get_sort_order() -> int: - return 0 if not _sort_order is int else int(_sort_order) + var _sort_order: int = null + var sort_order : int: + get: + return 0 if not _sort_order is int else int(_sort_order) # The UNIX time when the tournament start being active. A computed value. - var start_active : int setget , _get_start_active - var _start_active = null - func _get_start_active() -> int: - return 0 if not _start_active is int else int(_start_active) + var _start_active: int = null + var start_active : int: + get: + return 0 if not _start_active is int else int(_start_active) # The UNIX time when the tournament will start. - var start_time : String setget , _get_start_time - var _start_time = null - func _get_start_time() -> String: - return "" if not _start_time is String else String(_start_time) + var _start_time: String = null + var start_time : String: + get: + return "" if not _start_time is String else String(_start_time) # The title for the tournament. - var title : String setget , _get_title - var _title = null - func _get_title() -> String: - return "" if not _title is String else String(_title) + var _title: String = null + var title : String: + get: + return "" if not _title is String else String(_title) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiTournament: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiTournament", p_dict), ApiTournament) as ApiTournament @@ -2442,19 +2442,19 @@ class ApiTournamentList extends NakamaAsyncResult: } # A pagination cursor (optional). - var cursor : String setget , _get_cursor - var _cursor = null - func _get_cursor() -> String: - return "" if not _cursor is String else String(_cursor) + var _cursor: String = null + var cursor : String: + get: + return "" if not _cursor is String else String(_cursor) # The list of tournaments returned. - var tournaments : Array setget , _get_tournaments - var _tournaments = null - func _get_tournaments() -> Array: - return Array() if not _tournaments is Array else Array(_tournaments) + var _tournaments: Array = null + var tournaments : Array: + get: + return Array() if not _tournaments is Array else Array(_tournaments) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiTournamentList: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiTournamentList", p_dict), ApiTournamentList) as ApiTournamentList @@ -2481,31 +2481,31 @@ class ApiTournamentRecordList extends NakamaAsyncResult: } # The cursor to send when retireving the next page (optional). - var next_cursor : String setget , _get_next_cursor - var _next_cursor = null - func _get_next_cursor() -> String: - return "" if not _next_cursor is String else String(_next_cursor) + var _next_cursor: String = null + var next_cursor : String: + get: + return "" if not _next_cursor is String else String(_next_cursor) # A batched set of tournament records belonging to specified owners. - var owner_records : Array setget , _get_owner_records - var _owner_records = null - func _get_owner_records() -> Array: - return Array() if not _owner_records is Array else Array(_owner_records) + var _owner_records: Array = null + var owner_records : Array: + get: + return Array() if not _owner_records is Array else Array(_owner_records) # The cursor to send when retrieving the previous page (optional). - var prev_cursor : String setget , _get_prev_cursor - var _prev_cursor = null - func _get_prev_cursor() -> String: - return "" if not _prev_cursor is String else String(_prev_cursor) + var _prev_cursor: String = null + var prev_cursor : String: + get: + return "" if not _prev_cursor is String else String(_prev_cursor) # A list of tournament records. - var records : Array setget , _get_records - var _records = null - func _get_records() -> Array: - return Array() if not _records is Array else Array(_records) + var _records: Array = null + var records : Array: + get: + return Array() if not _records is Array else Array(_records) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiTournamentRecordList: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiTournamentRecordList", p_dict), ApiTournamentRecordList) as ApiTournamentRecordList @@ -2536,43 +2536,43 @@ class ApiUpdateAccountRequest extends NakamaAsyncResult: } # A URL for an avatar image. - var avatar_url : String setget , _get_avatar_url - var _avatar_url = null - func _get_avatar_url() -> String: - return "" if not _avatar_url is String else String(_avatar_url) + var _avatar_url: String = null + var avatar_url : String: + get: + return "" if not _avatar_url is String else String(_avatar_url) # The display name of the user. - var display_name : String setget , _get_display_name - var _display_name = null - func _get_display_name() -> String: - return "" if not _display_name is String else String(_display_name) + var _display_name: String = null + var display_name : String: + get: + return "" if not _display_name is String else String(_display_name) # The language expected to be a tag which follows the BCP-47 spec. - var lang_tag : String setget , _get_lang_tag - var _lang_tag = null - func _get_lang_tag() -> String: - return "" if not _lang_tag is String else String(_lang_tag) + var _lang_tag: String = null + var lang_tag : String: + get: + return "" if not _lang_tag is String else String(_lang_tag) # The location set by the user. - var location : String setget , _get_location - var _location = null - func _get_location() -> String: - return "" if not _location is String else String(_location) + var _location: String = null + var location : String: + get: + return "" if not _location is String else String(_location) # The timezone set by the user. - var timezone : String setget , _get_timezone - var _timezone = null - func _get_timezone() -> String: - return "" if not _timezone is String else String(_timezone) + var _timezone: String = null + var timezone : String: + get: + return "" if not _timezone is String else String(_timezone) # The username of the user's account. - var username : String setget , _get_username - var _username = null - func _get_username() -> String: - return "" if not _username is String else String(_username) + var _username: String = null + var username : String: + get: + return "" if not _username is String else String(_username) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiUpdateAccountRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiUpdateAccountRequest", p_dict), ApiUpdateAccountRequest) as ApiUpdateAccountRequest @@ -2605,43 +2605,43 @@ class ApiUpdateGroupRequest extends NakamaAsyncResult: } # Avatar URL. - var avatar_url : String setget , _get_avatar_url - var _avatar_url = null - func _get_avatar_url() -> String: - return "" if not _avatar_url is String else String(_avatar_url) + var _avatar_url: String = null + var avatar_url : String: + get: + return "" if not _avatar_url is String else String(_avatar_url) # Description string. - var description : String setget , _get_description - var _description = null - func _get_description() -> String: - return "" if not _description is String else String(_description) + var _description: String = null + var description : String: + get: + return "" if not _description is String else String(_description) # The ID of the group to update. - var group_id : String setget , _get_group_id - var _group_id = null - func _get_group_id() -> String: - return "" if not _group_id is String else String(_group_id) + var _group_id: String = null + var group_id : String: + get: + return "" if not _group_id is String else String(_group_id) # Lang tag. - var lang_tag : String setget , _get_lang_tag - var _lang_tag = null - func _get_lang_tag() -> String: - return "" if not _lang_tag is String else String(_lang_tag) + var _lang_tag: String = null + var lang_tag : String: + get: + return "" if not _lang_tag is String else String(_lang_tag) # Name. - var name : String setget , _get_name - var _name = null - func _get_name() -> String: - return "" if not _name is String else String(_name) + var _name: String = null + var name : String: + get: + return "" if not _name is String else String(_name) # Open is true if anyone should be allowed to join, or false if joins must be approved by a group admin. - var open : bool setget , _get_open - var _open = null - func _get_open() -> bool: - return false if not _open is bool else bool(_open) + var _open: bool = null + var open : bool: + get: + return false if not _open is bool else bool(_open) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiUpdateGroupRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiUpdateGroupRequest", p_dict), ApiUpdateGroupRequest) as ApiUpdateGroupRequest @@ -2686,115 +2686,115 @@ class ApiUser extends NakamaAsyncResult: } # The Apple Sign In ID in the user's account. - var apple_id : String setget , _get_apple_id - var _apple_id = null - func _get_apple_id() -> String: - return "" if not _apple_id is String else String(_apple_id) + var _apple_id: String = null + var apple_id : String: + get: + return "" if not _apple_id is String else String(_apple_id) # A URL for an avatar image. - var avatar_url : String setget , _get_avatar_url - var _avatar_url = null - func _get_avatar_url() -> String: - return "" if not _avatar_url is String else String(_avatar_url) + var _avatar_url: String = null + var avatar_url : String: + get: + return "" if not _avatar_url is String else String(_avatar_url) # The UNIX time when the user was created. - var create_time : String setget , _get_create_time - var _create_time = null - func _get_create_time() -> String: - return "" if not _create_time is String else String(_create_time) + var _create_time: String = null + var create_time : String: + get: + return "" if not _create_time is String else String(_create_time) # The display name of the user. - var display_name : String setget , _get_display_name - var _display_name = null - func _get_display_name() -> String: - return "" if not _display_name is String else String(_display_name) + var _display_name: String = null + var display_name : String: + get: + return "" if not _display_name is String else String(_display_name) # Number of related edges to this user. - var edge_count : int setget , _get_edge_count - var _edge_count = null - func _get_edge_count() -> int: - return 0 if not _edge_count is int else int(_edge_count) + var _edge_count: int = null + var edge_count : int: + get: + return 0 if not _edge_count is int else int(_edge_count) # The Facebook id in the user's account. - var facebook_id : String setget , _get_facebook_id - var _facebook_id = null - func _get_facebook_id() -> String: - return "" if not _facebook_id is String else String(_facebook_id) + var _facebook_id: String = null + var facebook_id : String: + get: + return "" if not _facebook_id is String else String(_facebook_id) # The Facebook Instant Game ID in the user's account. - var facebook_instant_game_id : String setget , _get_facebook_instant_game_id - var _facebook_instant_game_id = null - func _get_facebook_instant_game_id() -> String: - return "" if not _facebook_instant_game_id is String else String(_facebook_instant_game_id) + var _facebook_instant_game_id: String = null + var facebook_instant_game_id : String: + get: + return "" if not _facebook_instant_game_id is String else String(_facebook_instant_game_id) # The Apple Game Center in of the user's account. - var gamecenter_id : String setget , _get_gamecenter_id - var _gamecenter_id = null - func _get_gamecenter_id() -> String: - return "" if not _gamecenter_id is String else String(_gamecenter_id) + var _gamecenter_id: String = null + var gamecenter_id : String: + get: + return "" if not _gamecenter_id is String else String(_gamecenter_id) # The Google id in the user's account. - var google_id : String setget , _get_google_id - var _google_id = null - func _get_google_id() -> String: - return "" if not _google_id is String else String(_google_id) + var _google_id: String = null + var google_id : String: + get: + return "" if not _google_id is String else String(_google_id) # The id of the user's account. - var id : String setget , _get_id - var _id = null - func _get_id() -> String: - return "" if not _id is String else String(_id) + var _id: String = null + var id : String: + get: + return "" if not _id is String else String(_id) # The language expected to be a tag which follows the BCP-47 spec. - var lang_tag : String setget , _get_lang_tag - var _lang_tag = null - func _get_lang_tag() -> String: - return "" if not _lang_tag is String else String(_lang_tag) + var _lang_tag: String = null + var lang_tag : String: + get: + return "" if not _lang_tag is String else String(_lang_tag) # The location set by the user. - var location : String setget , _get_location - var _location = null - func _get_location() -> String: - return "" if not _location is String else String(_location) + var _location: String = null + var location : String: + get: + return "" if not _location is String else String(_location) # Additional information stored as a JSON object. - var metadata : String setget , _get_metadata - var _metadata = null - func _get_metadata() -> String: - return "" if not _metadata is String else String(_metadata) + var _metadata: String = null + var metadata : String: + get: + return "" if not _metadata is String else String(_metadata) # Indicates whether the user is currently online. - var online : bool setget , _get_online - var _online = null - func _get_online() -> bool: - return false if not _online is bool else bool(_online) + var _online: bool = null + var online : bool: + get: + return false if not _online is bool else bool(_online) # The Steam id in the user's account. - var steam_id : String setget , _get_steam_id - var _steam_id = null - func _get_steam_id() -> String: - return "" if not _steam_id is String else String(_steam_id) + var _steam_id: String = null + var steam_id : String: + get: + return "" if not _steam_id is String else String(_steam_id) # The timezone set by the user. - var timezone : String setget , _get_timezone - var _timezone = null - func _get_timezone() -> String: - return "" if not _timezone is String else String(_timezone) + var _timezone: String = null + var timezone : String: + get: + return "" if not _timezone is String else String(_timezone) # The UNIX time when the user was last updated. - var update_time : String setget , _get_update_time - var _update_time = null - func _get_update_time() -> String: - return "" if not _update_time is String else String(_update_time) + var _update_time: String = null + var update_time : String: + get: + return "" if not _update_time is String else String(_update_time) # The username of the user's account. - var username : String setget , _get_username - var _username = null - func _get_username() -> String: - return "" if not _username is String else String(_username) + var _username: String = null + var username : String: + get: + return "" if not _username is String else String(_username) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiUser: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiUser", p_dict), ApiUser) as ApiUser @@ -2835,19 +2835,19 @@ class ApiUserGroupList extends NakamaAsyncResult: } # Cursor for the next page of results, if any. - var cursor : String setget , _get_cursor - var _cursor = null - func _get_cursor() -> String: - return "" if not _cursor is String else String(_cursor) + var _cursor: String = null + var cursor : String: + get: + return "" if not _cursor is String else String(_cursor) # Group-role pairs for a user. - var user_groups : Array setget , _get_user_groups - var _user_groups = null - func _get_user_groups() -> Array: - return Array() if not _user_groups is Array else Array(_user_groups) + var _user_groups: Array = null + var user_groups : Array: + get: + return Array() if not _user_groups is Array else Array(_user_groups) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiUserGroupList: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiUserGroupList", p_dict), ApiUserGroupList) as ApiUserGroupList @@ -2871,13 +2871,13 @@ class ApiUsers extends NakamaAsyncResult: } # The User objects. - var users : Array setget , _get_users - var _users = null - func _get_users() -> Array: - return Array() if not _users is Array else Array(_users) + var _users: Array = null + var users : Array: + get: + return Array() if not _users is Array else Array(_users) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiUsers: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiUsers", p_dict), ApiUsers) as ApiUsers @@ -2900,13 +2900,13 @@ class ApiValidatePurchaseAppleRequest extends NakamaAsyncResult: } # Base64 encoded Apple receipt data payload. - var receipt : String setget , _get_receipt - var _receipt = null - func _get_receipt() -> String: - return "" if not _receipt is String else String(_receipt) + var _receipt: String = null + var receipt : String: + get: + return "" if not _receipt is String else String(_receipt) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiValidatePurchaseAppleRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiValidatePurchaseAppleRequest", p_dict), ApiValidatePurchaseAppleRequest) as ApiValidatePurchaseAppleRequest @@ -2929,13 +2929,13 @@ class ApiValidatePurchaseGoogleRequest extends NakamaAsyncResult: } # JSON encoded Google purchase payload. - var purchase : String setget , _get_purchase - var _purchase = null - func _get_purchase() -> String: - return "" if not _purchase is String else String(_purchase) + var _purchase: String = null + var purchase : String: + get: + return "" if not _purchase is String else String(_purchase) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiValidatePurchaseGoogleRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiValidatePurchaseGoogleRequest", p_dict), ApiValidatePurchaseGoogleRequest) as ApiValidatePurchaseGoogleRequest @@ -2959,19 +2959,19 @@ class ApiValidatePurchaseHuaweiRequest extends NakamaAsyncResult: } # JSON encoded Huawei InAppPurchaseData. - var purchase : String setget , _get_purchase - var _purchase = null - func _get_purchase() -> String: - return "" if not _purchase is String else String(_purchase) + var _purchase: String = null + var purchase : String: + get: + return "" if not _purchase is String else String(_purchase) # InAppPurchaseData signature. - var signature : String setget , _get_signature - var _signature = null - func _get_signature() -> String: - return "" if not _signature is String else String(_signature) + var _signature: String = null + var signature : String: + get: + return "" if not _signature is String else String(_signature) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiValidatePurchaseHuaweiRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiValidatePurchaseHuaweiRequest", p_dict), ApiValidatePurchaseHuaweiRequest) as ApiValidatePurchaseHuaweiRequest @@ -2995,13 +2995,13 @@ class ApiValidatePurchaseResponse extends NakamaAsyncResult: } # Newly seen validated purchases. - var validated_purchases : Array setget , _get_validated_purchases - var _validated_purchases = null - func _get_validated_purchases() -> Array: - return Array() if not _validated_purchases is Array else Array(_validated_purchases) + var _validated_purchases: Array = null + var validated_purchases : Array: + get: + return Array() if not _validated_purchases is Array else Array(_validated_purchases) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiValidatePurchaseResponse: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiValidatePurchaseResponse", p_dict), ApiValidatePurchaseResponse) as ApiValidatePurchaseResponse @@ -3031,55 +3031,55 @@ class ApiValidatedPurchase extends NakamaAsyncResult: } # UNIX Timestamp when the receipt validation was stored in DB. - var create_time : String setget , _get_create_time - var _create_time = null - func _get_create_time() -> String: - return "" if not _create_time is String else String(_create_time) + var _create_time: String = null + var create_time : String: + get: + return "" if not _create_time is String else String(_create_time) # Whether the purchase was done in production or sandbox environment. - var environment : int setget , _get_environment - var _environment = null - func _get_environment() -> int: - return ValidatedPurchaseEnvironment.values()[0] if not ValidatedPurchaseEnvironment.values().has(_environment) else _environment + var _environment: int = null + var environment : int: + get: + return ValidatedPurchaseEnvironment.values()[0] if not ValidatedPurchaseEnvironment.values().has(_environment) else _environment # Purchase Product ID. - var product_id : String setget , _get_product_id - var _product_id = null - func _get_product_id() -> String: - return "" if not _product_id is String else String(_product_id) + var _product_id: String = null + var product_id : String: + get: + return "" if not _product_id is String else String(_product_id) # Raw provider validation response. - var provider_response : String setget , _get_provider_response - var _provider_response = null - func _get_provider_response() -> String: - return "" if not _provider_response is String else String(_provider_response) + var _provider_response: String = null + var provider_response : String: + get: + return "" if not _provider_response is String else String(_provider_response) # UNIX Timestamp when the purchase was done. - var purchase_time : String setget , _get_purchase_time - var _purchase_time = null - func _get_purchase_time() -> String: - return "" if not _purchase_time is String else String(_purchase_time) + var _purchase_time: String = null + var purchase_time : String: + get: + return "" if not _purchase_time is String else String(_purchase_time) # - var store : int setget , _get_store - var _store = null - func _get_store() -> int: - return ValidatedPurchaseStore.values()[0] if not ValidatedPurchaseStore.values().has(_store) else _store + var _store: int = null + var store : int: + get: + return ValidatedPurchaseStore.values()[0] if not ValidatedPurchaseStore.values().has(_store) else _store # Purchase Transaction ID. - var transaction_id : String setget , _get_transaction_id - var _transaction_id = null - func _get_transaction_id() -> String: - return "" if not _transaction_id is String else String(_transaction_id) + var _transaction_id: String = null + var transaction_id : String: + get: + return "" if not _transaction_id is String else String(_transaction_id) # UNIX Timestamp when the receipt validation was updated in DB. - var update_time : String setget , _get_update_time - var _update_time = null - func _get_update_time() -> String: - return "" if not _update_time is String else String(_update_time) + var _update_time: String = null + var update_time : String: + get: + return "" if not _update_time is String else String(_update_time) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiValidatedPurchase: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiValidatedPurchase", p_dict), ApiValidatedPurchase) as ApiValidatedPurchase @@ -3114,43 +3114,43 @@ class ApiWriteStorageObject extends NakamaAsyncResult: } # The collection to store the object. - var collection : String setget , _get_collection - var _collection = null - func _get_collection() -> String: - return "" if not _collection is String else String(_collection) + var _collection: String = null + var collection : String: + get: + return "" if not _collection is String else String(_collection) # The key for the object within the collection. - var key : String setget , _get_key - var _key = null - func _get_key() -> String: - return "" if not _key is String else String(_key) + var _key: String = null + var key : String: + get: + return "" if not _key is String else String(_key) # The read access permissions for the object. - var permission_read : int setget , _get_permission_read - var _permission_read = null - func _get_permission_read() -> int: - return 0 if not _permission_read is int else int(_permission_read) + var _permission_read: int = null + var permission_read : int: + get: + return 0 if not _permission_read is int else int(_permission_read) # The write access permissions for the object. - var permission_write : int setget , _get_permission_write - var _permission_write = null - func _get_permission_write() -> int: - return 0 if not _permission_write is int else int(_permission_write) + var _permission_write: int = null + var permission_write : int: + get: + return 0 if not _permission_write is int else int(_permission_write) # The value of the object. - var value : String setget , _get_value - var _value = null - func _get_value() -> String: - return "" if not _value is String else String(_value) + var _value: String = null + var value : String: + get: + return "" if not _value is String else String(_value) # The version hash of the object to check. Possible values are: ["", "*", "#hash#"]. - var version : String setget , _get_version - var _version = null - func _get_version() -> String: - return "" if not _version is String else String(_version) + var _version: String = null + var version : String: + get: + return "" if not _version is String else String(_version) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiWriteStorageObject: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiWriteStorageObject", p_dict), ApiWriteStorageObject) as ApiWriteStorageObject @@ -3178,13 +3178,13 @@ class ApiWriteStorageObjectsRequest extends NakamaAsyncResult: } # The objects to store on the server. - var objects : Array setget , _get_objects - var _objects = null - func _get_objects() -> Array: - return Array() if not _objects is Array else Array(_objects) + var _objects: Array = null + var objects : Array: + get: + return Array() if not _objects is Array else Array(_objects) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ApiWriteStorageObjectsRequest: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ApiWriteStorageObjectsRequest", p_dict), ApiWriteStorageObjectsRequest) as ApiWriteStorageObjectsRequest @@ -3208,19 +3208,19 @@ class ProtobufAny extends NakamaAsyncResult: } # - var type_url : String setget , _get_type_url - var _type_url = null - func _get_type_url() -> String: - return "" if not _type_url is String else String(_type_url) + var _type_url: String = null + var type_url : String: + get: + return "" if not _type_url is String else String(_type_url) # - var value : String setget , _get_value - var _value = null - func _get_value() -> String: - return "" if not _value is String else String(_value) + var _value: String = null + var value : String: + get: + return "" if not _value is String else String(_value) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> ProtobufAny: return _safe_ret(NakamaSerializer.deserialize(p_ns, "ProtobufAny", p_dict), ProtobufAny) as ProtobufAny @@ -3246,25 +3246,25 @@ class RpcStatus extends NakamaAsyncResult: } # - var code : int setget , _get_code - var _code = null - func _get_code() -> int: - return 0 if not _code is int else int(_code) + var _code: int = null + var code : int: + get: + return 0 if not _code is int else int(_code) # - var details : Array setget , _get_details - var _details = null - func _get_details() -> Array: - return Array() if not _details is Array else Array(_details) + var _details: Array = null + var details : Array: + get: + return Array() if not _details is Array else Array(_details) # - var message : String setget , _get_message - var _message = null - func _get_message() -> String: - return "" if not _message is String else String(_message) + var _message: String = null + var message : String: + get: + return "" if not _message is String else String(_message) - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> RpcStatus: return _safe_ret(NakamaSerializer.deserialize(p_ns, "RpcStatus", p_dict), RpcStatus) as RpcStatus @@ -3282,7 +3282,7 @@ class RpcStatus extends NakamaAsyncResult: return output # The low level client for the Nakama API. -class ApiClient extends Reference: +class ApiClient extends RefCounted: var _base_uri : String @@ -3291,13 +3291,28 @@ class ApiClient extends Reference: var _server_key : String var auto_refresh := true var auto_refresh_time := 300 - var auto_retry : bool setget _set_retry, _get_retry - var auto_retry_count : int setget _set_retry_count, _get_retry_count - var auto_retry_backoff_base : int setget _set_retry_backoff, _get_retry_backoff - var last_cancel_token setget , _get_last_token - - func _set_retry(p_value): - _http_adapter.auto_retry = p_value + + var auto_retry : bool: + set(v): + _set_retry(v) + get: + return _get_retry() + + var auto_retry_count : int: + set(v): + _set_retry_count(v) + get: + return _get_retry_count() + + var auto_retry_backoff_base : int: + set(v): + _set_retry_backoff(v) + get: + return _get_retry_backoff() + + var last_cancel_token: + get: + _http_adapter.auto_retry = p_value func _get_retry(): return _http_adapter.auto_retry @@ -3328,7 +3343,7 @@ class ApiClient extends Reference: if auto_refresh and p_session.is_valid() and p_session.refresh_token and not p_session.is_refresh_expired() and p_session.would_expire_in(auto_refresh_time): var request = ApiSessionRefreshRequest.new() request._token = p_session.refresh_token - return yield(session_refresh_async(_server_key, "", request), "completed") + return await session_refresh_async(_server_key, "", request).complted return null func cancel_request(p_token): @@ -3341,7 +3356,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3355,7 +3370,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3366,7 +3381,7 @@ class ApiClient extends Reference: ) -> ApiAccount: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiAccount.new(session.get_exception()) p_session.refresh(session) @@ -3380,7 +3395,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiAccount.new(result) var out : ApiAccount = NakamaSerializer.deserialize(_namespace, "ApiAccount", result) @@ -3393,7 +3408,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3408,7 +3423,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3437,7 +3452,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiSession.new(result) var out : ApiSession = NakamaSerializer.deserialize(_namespace, "ApiSession", result) @@ -3467,7 +3482,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiSession.new(result) var out : ApiSession = NakamaSerializer.deserialize(_namespace, "ApiSession", result) @@ -3497,7 +3512,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiSession.new(result) var out : ApiSession = NakamaSerializer.deserialize(_namespace, "ApiSession", result) @@ -3527,7 +3542,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiSession.new(result) var out : ApiSession = NakamaSerializer.deserialize(_namespace, "ApiSession", result) @@ -3560,7 +3575,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiSession.new(result) var out : ApiSession = NakamaSerializer.deserialize(_namespace, "ApiSession", result) @@ -3590,7 +3605,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiSession.new(result) var out : ApiSession = NakamaSerializer.deserialize(_namespace, "ApiSession", result) @@ -3620,7 +3635,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiSession.new(result) var out : ApiSession = NakamaSerializer.deserialize(_namespace, "ApiSession", result) @@ -3650,7 +3665,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiSession.new(result) var out : ApiSession = NakamaSerializer.deserialize(_namespace, "ApiSession", result) @@ -3683,7 +3698,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiSession.new(result) var out : ApiSession = NakamaSerializer.deserialize(_namespace, "ApiSession", result) @@ -3696,7 +3711,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3711,7 +3726,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3723,7 +3738,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3738,7 +3753,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3750,7 +3765,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3765,7 +3780,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3777,7 +3792,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3792,7 +3807,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3805,7 +3820,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3822,7 +3837,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3834,7 +3849,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3849,7 +3864,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3861,7 +3876,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3876,7 +3891,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3888,7 +3903,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3903,7 +3918,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3915,7 +3930,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3930,7 +3945,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3953,7 +3968,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiSession.new(result) var out : ApiSession = NakamaSerializer.deserialize(_namespace, "ApiSession", result) @@ -3966,7 +3981,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -3981,7 +3996,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -3993,7 +4008,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4008,7 +4023,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4020,7 +4035,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4035,7 +4050,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4047,7 +4062,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4062,7 +4077,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4074,7 +4089,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4089,7 +4104,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4101,7 +4116,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4116,7 +4131,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4128,7 +4143,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4143,7 +4158,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4155,7 +4170,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4170,7 +4185,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4182,7 +4197,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4197,7 +4212,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4212,7 +4227,7 @@ class ApiClient extends Reference: ) -> ApiChannelMessageList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiChannelMessageList.new(session.get_exception()) p_session.refresh(session) @@ -4233,7 +4248,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiChannelMessageList.new(result) var out : ApiChannelMessageList = NakamaSerializer.deserialize(_namespace, "ApiChannelMessageList", result) @@ -4246,7 +4261,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4261,7 +4276,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4274,7 +4289,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4294,7 +4309,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4308,7 +4323,7 @@ class ApiClient extends Reference: ) -> ApiFriendList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiFriendList.new(session.get_exception()) p_session.refresh(session) @@ -4328,7 +4343,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiFriendList.new(result) var out : ApiFriendList = NakamaSerializer.deserialize(_namespace, "ApiFriendList", result) @@ -4342,7 +4357,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4362,7 +4377,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4375,7 +4390,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4395,7 +4410,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4408,7 +4423,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4425,7 +4440,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4438,7 +4453,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4455,7 +4470,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4472,7 +4487,7 @@ class ApiClient extends Reference: ) -> ApiGroupList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiGroupList.new(session.get_exception()) p_session.refresh(session) @@ -4498,7 +4513,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiGroupList.new(result) var out : ApiGroupList = NakamaSerializer.deserialize(_namespace, "ApiGroupList", result) @@ -4511,7 +4526,7 @@ class ApiClient extends Reference: ) -> ApiGroup: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiGroup.new(session.get_exception()) p_session.refresh(session) @@ -4526,7 +4541,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiGroup.new(result) var out : ApiGroup = NakamaSerializer.deserialize(_namespace, "ApiGroup", result) @@ -4539,7 +4554,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4554,7 +4569,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4567,7 +4582,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4583,7 +4598,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4596,7 +4611,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4614,7 +4629,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4627,7 +4642,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4645,7 +4660,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4658,7 +4673,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4676,7 +4691,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4688,7 +4703,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4703,7 +4718,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4716,7 +4731,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4734,7 +4749,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4746,7 +4761,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4761,7 +4776,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4774,7 +4789,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4792,7 +4807,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4807,7 +4822,7 @@ class ApiClient extends Reference: ) -> ApiGroupUserList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiGroupUserList.new(session.get_exception()) p_session.refresh(session) @@ -4828,7 +4843,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiGroupUserList.new(result) var out : ApiGroupUserList = NakamaSerializer.deserialize(_namespace, "ApiGroupUserList", result) @@ -4841,7 +4856,7 @@ class ApiClient extends Reference: ) -> ApiValidatePurchaseResponse: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiValidatePurchaseResponse.new(session.get_exception()) p_session.refresh(session) @@ -4856,7 +4871,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiValidatePurchaseResponse.new(result) var out : ApiValidatePurchaseResponse = NakamaSerializer.deserialize(_namespace, "ApiValidatePurchaseResponse", result) @@ -4869,7 +4884,7 @@ class ApiClient extends Reference: ) -> ApiValidatePurchaseResponse: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiValidatePurchaseResponse.new(session.get_exception()) p_session.refresh(session) @@ -4884,7 +4899,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiValidatePurchaseResponse.new(result) var out : ApiValidatePurchaseResponse = NakamaSerializer.deserialize(_namespace, "ApiValidatePurchaseResponse", result) @@ -4897,7 +4912,7 @@ class ApiClient extends Reference: ) -> ApiValidatePurchaseResponse: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiValidatePurchaseResponse.new(session.get_exception()) p_session.refresh(session) @@ -4912,7 +4927,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiValidatePurchaseResponse.new(result) var out : ApiValidatePurchaseResponse = NakamaSerializer.deserialize(_namespace, "ApiValidatePurchaseResponse", result) @@ -4925,7 +4940,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -4940,7 +4955,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -4956,7 +4971,7 @@ class ApiClient extends Reference: ) -> ApiLeaderboardRecordList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiLeaderboardRecordList.new(session.get_exception()) p_session.refresh(session) @@ -4980,7 +4995,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiLeaderboardRecordList.new(result) var out : ApiLeaderboardRecordList = NakamaSerializer.deserialize(_namespace, "ApiLeaderboardRecordList", result) @@ -4994,7 +5009,7 @@ class ApiClient extends Reference: ) -> ApiLeaderboardRecord: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiLeaderboardRecord.new(session.get_exception()) p_session.refresh(session) @@ -5010,7 +5025,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiLeaderboardRecord.new(result) var out : ApiLeaderboardRecord = NakamaSerializer.deserialize(_namespace, "ApiLeaderboardRecord", result) @@ -5026,7 +5041,7 @@ class ApiClient extends Reference: ) -> ApiLeaderboardRecordList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiLeaderboardRecordList.new(session.get_exception()) p_session.refresh(session) @@ -5046,7 +5061,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiLeaderboardRecordList.new(result) var out : ApiLeaderboardRecordList = NakamaSerializer.deserialize(_namespace, "ApiLeaderboardRecordList", result) @@ -5064,7 +5079,7 @@ class ApiClient extends Reference: ) -> ApiMatchList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiMatchList.new(session.get_exception()) p_session.refresh(session) @@ -5090,7 +5105,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiMatchList.new(result) var out : ApiMatchList = NakamaSerializer.deserialize(_namespace, "ApiMatchList", result) @@ -5103,7 +5118,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -5120,7 +5135,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -5133,7 +5148,7 @@ class ApiClient extends Reference: ) -> ApiNotificationList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiNotificationList.new(session.get_exception()) p_session.refresh(session) @@ -5151,7 +5166,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiNotificationList.new(result) var out : ApiNotificationList = NakamaSerializer.deserialize(_namespace, "ApiNotificationList", result) @@ -5180,7 +5195,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiRpc.new(result) var out : ApiRpc = NakamaSerializer.deserialize(_namespace, "ApiRpc", result) @@ -5208,7 +5223,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiRpc.new(result) var out : ApiRpc = NakamaSerializer.deserialize(_namespace, "ApiRpc", result) @@ -5221,7 +5236,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -5236,7 +5251,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -5248,7 +5263,7 @@ class ApiClient extends Reference: ) -> ApiStorageObjects: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiStorageObjects.new(session.get_exception()) p_session.refresh(session) @@ -5263,7 +5278,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiStorageObjects.new(result) var out : ApiStorageObjects = NakamaSerializer.deserialize(_namespace, "ApiStorageObjects", result) @@ -5276,7 +5291,7 @@ class ApiClient extends Reference: ) -> ApiStorageObjectAcks: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiStorageObjectAcks.new(session.get_exception()) p_session.refresh(session) @@ -5291,7 +5306,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiStorageObjectAcks.new(result) var out : ApiStorageObjectAcks = NakamaSerializer.deserialize(_namespace, "ApiStorageObjectAcks", result) @@ -5304,7 +5319,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -5319,7 +5334,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -5334,7 +5349,7 @@ class ApiClient extends Reference: ) -> ApiStorageObjectList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiStorageObjectList.new(session.get_exception()) p_session.refresh(session) @@ -5355,7 +5370,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiStorageObjectList.new(result) var out : ApiStorageObjectList = NakamaSerializer.deserialize(_namespace, "ApiStorageObjectList", result) @@ -5371,7 +5386,7 @@ class ApiClient extends Reference: ) -> ApiStorageObjectList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiStorageObjectList.new(session.get_exception()) p_session.refresh(session) @@ -5391,7 +5406,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiStorageObjectList.new(result) var out : ApiStorageObjectList = NakamaSerializer.deserialize(_namespace, "ApiStorageObjectList", result) @@ -5409,7 +5424,7 @@ class ApiClient extends Reference: ) -> ApiTournamentList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiTournamentList.new(session.get_exception()) p_session.refresh(session) @@ -5435,7 +5450,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiTournamentList.new(result) var out : ApiTournamentList = NakamaSerializer.deserialize(_namespace, "ApiTournamentList", result) @@ -5452,7 +5467,7 @@ class ApiClient extends Reference: ) -> ApiTournamentRecordList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiTournamentRecordList.new(session.get_exception()) p_session.refresh(session) @@ -5476,7 +5491,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiTournamentRecordList.new(result) var out : ApiTournamentRecordList = NakamaSerializer.deserialize(_namespace, "ApiTournamentRecordList", result) @@ -5490,7 +5505,7 @@ class ApiClient extends Reference: ) -> ApiLeaderboardRecord: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiLeaderboardRecord.new(session.get_exception()) p_session.refresh(session) @@ -5506,7 +5521,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiLeaderboardRecord.new(result) var out : ApiLeaderboardRecord = NakamaSerializer.deserialize(_namespace, "ApiLeaderboardRecord", result) @@ -5520,7 +5535,7 @@ class ApiClient extends Reference: ) -> ApiLeaderboardRecord: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiLeaderboardRecord.new(session.get_exception()) p_session.refresh(session) @@ -5536,7 +5551,7 @@ class ApiClient extends Reference: var content : PoolByteArray content = JSON.print(p_body.serialize()).to_utf8() - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiLeaderboardRecord.new(result) var out : ApiLeaderboardRecord = NakamaSerializer.deserialize(_namespace, "ApiLeaderboardRecord", result) @@ -5549,7 +5564,7 @@ class ApiClient extends Reference: ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) @@ -5564,7 +5579,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return NakamaAsyncResult.new(result) return NakamaAsyncResult.new() @@ -5579,7 +5594,7 @@ class ApiClient extends Reference: ) -> ApiTournamentRecordList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiTournamentRecordList.new(session.get_exception()) p_session.refresh(session) @@ -5599,7 +5614,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiTournamentRecordList.new(result) var out : ApiTournamentRecordList = NakamaSerializer.deserialize(_namespace, "ApiTournamentRecordList", result) @@ -5614,7 +5629,7 @@ class ApiClient extends Reference: ) -> ApiUsers: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiUsers.new(session.get_exception()) p_session.refresh(session) @@ -5637,7 +5652,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiUsers.new(result) var out : ApiUsers = NakamaSerializer.deserialize(_namespace, "ApiUsers", result) @@ -5653,7 +5668,7 @@ class ApiClient extends Reference: ) -> ApiUserGroupList: var should_refresh = _refresh_session(p_session) if should_refresh != null: - var session = yield(should_refresh, "completed") + var session = await should_refresh.complted if session.is_exception(): return ApiUserGroupList.new(session.get_exception()) p_session.refresh(session) @@ -5674,7 +5689,7 @@ class ApiClient extends Reference: var content : PoolByteArray - var result = yield(_http_adapter.send_async(method, uri, headers, content), "completed") + var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: return ApiUserGroupList.new(result) var out : ApiUserGroupList = NakamaSerializer.deserialize(_namespace, "ApiUserGroupList", result) From b236a69689c6780f7b5e4340994c4c93792d3b32 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:31:11 +0000 Subject: [PATCH 03/33] Swap setget _> property --- addons/com.heroiclabs.nakama/utils/NakamaAsyncResult.gd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/com.heroiclabs.nakama/utils/NakamaAsyncResult.gd b/addons/com.heroiclabs.nakama/utils/NakamaAsyncResult.gd index 3eb4b62..ccfc75c 100644 --- a/addons/com.heroiclabs.nakama/utils/NakamaAsyncResult.gd +++ b/addons/com.heroiclabs.nakama/utils/NakamaAsyncResult.gd @@ -1,7 +1,12 @@ extends RefCounted class_name NakamaAsyncResult -var exception : NakamaException setget _no_set, get_exception +var exception : NakamaException: + set(v): + _no_set(v) + get: + return get_exception() + var _ex = null func _no_set(v): From cdb9140393ff4fe5cf81bba531450201efa5de9c Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:32:44 +0000 Subject: [PATCH 04/33] Upgrade setgets to properties --- .../utils/NakamaException.gd | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/addons/com.heroiclabs.nakama/utils/NakamaException.gd b/addons/com.heroiclabs.nakama/utils/NakamaException.gd index 65ec3a2..5081731 100644 --- a/addons/com.heroiclabs.nakama/utils/NakamaException.gd +++ b/addons/com.heroiclabs.nakama/utils/NakamaException.gd @@ -4,10 +4,21 @@ extends RefCounted # Usually contains at least an error message. class_name NakamaException -var status_code : int = -1 setget _no_set -var grpc_status_code : int = -1 setget _no_set -var message : String = "" setget _no_set -var cancelled : bool = false setget _no_set +var status_code : int = -1: + set(v): + _no_set(v) + +var grpc_status_code : int = -1: + set(v): + _no_set(v) + +var message : String = "": + set(v): + _no_set(v) + +var cancelled : bool = false: + set(v): + _no_set(v) func _no_set(_p): pass From 03705d93c36f702a20b8b663c3e64b7d1ba2aa4e Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:35:37 +0000 Subject: [PATCH 05/33] Update TYPE_REAL -> Type_FLOAT --- addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd | 2 +- addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd | 4 ++-- addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd index c38e76f..21312f0 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd @@ -407,7 +407,7 @@ class MatchmakerUser extends NakamaAsyncResult: "presence": {"name": "presence", "type": "UserPresence", "required": true}, "party_id": {"name": "party_id", "type": TYPE_STRING, "required": false}, "string_properties": {"name": "string_properties", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, - "numeric_properties": {"name": "numeric_properties", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_REAL}, + "numeric_properties": {"name": "numeric_properties", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_FLOAT}, } # The presence of the user. diff --git a/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd b/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd index a56e645..6f91c40 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd @@ -241,7 +241,7 @@ class MatchmakerAdd extends NakamaAsyncResult: "query": {"name": "query", "type": TYPE_STRING, "required": true}, "max_count": {"name": "max_count", "type": TYPE_INT, "required": true}, "min_count": {"name": "min_count", "type": TYPE_INT, "required": true}, - "numeric_properties": {"name": "numeric_properties", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_REAL}, + "numeric_properties": {"name": "numeric_properties", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_FLOAT}, "string_properties": {"name": "string_properties", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } @@ -538,7 +538,7 @@ class PartyMatchmakerAdd extends NakamaAsyncResult: "max_count": {"name": "max_count", "type": TYPE_INT, "required": true}, "query": {"name": "query", "type": TYPE_STRING, "required": false}, "string_properties": {"name": "string_properties", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, - "numeric_properties": {"name": "numeric_properties", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_REAL}, + "numeric_properties": {"name": "numeric_properties", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_FLOAT}, } # Party ID. diff --git a/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd b/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd index 7462be0..01923a3 100644 --- a/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd +++ b/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd @@ -45,7 +45,7 @@ static func serialize(p_obj : Object) -> Dictionary: else: # Map of simple types for l in val: var e = val[l] - if content == TYPE_REAL: + if content == TYPE_FLOAT: e = float(e) elif content == TYPE_INT: e = int(e) @@ -85,7 +85,7 @@ static func deserialize(p_ns : GDScript, p_cls_name : String, p_dict : Dictionar # Ints might and up being recognized as floats. Change that if needed if type_cmp == TYPE_INT: - if typeof(val) == TYPE_REAL or (typeof(val) == TYPE_STRING and val.is_valid_integer()): + if typeof(val) == TYPE_FLOAT or (typeof(val) == TYPE_STRING and val.is_valid_integer()): val = int(val) if typeof(val) == type_cmp: @@ -96,7 +96,7 @@ static func deserialize(p_ns : GDScript, p_cls_name : String, p_dict : Dictionar for l in val: if typeof(content) == TYPE_STRING: v[l] = deserialize(p_ns, content, val[l]) - elif content == TYPE_REAL: + elif content == TYPE_FLOAT: v[l] = float(val[l]) elif content == TYPE_INT: v[l] = int(val[l]) @@ -114,7 +114,7 @@ static func deserialize(p_ns : GDScript, p_cls_name : String, p_dict : Dictionar for e in val: if typeof(content) == TYPE_STRING: v.append(deserialize(p_ns, content, e)) - elif content == TYPE_REAL: + elif content == TYPE_FLOAT: v.append(float(e)) elif content == TYPE_INT: v.append(int(e)) From ecf7a2adcc4176feae74768c4f78ef7e5805d0a4 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:37:16 +0000 Subject: [PATCH 06/33] Update Pool arrays to packed --- addons/com.heroiclabs.nakama/api/NakamaAPI.gd | 2 +- .../com.heroiclabs.nakama/api/NakamaRTMessage.gd | 10 +++++----- .../com.heroiclabs.nakama/client/NakamaClient.gd | 14 +++++++------- .../client/NakamaHTTPAdapter.gd | 6 +++--- .../com.heroiclabs.nakama/socket/NakamaSocket.gd | 4 ++-- .../utils/NakamaSerializer.gd | 4 ++-- codegen/main.go | 16 ++++++++-------- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd index 39ec1c5..014969b 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd @@ -4669,7 +4669,7 @@ class ApiClient extends RefCounted: func demote_group_users_async( p_session : NakamaSession , p_group_id : String - , p_user_ids : PoolStringArray + , p_user_ids : PackedStringArray ) -> NakamaAsyncResult: var should_refresh = _refresh_session(p_session) if should_refresh != null: diff --git a/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd b/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd index 6f91c40..62ab4a0 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd @@ -302,10 +302,10 @@ class StatusFollow extends NakamaAsyncResult: "usernames": {"name": "usernames", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } - var user_ids := PoolStringArray() - var usernames := PoolStringArray() + var user_ids := PackedStringArray() + var usernames := PackedStringArray() - func _init(p_ids : PoolStringArray, p_usernames : PoolStringArray): + func _init(p_ids : PackedStringArray, p_usernames : PackedStringArray): user_ids = p_ids usernames = p_usernames @@ -326,9 +326,9 @@ class StatusUnfollow extends NakamaAsyncResult: "user_ids": {"name": "user_ids", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } - var user_ids := PoolStringArray() + var user_ids := PackedStringArray() - func _init(p_ids : PoolStringArray): + func _init(p_ids : PackedStringArray): user_ids = p_ids func serialize(): diff --git a/addons/com.heroiclabs.nakama/client/NakamaClient.gd b/addons/com.heroiclabs.nakama/client/NakamaClient.gd index 314944f..cd2b9c8 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaClient.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaClient.gd @@ -118,7 +118,7 @@ func add_friends_async(p_session : NakamaSession, p_ids = null, p_usernames = nu # @param p_group_id - The id of the group to add users into. # @param p_ids - The ids of the users to add or invite to the group. # Returns a task which represents the asynchronous operation. -func add_group_users_async(p_session : NakamaSession, p_group_id : String, p_ids : PoolStringArray) -> NakamaAsyncResult: +func add_group_users_async(p_session : NakamaSession, p_group_id : String, p_ids : PackedStringArray) -> NakamaAsyncResult: return _api_client.add_group_users_async(p_session, p_group_id, p_ids); # Authenticate a user with an Apple ID against the server. @@ -257,7 +257,7 @@ func authenticate_steam_async(p_token : String, p_username = null, p_create : bo # @param p_ids - The ids of the users to block. # @param p_usernames - The usernames of the users to block. # Returns a task which represents the asynchronous operation. -func block_friends_async(p_session : NakamaSession, p_ids : PoolStringArray, p_usernames = null) -> NakamaAsyncResult: +func block_friends_async(p_session : NakamaSession, p_ids : PackedStringArray, p_usernames = null) -> NakamaAsyncResult: return _api_client.block_friends_async(p_session, p_ids, p_usernames); # Create a group. @@ -286,7 +286,7 @@ func create_group_async(p_session : NakamaSession, p_name : String, p_descriptio # @param p_ids - The user ids to remove as friends. # @param p_usernames - The usernames to remove as friends. # Returns a task which represents the asynchronous operation. -func delete_friends_async(p_session : NakamaSession, p_ids : PoolStringArray, p_usernames = null) -> NakamaAsyncResult: +func delete_friends_async(p_session : NakamaSession, p_ids : PackedStringArray, p_usernames = null) -> NakamaAsyncResult: return _api_client.delete_friends_async(p_session, p_ids, p_usernames) # Delete a group by id. @@ -307,7 +307,7 @@ func delete_leaderboard_record_async(p_session : NakamaSession, p_leaderboard_id # @param p_session - The session of the user. # @param p_ids - The notification ids to remove. # Returns a task which represents the asynchronous operation. -func delete_notifications_async(p_session : NakamaSession, p_ids : PoolStringArray) -> NakamaAsyncResult: +func delete_notifications_async(p_session : NakamaSession, p_ids : PackedStringArray) -> NakamaAsyncResult: return _api_client.delete_notifications_async(p_session, p_ids) # Delete one or more storage objects. @@ -346,7 +346,7 @@ func get_account_async(p_session : NakamaSession): # -> NakamaAPI.ApiAccount: # @param p_usernames - The usernames of the users to retrieve. # @param p_facebook_ids - The facebook IDs of the users to retrieve. # Returns a task which resolves to a collection of user objects. -func get_users_async(p_session : NakamaSession, p_ids : PoolStringArray, p_usernames = null, p_facebook_ids = null): # -> NakamaAPI.ApiUsers: +func get_users_async(p_session : NakamaSession, p_ids : PackedStringArray, p_usernames = null, p_facebook_ids = null): # -> NakamaAPI.ApiUsers: return _api_client.get_users_async(p_session, p_ids, p_usernames, p_facebook_ids) # Import Facebook friends and add them to the user's account. @@ -394,7 +394,7 @@ func join_tournament_async(p_session : NakamaSession, p_tournament_id : String) # @param p_group_id - The ID of the group. # @param p_ids - The IDs of the users to kick. # Returns a task which represents the asynchronous operation. -func kick_group_users_async(p_session : NakamaSession, p_group_id : String, p_ids : PoolStringArray) -> NakamaAsyncResult: +func kick_group_users_async(p_session : NakamaSession, p_group_id : String, p_ids : PackedStringArray) -> NakamaAsyncResult: return _api_client.kick_group_users_async(p_session, p_group_id, p_ids) # Leave a group by ID. @@ -674,7 +674,7 @@ func list_users_storage_objects_async(p_session : NakamaSession, # @param p_group_id - The ID of the group to promote users into. # @param p_ids - The IDs of the users to promote. # Returns a task which represents the asynchronous operation. -func promote_group_users_async(p_session : NakamaSession, p_group_id : String, p_ids : PoolStringArray) -> NakamaAsyncResult: +func promote_group_users_async(p_session : NakamaSession, p_group_id : String, p_ids : PackedStringArray) -> NakamaAsyncResult: return _api_client.promote_group_users_async(p_session, p_group_id, p_ids) # Read one or more objects from the storage engine. diff --git a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd index 41f4552..325d1f4 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd @@ -23,7 +23,7 @@ class AsyncRequest: var request : HTTPRequest var uri : String var method : int - var headers : PoolStringArray + var headers : PackedStringArray var body : PoolByteArray var retry_count := 3 var backoff_time := 10 @@ -38,7 +38,7 @@ class AsyncRequest: var rng = RandomNumberGenerator.new() func _init(p_id : int, p_request : HTTPRequest, p_uri : String, - p_method : int, p_headers : PoolStringArray, p_body : PoolByteArray, + p_method : int, p_headers : PackedStringArray, p_body : PoolByteArray, p_retry_count : int, p_backoff_time : int, p_logger : NakamaLogger): rng.seed = OS.get_ticks_usec() id = p_id @@ -150,7 +150,7 @@ func send_async(p_method : String, p_uri : String, p_headers : Dictionary, p_bod method = HTTPClient.METHOD_DELETE elif p_method == "HEAD": method = HTTPClient.METHOD_HEAD - var headers = PoolStringArray() + var headers = PackedStringArray() # Parse headers headers.append("Accept: application/json") diff --git a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd index 58838d5..b6f6068 100644 --- a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd +++ b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd @@ -331,7 +331,7 @@ func create_match_async(): # @param p_user_ids - The IDs of users. # @param p_usernames - The usernames of the users. # Returns a task which resolves to the current statuses for the users. -func follow_users_async(p_ids : PoolStringArray, p_usernames : PoolStringArray = []) -> NakamaRTAPI.Status: +func follow_users_async(p_ids : PackedStringArray, p_usernames : PackedStringArray = []) -> NakamaRTAPI.Status: return _send_async(NakamaRTMessage.StatusFollow.new(p_ids, p_usernames), NakamaRTAPI.Status) # Join a chat channel on the server. @@ -452,7 +452,7 @@ func send_match_state_raw_async(p_match_id, p_op_code : int, p_data : PoolByteAr # Unfollow one or more users from their status updates. # @param p_user_ids - An array of user ids to unfollow. # Returns a task which represents the asynchronous operation. -func unfollow_users_async(p_ids : PoolStringArray): +func unfollow_users_async(p_ids : PackedStringArray): return _send_async(NakamaRTMessage.StatusUnfollow.new(p_ids)) # Update a chat message on a chat channel in the server. diff --git a/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd b/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd index 01923a3..e94d72c 100644 --- a/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd +++ b/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd @@ -108,8 +108,8 @@ static func deserialize(p_ns : GDScript, p_cls_name : String, p_dict : Dictionar elif type_cmp == TYPE_ARRAY: var v match content: - TYPE_INT, TYPE_BOOL: v = PoolIntArray() - TYPE_STRING: v = PoolStringArray() + TYPE_INT, TYPE_BOOL: v = PackedIntArray() + TYPE_STRING: v = PackedStringArray() _: v = Array() for e in val: if typeof(content) == TYPE_STRING: diff --git a/codegen/main.go b/codegen/main.go index cb1ce5b..b879473 100644 --- a/codegen/main.go +++ b/codegen/main.go @@ -381,13 +381,13 @@ func godotType(p_type string, p_ref string, p_item_type string, p_extra string, if is_array { switch p_item_type { case "integer": - out = "PoolIntArray" + out = "PackedIntArray" return case "string": - out = "PoolStringArray" + out = "PackedStringArray" return case "boolean": - out = "PoolIntArray" + out = "PackedIntArray" return default: out = "Array" @@ -404,8 +404,8 @@ func godotDef(p_type string) (out string) { case "bool": out = "false" case "int": out = "0" case "String": out = "\"\"" - case "PoolIntArray": out = "PoolIntArray()" - case "PoolStringArray": out = "PoolStringArray()" + case "PackedIntArray": out = "PackedIntArray()" + case "PackedStringArray": out = "PackedStringArray()" case "Array": out = "Array()" case "Dictionary": out = "Dictionary()" } @@ -414,7 +414,7 @@ func godotDef(p_type string) (out string) { func godotLooseType(p_type string) (out string) { switch(p_type) { - case "PoolStringArray", "PoolIntArray": + case "PackedStringArray", "PackedIntArray": out = "Array" default: out = p_type @@ -428,8 +428,8 @@ func godotSchemaType(p_type string) (out string) { case "bool": out += "BOOL" case "int": out += "INT" case "String": out += "STRING" - case "PoolIntArray": out += "ARRAY" - case "PoolStringArray": out += "ARRAY" + case "PackedIntArray": out += "ARRAY" + case "PackedStringArray": out += "ARRAY" case "Array": out += "ARRAY" case "Dictionary": out += "DICTIONARY" default: out = "\"" + p_type + "\"" From 1b1fe025ea17096ea1d62599a5a30ac7d202849c Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:40:34 +0000 Subject: [PATCH 07/33] Update tool -> @tool for gdscript2 --- addons/com.heroiclabs.nakama/Nakama.gd | 2 +- addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd | 2 +- addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/com.heroiclabs.nakama/Nakama.gd b/addons/com.heroiclabs.nakama/Nakama.gd index c9dbdbf..ecbf834 100644 --- a/addons/com.heroiclabs.nakama/Nakama.gd +++ b/addons/com.heroiclabs.nakama/Nakama.gd @@ -1,4 +1,4 @@ -tool +@tool extends Node # The default host address of the server. diff --git a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd index 325d1f4..b14e94e 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd @@ -1,4 +1,4 @@ -tool +@tool extends Node # An adapter which implements the HTTP protocol. diff --git a/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd b/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd index 372a30a..2311aa1 100644 --- a/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd +++ b/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd @@ -1,4 +1,4 @@ -tool +@tool extends Node # An adapter which implements a socket with a protocol supported by Nakama. From 59d6c727b114677cd593fddaa154df0d0c7c1025 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:45:41 +0000 Subject: [PATCH 08/33] user super where possible --- .../com.heroiclabs.nakama/api/NakamaRTAPI.gd | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd index 21312f0..9cd89ba 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd @@ -36,8 +36,8 @@ class Channel extends NakamaAsyncResult: # The ID of the second DM user, or an empty string if this message was not sent through a DM chat. var user_id_two : String - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func _to_string(): if is_exception(): return get_exception()._to_string() @@ -101,8 +101,8 @@ class ChannelMessageAck extends NakamaAsyncResult: # The ID of the second DM user, or an empty string if this message was not sent through a DM chat. var user_id_two : String - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func _to_string(): if is_exception(): return get_exception()._to_string() @@ -151,8 +151,8 @@ class ChannelPresenceEvent extends NakamaAsyncResult: # The ID of the second DM user, or an empty string if this message was not sent through a DM chat. var user_id_two : String - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func _to_string(): if is_exception(): return get_exception()._to_string() @@ -205,8 +205,8 @@ class Error extends NakamaAsyncResult: # Additional error details which may be different for each response. var context : Dictionary - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func _to_string(): if is_exception(): return get_exception()._to_string() @@ -249,8 +249,8 @@ class Match extends NakamaAsyncResult: # The current user in this match. i.e. Yourself. var self_user : UserPresence - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) static func create(p_ns : GDScript, p_dict : Dictionary): return _safe_ret(NakamaSerializer.deserialize(p_ns, "Match", p_dict), Match) as Match @@ -285,8 +285,8 @@ class MatchData extends NakamaAsyncResult: # The byte contents of the state change. var data : String - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func _to_string(): if is_exception(): return get_exception()._to_string() @@ -319,8 +319,8 @@ class MatchPresenceEvent extends NakamaAsyncResult: # The unique match identifier. var match_id : String - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func _to_string(): if is_exception(): return get_exception()._to_string() @@ -360,8 +360,8 @@ class MatchmakerMatched extends NakamaAsyncResult: # The current user who matched with opponents. var self_user : MatchmakerUser - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func _to_string(): if is_exception(): return get_exception()._to_string() @@ -386,8 +386,8 @@ class MatchmakerTicket extends NakamaAsyncResult: # The ticket generated by the matchmaker. var ticket : String - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) static func create(p_ns : GDScript, p_dict : Dictionary) -> MatchmakerTicket: return _safe_ret(NakamaSerializer.deserialize(p_ns, "MatchmakerTicket", p_dict), MatchmakerTicket) as MatchmakerTicket @@ -422,8 +422,8 @@ class MatchmakerUser extends NakamaAsyncResult: # The string properties which this user asked to matchmake with. var string_properties : Dictionary - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func _to_string(): if is_exception(): return get_exception()._to_string() @@ -447,8 +447,8 @@ class Status extends NakamaAsyncResult: # The status events for the users followed. var presences := Array() - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) static func create(p_ns : GDScript, p_dict : Dictionary) -> Status: return _safe_ret(NakamaSerializer.deserialize(p_ns, "Status", p_dict), Status) as Status @@ -476,8 +476,8 @@ class StatusPresenceEvent extends NakamaAsyncResult: # This leave information is in response to a subscription made to be notified when a user goes offline. var leaves : Array - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func _to_string(): if is_exception(): return get_exception()._to_string() @@ -512,8 +512,8 @@ class Stream extends NakamaAsyncResult: # Identifies streams which have a context across users like a chat channel room. var label : String - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func _to_string(): if is_exception(): return get_exception()._to_string() @@ -617,8 +617,8 @@ class UserPresence extends NakamaAsyncResult: # The id of the user. var user_id : String - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func serialize() -> Dictionary: return NakamaSerializer.serialize(self) @@ -664,8 +664,8 @@ class Party extends NakamaAsyncResult: # All current party members. var presences : Array # of objects NakamaUserPresence - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func serialize() -> Dictionary: return NakamaSerializer.serialize(self) @@ -696,8 +696,8 @@ class PartyPresenceEvent extends NakamaAsyncResult: # User presences that have just left the party. var leaves : Array - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func serialize() -> Dictionary: return NakamaSerializer.serialize(self) @@ -724,8 +724,8 @@ class PartyLeader extends NakamaAsyncResult: # The presence of an existing party member to promote as the new leader. var presence : NakamaRTAPI.UserPresence - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func serialize() -> Dictionary: return NakamaSerializer.serialize(self) @@ -752,8 +752,8 @@ class PartyJoinRequest extends NakamaAsyncResult: # Presences attempting to join. var presences : Array - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func serialize() -> Dictionary: return NakamaSerializer.serialize(self) @@ -780,8 +780,8 @@ class PartyMatchmakerTicket extends NakamaAsyncResult: # The ticket that can be used to cancel matchmaking. var ticket : String - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func serialize() -> Dictionary: return NakamaSerializer.serialize(self) @@ -814,8 +814,8 @@ class PartyData extends NakamaAsyncResult: # Data payload, if any. var data : String - func _init(p_ex = null).(p_ex): - pass + func _init(p_ex = null): + super(p_ex) func serialize() -> Dictionary: return NakamaSerializer.serialize(self) From 8ffe9bef32127ae1b8a614c36cb2333e10dbdc5a Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:48:05 +0000 Subject: [PATCH 09/33] Repalce . with super --- addons/com.heroiclabs.nakama/api/NakamaSession.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaSession.gd b/addons/com.heroiclabs.nakama/api/NakamaSession.gd index aff7162..d720bf3 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaSession.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaSession.gd @@ -29,7 +29,9 @@ func is_refresh_expired() -> bool: func is_valid(): return valid -func _init(p_token = null, p_created : bool = false, p_refresh_token = null, p_exception = null).(p_exception): +func _init(p_token = null, p_created : bool = false, p_refresh_token = null, p_exception = null): + super(p_exception) + if p_token: created = p_created _parse_token(p_token) From e7ee928ece932a38c3437d0a4e9fea2720597ae1 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:48:11 +0000 Subject: [PATCH 10/33] Replace . with super --- codegen/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codegen/main.go b/codegen/main.go index b879473..3ee611f 100644 --- a/codegen/main.go +++ b/codegen/main.go @@ -99,8 +99,8 @@ class {{ $classname }} extends NakamaAsyncResult: {{- godotClassUtils $classname }} - func _init(p_exception = null).(p_exception): - pass + func _init(p_exception = null): + super(p_exception) static func create(p_ns : GDScript, p_dict : Dictionary) -> {{ $classname }}: return _safe_ret(NakamaSerializer.deserialize(p_ns, "{{ $classname }}", p_dict), {{ $classname }}) as {{ $classname }} From 5fb1e57a35774b1c70f757dde5423438f8f4d8df Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:49:30 +0000 Subject: [PATCH 11/33] Replafce. with super1 --- addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd b/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd index 62ab4a0..bc1666c 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd @@ -169,8 +169,8 @@ class MatchJoin extends NakamaAsyncResult: var token = null var metadata = null - func _init(p_ex=null).(p_ex): - pass + func _init(p_ex=null): + super(p_ex) func serialize() -> Dictionary: return NakamaSerializer.serialize(self) From c177a73b75f589286bdd19f924500ba247a979f3 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 00:51:58 +0000 Subject: [PATCH 12/33] Update setgets to properties --- .../api/NakamaSession.gd | 58 +++++++++++++++---- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaSession.gd b/addons/com.heroiclabs.nakama/api/NakamaSession.gd index d720bf3..3a1d0b0 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaSession.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaSession.gd @@ -2,17 +2,53 @@ extends NakamaAsyncResult class_name NakamaSession -var created : bool = false setget _no_set -var token : String = "" setget _no_set -var create_time : int = 0 setget _no_set -var expire_time : int = 0 setget _no_set -var expired : bool = true setget _no_set, is_expired -var vars : Dictionary = {} setget _no_set -var username : String = "" setget _no_set -var user_id : String = "" setget _no_set -var refresh_token : String = "" setget _no_set -var refresh_expire_time : int = 0 setget _no_set -var valid : bool = false setget _no_set, is_valid +var created : bool = false: + set(v): + _no_set(v) + +var token : String = "": + set(v): + _no_set(v) + +var create_time : int = 0: + set(v): + _no_set(v) + +var expire_time : int = 0: + set(v): + _no_set(v) + +var expired : bool = true: + set(v): + _no_set(v) + get: + return is_expired() + +var vars : Dictionary = {}: + set(v): + _no_set(v) + +var username : String = "": + set(v): + _no_set(v) + +var user_id : String = "": + set(v): + _no_set(v) + +var refresh_token : String = "": + set(v): + _no_set(v) + +var refresh_expire_time : int = 0: + set(v): + _no_set(v) + +var valid : bool = false: + set(v): + _no_set(v) + get: + return is_valid() func _no_set(v): return From f76a4c5a3c3596db109804536c3c2897538e6e31 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 01:02:12 +0000 Subject: [PATCH 13/33] Update connect calls --- .../com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd b/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd index 2311aa1..8ddd9d3 100644 --- a/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd +++ b/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd @@ -63,10 +63,10 @@ func _process(delta): _ws.poll() func _init(): - _ws.connect("data_received", self, "_received") - _ws.connect("connection_established", self, "_connected") - _ws.connect("connection_error", self, "_error") - _ws.connect("connection_closed", self, "_closed") + _ws.connect("data_received", _received) + _ws.connect("connection_established", _connected) + _ws.connect("connection_error", _error) + _ws.connect("connection_closed", _closed) func _received(): emit_signal("received", _ws.get_peer(1).get_packet()) From 2fb380cd8ca9173720cc659afb2fb2195b38249d Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 12:32:20 +0000 Subject: [PATCH 14/33] * Fix const causing broken compilation * Fix some properties --- addons/com.heroiclabs.nakama/api/NakamaAPI.gd | 136 ++++++++++-------- 1 file changed, 73 insertions(+), 63 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd index 014969b..bf9578f 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd @@ -6,7 +6,7 @@ class_name NakamaAPI # A single user-role pair. class GroupUserListGroupUser extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "state": {"name": "_state", "type": TYPE_INT, "required": false}, "user": {"name": "_user", "type": "ApiUser", "required": false}, } @@ -43,7 +43,7 @@ class GroupUserListGroupUser extends NakamaAsyncResult: # A single group-role pair. class UserGroupListUserGroup extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "group": {"name": "_group", "type": "ApiGroup", "required": false}, "state": {"name": "_state", "type": TYPE_INT, "required": false}, } @@ -92,7 +92,7 @@ enum ValidatedPurchaseStore {APPLE_APP_STORE = 0,GOOGLE_PLAY_STORE = 1,HUAWEI_AP # Record values to write. class WriteLeaderboardRecordRequestLeaderboardRecordWrite extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "metadata": {"name": "_metadata", "type": TYPE_STRING, "required": false}, "operator": {"name": "_operator", "type": TYPE_INT, "required": false}, "score": {"name": "_score", "type": TYPE_STRING, "required": false}, @@ -145,7 +145,7 @@ class WriteLeaderboardRecordRequestLeaderboardRecordWrite extends NakamaAsyncRes # Record values to write. class WriteTournamentRecordRequestTournamentRecordWrite extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "metadata": {"name": "_metadata", "type": TYPE_STRING, "required": false}, "operator": {"name": "_operator", "type": TYPE_INT, "required": false}, "score": {"name": "_score", "type": TYPE_STRING, "required": false}, @@ -198,7 +198,7 @@ class WriteTournamentRecordRequestTournamentRecordWrite extends NakamaAsyncResul # A user with additional account details. Always the current user. class ApiAccount extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "custom_id": {"name": "_custom_id", "type": TYPE_STRING, "required": false}, "devices": {"name": "_devices", "type": TYPE_ARRAY, "required": false, "content": "ApiAccountDevice"}, "disable_time": {"name": "_disable_time", "type": TYPE_STRING, "required": false}, @@ -253,10 +253,17 @@ class ApiAccount extends NakamaAsyncResult: var _wallet_dict = null var wallet_dict : Dictionary: get: - if _wallet == null or validate_json(_wallet): + var json = JSON.new() + if _wallet == null: return {} - _wallet_dict = parse_json(_wallet) + var error = json.parse(_wallet) + + if error == OK: + _wallet_dict = json.get_data() + else: + return {} + return _wallet_dict as Dictionary @@ -285,7 +292,7 @@ class ApiAccount extends NakamaAsyncResult: # Send a Apple Sign In token to the server. Used with authenticate/link/unlink. class ApiAccountApple extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "token": {"name": "_token", "type": TYPE_STRING, "required": false}, "vars": {"name": "_vars", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } @@ -326,7 +333,7 @@ class ApiAccountApple extends NakamaAsyncResult: # Send a custom ID to the server. Used with authenticate/link/unlink. class ApiAccountCustom extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "id": {"name": "_id", "type": TYPE_STRING, "required": false}, "vars": {"name": "_vars", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } @@ -367,7 +374,7 @@ class ApiAccountCustom extends NakamaAsyncResult: # Send a device to the server. Used with authenticate/link/unlink and user. class ApiAccountDevice extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "id": {"name": "_id", "type": TYPE_STRING, "required": false}, "vars": {"name": "_vars", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } @@ -408,7 +415,7 @@ class ApiAccountDevice extends NakamaAsyncResult: # Send an email with password to the server. Used with authenticate/link/unlink. class ApiAccountEmail extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "email": {"name": "_email", "type": TYPE_STRING, "required": false}, "password": {"name": "_password", "type": TYPE_STRING, "required": false}, "vars": {"name": "_vars", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, @@ -457,7 +464,7 @@ class ApiAccountEmail extends NakamaAsyncResult: # Send a Facebook token to the server. Used with authenticate/link/unlink. class ApiAccountFacebook extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "token": {"name": "_token", "type": TYPE_STRING, "required": false}, "vars": {"name": "_vars", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } @@ -498,7 +505,7 @@ class ApiAccountFacebook extends NakamaAsyncResult: # Send a Facebook Instant Game token to the server. Used with authenticate/link/unlink. class ApiAccountFacebookInstantGame extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "signed_player_info": {"name": "_signed_player_info", "type": TYPE_STRING, "required": false}, "vars": {"name": "_vars", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } @@ -539,7 +546,7 @@ class ApiAccountFacebookInstantGame extends NakamaAsyncResult: # Send Apple's Game Center account credentials to the server. Used with authenticate/link/unlink. class ApiAccountGameCenter extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "bundle_id": {"name": "_bundle_id", "type": TYPE_STRING, "required": false}, "player_id": {"name": "_player_id", "type": TYPE_STRING, "required": false}, "public_key_url": {"name": "_public_key_url", "type": TYPE_STRING, "required": false}, @@ -620,7 +627,7 @@ class ApiAccountGameCenter extends NakamaAsyncResult: # Send a Google token to the server. Used with authenticate/link/unlink. class ApiAccountGoogle extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "token": {"name": "_token", "type": TYPE_STRING, "required": false}, "vars": {"name": "_vars", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } @@ -661,7 +668,7 @@ class ApiAccountGoogle extends NakamaAsyncResult: # Send a Steam token to the server. Used with authenticate/link/unlink. class ApiAccountSteam extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "token": {"name": "_token", "type": TYPE_STRING, "required": false}, "vars": {"name": "_vars", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } @@ -702,7 +709,7 @@ class ApiAccountSteam extends NakamaAsyncResult: # A message sent on a channel. class ApiChannelMessage extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "channel_id": {"name": "_channel_id", "type": TYPE_STRING, "required": false}, "code": {"name": "_code", "type": TYPE_INT, "required": false}, "content": {"name": "_content", "type": TYPE_STRING, "required": false}, @@ -827,7 +834,7 @@ class ApiChannelMessage extends NakamaAsyncResult: # A list of channel messages, usually a result of a list operation. class ApiChannelMessageList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "cacheable_cursor": {"name": "_cacheable_cursor", "type": TYPE_STRING, "required": false}, "messages": {"name": "_messages", "type": TYPE_ARRAY, "required": false, "content": "ApiChannelMessage"}, "next_cursor": {"name": "_next_cursor", "type": TYPE_STRING, "required": false}, @@ -880,7 +887,7 @@ class ApiChannelMessageList extends NakamaAsyncResult: # Create a group with the current user as owner. class ApiCreateGroupRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "avatar_url": {"name": "_avatar_url", "type": TYPE_STRING, "required": false}, "description": {"name": "_description", "type": TYPE_STRING, "required": false}, "lang_tag": {"name": "_lang_tag", "type": TYPE_STRING, "required": false}, @@ -949,7 +956,7 @@ class ApiCreateGroupRequest extends NakamaAsyncResult: # Storage objects to delete. class ApiDeleteStorageObjectId extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "collection": {"name": "_collection", "type": TYPE_STRING, "required": false}, "key": {"name": "_key", "type": TYPE_STRING, "required": false}, "version": {"name": "_version", "type": TYPE_STRING, "required": false}, @@ -994,7 +1001,7 @@ class ApiDeleteStorageObjectId extends NakamaAsyncResult: # Batch delete storage objects. class ApiDeleteStorageObjectsRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "object_ids": {"name": "_object_ids", "type": TYPE_ARRAY, "required": false, "content": "ApiDeleteStorageObjectId"}, } @@ -1023,7 +1030,7 @@ class ApiDeleteStorageObjectsRequest extends NakamaAsyncResult: # Represents an event to be passed through the server to registered event handlers. class ApiEvent extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "external": {"name": "_external", "type": TYPE_BOOL, "required": false}, "name": {"name": "_name", "type": TYPE_STRING, "required": false}, "properties": {"name": "_properties", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, @@ -1080,7 +1087,7 @@ class ApiEvent extends NakamaAsyncResult: # A friend of a user. class ApiFriend extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "state": {"name": "_state", "type": TYPE_INT, "required": false}, "update_time": {"name": "_update_time", "type": TYPE_STRING, "required": false}, "user": {"name": "_user", "type": "ApiUser", "required": false}, @@ -1125,7 +1132,7 @@ class ApiFriend extends NakamaAsyncResult: # A collection of zero or more friends of the user. class ApiFriendList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "cursor": {"name": "_cursor", "type": TYPE_STRING, "required": false}, "friends": {"name": "_friends", "type": TYPE_ARRAY, "required": false, "content": "ApiFriend"}, } @@ -1162,7 +1169,7 @@ class ApiFriendList extends NakamaAsyncResult: # A group in the server. class ApiGroup extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "avatar_url": {"name": "_avatar_url", "type": TYPE_STRING, "required": false}, "create_time": {"name": "_create_time", "type": TYPE_STRING, "required": false}, "creator_id": {"name": "_creator_id", "type": TYPE_STRING, "required": false}, @@ -1279,7 +1286,7 @@ class ApiGroup extends NakamaAsyncResult: # One or more groups returned from a listing operation. class ApiGroupList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "cursor": {"name": "_cursor", "type": TYPE_STRING, "required": false}, "groups": {"name": "_groups", "type": TYPE_ARRAY, "required": false, "content": "ApiGroup"}, } @@ -1316,7 +1323,7 @@ class ApiGroupList extends NakamaAsyncResult: # A list of users belonging to a group, along with their role. class ApiGroupUserList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "cursor": {"name": "_cursor", "type": TYPE_STRING, "required": false}, "group_users": {"name": "_group_users", "type": TYPE_ARRAY, "required": false, "content": "GroupUserListGroupUser"}, } @@ -1353,7 +1360,7 @@ class ApiGroupUserList extends NakamaAsyncResult: # Represents a complete leaderboard record with all scores and associated metadata. class ApiLeaderboardRecord extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "create_time": {"name": "_create_time", "type": TYPE_STRING, "required": false}, "expiry_time": {"name": "_expiry_time", "type": TYPE_STRING, "required": false}, "leaderboard_id": {"name": "_leaderboard_id", "type": TYPE_STRING, "required": false}, @@ -1470,7 +1477,7 @@ class ApiLeaderboardRecord extends NakamaAsyncResult: # A set of leaderboard records, may be part of a leaderboard records page or a batch of individual records. class ApiLeaderboardRecordList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "next_cursor": {"name": "_next_cursor", "type": TYPE_STRING, "required": false}, "owner_records": {"name": "_owner_records", "type": TYPE_ARRAY, "required": false, "content": "ApiLeaderboardRecord"}, "prev_cursor": {"name": "_prev_cursor", "type": TYPE_STRING, "required": false}, @@ -1523,7 +1530,7 @@ class ApiLeaderboardRecordList extends NakamaAsyncResult: # Link Steam to the current user's account. class ApiLinkSteamRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "account": {"name": "_account", "type": "ApiAccountSteam", "required": false}, "sync": {"name": "_sync", "type": TYPE_BOOL, "required": false}, } @@ -1560,7 +1567,7 @@ class ApiLinkSteamRequest extends NakamaAsyncResult: # Represents a realtime match. class ApiMatch extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "authoritative": {"name": "_authoritative", "type": TYPE_BOOL, "required": false}, "handler_name": {"name": "_handler_name", "type": TYPE_STRING, "required": false}, "label": {"name": "_label", "type": TYPE_STRING, "required": false}, @@ -1629,7 +1636,7 @@ class ApiMatch extends NakamaAsyncResult: # A list of realtime matches. class ApiMatchList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "matches": {"name": "_matches", "type": TYPE_ARRAY, "required": false, "content": "ApiMatch"}, } @@ -1658,7 +1665,7 @@ class ApiMatchList extends NakamaAsyncResult: # A notification in the server. class ApiNotification extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "code": {"name": "_code", "type": TYPE_INT, "required": false}, "content": {"name": "_content", "type": TYPE_STRING, "required": false}, "create_time": {"name": "_create_time", "type": TYPE_STRING, "required": false}, @@ -1735,7 +1742,7 @@ class ApiNotification extends NakamaAsyncResult: # A collection of zero or more notifications. class ApiNotificationList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "cacheable_cursor": {"name": "_cacheable_cursor", "type": TYPE_STRING, "required": false}, "notifications": {"name": "_notifications", "type": TYPE_ARRAY, "required": false, "content": "ApiNotification"}, } @@ -1780,7 +1787,7 @@ enum ApiOperator {NO_OVERRIDE = 0,BEST = 1,SET = 2,INCREMENT = 3,DECREMENT = 4,} # Storage objects to get. class ApiReadStorageObjectId extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "collection": {"name": "_collection", "type": TYPE_STRING, "required": false}, "key": {"name": "_key", "type": TYPE_STRING, "required": false}, "user_id": {"name": "_user_id", "type": TYPE_STRING, "required": false}, @@ -1825,7 +1832,7 @@ class ApiReadStorageObjectId extends NakamaAsyncResult: # Batch get storage objects. class ApiReadStorageObjectsRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "object_ids": {"name": "_object_ids", "type": TYPE_ARRAY, "required": false, "content": "ApiReadStorageObjectId"}, } @@ -1854,7 +1861,7 @@ class ApiReadStorageObjectsRequest extends NakamaAsyncResult: # Execute an Lua function on the server. class ApiRpc extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "http_key": {"name": "_http_key", "type": TYPE_STRING, "required": false}, "id": {"name": "_id", "type": TYPE_STRING, "required": false}, "payload": {"name": "_payload", "type": TYPE_STRING, "required": false}, @@ -1899,7 +1906,7 @@ class ApiRpc extends NakamaAsyncResult: # A user's session used to authenticate messages. class ApiSession extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "created": {"name": "_created", "type": TYPE_BOOL, "required": false}, "refresh_token": {"name": "_refresh_token", "type": TYPE_STRING, "required": false}, "token": {"name": "_token", "type": TYPE_STRING, "required": false}, @@ -1944,7 +1951,7 @@ class ApiSession extends NakamaAsyncResult: # Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. class ApiSessionLogoutRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "refresh_token": {"name": "_refresh_token", "type": TYPE_STRING, "required": false}, "token": {"name": "_token", "type": TYPE_STRING, "required": false}, } @@ -1981,7 +1988,7 @@ class ApiSessionLogoutRequest extends NakamaAsyncResult: # Authenticate against the server with a refresh token. class ApiSessionRefreshRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "token": {"name": "_token", "type": TYPE_STRING, "required": false}, "vars": {"name": "_vars", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } @@ -2022,7 +2029,7 @@ class ApiSessionRefreshRequest extends NakamaAsyncResult: # An object within the storage engine. class ApiStorageObject extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "collection": {"name": "_collection", "type": TYPE_STRING, "required": false}, "create_time": {"name": "_create_time", "type": TYPE_STRING, "required": false}, "key": {"name": "_key", "type": TYPE_STRING, "required": false}, @@ -2115,7 +2122,7 @@ class ApiStorageObject extends NakamaAsyncResult: # A storage acknowledgement. class ApiStorageObjectAck extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "collection": {"name": "_collection", "type": TYPE_STRING, "required": false}, "key": {"name": "_key", "type": TYPE_STRING, "required": false}, "user_id": {"name": "_user_id", "type": TYPE_STRING, "required": false}, @@ -2168,7 +2175,7 @@ class ApiStorageObjectAck extends NakamaAsyncResult: # Batch of acknowledgements for the storage object write. class ApiStorageObjectAcks extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "acks": {"name": "_acks", "type": TYPE_ARRAY, "required": false, "content": "ApiStorageObjectAck"}, } @@ -2197,7 +2204,7 @@ class ApiStorageObjectAcks extends NakamaAsyncResult: # List of storage objects. class ApiStorageObjectList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "cursor": {"name": "_cursor", "type": TYPE_STRING, "required": false}, "objects": {"name": "_objects", "type": TYPE_ARRAY, "required": false, "content": "ApiStorageObject"}, } @@ -2234,7 +2241,7 @@ class ApiStorageObjectList extends NakamaAsyncResult: # Batch of storage objects. class ApiStorageObjects extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "objects": {"name": "_objects", "type": TYPE_ARRAY, "required": false, "content": "ApiStorageObject"}, } @@ -2263,7 +2270,7 @@ class ApiStorageObjects extends NakamaAsyncResult: # A tournament on the server. class ApiTournament extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "can_enter": {"name": "_can_enter", "type": TYPE_BOOL, "required": false}, "category": {"name": "_category", "type": TYPE_INT, "required": false}, "create_time": {"name": "_create_time", "type": TYPE_STRING, "required": false}, @@ -2436,7 +2443,7 @@ class ApiTournament extends NakamaAsyncResult: # A list of tournaments. class ApiTournamentList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "cursor": {"name": "_cursor", "type": TYPE_STRING, "required": false}, "tournaments": {"name": "_tournaments", "type": TYPE_ARRAY, "required": false, "content": "ApiTournament"}, } @@ -2473,7 +2480,7 @@ class ApiTournamentList extends NakamaAsyncResult: # A set of tournament records which may be part of a tournament records page or a batch of individual records. class ApiTournamentRecordList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "next_cursor": {"name": "_next_cursor", "type": TYPE_STRING, "required": false}, "owner_records": {"name": "_owner_records", "type": TYPE_ARRAY, "required": false, "content": "ApiLeaderboardRecord"}, "prev_cursor": {"name": "_prev_cursor", "type": TYPE_STRING, "required": false}, @@ -2526,7 +2533,7 @@ class ApiTournamentRecordList extends NakamaAsyncResult: # Update a user's account details. class ApiUpdateAccountRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "avatar_url": {"name": "_avatar_url", "type": TYPE_STRING, "required": false}, "display_name": {"name": "_display_name", "type": TYPE_STRING, "required": false}, "lang_tag": {"name": "_lang_tag", "type": TYPE_STRING, "required": false}, @@ -2595,7 +2602,7 @@ class ApiUpdateAccountRequest extends NakamaAsyncResult: # Update fields in a given group. class ApiUpdateGroupRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "avatar_url": {"name": "_avatar_url", "type": TYPE_STRING, "required": false}, "description": {"name": "_description", "type": TYPE_STRING, "required": false}, "group_id": {"name": "_group_id", "type": TYPE_STRING, "required": false}, @@ -2664,7 +2671,7 @@ class ApiUpdateGroupRequest extends NakamaAsyncResult: # A user in the server. class ApiUser extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "apple_id": {"name": "_apple_id", "type": TYPE_STRING, "required": false}, "avatar_url": {"name": "_avatar_url", "type": TYPE_STRING, "required": false}, "create_time": {"name": "_create_time", "type": TYPE_STRING, "required": false}, @@ -2829,7 +2836,7 @@ class ApiUser extends NakamaAsyncResult: # A list of groups belonging to a user, along with the user's role in each group. class ApiUserGroupList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "cursor": {"name": "_cursor", "type": TYPE_STRING, "required": false}, "user_groups": {"name": "_user_groups", "type": TYPE_ARRAY, "required": false, "content": "UserGroupListUserGroup"}, } @@ -2866,7 +2873,7 @@ class ApiUserGroupList extends NakamaAsyncResult: # A collection of zero or more users. class ApiUsers extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "users": {"name": "_users", "type": TYPE_ARRAY, "required": false, "content": "ApiUser"}, } @@ -2895,7 +2902,7 @@ class ApiUsers extends NakamaAsyncResult: # class ApiValidatePurchaseAppleRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "receipt": {"name": "_receipt", "type": TYPE_STRING, "required": false}, } @@ -2924,7 +2931,7 @@ class ApiValidatePurchaseAppleRequest extends NakamaAsyncResult: # class ApiValidatePurchaseGoogleRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "purchase": {"name": "_purchase", "type": TYPE_STRING, "required": false}, } @@ -2953,7 +2960,7 @@ class ApiValidatePurchaseGoogleRequest extends NakamaAsyncResult: # class ApiValidatePurchaseHuaweiRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "purchase": {"name": "_purchase", "type": TYPE_STRING, "required": false}, "signature": {"name": "_signature", "type": TYPE_STRING, "required": false}, } @@ -2990,7 +2997,7 @@ class ApiValidatePurchaseHuaweiRequest extends NakamaAsyncResult: # class ApiValidatePurchaseResponse extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "validated_purchases": {"name": "_validated_purchases", "type": TYPE_ARRAY, "required": false, "content": "ApiValidatedPurchase"}, } @@ -3019,7 +3026,7 @@ class ApiValidatePurchaseResponse extends NakamaAsyncResult: # Validated Purchase stored by Nakama. class ApiValidatedPurchase extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "create_time": {"name": "_create_time", "type": TYPE_STRING, "required": false}, "environment": {"name": "_environment", "type": TYPE_INT, "required": false}, "product_id": {"name": "_product_id", "type": TYPE_STRING, "required": false}, @@ -3104,7 +3111,7 @@ class ApiValidatedPurchase extends NakamaAsyncResult: # The object to store. class ApiWriteStorageObject extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "collection": {"name": "_collection", "type": TYPE_STRING, "required": false}, "key": {"name": "_key", "type": TYPE_STRING, "required": false}, "permission_read": {"name": "_permission_read", "type": TYPE_INT, "required": false}, @@ -3173,7 +3180,7 @@ class ApiWriteStorageObject extends NakamaAsyncResult: # Write objects to the storage engine. class ApiWriteStorageObjectsRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "objects": {"name": "_objects", "type": TYPE_ARRAY, "required": false, "content": "ApiWriteStorageObject"}, } @@ -3202,7 +3209,7 @@ class ApiWriteStorageObjectsRequest extends NakamaAsyncResult: # class ProtobufAny extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "type_url": {"name": "_type_url", "type": TYPE_STRING, "required": false}, "value": {"name": "_value", "type": TYPE_STRING, "required": false}, } @@ -3239,7 +3246,7 @@ class ProtobufAny extends NakamaAsyncResult: # class RpcStatus extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "code": {"name": "_code", "type": TYPE_INT, "required": false}, "details": {"name": "_details", "type": TYPE_ARRAY, "required": false, "content": "ProtobufAny"}, "message": {"name": "_message", "type": TYPE_STRING, "required": false}, @@ -3312,8 +3319,11 @@ class ApiClient extends RefCounted: var last_cancel_token: get: - _http_adapter.auto_retry = p_value + return _get_last_token() + func _set_retry(p_value): + _http_adapter.auto_retry = p_value + func _get_retry(): return _http_adapter.auto_retry From ccdcde053f8d96c4dccbaddd36785a4c4202991a Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 12:33:22 +0000 Subject: [PATCH 15/33] Fix coroutine calls --- addons/com.heroiclabs.nakama/api/NakamaAPI.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd index bf9578f..20c1375 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd @@ -3353,7 +3353,7 @@ class ApiClient extends RefCounted: if auto_refresh and p_session.is_valid() and p_session.refresh_token and not p_session.is_refresh_expired() and p_session.would_expire_in(auto_refresh_time): var request = ApiSessionRefreshRequest.new() request._token = p_session.refresh_token - return await session_refresh_async(_server_key, "", request).complted + return await session_refresh_async.call(_server_key, "", request).complted return null func cancel_request(p_token): @@ -3364,7 +3364,7 @@ class ApiClient extends RefCounted: func healthcheck_async( p_session : NakamaSession ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): From 0343c145fb7f545ce95a8df0412ff47f9fd1c667 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 12:33:57 +0000 Subject: [PATCH 16/33] Fix PoolByteArray to PackedByteArray --- addons/com.heroiclabs.nakama/api/NakamaAPI.gd | 154 +++++++++--------- .../client/NakamaHTTPAdapter.gd | 8 +- .../socket/NakamaSocket.gd | 4 +- .../socket/NakamaSocketAdapter.gd | 4 +- codegen/main.go | 2 +- 5 files changed, 86 insertions(+), 86 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd index 20c1375..35c7904 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd @@ -3378,7 +3378,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -3403,7 +3403,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -3430,7 +3430,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3459,7 +3459,7 @@ class ApiClient extends RefCounted: var header = "Basic %s" % credentials headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3489,7 +3489,7 @@ class ApiClient extends RefCounted: var header = "Basic %s" % credentials headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3519,7 +3519,7 @@ class ApiClient extends RefCounted: var header = "Basic %s" % credentials headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3549,7 +3549,7 @@ class ApiClient extends RefCounted: var header = "Basic %s" % credentials headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3582,7 +3582,7 @@ class ApiClient extends RefCounted: var header = "Basic %s" % credentials headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3612,7 +3612,7 @@ class ApiClient extends RefCounted: var header = "Basic %s" % credentials headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3642,7 +3642,7 @@ class ApiClient extends RefCounted: var header = "Basic %s" % credentials headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3672,7 +3672,7 @@ class ApiClient extends RefCounted: var header = "Basic %s" % credentials headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3705,7 +3705,7 @@ class ApiClient extends RefCounted: var header = "Basic %s" % credentials headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3733,7 +3733,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3760,7 +3760,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3787,7 +3787,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3814,7 +3814,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3844,7 +3844,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3871,7 +3871,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3898,7 +3898,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3925,7 +3925,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3952,7 +3952,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -3975,7 +3975,7 @@ class ApiClient extends RefCounted: var header = "Basic %s" % credentials headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4003,7 +4003,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4030,7 +4030,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4057,7 +4057,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4084,7 +4084,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4111,7 +4111,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4138,7 +4138,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4165,7 +4165,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4192,7 +4192,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4219,7 +4219,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4256,7 +4256,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4283,7 +4283,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4317,7 +4317,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4351,7 +4351,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4385,7 +4385,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4418,7 +4418,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4447,7 +4447,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4477,7 +4477,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4521,7 +4521,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4548,7 +4548,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4577,7 +4577,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4605,7 +4605,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4637,7 +4637,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4668,7 +4668,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4699,7 +4699,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4726,7 +4726,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4757,7 +4757,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4784,7 +4784,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4815,7 +4815,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4851,7 +4851,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -4878,7 +4878,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4906,7 +4906,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4934,7 +4934,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -4963,7 +4963,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5003,7 +5003,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5032,7 +5032,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -5069,7 +5069,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5113,7 +5113,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5143,7 +5143,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5174,7 +5174,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5203,7 +5203,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_bearer_token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5230,7 +5230,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_bearer_token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -5258,7 +5258,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -5285,7 +5285,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -5313,7 +5313,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -5341,7 +5341,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -5378,7 +5378,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5414,7 +5414,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5458,7 +5458,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5499,7 +5499,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5528,7 +5528,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -5558,7 +5558,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray content = JSON.print(p_body.serialize()).to_utf8() var result = await _http_adapter.send_async(method, uri, headers, content).complted @@ -5587,7 +5587,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5622,7 +5622,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5660,7 +5660,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: @@ -5697,7 +5697,7 @@ class ApiClient extends RefCounted: var header = "Bearer %s" % p_session.token headers["Authorization"] = header - var content : PoolByteArray + var content : PackedByteArray var result = await _http_adapter.send_async(method, uri, headers, content).complted if result is NakamaException: diff --git a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd index b14e94e..95eae5c 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd @@ -24,7 +24,7 @@ class AsyncRequest: var uri : String var method : int var headers : PackedStringArray - var body : PoolByteArray + var body : PackedByteArray var retry_count := 3 var backoff_time := 10 var logger : NakamaLogger @@ -32,13 +32,13 @@ class AsyncRequest: var cancelled = false var result : int = HTTPRequest.RESULT_NO_RESPONSE var response_code : int = -1 - var response_body : PoolByteArray + var response_body : PackedByteArray var timer : SceneTreeTimer = null var cur_try : int = 1 var rng = RandomNumberGenerator.new() func _init(p_id : int, p_request : HTTPRequest, p_uri : String, - p_method : int, p_headers : PackedStringArray, p_body : PoolByteArray, + p_method : int, p_headers : PackedStringArray, p_body : PackedByteArray, p_retry_count : int, p_backoff_time : int, p_logger : NakamaLogger): rng.seed = OS.get_ticks_usec() id = p_id @@ -134,7 +134,7 @@ class AsyncRequest: # @param body - Request content body to set. # @param timeoutSec - Request timeout. # Returns a task which resolves to the contents of the response. -func send_async(p_method : String, p_uri : String, p_headers : Dictionary, p_body : PoolByteArray): +func send_async(p_method : String, p_uri : String, p_headers : Dictionary, p_body : PackedByteArray): var req = HTTPRequest.new() req.timeout = timeout if OS.get_name() != 'HTML5': diff --git a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd index b6f6068..441386a 100644 --- a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd +++ b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd @@ -136,7 +136,7 @@ func _connected(): emit_signal("connected") _resume_conn(OK) -func _received(p_bytes : PoolByteArray): +func _received(p_bytes : PackedByteArray): var json_str = p_bytes.get_string_from_utf8() var json := JSON.parse(json_str) if json.error != OK or typeof(json.result) != TYPE_DICTIONARY: @@ -437,7 +437,7 @@ func send_match_state_async(p_match_id, p_op_code : int, p_data : String, p_pres # @param p_data - The input data to send. # @param p_presences - The presences in the match who should receive the input. # Returns a task which represents the asynchronous operation. -func send_match_state_raw_async(p_match_id, p_op_code : int, p_data : PoolByteArray, p_presences = null): +func send_match_state_raw_async(p_match_id, p_op_code : int, p_data : PackedByteArray, p_presences = null): var req = _send_async(NakamaRTMessage.MatchDataSend.new( p_match_id, p_op_code, diff --git a/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd b/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd index 8ddd9d3..c461b35 100644 --- a/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd +++ b/addons/com.heroiclabs.nakama/socket/NakamaSocketAdapter.gd @@ -19,7 +19,7 @@ signal closed() signal received_error(p_exception) # A signal emitted when the socket receives a message. -signal received(p_bytes) # PoolByteArray +signal received(p_bytes) # PackedByteArray # If the socket is connected. func is_connected_to_host(): @@ -48,7 +48,7 @@ func connect_to_host(p_uri : String, p_timeout : int): # Send data to the server with an asynchronous operation. # @param p_buffer - The buffer with the message to send. # @param p_reliable - If the message should be sent reliably (will be ignored by some protocols). -func send(p_buffer : PoolByteArray, p_reliable : bool = true) -> int: +func send(p_buffer : PackedByteArray, p_reliable : bool = true) -> int: return _ws.get_peer(1).put_packet(p_buffer) func _process(delta): diff --git a/codegen/main.go b/codegen/main.go index 3ee611f..f402e59 100644 --- a/codegen/main.go +++ b/codegen/main.go @@ -293,7 +293,7 @@ class ApiClient extends Reference: headers["Authorization"] = header {{- end }} - var content : PoolByteArray + var content : PackedByteArray {{- range $parameter := $operation.Parameters }} {{- $argument := $parameter.Name | prependParameter }} {{- if eq $parameter.In "body" }} From 47061c20949bf03b54099f153f6e520391da352e Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 12:35:04 +0000 Subject: [PATCH 17/33] Update coroutie calls --- addons/com.heroiclabs.nakama/api/NakamaAPI.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd index 35c7904..98dfa99 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd @@ -3389,7 +3389,7 @@ class ApiClient extends RefCounted: func get_account_async( p_session : NakamaSession ) -> ApiAccount: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -3416,7 +3416,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiUpdateAccountRequest ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): From 5640dbb6a2a187adbcc7ae9d21d454491416a00c Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 17:27:31 +0000 Subject: [PATCH 18/33] Call escape_http with str --- addons/com.heroiclabs.nakama/api/NakamaAPI.gd | 120 +++++++++--------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd index 98dfa99..211927a 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd @@ -3451,7 +3451,7 @@ class ApiClient extends RefCounted: if p_create != null: query_params += "create=%s&" % str(bool(p_create)).to_lower() if p_username != null: - query_params += "username=%s&" % NakamaSerializer.escape_http(p_username) + query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -3481,7 +3481,7 @@ class ApiClient extends RefCounted: if p_create != null: query_params += "create=%s&" % str(bool(p_create)).to_lower() if p_username != null: - query_params += "username=%s&" % NakamaSerializer.escape_http(p_username) + query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -3511,7 +3511,7 @@ class ApiClient extends RefCounted: if p_create != null: query_params += "create=%s&" % str(bool(p_create)).to_lower() if p_username != null: - query_params += "username=%s&" % NakamaSerializer.escape_http(p_username) + query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -3541,7 +3541,7 @@ class ApiClient extends RefCounted: if p_create != null: query_params += "create=%s&" % str(bool(p_create)).to_lower() if p_username != null: - query_params += "username=%s&" % NakamaSerializer.escape_http(p_username) + query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -3572,7 +3572,7 @@ class ApiClient extends RefCounted: if p_create != null: query_params += "create=%s&" % str(bool(p_create)).to_lower() if p_username != null: - query_params += "username=%s&" % NakamaSerializer.escape_http(p_username) + query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) if p_sync != null: query_params += "sync=%s&" % str(bool(p_sync)).to_lower() var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] @@ -3604,7 +3604,7 @@ class ApiClient extends RefCounted: if p_create != null: query_params += "create=%s&" % str(bool(p_create)).to_lower() if p_username != null: - query_params += "username=%s&" % NakamaSerializer.escape_http(p_username) + query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -3634,7 +3634,7 @@ class ApiClient extends RefCounted: if p_create != null: query_params += "create=%s&" % str(bool(p_create)).to_lower() if p_username != null: - query_params += "username=%s&" % NakamaSerializer.escape_http(p_username) + query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -3664,7 +3664,7 @@ class ApiClient extends RefCounted: if p_create != null: query_params += "create=%s&" % str(bool(p_create)).to_lower() if p_username != null: - query_params += "username=%s&" % NakamaSerializer.escape_http(p_username) + query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -3695,7 +3695,7 @@ class ApiClient extends RefCounted: if p_create != null: query_params += "create=%s&" % str(bool(p_create)).to_lower() if p_username != null: - query_params += "username=%s&" % NakamaSerializer.escape_http(p_username) + query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) if p_sync != null: query_params += "sync=%s&" % str(bool(p_sync)).to_lower() var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] @@ -4242,14 +4242,14 @@ class ApiClient extends RefCounted: return ApiChannelMessageList.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/channel/{channelId}" - urlpath = urlpath.replace("{channelId}", NakamaSerializer.escape_http(p_channel_id)) + urlpath = urlpath.replace("{channelId}", NakamaSerializer.escape_http(str(p_channel_id))) var query_params = "" if p_limit != null: query_params += "limit=%d&" % p_limit if p_forward != null: query_params += "forward=%s&" % str(bool(p_forward)).to_lower() if p_cursor != null: - query_params += "cursor=%s&" % NakamaSerializer.escape_http(p_cursor) + query_params += "cursor=%s&" % NakamaSerializer.escape_http(str(p_cursor)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -4344,7 +4344,7 @@ class ApiClient extends RefCounted: if p_state != null: query_params += "state=%d&" % p_state if p_cursor != null: - query_params += "cursor=%s&" % NakamaSerializer.escape_http(p_cursor) + query_params += "cursor=%s&" % NakamaSerializer.escape_http(str(p_cursor)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -4504,13 +4504,13 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/group" var query_params = "" if p_name != null: - query_params += "name=%s&" % NakamaSerializer.escape_http(p_name) + query_params += "name=%s&" % NakamaSerializer.escape_http(str(p_name)) if p_cursor != null: - query_params += "cursor=%s&" % NakamaSerializer.escape_http(p_cursor) + query_params += "cursor=%s&" % NakamaSerializer.escape_http(str(p_cursor)) if p_limit != null: query_params += "limit=%d&" % p_limit if p_lang_tag != null: - query_params += "lang_tag=%s&" % NakamaSerializer.escape_http(p_lang_tag) + query_params += "lang_tag=%s&" % NakamaSerializer.escape_http(str(p_lang_tag)) if p_members != null: query_params += "members=%d&" % p_members if p_open != null: @@ -4569,7 +4569,7 @@ class ApiClient extends RefCounted: return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/group/{groupId}" - urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(p_group_id)) + urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(str(p_group_id))) var query_params = "" var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "DELETE" @@ -4597,7 +4597,7 @@ class ApiClient extends RefCounted: return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/group/{groupId}" - urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(p_group_id)) + urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(str(p_group_id))) var query_params = "" var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "PUT" @@ -4626,7 +4626,7 @@ class ApiClient extends RefCounted: return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/group/{groupId}/add" - urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(p_group_id)) + urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(str(p_group_id))) var query_params = "" if p_user_ids != null: for elem in p_user_ids: @@ -4657,7 +4657,7 @@ class ApiClient extends RefCounted: return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/group/{groupId}/ban" - urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(p_group_id)) + urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(str(p_group_id))) var query_params = "" if p_user_ids != null: for elem in p_user_ids: @@ -4688,7 +4688,7 @@ class ApiClient extends RefCounted: return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/group/{groupId}/demote" - urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(p_group_id)) + urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(str(p_group_id))) var query_params = "" if true: # Hack for static checks for elem in p_user_ids: @@ -4718,7 +4718,7 @@ class ApiClient extends RefCounted: return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/group/{groupId}/join" - urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(p_group_id)) + urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(str(p_group_id))) var query_params = "" var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" @@ -4746,7 +4746,7 @@ class ApiClient extends RefCounted: return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/group/{groupId}/kick" - urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(p_group_id)) + urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(str(p_group_id))) var query_params = "" if p_user_ids != null: for elem in p_user_ids: @@ -4776,7 +4776,7 @@ class ApiClient extends RefCounted: return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/group/{groupId}/leave" - urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(p_group_id)) + urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(str(p_group_id))) var query_params = "" var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" @@ -4804,7 +4804,7 @@ class ApiClient extends RefCounted: return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/group/{groupId}/promote" - urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(p_group_id)) + urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(str(p_group_id))) var query_params = "" if p_user_ids != null: for elem in p_user_ids: @@ -4837,14 +4837,14 @@ class ApiClient extends RefCounted: return ApiGroupUserList.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/group/{groupId}/user" - urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(p_group_id)) + urlpath = urlpath.replace("{groupId}", NakamaSerializer.escape_http(str(p_group_id))) var query_params = "" if p_limit != null: query_params += "limit=%d&" % p_limit if p_state != null: query_params += "state=%d&" % p_state if p_cursor != null: - query_params += "cursor=%s&" % NakamaSerializer.escape_http(p_cursor) + query_params += "cursor=%s&" % NakamaSerializer.escape_http(str(p_cursor)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -4955,7 +4955,7 @@ class ApiClient extends RefCounted: return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/leaderboard/{leaderboardId}" - urlpath = urlpath.replace("{leaderboardId}", NakamaSerializer.escape_http(p_leaderboard_id)) + urlpath = urlpath.replace("{leaderboardId}", NakamaSerializer.escape_http(str(p_leaderboard_id))) var query_params = "" var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "DELETE" @@ -4986,7 +4986,7 @@ class ApiClient extends RefCounted: return ApiLeaderboardRecordList.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/leaderboard/{leaderboardId}" - urlpath = urlpath.replace("{leaderboardId}", NakamaSerializer.escape_http(p_leaderboard_id)) + urlpath = urlpath.replace("{leaderboardId}", NakamaSerializer.escape_http(str(p_leaderboard_id))) var query_params = "" if p_owner_ids != null: for elem in p_owner_ids: @@ -4994,9 +4994,9 @@ class ApiClient extends RefCounted: if p_limit != null: query_params += "limit=%d&" % p_limit if p_cursor != null: - query_params += "cursor=%s&" % NakamaSerializer.escape_http(p_cursor) + query_params += "cursor=%s&" % NakamaSerializer.escape_http(str(p_cursor)) if p_expiry != null: - query_params += "expiry=%s&" % NakamaSerializer.escape_http(p_expiry) + query_params += "expiry=%s&" % NakamaSerializer.escape_http(str(p_expiry)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -5024,7 +5024,7 @@ class ApiClient extends RefCounted: return ApiLeaderboardRecord.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/leaderboard/{leaderboardId}" - urlpath = urlpath.replace("{leaderboardId}", NakamaSerializer.escape_http(p_leaderboard_id)) + urlpath = urlpath.replace("{leaderboardId}", NakamaSerializer.escape_http(str(p_leaderboard_id))) var query_params = "" var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" @@ -5056,13 +5056,13 @@ class ApiClient extends RefCounted: return ApiLeaderboardRecordList.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/leaderboard/{leaderboardId}/owner/{ownerId}" - urlpath = urlpath.replace("{leaderboardId}", NakamaSerializer.escape_http(p_leaderboard_id)) - urlpath = urlpath.replace("{ownerId}", NakamaSerializer.escape_http(p_owner_id)) + urlpath = urlpath.replace("{leaderboardId}", NakamaSerializer.escape_http(str(p_leaderboard_id))) + urlpath = urlpath.replace("{ownerId}", NakamaSerializer.escape_http(str(p_owner_id))) var query_params = "" if p_limit != null: query_params += "limit=%d&" % p_limit if p_expiry != null: - query_params += "expiry=%s&" % NakamaSerializer.escape_http(p_expiry) + query_params += "expiry=%s&" % NakamaSerializer.escape_http(str(p_expiry)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -5100,13 +5100,13 @@ class ApiClient extends RefCounted: if p_authoritative != null: query_params += "authoritative=%s&" % str(bool(p_authoritative)).to_lower() if p_label != null: - query_params += "label=%s&" % NakamaSerializer.escape_http(p_label) + query_params += "label=%s&" % NakamaSerializer.escape_http(str(p_label)) if p_min_size != null: query_params += "min_size=%d&" % p_min_size if p_max_size != null: query_params += "max_size=%d&" % p_max_size if p_query != null: - query_params += "query=%s&" % NakamaSerializer.escape_http(p_query) + query_params += "query=%s&" % NakamaSerializer.escape_http(str(p_query)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -5167,7 +5167,7 @@ class ApiClient extends RefCounted: if p_limit != null: query_params += "limit=%d&" % p_limit if p_cacheable_cursor != null: - query_params += "cacheable_cursor=%s&" % NakamaSerializer.escape_http(p_cacheable_cursor) + query_params += "cacheable_cursor=%s&" % NakamaSerializer.escape_http(str(p_cacheable_cursor)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -5190,12 +5190,12 @@ class ApiClient extends RefCounted: , p_http_key = null # : string ) -> ApiRpc: var urlpath : String = "/v2/rpc/{id}" - urlpath = urlpath.replace("{id}", NakamaSerializer.escape_http(p_id)) + urlpath = urlpath.replace("{id}", NakamaSerializer.escape_http(str(p_id))) var query_params = "" if p_payload != null: - query_params += "payload=%s&" % NakamaSerializer.escape_http(p_payload) + query_params += "payload=%s&" % NakamaSerializer.escape_http(str(p_payload)) if p_http_key != null: - query_params += "http_key=%s&" % NakamaSerializer.escape_http(p_http_key) + query_params += "http_key=%s&" % NakamaSerializer.escape_http(str(p_http_key)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -5219,10 +5219,10 @@ class ApiClient extends RefCounted: , p_http_key = null # : string ) -> ApiRpc: var urlpath : String = "/v2/rpc/{id}" - urlpath = urlpath.replace("{id}", NakamaSerializer.escape_http(p_id)) + urlpath = urlpath.replace("{id}", NakamaSerializer.escape_http(str(p_id))) var query_params = "" if p_http_key != null: - query_params += "http_key=%s&" % NakamaSerializer.escape_http(p_http_key) + query_params += "http_key=%s&" % NakamaSerializer.escape_http(str(p_http_key)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -5364,14 +5364,14 @@ class ApiClient extends RefCounted: return ApiStorageObjectList.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/storage/{collection}" - urlpath = urlpath.replace("{collection}", NakamaSerializer.escape_http(p_collection)) + urlpath = urlpath.replace("{collection}", NakamaSerializer.escape_http(str(p_collection))) var query_params = "" if p_user_id != null: - query_params += "user_id=%s&" % NakamaSerializer.escape_http(p_user_id) + query_params += "user_id=%s&" % NakamaSerializer.escape_http(str(p_user_id)) if p_limit != null: query_params += "limit=%d&" % p_limit if p_cursor != null: - query_params += "cursor=%s&" % NakamaSerializer.escape_http(p_cursor) + query_params += "cursor=%s&" % NakamaSerializer.escape_http(str(p_cursor)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -5401,13 +5401,13 @@ class ApiClient extends RefCounted: return ApiStorageObjectList.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/storage/{collection}/{userId}" - urlpath = urlpath.replace("{collection}", NakamaSerializer.escape_http(p_collection)) - urlpath = urlpath.replace("{userId}", NakamaSerializer.escape_http(p_user_id)) + urlpath = urlpath.replace("{collection}", NakamaSerializer.escape_http(str(p_collection))) + urlpath = urlpath.replace("{userId}", NakamaSerializer.escape_http(str(p_user_id))) var query_params = "" if p_limit != null: query_params += "limit=%d&" % p_limit if p_cursor != null: - query_params += "cursor=%s&" % NakamaSerializer.escape_http(p_cursor) + query_params += "cursor=%s&" % NakamaSerializer.escape_http(str(p_cursor)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -5451,7 +5451,7 @@ class ApiClient extends RefCounted: if p_limit != null: query_params += "limit=%d&" % p_limit if p_cursor != null: - query_params += "cursor=%s&" % NakamaSerializer.escape_http(p_cursor) + query_params += "cursor=%s&" % NakamaSerializer.escape_http(str(p_cursor)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -5482,7 +5482,7 @@ class ApiClient extends RefCounted: return ApiTournamentRecordList.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/tournament/{tournamentId}" - urlpath = urlpath.replace("{tournamentId}", NakamaSerializer.escape_http(p_tournament_id)) + urlpath = urlpath.replace("{tournamentId}", NakamaSerializer.escape_http(str(p_tournament_id))) var query_params = "" if p_owner_ids != null: for elem in p_owner_ids: @@ -5490,9 +5490,9 @@ class ApiClient extends RefCounted: if p_limit != null: query_params += "limit=%d&" % p_limit if p_cursor != null: - query_params += "cursor=%s&" % NakamaSerializer.escape_http(p_cursor) + query_params += "cursor=%s&" % NakamaSerializer.escape_http(str(p_cursor)) if p_expiry != null: - query_params += "expiry=%s&" % NakamaSerializer.escape_http(p_expiry) + query_params += "expiry=%s&" % NakamaSerializer.escape_http(str(p_expiry)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -5520,7 +5520,7 @@ class ApiClient extends RefCounted: return ApiLeaderboardRecord.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/tournament/{tournamentId}" - urlpath = urlpath.replace("{tournamentId}", NakamaSerializer.escape_http(p_tournament_id)) + urlpath = urlpath.replace("{tournamentId}", NakamaSerializer.escape_http(str(p_tournament_id))) var query_params = "" var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" @@ -5550,7 +5550,7 @@ class ApiClient extends RefCounted: return ApiLeaderboardRecord.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/tournament/{tournamentId}" - urlpath = urlpath.replace("{tournamentId}", NakamaSerializer.escape_http(p_tournament_id)) + urlpath = urlpath.replace("{tournamentId}", NakamaSerializer.escape_http(str(p_tournament_id))) var query_params = "" var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "PUT" @@ -5579,7 +5579,7 @@ class ApiClient extends RefCounted: return NakamaAsyncResult.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/tournament/{tournamentId}/join" - urlpath = urlpath.replace("{tournamentId}", NakamaSerializer.escape_http(p_tournament_id)) + urlpath = urlpath.replace("{tournamentId}", NakamaSerializer.escape_http(str(p_tournament_id))) var query_params = "" var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" @@ -5609,13 +5609,13 @@ class ApiClient extends RefCounted: return ApiTournamentRecordList.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/tournament/{tournamentId}/owner/{ownerId}" - urlpath = urlpath.replace("{tournamentId}", NakamaSerializer.escape_http(p_tournament_id)) - urlpath = urlpath.replace("{ownerId}", NakamaSerializer.escape_http(p_owner_id)) + urlpath = urlpath.replace("{tournamentId}", NakamaSerializer.escape_http(str(p_tournament_id))) + urlpath = urlpath.replace("{ownerId}", NakamaSerializer.escape_http(str(p_owner_id))) var query_params = "" if p_limit != null: query_params += "limit=%d&" % p_limit if p_expiry != null: - query_params += "expiry=%s&" % NakamaSerializer.escape_http(p_expiry) + query_params += "expiry=%s&" % NakamaSerializer.escape_http(str(p_expiry)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -5683,14 +5683,14 @@ class ApiClient extends RefCounted: return ApiUserGroupList.new(session.get_exception()) p_session.refresh(session) var urlpath : String = "/v2/user/{userId}/group" - urlpath = urlpath.replace("{userId}", NakamaSerializer.escape_http(p_user_id)) + urlpath = urlpath.replace("{userId}", NakamaSerializer.escape_http(str(p_user_id))) var query_params = "" if p_limit != null: query_params += "limit=%d&" % p_limit if p_state != null: query_params += "state=%d&" % p_state if p_cursor != null: - query_params += "cursor=%s&" % NakamaSerializer.escape_http(p_cursor) + query_params += "cursor=%s&" % NakamaSerializer.escape_http(str(p_cursor)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} From de7c8ef81f67efa6f2d921c82c4369663e6f4bdc Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 17:31:22 +0000 Subject: [PATCH 19/33] There is no bool constructor. So just use str --- addons/com.heroiclabs.nakama/api/NakamaAPI.gd | 34 +++++++++---------- codegen/main.go | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd index 211927a..8e17c41 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd @@ -3449,7 +3449,7 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/account/authenticate/apple" var query_params = "" if p_create != null: - query_params += "create=%s&" % str(bool(p_create)).to_lower() + query_params += "create=%s&" % str(p_create).to_lower() if p_username != null: query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] @@ -3479,7 +3479,7 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/account/authenticate/custom" var query_params = "" if p_create != null: - query_params += "create=%s&" % str(bool(p_create)).to_lower() + query_params += "create=%s&" % str(p_create).to_lower() if p_username != null: query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] @@ -3509,7 +3509,7 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/account/authenticate/device" var query_params = "" if p_create != null: - query_params += "create=%s&" % str(bool(p_create)).to_lower() + query_params += "create=%s&" % str(p_create).to_lower() if p_username != null: query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] @@ -3539,7 +3539,7 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/account/authenticate/email" var query_params = "" if p_create != null: - query_params += "create=%s&" % str(bool(p_create)).to_lower() + query_params += "create=%s&" % str(p_create).to_lower() if p_username != null: query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] @@ -3570,11 +3570,11 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/account/authenticate/facebook" var query_params = "" if p_create != null: - query_params += "create=%s&" % str(bool(p_create)).to_lower() + query_params += "create=%s&" % str(p_create).to_lower() if p_username != null: query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) if p_sync != null: - query_params += "sync=%s&" % str(bool(p_sync)).to_lower() + query_params += "sync=%s&" % str(p_sync).to_lower() var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -3602,7 +3602,7 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/account/authenticate/facebookinstantgame" var query_params = "" if p_create != null: - query_params += "create=%s&" % str(bool(p_create)).to_lower() + query_params += "create=%s&" % str(p_create).to_lower() if p_username != null: query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] @@ -3632,7 +3632,7 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/account/authenticate/gamecenter" var query_params = "" if p_create != null: - query_params += "create=%s&" % str(bool(p_create)).to_lower() + query_params += "create=%s&" % str(p_create).to_lower() if p_username != null: query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] @@ -3662,7 +3662,7 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/account/authenticate/google" var query_params = "" if p_create != null: - query_params += "create=%s&" % str(bool(p_create)).to_lower() + query_params += "create=%s&" % str(p_create).to_lower() if p_username != null: query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] @@ -3693,11 +3693,11 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/account/authenticate/steam" var query_params = "" if p_create != null: - query_params += "create=%s&" % str(bool(p_create)).to_lower() + query_params += "create=%s&" % str(p_create).to_lower() if p_username != null: query_params += "username=%s&" % NakamaSerializer.escape_http(str(p_username)) if p_sync != null: - query_params += "sync=%s&" % str(bool(p_sync)).to_lower() + query_params += "sync=%s&" % str(p_sync).to_lower() var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -3837,7 +3837,7 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/account/link/facebook" var query_params = "" if p_sync != null: - query_params += "sync=%s&" % str(bool(p_sync)).to_lower() + query_params += "sync=%s&" % str(p_sync).to_lower() var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -4247,7 +4247,7 @@ class ApiClient extends RefCounted: if p_limit != null: query_params += "limit=%d&" % p_limit if p_forward != null: - query_params += "forward=%s&" % str(bool(p_forward)).to_lower() + query_params += "forward=%s&" % str(p_forward).to_lower() if p_cursor != null: query_params += "cursor=%s&" % NakamaSerializer.escape_http(str(p_cursor)) var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] @@ -4440,7 +4440,7 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/friend/facebook" var query_params = "" if p_reset != null: - query_params += "reset=%s&" % str(bool(p_reset)).to_lower() + query_params += "reset=%s&" % str(p_reset).to_lower() var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -4470,7 +4470,7 @@ class ApiClient extends RefCounted: var urlpath : String = "/v2/friend/steam" var query_params = "" if p_reset != null: - query_params += "reset=%s&" % str(bool(p_reset)).to_lower() + query_params += "reset=%s&" % str(p_reset).to_lower() var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "POST" var headers = {} @@ -4514,7 +4514,7 @@ class ApiClient extends RefCounted: if p_members != null: query_params += "members=%d&" % p_members if p_open != null: - query_params += "open=%s&" % str(bool(p_open)).to_lower() + query_params += "open=%s&" % str(p_open).to_lower() var uri = "%s%s%s" % [_base_uri, urlpath, "?" + query_params if query_params else ""] var method = "GET" var headers = {} @@ -5098,7 +5098,7 @@ class ApiClient extends RefCounted: if p_limit != null: query_params += "limit=%d&" % p_limit if p_authoritative != null: - query_params += "authoritative=%s&" % str(bool(p_authoritative)).to_lower() + query_params += "authoritative=%s&" % str(p_authoritative).to_lower() if p_label != null: query_params += "label=%s&" % NakamaSerializer.escape_http(str(p_label)) if p_min_size != null: diff --git a/codegen/main.go b/codegen/main.go index f402e59..95b230d 100644 --- a/codegen/main.go +++ b/codegen/main.go @@ -262,7 +262,7 @@ class ApiClient extends Reference: {{- else if eq $parameter.Type "string" }} query_params += "{{- $snakecase }}=%s&" % NakamaSerializer.escape_http({{ $argument }}) {{- else if eq $parameter.Type "boolean" }} - query_params += "{{- $snakecase }}=%s&" % str(bool({{ $argument }})).to_lower() + query_params += "{{- $snakecase }}=%s&" % str({{ $argument }}).to_lower() {{- else if eq $parameter.Type "array" }} for elem in {{ $argument }}: query_params += "{{- $snakecase }}=%s&" % elem From 589fff424c9b655a417581d75a0db20562e4374c Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 17:34:32 +0000 Subject: [PATCH 20/33] Update _refresh_session coroutines. Call the coroutine _refresh_session.call --- addons/com.heroiclabs.nakama/api/NakamaAPI.gd | 124 +++++++++--------- codegen/main.go | 2 +- 2 files changed, 63 insertions(+), 63 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd index 8e17c41..8274d5f 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaAPI.gd @@ -3719,7 +3719,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountApple ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -3746,7 +3746,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountCustom ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -3773,7 +3773,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountDevice ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -3800,7 +3800,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountEmail ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -3828,7 +3828,7 @@ class ApiClient extends RefCounted: , p_body : ApiAccountFacebook , p_sync = null # : boolean ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -3857,7 +3857,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountFacebookInstantGame ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -3884,7 +3884,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountGameCenter ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -3911,7 +3911,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountGoogle ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -3938,7 +3938,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiLinkSteamRequest ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -3989,7 +3989,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountApple ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4016,7 +4016,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountCustom ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4043,7 +4043,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountDevice ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4070,7 +4070,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountEmail ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4097,7 +4097,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountFacebook ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4124,7 +4124,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountFacebookInstantGame ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4151,7 +4151,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountGameCenter ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4178,7 +4178,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountGoogle ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4205,7 +4205,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiAccountSteam ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4235,7 +4235,7 @@ class ApiClient extends RefCounted: , p_forward = null # : boolean , p_cursor = null # : string ) -> ApiChannelMessageList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4269,7 +4269,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiEvent ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4297,7 +4297,7 @@ class ApiClient extends RefCounted: , p_ids = null # : array , p_usernames = null # : array ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4331,7 +4331,7 @@ class ApiClient extends RefCounted: , p_state = null # : integer , p_cursor = null # : string ) -> ApiFriendList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4365,7 +4365,7 @@ class ApiClient extends RefCounted: , p_ids = null # : array , p_usernames = null # : array ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4398,7 +4398,7 @@ class ApiClient extends RefCounted: , p_ids = null # : array , p_usernames = null # : array ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4431,7 +4431,7 @@ class ApiClient extends RefCounted: , p_body : ApiAccountFacebook , p_reset = null # : boolean ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4461,7 +4461,7 @@ class ApiClient extends RefCounted: , p_body : ApiAccountSteam , p_reset = null # : boolean ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4495,7 +4495,7 @@ class ApiClient extends RefCounted: , p_members = null # : integer , p_open = null # : boolean ) -> ApiGroupList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4534,7 +4534,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiCreateGroupRequest ) -> ApiGroup: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4562,7 +4562,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_group_id : String ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4590,7 +4590,7 @@ class ApiClient extends RefCounted: , p_group_id : String , p_body : ApiUpdateGroupRequest ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4619,7 +4619,7 @@ class ApiClient extends RefCounted: , p_group_id : String , p_user_ids = null # : array ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4650,7 +4650,7 @@ class ApiClient extends RefCounted: , p_group_id : String , p_user_ids = null # : array ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4681,7 +4681,7 @@ class ApiClient extends RefCounted: , p_group_id : String , p_user_ids : PackedStringArray ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4711,7 +4711,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_group_id : String ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4739,7 +4739,7 @@ class ApiClient extends RefCounted: , p_group_id : String , p_user_ids = null # : array ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4769,7 +4769,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_group_id : String ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4797,7 +4797,7 @@ class ApiClient extends RefCounted: , p_group_id : String , p_user_ids = null # : array ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4830,7 +4830,7 @@ class ApiClient extends RefCounted: , p_state = null # : integer , p_cursor = null # : string ) -> ApiGroupUserList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4864,7 +4864,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiValidatePurchaseAppleRequest ) -> ApiValidatePurchaseResponse: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4892,7 +4892,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiValidatePurchaseGoogleRequest ) -> ApiValidatePurchaseResponse: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4920,7 +4920,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiValidatePurchaseHuaweiRequest ) -> ApiValidatePurchaseResponse: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4948,7 +4948,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_leaderboard_id : String ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -4979,7 +4979,7 @@ class ApiClient extends RefCounted: , p_cursor = null # : string , p_expiry = null # : string ) -> ApiLeaderboardRecordList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5017,7 +5017,7 @@ class ApiClient extends RefCounted: , p_leaderboard_id : String , p_body : WriteLeaderboardRecordRequestLeaderboardRecordWrite ) -> ApiLeaderboardRecord: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5049,7 +5049,7 @@ class ApiClient extends RefCounted: , p_limit = null # : integer , p_expiry = null # : string ) -> ApiLeaderboardRecordList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5087,7 +5087,7 @@ class ApiClient extends RefCounted: , p_max_size = null # : integer , p_query = null # : string ) -> ApiMatchList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5126,7 +5126,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_ids = null # : array ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5156,7 +5156,7 @@ class ApiClient extends RefCounted: , p_limit = null # : integer , p_cacheable_cursor = null # : string ) -> ApiNotificationList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5244,7 +5244,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiSessionLogoutRequest ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5271,7 +5271,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiReadStorageObjectsRequest ) -> ApiStorageObjects: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5299,7 +5299,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiWriteStorageObjectsRequest ) -> ApiStorageObjectAcks: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5327,7 +5327,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_body : ApiDeleteStorageObjectsRequest ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5357,7 +5357,7 @@ class ApiClient extends RefCounted: , p_limit = null # : integer , p_cursor = null # : string ) -> ApiStorageObjectList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5394,7 +5394,7 @@ class ApiClient extends RefCounted: , p_limit = null # : integer , p_cursor = null # : string ) -> ApiStorageObjectList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5432,7 +5432,7 @@ class ApiClient extends RefCounted: , p_limit = null # : integer , p_cursor = null # : string ) -> ApiTournamentList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5475,7 +5475,7 @@ class ApiClient extends RefCounted: , p_cursor = null # : string , p_expiry = null # : string ) -> ApiTournamentRecordList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5513,7 +5513,7 @@ class ApiClient extends RefCounted: , p_tournament_id : String , p_body : WriteTournamentRecordRequestTournamentRecordWrite ) -> ApiLeaderboardRecord: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5543,7 +5543,7 @@ class ApiClient extends RefCounted: , p_tournament_id : String , p_body : WriteTournamentRecordRequestTournamentRecordWrite ) -> ApiLeaderboardRecord: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5572,7 +5572,7 @@ class ApiClient extends RefCounted: p_session : NakamaSession , p_tournament_id : String ) -> NakamaAsyncResult: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5602,7 +5602,7 @@ class ApiClient extends RefCounted: , p_limit = null # : integer , p_expiry = null # : string ) -> ApiTournamentRecordList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5637,7 +5637,7 @@ class ApiClient extends RefCounted: , p_usernames = null # : array , p_facebook_ids = null # : array ) -> ApiUsers: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): @@ -5676,7 +5676,7 @@ class ApiClient extends RefCounted: , p_state = null # : integer , p_cursor = null # : string ) -> ApiUserGroupList: - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = await should_refresh.complted if session.is_exception(): diff --git a/codegen/main.go b/codegen/main.go index 95b230d..d5eedfd 100644 --- a/codegen/main.go +++ b/codegen/main.go @@ -233,7 +233,7 @@ class ApiClient extends Reference: {{- $classname = $operation.Responses.Ok.Schema.Ref | cleanRef }} {{- end }} {{- if not $operation.Security }} - var should_refresh = _refresh_session(p_session) + var should_refresh = _refresh_session.call(p_session) if should_refresh != null: var session = yield(should_refresh, "completed") if session.is_exception(): From 21f4444c58c3f8212cd9c7a1febb4f464b9993af Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 17:36:27 +0000 Subject: [PATCH 21/33] Switch to var _SCHEMA as dbstrict 2 is not accepting const --- .../com.heroiclabs.nakama/api/NakamaRTAPI.gd | 46 +++++++++--------- .../api/NakamaRTMessage.gd | 48 +++++++++---------- codegen/main.go | 2 +- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd b/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd index 9cd89ba..aa2fa10 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaRTAPI.gd @@ -5,7 +5,7 @@ class_name NakamaRTAPI # A chat channel on the server. class Channel extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "id": {"name": "id", "type": TYPE_STRING, "required": true}, "presences": {"name": "presences", "type": TYPE_ARRAY, "required": false, "content": "UserPresence"}, "self": {"name": "self_presence", "type": "UserPresence", "required": true}, @@ -54,7 +54,7 @@ class Channel extends NakamaAsyncResult: class ChannelMessageAck extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "channel_id": {"name": "channel_id", "type": TYPE_STRING, "required": true}, "code": {"name": "code", "type": TYPE_INT, "required": true}, "create_time": {"name": "create_time", "type": TYPE_STRING, "required": false}, @@ -120,7 +120,7 @@ class ChannelMessageAck extends NakamaAsyncResult: # A batch of join and leave presences on a chat channel. class ChannelPresenceEvent extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "channel_id": {"name": "channel_id", "type": TYPE_STRING, "required": true}, "joins": {"name": "joins", "type": TYPE_ARRAY, "required": false, "content" : "UserPresence"}, "leaves": {"name": "leaves", "type": TYPE_ARRAY, "required": false, "content" : "UserPresence"}, @@ -170,7 +170,7 @@ class ChannelPresenceEvent extends NakamaAsyncResult: # Describes an error which occurred on the server. class Error extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "code": {"name": "code", "type": TYPE_INT, "required": true}, "message": {"name": "message", "type": TYPE_STRING, "required": true}, "context": {"name": "context", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, @@ -222,7 +222,7 @@ class Error extends NakamaAsyncResult: # A multiplayer match. class Match extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "authoritative": {"name": "authoritative", "type": TYPE_BOOL, "required": false}, "match_id": {"name": "match_id", "type": TYPE_STRING, "required": true}, "label": {"name": "label", "type": TYPE_STRING, "required": false}, @@ -265,7 +265,7 @@ class Match extends NakamaAsyncResult: # Some game state update in a match. class MatchData extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "match_id": {"name": "match_id", "type": TYPE_STRING, "required": true}, "presence": {"name": "presence", "type": "UserPresence", "required": false}, "op_code": {"name": "op_code", "type": TYPE_STRING, "required": false}, @@ -304,7 +304,7 @@ class MatchData extends NakamaAsyncResult: # A batch of join and leave presences for a match. class MatchPresenceEvent extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "match_id": {"name": "match_id", "type": TYPE_STRING, "required": true}, "joins": {"name": "joins", "type": TYPE_ARRAY, "required": false, "content" : "UserPresence"}, "leaves": {"name": "leaves", "type": TYPE_ARRAY, "required": false, "content" : "UserPresence"}, @@ -336,7 +336,7 @@ class MatchPresenceEvent extends NakamaAsyncResult: # The result of a successful matchmaker operation sent to the server. class MatchmakerMatched extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "match_id": {"name": "match_id", "type": TYPE_STRING, "required": false}, "ticket": {"name": "ticket", "type": TYPE_STRING, "required": true}, "token": {"name": "token", "type": TYPE_STRING, "required": false}, @@ -379,7 +379,7 @@ class MatchmakerMatched extends NakamaAsyncResult: # The matchmaker ticket received from the server. class MatchmakerTicket extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "ticket": {"name": "ticket", "type": TYPE_STRING, "required": true} } @@ -403,7 +403,7 @@ class MatchmakerTicket extends NakamaAsyncResult: # The user with the parameters they sent to the server when asking for opponents. class MatchmakerUser extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "presence": {"name": "presence", "type": "UserPresence", "required": true}, "party_id": {"name": "party_id", "type": TYPE_STRING, "required": false}, "string_properties": {"name": "string_properties", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, @@ -440,7 +440,7 @@ class MatchmakerUser extends NakamaAsyncResult: # Receive status updates for users. class Status extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "presences": {"name": "presences", "type": TYPE_ARRAY, "required": true, "content": "UserPresence"}, } @@ -463,7 +463,7 @@ class Status extends NakamaAsyncResult: # A status update event about other users who've come online or gone offline. class StatusPresenceEvent extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "joins": {"name": "joins", "type": TYPE_ARRAY, "required": false, "content" : "UserPresence"}, "leaves": {"name": "leaves", "type": TYPE_ARRAY, "required": false, "content" : "UserPresence"}, } @@ -493,7 +493,7 @@ class StatusPresenceEvent extends NakamaAsyncResult: # A realtime socket stream on the server. class Stream extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "mode": {"name": "mode", "type": TYPE_INT, "required": true}, "subject": {"name": "subject", "type": TYPE_STRING, "required": false}, "subcontext": {"name": "subcontext", "type": TYPE_STRING, "required": false}, @@ -530,7 +530,7 @@ class Stream extends NakamaAsyncResult: # Streams are built on to provide abstractions for matches, chat channels, etc. In most cases you'll never need to # interact with the low level stream itself. class StreamPresenceEvent extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "stream": {"name": "stream", "type": "Stream", "required": true}, "joins": {"name": "joins", "type": TYPE_ARRAY, "required": false, "content" : "UserPresence"}, "leaves": {"name": "leaves", "type": TYPE_ARRAY, "required": false, "content" : "UserPresence"}, @@ -559,7 +559,7 @@ class StreamPresenceEvent extends NakamaAsyncResult: # A state change received from a stream. class StreamData extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "stream": {"name": "stream", "type": "Stream", "required": true}, "sender": {"name": "sender", "type": "UserPresence", "required": false}, "data": {"name": "state", "type": TYPE_STRING, "required": false}, @@ -594,7 +594,7 @@ class StreamData extends NakamaAsyncResult: # `{ node_id, user_id, session_id }` is used which is exposed as this object. class UserPresence extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "persistence": {"name": "persistence", "type": TYPE_BOOL, "required": false}, "session_id": {"name": "session_id", "type": TYPE_STRING, "required": true}, "status": {"name": "status", "type": TYPE_STRING, "required": false}, @@ -637,7 +637,7 @@ class UserPresence extends NakamaAsyncResult: class Party extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "open": {"name": "open", "type": TYPE_BOOL, "required": false}, "max_size": {"name": "max_size", "type": TYPE_INT, "required": true}, @@ -684,7 +684,7 @@ class Party extends NakamaAsyncResult: # Presence update for a particular party. class PartyPresenceEvent extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "joins": {"name": "joins", "type": TYPE_ARRAY, "required": false, "content": "UserPresence"}, "leaves": {"name": "leaves", "type": TYPE_ARRAY, "required": false, "content": "UserPresence"}, @@ -715,7 +715,7 @@ class PartyPresenceEvent extends NakamaAsyncResult: # Announcement of a new party leader. class PartyLeader extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "presence": {"name": "presence", "type": "UserPresence", "required": true}, } @@ -743,7 +743,7 @@ class PartyLeader extends NakamaAsyncResult: # Incoming notification for one or more new presences attempting to join the party. class PartyJoinRequest extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "presences": {"name": "presences", "type": TYPE_ARRAY, "required": false, "content": "UserPresence"}, } @@ -771,7 +771,7 @@ class PartyJoinRequest extends NakamaAsyncResult: # A response from starting a new party matchmaking process. class PartyMatchmakerTicket extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "ticket": {"name": "ticket", "type": TYPE_STRING, "required": true}, } @@ -799,7 +799,7 @@ class PartyMatchmakerTicket extends NakamaAsyncResult: # Incoming party data delivered from the server. class PartyData extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "presence": {"name": "presence", "type": "UserPresence", "required": false}, "op_code": {"name": "op_code", "type": TYPE_INT, "required": true}, @@ -832,7 +832,7 @@ class PartyData extends NakamaAsyncResult: # End a party, kicking all party members and closing it. (this is both a message and a result) class PartyClose extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, } # Party ID to close. diff --git a/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd b/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd index bc1666c..472a495 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaRTMessage.gd @@ -4,7 +4,7 @@ class_name NakamaRTMessage # Send a channel join message to the server. class ChannelJoin: - const _SCHEMA = { + var _SCHEMA = { "persistence": {"name": "persistence", "type": TYPE_BOOL, "required": true}, "hidden": {"name": "hidden", "type": TYPE_BOOL, "required": true}, "target": {"name": "target", "type": TYPE_STRING, "required": true}, @@ -44,7 +44,7 @@ class ChannelJoin: # A leave message for a match on the server. class ChannelLeave extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "channel_id": {"name": "channel_id", "type": TYPE_STRING, "required": true} } var channel_id : String @@ -64,7 +64,7 @@ class ChannelLeave extends NakamaAsyncResult: class ChannelMessageRemove extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "channel_id": {"name": "channel_id", "type": TYPE_STRING, "required": true}, "message_id": {"name": "message_id", "type": TYPE_STRING, "required": true} } @@ -89,7 +89,7 @@ class ChannelMessageRemove extends NakamaAsyncResult: # Send a chat message to a channel on the server. class ChannelMessageSend extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "channel_id": {"name": "channel_id", "type": TYPE_STRING, "required": true}, "content": {"name": "content", "type": TYPE_STRING, "required": true} } @@ -113,7 +113,7 @@ class ChannelMessageSend extends NakamaAsyncResult: class ChannelMessageUpdate extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "channel_id": {"name": "channel_id", "type": TYPE_STRING, "required": true}, "message_id": {"name": "message_id", "type": TYPE_STRING, "required": true}, "content": {"name": "content", "type": TYPE_STRING, "required": true} @@ -140,7 +140,7 @@ class ChannelMessageUpdate extends NakamaAsyncResult: # A create message for a match on the server. class MatchCreate extends NakamaAsyncResult: - const _SCHEMA = {} + var _SCHEMA = {} func _init(): pass @@ -158,7 +158,7 @@ class MatchCreate extends NakamaAsyncResult: # A join message for a match on the server. class MatchJoin extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "match_id": {"name": "match_id", "type": TYPE_STRING, "required": false}, "token": {"name": "token", "type": TYPE_STRING, "required": false}, "metadata": {"name": "metadata", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, @@ -185,7 +185,7 @@ class MatchJoin extends NakamaAsyncResult: # A leave message for a match on the server. class MatchLeave extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "match_id": {"name": "match_id", "type": TYPE_STRING, "required": true} } var match_id : String @@ -206,7 +206,7 @@ class MatchLeave extends NakamaAsyncResult: # Send new state to a match on the server. class MatchDataSend extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "match_id": {"name": "match_id", "type": TYPE_STRING, "required": true}, "op_code": {"name": "op_code", "type": TYPE_INT, "required": true}, "presences": {"name": "presences", "type": TYPE_ARRAY, "required": false, "content": "UserPresence"}, @@ -237,7 +237,7 @@ class MatchDataSend extends NakamaAsyncResult: # Add the user to the matchmaker pool with properties. class MatchmakerAdd extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "query": {"name": "query", "type": TYPE_STRING, "required": true}, "max_count": {"name": "max_count", "type": TYPE_INT, "required": true}, "min_count": {"name": "min_count", "type": TYPE_INT, "required": true}, @@ -275,7 +275,7 @@ class MatchmakerAdd extends NakamaAsyncResult: # Remove the user from the matchmaker pool by ticket. class MatchmakerRemove extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "ticket": {"name": "ticket", "type": TYPE_STRING, "required": true} } @@ -297,7 +297,7 @@ class MatchmakerRemove extends NakamaAsyncResult: # Follow one or more other users for status updates. class StatusFollow extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "user_ids": {"name": "user_ids", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, "usernames": {"name": "usernames", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } @@ -322,7 +322,7 @@ class StatusFollow extends NakamaAsyncResult: # Unfollow one or more users on the server. class StatusUnfollow extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "user_ids": {"name": "user_ids", "type": TYPE_DICTIONARY, "required": false, "content": TYPE_STRING}, } @@ -344,7 +344,7 @@ class StatusUnfollow extends NakamaAsyncResult: # Unfollow one or more users on the server. class StatusUpdate extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "status": {"name": "status", "type": TYPE_STRING, "required": true}, } @@ -365,7 +365,7 @@ class StatusUpdate extends NakamaAsyncResult: # Create a party. class PartyCreate extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "open": {"name": "open", "type": TYPE_BOOL, "required": true}, "max_size": {"name": "max_size", "type": TYPE_INT, "required": true}, } @@ -391,7 +391,7 @@ class PartyCreate extends NakamaAsyncResult: # Join a party, or request to join if the party is not open. class PartyJoin extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, } # Party ID to join. @@ -413,7 +413,7 @@ class PartyJoin extends NakamaAsyncResult: # Leave a party. class PartyLeave extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, } # Party ID to leave. @@ -435,7 +435,7 @@ class PartyLeave extends NakamaAsyncResult: # Promote a new party leader. class PartyPromote extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "presence": {"name": "presence", "type": "UserPresence", "required": true}, } @@ -460,7 +460,7 @@ class PartyPromote extends NakamaAsyncResult: # Accept a request to join. class PartyAccept extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "presence": {"name": "presence", "type": "UserPresence", "required": true}, } @@ -485,7 +485,7 @@ class PartyAccept extends NakamaAsyncResult: # Kick a party member, or decline a request to join. class PartyRemove extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "presence": {"name": "presence", "type": "UserPresence", "required": true}, } @@ -510,7 +510,7 @@ class PartyRemove extends NakamaAsyncResult: # Request a list of pending join requests for a party. class PartyJoinRequestList extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, } # Party ID to get a list of join requests for. @@ -532,7 +532,7 @@ class PartyJoinRequestList extends NakamaAsyncResult: # Begin matchmaking as a party. class PartyMatchmakerAdd extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "min_count": {"name": "min_count", "type": TYPE_INT, "required": true}, "max_count": {"name": "max_count", "type": TYPE_INT, "required": true}, @@ -574,7 +574,7 @@ class PartyMatchmakerAdd extends NakamaAsyncResult: # Cancel a party matchmaking process using a ticket. class PartyMatchmakerRemove extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "ticket": {"name": "ticket", "type": TYPE_STRING, "required": true}, } @@ -599,7 +599,7 @@ class PartyMatchmakerRemove extends NakamaAsyncResult: # Send data to a party. class PartyDataSend extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { "party_id": {"name": "party_id", "type": TYPE_STRING, "required": true}, "op_code": {"name": "op_code", "type": TYPE_INT, "required": true}, "data": {"name": "data", "type": TYPE_STRING, "required": false} diff --git a/codegen/main.go b/codegen/main.go index d5eedfd..794268c 100644 --- a/codegen/main.go +++ b/codegen/main.go @@ -59,7 +59,7 @@ enum {{ $classname | title }} { {{- range $idx, $enum := $definition.Enum }}{{ $ # {{ $definition.Description | stripNewlines }} class {{ $classname }} extends NakamaAsyncResult: - const _SCHEMA = { + var _SCHEMA = { {{- range $propname, $property := $definition.Properties }} {{- $fieldname := $propname | pascalToSnake }} {{- $_field := printf "_%s" $fieldname }} From c3c812c1a416c1ce0c06b31731737fb40843ec8f Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 17:45:05 +0000 Subject: [PATCH 22/33] Replace validate json with new json class --- addons/com.heroiclabs.nakama/api/NakamaSession.gd | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/com.heroiclabs.nakama/api/NakamaSession.gd b/addons/com.heroiclabs.nakama/api/NakamaSession.gd index 3a1d0b0..d883ac1 100644 --- a/addons/com.heroiclabs.nakama/api/NakamaSession.gd +++ b/addons/com.heroiclabs.nakama/api/NakamaSession.gd @@ -121,8 +121,12 @@ func _jwt_unpack(p_token : String) -> Dictionary: payload += "=" payload = payload.replace("-", "+").replace("_", "/") var unpacked = Marshalls.base64_to_utf8(payload) - if not validate_json(unpacked): - var decoded = parse_json(unpacked) + + var json = JSON.new() + var error = json.parse(unpacked) + + if error == OK: + var decoded = json.get_data() if typeof(decoded) == TYPE_DICTIONARY: return decoded _ex = NakamaException.new("Unable to unpack token: %s" % p_token) From 53130d9ebc2af59ad5e7bd382f3d291f52779de5 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 17:52:45 +0000 Subject: [PATCH 23/33] * Update properties * Update yields --- .../client/NakamaClient.gd | 107 ++++++++++++------ 1 file changed, 74 insertions(+), 33 deletions(-) diff --git a/addons/com.heroiclabs.nakama/client/NakamaClient.gd b/addons/com.heroiclabs.nakama/client/NakamaClient.gd index cd2b9c8..6c590bc 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaClient.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaClient.gd @@ -12,30 +12,71 @@ func _no_get(): return null # The host address of the server. Defaults to "127.0.0.1". -var host : String setget _no_set - +var host : String: + set(v): + _no_set(_p) + # The port number of the server. Defaults to 7350. -var port : int setget _no_set +var port : int: + set(v): + _no_set(_p) # The protocol scheme used to connect with the server. Must be either "http" or "https". -var scheme : String setget _no_set +var scheme : String: + set(v): + _no_set(_p) # The key used to authenticate with the server without a session. Defaults to "defaultkey". -var server_key : String = "defaultkey" setget _no_set +var server_key : String = "defaultkey": + set(v): + _no_set(_p) # Set the timeout in seconds on requests sent to the server. var timeout : int var logger : NakamaLogger = null -var _api_client : NakamaAPI.ApiClient setget _no_set, _no_get - -var auto_refresh : bool = true setget set_auto_refresh, get_auto_refresh -var auto_refresh_seconds : int = true setget set_auto_refresh_seconds, get_auto_refresh_seconds -var auto_retry : bool = true setget set_auto_retry, get_auto_retry -var auto_retry_count setget set_auto_retry_count, get_auto_retry_count -var auto_retry_backoff_base setget set_auto_retry_backoff_base, get_auto_retry_backoff_base -var last_cancel_token setget _no_set, get_last_cancel_token +var _api_client : NakamaAPI.ApiClient: + set(v): + _no_set(_p) + get: + return _no_get() + +var auto_refresh : bool = true: + set(v): + set_auto_refresh(_p) + get: + return get_auto_refresh() + +var auto_refresh_seconds : int = true: + set(v): + set_auto_refresh_seconds(_p) + get: + return get_auto_refresh_seconds() + +var auto_retry : bool = true: + set(v): + set_auto_retry(_p) + get: + return get_auto_retry() + +var auto_retry_count: + set(v): + set_auto_retry_count(_p) + get: + return get_auto_retry_count() + +var auto_retry_backoff_base: + set(v): + set_auto_retry_backoff_base(_p) + get: + return get_auto_retry_backoff_base() + +var last_cancel_token: + set(v): + _no_set(_p) + get: + return get_last_cancel_token() func get_auto_refresh(): return _api_client.auto_refresh @@ -127,11 +168,11 @@ func add_group_users_async(p_session : NakamaSession, p_group_id : String, p_ids # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_apple_async(p_token : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(yield(_api_client.authenticate_apple_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_apple_async(server_key, "", NakamaAPI.ApiAccountApple.create(NakamaAPI, { "token": p_token, "vars": p_vars - }), p_create, p_username), "completed")) + }), p_create, p_username).completed)) # Authenticate a user with a custom id. # @param p_id - A custom identifier usually obtained from an external authentication service. @@ -140,11 +181,11 @@ func authenticate_apple_async(p_token : String, p_username = null, p_create : bo # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_custom_async(p_id : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(yield(_api_client.authenticate_custom_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_custom_async(server_key, "", NakamaAPI.ApiAccountCustom.create(NakamaAPI, { "id": p_id, "vars": p_vars - }), p_create, p_username), "completed")) + }), p_create, p_username).completed)) # Authenticate a user with a device id. # @param p_id - A device identifier usually obtained from a platform API. @@ -153,11 +194,11 @@ func authenticate_custom_async(p_id : String, p_username = null, p_create : bool # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_device_async(p_id : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(yield(_api_client.authenticate_device_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_device_async(server_key, "", NakamaAPI.ApiAccountDevice.create(NakamaAPI, { "id": p_id, "vars": p_vars - }), p_create, p_username), "completed")) + }), p_create, p_username).completed)) # Authenticate a user with an email and password. # @param p_email - The email address of the user. @@ -167,12 +208,12 @@ func authenticate_device_async(p_id : String, p_username = null, p_create : bool # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_email_async(p_email : String, p_password : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(yield(_api_client.authenticate_email_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_email_async(server_key, "", NakamaAPI.ApiAccountEmail.create(NakamaAPI, { "email": p_email, "password": p_password, "vars": p_vars - }), p_create, p_username), "completed")) + }), p_create, p_username).completed)) # Authenticate a user with a Facebook auth token. # @param p_token - An OAuth access token from the Facebook SDK. @@ -182,11 +223,11 @@ func authenticate_email_async(p_email : String, p_password : String, p_username # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_facebook_async(p_token : String, p_username = null, p_create : bool = true, p_import : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(yield(_api_client.authenticate_facebook_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_facebook_async(server_key, "", NakamaAPI.ApiAccountFacebook.create(NakamaAPI, { "token": p_token, "vars": p_vars - }), p_create, p_username, p_import), "completed")) + }), p_create, p_username, p_import).completed)) # Authenticate a user with a Facebook Instant Game token against the server. # @param p_signed_player_info - Facebook Instant Game signed info from Facebook SDK. @@ -196,11 +237,11 @@ func authenticate_facebook_async(p_token : String, p_username = null, p_create : # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_facebook_instant_game_async(p_signed_player_info : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(yield(_api_client.authenticate_facebook_instant_game_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_facebook_instant_game_async(server_key, "", NakamaAPI.ApiAccountFacebookInstantGame.create(NakamaAPI, { "signed_player_info": p_signed_player_info, "vars": p_vars - }), p_create, p_username), "completed")) + }), p_create, p_username).completed)) # Authenticate a user with Apple Game Center. # @param p_bundle_id - The bundle id of the Game Center application. @@ -215,7 +256,7 @@ func authenticate_facebook_instant_game_async(p_signed_player_info : String, p_u # Returns a task which resolves to a session object. func authenticate_game_center_async(p_bundle_id : String, p_player_id : String, p_public_key_url : String, p_salt : String, p_signature : String, p_timestamp_seconds : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(yield(_api_client.authenticate_game_center_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_game_center_async(server_key, "", NakamaAPI.ApiAccountGameCenter.create(NakamaAPI, { "bundle_id": p_bundle_id, "player_id": p_player_id, @@ -224,7 +265,7 @@ func authenticate_game_center_async(p_bundle_id : String, p_player_id : String, "signature": p_signature, "timestamp_seconds": p_timestamp_seconds, "vars": p_vars - }), p_create, p_username), "completed")) + }), p_create, p_username).completed)) # Authenticate a user with a Google auth token. # @param p_token - An OAuth access token from the Google SDK. @@ -233,11 +274,11 @@ func authenticate_game_center_async(p_bundle_id : String, p_player_id : String, # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_google_async(p_token : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(yield(_api_client.authenticate_google_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_google_async(server_key, "", NakamaAPI.ApiAccountGoogle.create(NakamaAPI, { "token": p_token, "vars": p_vars - }), p_create, p_username), "completed")) + }), p_create, p_username).completed)) # Authenticate a user with a Steam auth token. # @param p_token - An authentication token from the Steam network. @@ -246,11 +287,11 @@ func authenticate_google_async(p_token : String, p_username = null, p_create : b # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_steam_async(p_token : String, p_username = null, p_create : bool = true, p_vars = null, p_sync : bool = false) -> NakamaSession: - return _parse_auth(yield(_api_client.authenticate_steam_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_steam_async(server_key, "", NakamaAPI.ApiAccountSteam.create(NakamaAPI, { "token": p_token, "vars": p_vars - }), p_create, p_username, p_sync), "completed")) + }), p_create, p_username, p_sync).completed)) # Block one or more friends by id or username. # @param p_session - The session of the user. @@ -730,11 +771,11 @@ func session_logout_async(p_session : NakamaSession) -> NakamaAsyncResult: # @param p_vars - Extra information which should be bundled inside the session token. # Returns a task which resolves to a new session object. func session_refresh_async(p_sesison : NakamaSession, p_vars = null) -> NakamaSession: - return _parse_auth(yield(_api_client.session_refresh_async(server_key, "", + return _parse_auth(await (_api_client.session_refresh_async(server_key, "", NakamaAPI.ApiSessionRefreshRequest.create(NakamaAPI, { "token": p_sesison.refresh_token, "vars": p_vars - })), "completed")) + })).completed)) # Remove the Apple ID from the social profiles on the current user's account. # @param p_session - The session of the user. From efe8ffb2767bf3b7ae25134d3703b281acd0b045 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 17:56:14 +0000 Subject: [PATCH 24/33] Replace yields with await --- .../client/NakamaHTTPAdapter.gd | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd index 95eae5c..eb3e11f 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd @@ -60,27 +60,27 @@ class AsyncRequest: id, retry_count - cur_try, time ]) cur_try += 1 - yield(backoff(time), "completed") + await (backoff(time).completed) if cancelled: return - return yield(make_request(), "completed") + return await (make_request().completed) func make_request(): var err = request.request(uri, headers, true, method, body.get_string_from_utf8()) if err != OK: - yield(request.get_tree(), "idle_frame") + await request.get_tree().idle_frame result = HTTPRequest.RESULT_CANT_CONNECT logger.debug("Request %d failed to start, error: %d" % [id, err]) return - var args = yield(request, "request_completed") + var args = await request.request_completed result = args[0] response_code = args[1] response_body = args[3] func backoff(p_time : int): timer = request.get_tree().create_timer(p_time / 1000) - yield(timer, "timeout") + await timer.timeout timer = null func cancel(): @@ -186,7 +186,7 @@ static func _clear_request(p_request : AsyncRequest, p_pending : Dictionary, p_i static func _send_async(p_id : int, p_pending : Dictionary): var req : AsyncRequest = p_pending[p_id] - yield(req.make_request(), "completed") + await (req.make_request().completed) while req.result != HTTPRequest.RESULT_SUCCESS: req.logger.debug("Request %d failed with result: %d, response code: %d" % [ @@ -194,7 +194,7 @@ static func _send_async(p_id : int, p_pending : Dictionary): ]) if not req.should_retry(): break - yield(req.retry(), "completed") + await (req.retry().completed) _clear_request(req, p_pending, p_id) return req.parse_result() From 0cc64e4219b19d4149cd6ea21afceb69f2dbaea8 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 17:59:16 +0000 Subject: [PATCH 25/33] * Replace reference with RefCounted * Update coroutines with a call --- .../client/NakamaHTTPAdapter.gd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd index eb3e11f..cada389 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd @@ -5,7 +5,7 @@ extends Node class_name NakamaHTTPAdapter # The logger to use with the adapter. -var logger : Reference = NakamaLogger.new() +var logger : RefCounted = NakamaLogger.new() # The timeout for requests var timeout : int = 3 @@ -60,10 +60,10 @@ class AsyncRequest: id, retry_count - cur_try, time ]) cur_try += 1 - await (backoff(time).completed) + await backoff.call(time).completed if cancelled: return - return await (make_request().completed) + return await make_request.call().completed func make_request(): var err = request.request(uri, headers, true, method, body.get_string_from_utf8()) @@ -168,7 +168,7 @@ func send_async(p_method : String, p_uri : String, p_headers : Dictionary, p_bod add_child(req) - return _send_async(id, _pending) + return _send_async.call(id, _pending) func get_last_token(): return id @@ -186,7 +186,7 @@ static func _clear_request(p_request : AsyncRequest, p_pending : Dictionary, p_i static func _send_async(p_id : int, p_pending : Dictionary): var req : AsyncRequest = p_pending[p_id] - await (req.make_request().completed) + await req.make_request.call().completed while req.result != HTTPRequest.RESULT_SUCCESS: req.logger.debug("Request %d failed with result: %d, response code: %d" % [ @@ -194,7 +194,7 @@ static func _send_async(p_id : int, p_pending : Dictionary): ]) if not req.should_retry(): break - await (req.retry().completed) + await req.retry.call().completed _clear_request(req, p_pending, p_id) return req.parse_result() From da9ff5355611c839f4b1db163d55410ee09a3345 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 17:59:40 +0000 Subject: [PATCH 26/33] Change const with var, gdscript2 is failing to assign a const --- addons/com.heroiclabs.nakama/client/NakamaClient.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/com.heroiclabs.nakama/client/NakamaClient.gd b/addons/com.heroiclabs.nakama/client/NakamaClient.gd index 6c590bc..89228fd 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaClient.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaClient.gd @@ -3,7 +3,7 @@ extends RefCounted # A client for the API in Nakama server. class_name NakamaClient -const ChannelType = NakamaRTMessage.ChannelJoin.ChannelType +var ChannelType = NakamaRTMessage.ChannelJoin.ChannelType func _no_set(_p): return From 14ad2aace5c961bec873335339eee5383a42e489 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 18:02:34 +0000 Subject: [PATCH 27/33] Swap to using JSON.new --- .../client/NakamaHTTPAdapter.gd | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd index cada389..ebdbd04 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd @@ -97,26 +97,30 @@ class AsyncRequest: elif result != HTTPRequest.RESULT_SUCCESS: return NakamaException.new("HTTPRequest failed!", result) - var json : JSONParseResult = JSON.parse(response_body.get_string_from_utf8()) - if json.error != OK: + var json = JSON.new() + + var error : JSONParseResult = json.parse(response_body.get_string_from_utf8()) + if error != OK: logger.debug("Unable to parse request %d response. JSON error: %d, response code: %d" % [ id, json.error, response_code ]) return NakamaException.new("Failed to decode JSON response", response_code) + var result = json.get_data() + if response_code != HTTPClient.RESPONSE_OK: var error = "" var code = -1 - if typeof(json.result) == TYPE_DICTIONARY: - if "message" in json.result: - error = json.result["message"] - elif "error" in json.result: - error = json.result["error"] + if typeof(result) == TYPE_DICTIONARY: + if "message" in result: + error = result["message"] + elif "error" in result: + error = result["error"] else: - error = str(json.result) - code = json.result["code"] if "code" in json.result else -1 + error = str(result) + code = result["code"] if "code" in result else -1 else: - error = str(json.result) + error = str(result) if typeof(error) == TYPE_DICTIONARY: error = JSON.print(error) logger.debug("Request %d returned response code: %d, RPC code: %d, error: %s" % [ @@ -124,7 +128,7 @@ class AsyncRequest: ]) return NakamaException.new(error, response_code, code) - return json.result + return result # Send a HTTP request. From d669908d73ab541aa0e6a7a21962567521df9365 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 18:04:04 +0000 Subject: [PATCH 28/33] Fix json result no longer existing --- addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd index ebdbd04..e43a7f4 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaHTTPAdapter.gd @@ -99,8 +99,8 @@ class AsyncRequest: var json = JSON.new() - var error : JSONParseResult = json.parse(response_body.get_string_from_utf8()) - if error != OK: + var json_error = json.parse(response_body.get_string_from_utf8()) + if json_error != OK: logger.debug("Unable to parse request %d response. JSON error: %d, response code: %d" % [ id, json.error, response_code ]) From 038cced9ded470edf0a70a81e606675422f6dbef Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 18:13:10 +0000 Subject: [PATCH 29/33] Update properties. Fix wrong param name Update coroutine calls --- .../client/NakamaClient.gd | 174 +++++++++--------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/addons/com.heroiclabs.nakama/client/NakamaClient.gd b/addons/com.heroiclabs.nakama/client/NakamaClient.gd index 89228fd..d8e3353 100644 --- a/addons/com.heroiclabs.nakama/client/NakamaClient.gd +++ b/addons/com.heroiclabs.nakama/client/NakamaClient.gd @@ -14,22 +14,22 @@ func _no_get(): # The host address of the server. Defaults to "127.0.0.1". var host : String: set(v): - _no_set(_p) + _no_set(v) # The port number of the server. Defaults to 7350. var port : int: set(v): - _no_set(_p) + _no_set(v) # The protocol scheme used to connect with the server. Must be either "http" or "https". var scheme : String: set(v): - _no_set(_p) + _no_set(v) # The key used to authenticate with the server without a session. Defaults to "defaultkey". var server_key : String = "defaultkey": set(v): - _no_set(_p) + _no_set(v) # Set the timeout in seconds on requests sent to the server. var timeout : int @@ -38,43 +38,43 @@ var logger : NakamaLogger = null var _api_client : NakamaAPI.ApiClient: set(v): - _no_set(_p) + _no_set(v) get: return _no_get() var auto_refresh : bool = true: set(v): - set_auto_refresh(_p) + set_auto_refresh(v) get: return get_auto_refresh() var auto_refresh_seconds : int = true: set(v): - set_auto_refresh_seconds(_p) + set_auto_refresh_seconds(v) get: return get_auto_refresh_seconds() var auto_retry : bool = true: set(v): - set_auto_retry(_p) + set_auto_retry(v) get: return get_auto_retry() var auto_retry_count: set(v): - set_auto_retry_count(_p) + set_auto_retry_count(v) get: return get_auto_retry_count() var auto_retry_backoff_base: set(v): - set_auto_retry_backoff_base(_p) + set_auto_retry_backoff_base(v) get: return get_auto_retry_backoff_base() var last_cancel_token: set(v): - _no_set(_p) + _no_set(v) get: return get_last_cancel_token() @@ -152,7 +152,7 @@ func _parse_auth(p_session) -> NakamaSession: # @param p_usernames - The usernames of the users to add as friends. # Returns a task which represents the asynchronous operation. func add_friends_async(p_session : NakamaSession, p_ids = null, p_usernames = null) -> NakamaAsyncResult: - return _api_client.add_friends_async(p_session, p_ids, p_usernames) + return _api_client.add_friends_async.call(p_session, p_ids, p_usernames) # Add one or more users to the group. # @param p_session - The session of the user. @@ -160,7 +160,7 @@ func add_friends_async(p_session : NakamaSession, p_ids = null, p_usernames = nu # @param p_ids - The ids of the users to add or invite to the group. # Returns a task which represents the asynchronous operation. func add_group_users_async(p_session : NakamaSession, p_group_id : String, p_ids : PackedStringArray) -> NakamaAsyncResult: - return _api_client.add_group_users_async(p_session, p_group_id, p_ids); + return _api_client.add_group_users_async.call(p_session, p_group_id, p_ids); # Authenticate a user with an Apple ID against the server. # @param p_username - A username used to create the user. @@ -168,7 +168,7 @@ func add_group_users_async(p_session : NakamaSession, p_group_id : String, p_ids # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_apple_async(p_token : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(await (_api_client.authenticate_apple_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_apple_async.call(server_key, "", NakamaAPI.ApiAccountApple.create(NakamaAPI, { "token": p_token, "vars": p_vars @@ -181,7 +181,7 @@ func authenticate_apple_async(p_token : String, p_username = null, p_create : bo # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_custom_async(p_id : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(await (_api_client.authenticate_custom_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_custom_async.call(server_key, "", NakamaAPI.ApiAccountCustom.create(NakamaAPI, { "id": p_id, "vars": p_vars @@ -194,7 +194,7 @@ func authenticate_custom_async(p_id : String, p_username = null, p_create : bool # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_device_async(p_id : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(await (_api_client.authenticate_device_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_device_async.call(server_key, "", NakamaAPI.ApiAccountDevice.create(NakamaAPI, { "id": p_id, "vars": p_vars @@ -208,7 +208,7 @@ func authenticate_device_async(p_id : String, p_username = null, p_create : bool # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_email_async(p_email : String, p_password : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(await (_api_client.authenticate_email_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_email_async.call(server_key, "", NakamaAPI.ApiAccountEmail.create(NakamaAPI, { "email": p_email, "password": p_password, @@ -223,7 +223,7 @@ func authenticate_email_async(p_email : String, p_password : String, p_username # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_facebook_async(p_token : String, p_username = null, p_create : bool = true, p_import : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(await (_api_client.authenticate_facebook_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_facebook_async.call(server_key, "", NakamaAPI.ApiAccountFacebook.create(NakamaAPI, { "token": p_token, "vars": p_vars @@ -237,7 +237,7 @@ func authenticate_facebook_async(p_token : String, p_username = null, p_create : # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_facebook_instant_game_async(p_signed_player_info : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(await (_api_client.authenticate_facebook_instant_game_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_facebook_instant_game_async.call(server_key, "", NakamaAPI.ApiAccountFacebookInstantGame.create(NakamaAPI, { "signed_player_info": p_signed_player_info, "vars": p_vars @@ -256,7 +256,7 @@ func authenticate_facebook_instant_game_async(p_signed_player_info : String, p_u # Returns a task which resolves to a session object. func authenticate_game_center_async(p_bundle_id : String, p_player_id : String, p_public_key_url : String, p_salt : String, p_signature : String, p_timestamp_seconds : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(await (_api_client.authenticate_game_center_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_game_center_async.call(server_key, "", NakamaAPI.ApiAccountGameCenter.create(NakamaAPI, { "bundle_id": p_bundle_id, "player_id": p_player_id, @@ -274,7 +274,7 @@ func authenticate_game_center_async(p_bundle_id : String, p_player_id : String, # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_google_async(p_token : String, p_username = null, p_create : bool = true, p_vars = null) -> NakamaSession: - return _parse_auth(await (_api_client.authenticate_google_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_google_async.call(server_key, "", NakamaAPI.ApiAccountGoogle.create(NakamaAPI, { "token": p_token, "vars": p_vars @@ -287,7 +287,7 @@ func authenticate_google_async(p_token : String, p_username = null, p_create : b # @param p_vars - Extra information that will be bundled in the session token. # Returns a task which resolves to a session object. func authenticate_steam_async(p_token : String, p_username = null, p_create : bool = true, p_vars = null, p_sync : bool = false) -> NakamaSession: - return _parse_auth(await (_api_client.authenticate_steam_async(server_key, "", + return _parse_auth(await (_api_client.authenticate_steam_async.call(server_key, "", NakamaAPI.ApiAccountSteam.create(NakamaAPI, { "token": p_token, "vars": p_vars @@ -299,7 +299,7 @@ func authenticate_steam_async(p_token : String, p_username = null, p_create : bo # @param p_usernames - The usernames of the users to block. # Returns a task which represents the asynchronous operation. func block_friends_async(p_session : NakamaSession, p_ids : PackedStringArray, p_usernames = null) -> NakamaAsyncResult: - return _api_client.block_friends_async(p_session, p_ids, p_usernames); + return _api_client.block_friends_async.call(p_session, p_ids, p_usernames); # Create a group. # @param p_session - The session of the user. @@ -312,7 +312,7 @@ func block_friends_async(p_session : NakamaSession, p_ids : PackedStringArray, p # Returns a task which resolves to a new group object. func create_group_async(p_session : NakamaSession, p_name : String, p_description : String = "", p_avatar_url = null, p_lang_tag = null, p_open : bool = true, p_max_count : int = 100): # -> NakamaAPI.ApiGroup: - return _api_client.create_group_async(p_session, + return _api_client.create_group_async.call(p_session, NakamaAPI.ApiCreateGroupRequest.create(NakamaAPI, { "avatar_url": p_avatar_url, "description": p_description, @@ -328,28 +328,28 @@ func create_group_async(p_session : NakamaSession, p_name : String, p_descriptio # @param p_usernames - The usernames to remove as friends. # Returns a task which represents the asynchronous operation. func delete_friends_async(p_session : NakamaSession, p_ids : PackedStringArray, p_usernames = null) -> NakamaAsyncResult: - return _api_client.delete_friends_async(p_session, p_ids, p_usernames) + return _api_client.delete_friends_async.call(p_session, p_ids, p_usernames) # Delete a group by id. # @param p_session - The session of the user. # @param p_group_id - The group id to to remove. # Returns a task which represents the asynchronous operation. func delete_group_async(p_session : NakamaSession, p_group_id : String) -> NakamaAsyncResult: - return _api_client.delete_group_async(p_session, p_group_id) + return _api_client.delete_group_async.call(p_session, p_group_id) # Delete a leaderboard record. # @param p_session - The session of the user. # @param p_leaderboard_id - The id of the leaderboard with the record to be deleted. # Returns a task which represents the asynchronous operation. func delete_leaderboard_record_async(p_session : NakamaSession, p_leaderboard_id : String) -> NakamaAsyncResult: - return _api_client.delete_leaderboard_record_async(p_session, p_leaderboard_id) + return _api_client.delete_leaderboard_record_async.call(p_session, p_leaderboard_id) # Delete one or more notifications by id. # @param p_session - The session of the user. # @param p_ids - The notification ids to remove. # Returns a task which represents the asynchronous operation. func delete_notifications_async(p_session : NakamaSession, p_ids : PackedStringArray) -> NakamaAsyncResult: - return _api_client.delete_notifications_async(p_session, p_ids) + return _api_client.delete_notifications_async.call(p_session, p_ids) # Delete one or more storage objects. # @param p_session - The session of the user. @@ -362,7 +362,7 @@ func delete_storage_objects_async(p_session : NakamaSession, p_ids : Array) -> N continue # TODO Exceptions var obj_id : NakamaStorageObjectId = id ids.append(obj_id.as_delete().serialize()) - return _api_client.delete_storage_objects_async(p_session, + return _api_client.delete_storage_objects_async.call(p_session, NakamaAPI.ApiDeleteStorageObjectsRequest.create(NakamaAPI, { "object_ids": ids })) @@ -373,13 +373,13 @@ func delete_storage_objects_async(p_session : NakamaSession, p_ids : Array) -> N # @param p_ids - The IDs of the users to demote. # Returns a task which represents the asynchronous operation. func demote_group_users_async(p_session : NakamaSession, p_group_id : String, p_user_ids : Array): - return _api_client.demote_group_users_async(p_session, p_group_id, p_user_ids) + return _api_client.demote_group_users_async.call(p_session, p_group_id, p_user_ids) # Fetch the user account owned by the session. # @param p_session - The session of the user. # Returns a task which resolves to the account object. func get_account_async(p_session : NakamaSession): # -> NakamaAPI.ApiAccount: - return _api_client.get_account_async(p_session) + return _api_client.get_account_async.call(p_session) # Fetch one or more users by id, usernames, and Facebook ids. # @param p_session - The session of the user. @@ -388,7 +388,7 @@ func get_account_async(p_session : NakamaSession): # -> NakamaAPI.ApiAccount: # @param p_facebook_ids - The facebook IDs of the users to retrieve. # Returns a task which resolves to a collection of user objects. func get_users_async(p_session : NakamaSession, p_ids : PackedStringArray, p_usernames = null, p_facebook_ids = null): # -> NakamaAPI.ApiUsers: - return _api_client.get_users_async(p_session, p_ids, p_usernames, p_facebook_ids) + return _api_client.get_users_async.call(p_session, p_ids, p_usernames, p_facebook_ids) # Import Facebook friends and add them to the user's account. # The server will import friends when the user authenticates with Facebook. This function can be used to be @@ -398,7 +398,7 @@ func get_users_async(p_session : NakamaSession, p_ids : PackedStringArray, p_use # @param p_reset - If the Facebook friend import for the user should be reset. # Returns a task which represents the asynchronous operation. func import_facebook_friends_async(p_session : NakamaSession, p_token : String, p_reset = null) -> NakamaAsyncResult: - return _api_client.import_facebook_friends_async(p_session, + return _api_client.import_facebook_friends_async.call(p_session, NakamaAPI.ApiAccountFacebook.create(NakamaAPI, { "token": p_token }), p_reset) @@ -411,7 +411,7 @@ func import_facebook_friends_async(p_session : NakamaSession, p_token : String, # @param p_reset - If the Steam friend import for the user should be reset. # Returns a task which represents the asynchronous operation. func import_steam_friends_async(p_session : NakamaSession, p_token : String, p_reset = null): - return _api_client.import_steam_friends_async(p_session, + return _api_client.import_steam_friends_async.call(p_session, NakamaAPI.ApiAccountSteam.create(NakamaAPI, { "token": p_token }), p_reset) @@ -421,14 +421,14 @@ func import_steam_friends_async(p_session : NakamaSession, p_token : String, p_r # @param p_group_id - The ID of the group to join. # Returns a task which represents the asynchronous operation. func join_group_async(p_session : NakamaSession, p_group_id : String) -> NakamaAsyncResult: - return _api_client.join_group_async(p_session, p_group_id) + return _api_client.join_group_async.call(p_session, p_group_id) # Join a tournament by ID. # @param p_session - The session of the user. # @param p_tournament_id - The ID of the tournament to join. # Returns a task which represents the asynchronous operation. func join_tournament_async(p_session : NakamaSession, p_tournament_id : String) -> NakamaAsyncResult: - return _api_client.join_tournament_async(p_session, p_tournament_id) + return _api_client.join_tournament_async.call(p_session, p_tournament_id) # Kick one or more users from the group. # @param p_session - The session of the user. @@ -436,21 +436,21 @@ func join_tournament_async(p_session : NakamaSession, p_tournament_id : String) # @param p_ids - The IDs of the users to kick. # Returns a task which represents the asynchronous operation. func kick_group_users_async(p_session : NakamaSession, p_group_id : String, p_ids : PackedStringArray) -> NakamaAsyncResult: - return _api_client.kick_group_users_async(p_session, p_group_id, p_ids) + return _api_client.kick_group_users_async.call(p_session, p_group_id, p_ids) # Leave a group by ID. # @param p_session - The session of the user. # @param p_group_id - The ID of the group to leave. # Returns a task which represents the asynchronous operation. func leave_group_async(p_session : NakamaSession, p_group_id : String) -> NakamaAsyncResult: - return _api_client.leave_group_async(p_session, p_group_id) + return _api_client.leave_group_async.call(p_session, p_group_id) # Link an Apple ID to the social profiles on the current user's account. # @param p_session - The session of the user. # @param p_token - The ID token received from Apple to validate. # Returns a task which represents the asynchronous operation. func link_apple_async(p_session : NakamaSession, p_token : String) -> NakamaAsyncResult: - return _api_client.link_apple_async(p_session, NakamaAPI.ApiAccountApple.create(NakamaAPI, { + return _api_client.link_apple_async.call(p_session, NakamaAPI.ApiAccountApple.create(NakamaAPI, { "token": p_token })) @@ -459,7 +459,7 @@ func link_apple_async(p_session : NakamaSession, p_token : String) -> NakamaAsyn # @param p_id - A custom identifier usually obtained from an external authentication service. # Returns a task which represents the asynchronous operation. func link_custom_async(p_session : NakamaSession, p_id : String) -> NakamaAsyncResult: - return _api_client.link_custom_async(p_session, NakamaAPI.ApiAccountCustom.create(NakamaAPI, { + return _api_client.link_custom_async.call(p_session, NakamaAPI.ApiAccountCustom.create(NakamaAPI, { "id": p_id })) @@ -468,7 +468,7 @@ func link_custom_async(p_session : NakamaSession, p_id : String) -> NakamaAsyncR # @param p_id - A device identifier usually obtained from a platform API. # Returns a task which represents the asynchronous operation. func link_device_async(p_session : NakamaSession, p_id : String) -> NakamaAsyncResult: - return _api_client.link_device_async(p_session, NakamaAPI.ApiAccountDevice.create(NakamaAPI, { + return _api_client.link_device_async.call(p_session, NakamaAPI.ApiAccountDevice.create(NakamaAPI, { "id": p_id })) @@ -478,7 +478,7 @@ func link_device_async(p_session : NakamaSession, p_id : String) -> NakamaAsyncR # @param p_password - The password for the user. # Returns a task which represents the asynchronous operation. func link_email_async(p_session : NakamaSession, p_email : String, p_password : String) -> NakamaAsyncResult: - return _api_client.link_email_async(p_session, NakamaAPI.ApiAccountEmail.create(NakamaAPI, { + return _api_client.link_email_async.call(p_session, NakamaAPI.ApiAccountEmail.create(NakamaAPI, { "email": p_email, "password": p_password })) @@ -489,7 +489,7 @@ func link_email_async(p_session : NakamaSession, p_email : String, p_password : # @param p_import - If the Facebook friends should be imported. # Returns a task which represents the asynchronous operation. func link_facebook_async(p_session : NakamaSession, p_token : String) -> NakamaAsyncResult: - return _api_client.link_facebook_async(p_session, NakamaAPI.ApiAccountFacebook.create(NakamaAPI, { + return _api_client.link_facebook_async.call(p_session, NakamaAPI.ApiAccountFacebook.create(NakamaAPI, { "token": p_token })) @@ -499,7 +499,7 @@ func link_facebook_async(p_session : NakamaSession, p_token : String) -> NakamaA # @param p_import - If the Facebook friends should be imported. # Returns a task which represents the asynchronous operation. func link_facebook_instant_game_async(p_session : NakamaSession, p_signed_player_info : String) -> NakamaAsyncResult: - return _api_client.link_facebook_instant_game_async( + return _api_client.link_facebook_instant_game_async.call( p_session, NakamaAPI.ApiAccountFacebookInstantGame.create( NakamaAPI, { @@ -518,7 +518,7 @@ func link_facebook_instant_game_async(p_session : NakamaSession, p_signed_player # Returns a task which represents the asynchronous operation. func link_game_center_async(p_session : NakamaSession, p_bundle_id : String, p_player_id : String, p_public_key_url : String, p_salt : String, p_signature : String, p_timestamp_seconds) -> NakamaAsyncResult: - return _api_client.link_game_center_async(p_session, + return _api_client.link_game_center_async.call(p_session, NakamaAPI.ApiAccountGameCenter.create(NakamaAPI, { "bundle_id": p_bundle_id, "player_id": p_player_id, @@ -533,7 +533,7 @@ func link_game_center_async(p_session : NakamaSession, # @param p_token - An OAuth access token from the Google SDK. # Returns a task which represents the asynchronous operation. func link_google_async(p_session : NakamaSession, p_token : String) -> NakamaAsyncResult: - return _api_client.link_google_async(p_session, NakamaAPI.ApiAccountGoogle.create(NakamaAPI, { + return _api_client.link_google_async.call(p_session, NakamaAPI.ApiAccountGoogle.create(NakamaAPI, { "token": p_token })) @@ -542,7 +542,7 @@ func link_google_async(p_session : NakamaSession, p_token : String) -> NakamaAsy # @param p_token - An authentication token from the Steam network. # Returns a task which represents the asynchronous operation. func link_steam_async(p_session : NakamaSession, p_token : String, p_sync : bool = false) -> NakamaAsyncResult: - return _api_client.link_steam_async(p_session, NakamaAPI.ApiLinkSteamRequest.create( + return _api_client.link_steam_async.call(p_session, NakamaAPI.ApiLinkSteamRequest.create( NakamaAPI, { "account": NakamaAPI.ApiAccountSteam.create(NakamaAPI, { @@ -562,7 +562,7 @@ func link_steam_async(p_session : NakamaSession, p_token : String, p_sync : bool # Returns a task which resolves to the channel message list object. func list_channel_messages_async(p_session : NakamaSession, p_channel_id : String, limit : int = 1, forward : bool = true, cursor = null): # -> NakamaAPI.ApiChannelMessageList: - return _api_client.list_channel_messages_async(p_session, p_channel_id, limit, forward, cursor) + return _api_client.list_channel_messages_async.call(p_session, p_channel_id, limit, forward, cursor) # List of friends of the current user. # @param p_session - The session of the user. @@ -571,7 +571,7 @@ func list_channel_messages_async(p_session : NakamaSession, p_channel_id : Strin # @param p_cursor - A cursor for the current position in the friends list. # Returns a task which resolves to the friend objects. func list_friends_async(p_session : NakamaSession, p_state = null, p_limit = null, p_cursor = null): # -> NakamaAPI.ApiFriendList: - return _api_client.list_friends_async(p_session, p_limit, p_state, p_cursor) + return _api_client.list_friends_async.call(p_session, p_limit, p_state, p_cursor) # List all users part of the group. # @param p_session - The session of the user. @@ -581,7 +581,7 @@ func list_friends_async(p_session : NakamaSession, p_state = null, p_limit = nul # @param p_cursor - A cursor for the current position in the group listing. # Returns a task which resolves to the group user objects. func list_group_users_async(p_session : NakamaSession, p_group_id : String, p_state = null, p_limit = null, p_cursor = null): # -> NakamaAPI.ApiGroupUserList: - return _api_client.list_group_users_async(p_session, p_group_id, p_limit, p_state, p_cursor) + return _api_client.list_group_users_async.call(p_session, p_group_id, p_limit, p_state, p_cursor) # List groups on the server. # @param p_session - The session of the user. @@ -593,7 +593,7 @@ func list_group_users_async(p_session : NakamaSession, p_group_id : String, p_st # @param p_open - Optional open/closed filter. # Returns a task to resolve group objects. func list_groups_async(p_session : NakamaSession, p_name = null, p_limit : int = 10, p_cursor = null, p_lang_tag = null, p_members = null, p_open = null): # -> NakamaAPI.ApiGroupList: - return _api_client.list_groups_async(p_session, p_name, p_cursor, p_limit, p_lang_tag, p_members, p_open) + return _api_client.list_groups_async.call(p_session, p_name, p_cursor, p_limit, p_lang_tag, p_members, p_open) # List records from a leaderboard. # @param p_session - The session of the user. @@ -605,7 +605,7 @@ func list_groups_async(p_session : NakamaSession, p_name = null, p_limit : int = # Returns a task which resolves to the leaderboard record objects. func list_leaderboard_records_async(p_session : NakamaSession, p_leaderboard_id : String, p_owner_ids = null, p_expiry = null, p_limit : int = 10, p_cursor = null): # -> NakamaAPI.ApiLeaderboardRecordList: - return _api_client.list_leaderboard_records_async(p_session, + return _api_client.list_leaderboard_records_async.call(p_session, p_leaderboard_id, p_owner_ids, p_limit, p_cursor, p_expiry) # List leaderboard records that belong to a user. @@ -617,7 +617,7 @@ func list_leaderboard_records_async(p_session : NakamaSession, # Returns a task which resolves to the leaderboard record objects. func list_leaderboard_records_around_owner_async(p_session : NakamaSession, p_leaderboar_id : String, p_owner_id : String, p_expiry = null, p_limit : int = 10): # -> NakamaAPI.ApiLeaderboardRecordList: - return _api_client.list_leaderboard_records_around_owner_async(p_session, + return _api_client.list_leaderboard_records_around_owner_async.call(p_session, p_leaderboar_id, p_owner_id, p_limit, p_expiry) # Fetch a list of matches active on the server. @@ -631,7 +631,7 @@ func list_leaderboard_records_around_owner_async(p_session : NakamaSession, # Returns a task which resolves to the match list object. func list_matches_async(p_session : NakamaSession, p_min : int, p_max : int, p_limit : int, p_authoritative : bool, p_label : String, p_query : String): # -> NakamaAPI.ApiMatchList: - return _api_client.list_matches_async(p_session, p_limit, p_authoritative, p_label if p_label else null, p_min, p_max, p_query if p_query else null) + return _api_client.list_matches_async.call(p_session, p_limit, p_authoritative, p_label if p_label else null, p_min, p_max, p_query if p_query else null) # List notifications for the user with an optional cursor. # @param p_session - The session of the user. @@ -639,7 +639,7 @@ func list_matches_async(p_session : NakamaSession, p_min : int, p_max : int, p_l # @param p_cacheable_cursor - A cursor for the current position in notifications to list. # Returns a task to resolve notifications objects. func list_notifications_async(p_session : NakamaSession, p_limit : int = 10, p_cacheable_cursor = null): # -> NakamaAPI.ApiNotificationList: - return _api_client.list_notifications_async(p_session, p_limit, p_cacheable_cursor) + return _api_client.list_notifications_async.call(p_session, p_limit, p_cacheable_cursor) # List storage objects in a collection which have public read access. # @param p_session - The session of the user. @@ -650,7 +650,7 @@ func list_notifications_async(p_session : NakamaSession, p_limit : int = 10, p_c # Returns a task which resolves to the storage object list. func list_storage_objects_async(p_session : NakamaSession, p_collection : String, p_user_id : String = "", p_limit : int = 10, p_cursor = null): # -> NakamaAPI.ApiStorageObjectList: # List tournament records around the owner. - return _api_client.list_storage_objects_async(p_session, p_collection, p_user_id, p_limit, p_cursor) + return _api_client.list_storage_objects_async.call(p_session, p_collection, p_user_id, p_limit, p_cursor) # List tournament records around the owner. # @param p_session - The session of the user. @@ -661,7 +661,7 @@ func list_storage_objects_async(p_session : NakamaSession, p_collection : String # Returns a task which resolves to the tournament record list object. func list_tournament_records_around_owner_async(p_session : NakamaSession, p_tournament_id : String, p_owner_id : String, p_limit : int = 10, p_expiry = null): # -> NakamaAPI.ApiTournamentRecordList: - return _api_client.list_tournament_records_around_owner_async(p_session, p_tournament_id, p_owner_id, p_limit, p_expiry) + return _api_client.list_tournament_records_around_owner_async.call(p_session, p_tournament_id, p_owner_id, p_limit, p_expiry) # List records from a tournament. # @param p_session - The session of the user. @@ -673,7 +673,7 @@ func list_tournament_records_around_owner_async(p_session : NakamaSession, # Returns a task which resolves to the list of tournament records. func list_tournament_records_async(p_session : NakamaSession, p_tournament_id : String, p_owner_ids = null, p_limit : int = 10, p_cursor = null, p_expiry = null): # -> NakamaAPI.ApiTournamentRecordList: - return _api_client.list_tournament_records_async(p_session, p_tournament_id, p_owner_ids, p_limit, p_cursor, p_expiry) + return _api_client.list_tournament_records_async.call(p_session, p_tournament_id, p_owner_ids, p_limit, p_cursor, p_expiry) # List current or upcoming tournaments. # @param p_session - The session of the user. @@ -686,7 +686,7 @@ func list_tournament_records_async(p_session : NakamaSession, p_tournament_id : # Returns a task which resolves to the list of tournament objects. func list_tournaments_async(p_session : NakamaSession, p_category_start : int, p_category_end : int, p_start_time : int, p_end_time : int, p_limit : int = 10, p_cursor = null): # -> NakamaAPI.ApiTournamentList: - return _api_client.list_tournaments_async(p_session, + return _api_client.list_tournaments_async.call(p_session, p_category_start, p_category_end, p_start_time, p_end_time, p_limit, p_cursor) # List of groups the current user is a member of. @@ -697,7 +697,7 @@ func list_tournaments_async(p_session : NakamaSession, p_category_start : int, p # @param p_cursor - A cursor for the current position in the listing. # Returns a task which resolves to the group list object. func list_user_groups_async(p_session : NakamaSession, p_user_id : String, p_state = null, p_limit = null, p_cursor = null): # -> NakamaAPI.ApiUserGroupList: - return _api_client.list_user_groups_async(p_session, p_user_id, p_limit, p_state, p_cursor) + return _api_client.list_user_groups_async.call(p_session, p_user_id, p_limit, p_state, p_cursor) # List storage objects in a collection which belong to a specific user and have public read access. # @param p_session - The session of the user. @@ -708,7 +708,7 @@ func list_user_groups_async(p_session : NakamaSession, p_user_id : String, p_sta # Returns a task which resolves to the storage object list. func list_users_storage_objects_async(p_session : NakamaSession, p_collection : String, p_user_id : String, p_limit : int, p_cursor : String): # -> NakamaAPI.ApiStorageObjectList: - return _api_client.list_storage_objects2_async(p_session, p_collection, p_user_id, p_limit, p_cursor) + return _api_client.list_storage_objects2_async.call(p_session, p_collection, p_user_id, p_limit, p_cursor) # Promote one or more users in the group. # @param p_session - The session of the user. @@ -716,7 +716,7 @@ func list_users_storage_objects_async(p_session : NakamaSession, # @param p_ids - The IDs of the users to promote. # Returns a task which represents the asynchronous operation. func promote_group_users_async(p_session : NakamaSession, p_group_id : String, p_ids : PackedStringArray) -> NakamaAsyncResult: - return _api_client.promote_group_users_async(p_session, p_group_id, p_ids) + return _api_client.promote_group_users_async.call(p_session, p_group_id, p_ids) # Read one or more objects from the storage engine. # @param p_session - The session of the user. @@ -729,7 +729,7 @@ func read_storage_objects_async(p_session : NakamaSession, p_ids : Array): # -> continue # TODO Exceptions var obj_id : NakamaStorageObjectId = id ids.append(obj_id.as_read().serialize()) - return _api_client.read_storage_objects_async(p_session, + return _api_client.read_storage_objects_async.call(p_session, NakamaAPI.ApiReadStorageObjectsRequest.create(NakamaAPI, { "object_ids": ids })) @@ -741,8 +741,8 @@ func read_storage_objects_async(p_session : NakamaSession, p_ids : Array): # -> # Returns a task which resolves to the RPC response. func rpc_async(p_session : NakamaSession, p_id : String, p_payload = null): # -> NakamaAPI.ApiRpc: if p_payload == null: - return _api_client.rpc_func2_async(p_session.token, p_id) - return _api_client.rpc_func_async(p_session.token, p_id, p_payload) + return _api_client.rpc_func2_async.call(p_session.token, p_id) + return _api_client.rpc_func_async.call(p_session.token, p_id, p_payload) # Execute a function on the server without a session. # This function is usually used with server side code. DO NOT USE client side. @@ -752,14 +752,14 @@ func rpc_async(p_session : NakamaSession, p_id : String, p_payload = null): # -> # Returns a task to resolve an RPC response. func rpc_async_with_key(p_http_key : String, p_id : String, p_payload = null): # -> NakamaAPI.ApiRpc: if p_payload == null: - return _api_client.rpc_func2_async("", p_id, null, p_http_key) - return _api_client.rpc_func_async("", p_id, p_payload, p_http_key) + return _api_client.rpc_func2_async.call("", p_id, null, p_http_key) + return _api_client.rpc_func_async.call("", p_id, p_payload, p_http_key) # Log out a session which optionally invalidates the authorization and/or refresh tokens. # @param p_session - The session of the user. # Returns a task which represents the asynchronous operation. func session_logout_async(p_session : NakamaSession) -> NakamaAsyncResult: - return _api_client.session_logout_async(p_session, + return _api_client.session_logout_async.call(p_session, NakamaAPI.ApiSessionLogoutRequest.create(NakamaAPI, { "refresh_token": p_session.refresh_token, "token": p_session.token @@ -771,7 +771,7 @@ func session_logout_async(p_session : NakamaSession) -> NakamaAsyncResult: # @param p_vars - Extra information which should be bundled inside the session token. # Returns a task which resolves to a new session object. func session_refresh_async(p_sesison : NakamaSession, p_vars = null) -> NakamaSession: - return _parse_auth(await (_api_client.session_refresh_async(server_key, "", + return _parse_auth(await (_api_client.session_refresh_async.call(server_key, "", NakamaAPI.ApiSessionRefreshRequest.create(NakamaAPI, { "token": p_sesison.refresh_token, "vars": p_vars @@ -782,7 +782,7 @@ func session_refresh_async(p_sesison : NakamaSession, p_vars = null) -> NakamaSe # @param p_token - The ID token received from Apple. # Returns a task which represents the asynchronous operation. func unlink_apple_async(p_session : NakamaSession, p_token : String) -> NakamaAsyncResult: - return _api_client.unlink_apple_async(p_session, NakamaAPI.ApiAccountApple.create(NakamaAPI, { + return _api_client.unlink_apple_async.call(p_session, NakamaAPI.ApiAccountApple.create(NakamaAPI, { "token": p_token })) @@ -791,7 +791,7 @@ func unlink_apple_async(p_session : NakamaSession, p_token : String) -> NakamaAs # @param p_id - A custom identifier usually obtained from an external authentication service. # Returns a task which represents the asynchronous operation. func unlink_custom_async(p_session : NakamaSession, p_id : String) -> NakamaAsyncResult: - return _api_client.unlink_custom_async(p_session, NakamaAPI.ApiAccountCustom.create(NakamaAPI, { + return _api_client.unlink_custom_async.call(p_session, NakamaAPI.ApiAccountCustom.create(NakamaAPI, { "id": p_id })) @@ -800,7 +800,7 @@ func unlink_custom_async(p_session : NakamaSession, p_id : String) -> NakamaAsyn # @param p_id - A device identifier usually obtained from a platform API. # Returns a task which represents the asynchronous operation. func unlink_device_async(p_session : NakamaSession, p_id : String) -> NakamaAsyncResult: - return _api_client.unlink_device_async(p_session, NakamaAPI.ApiAccountDevice.create(NakamaAPI, { + return _api_client.unlink_device_async.call(p_session, NakamaAPI.ApiAccountDevice.create(NakamaAPI, { "id": p_id })) @@ -810,7 +810,7 @@ func unlink_device_async(p_session : NakamaSession, p_id : String) -> NakamaAsyn # @param p_password - The password for the user. # Returns a task which represents the asynchronous operation. func unlink_email_async(p_session : NakamaSession, p_email : String, p_password : String) -> NakamaAsyncResult: - return _api_client.unlink_email_async(p_session, NakamaAPI.ApiAccountEmail.create(NakamaAPI, { + return _api_client.unlink_email_async.call(p_session, NakamaAPI.ApiAccountEmail.create(NakamaAPI, { "email": p_email, "password": p_password })) @@ -820,7 +820,7 @@ func unlink_email_async(p_session : NakamaSession, p_email : String, p_password # @param p_token - An OAuth access token from the Facebook SDK. # Returns a task which represents the asynchronous operation. func unlink_facebook_async(p_session : NakamaSession, p_token : String) -> NakamaAsyncResult: - return _api_client.unlink_facebook_async(p_session, NakamaAPI.ApiAccountFacebook.create(NakamaAPI, { + return _api_client.unlink_facebook_async.call(p_session, NakamaAPI.ApiAccountFacebook.create(NakamaAPI, { "token": p_token })) @@ -829,7 +829,7 @@ func unlink_facebook_async(p_session : NakamaSession, p_token : String) -> Nakam # @param p_token - An OAuth access token from the Facebook SDK. # Returns a task which represents the asynchronous operation. func unlink_facebook_instant_game_async(p_session : NakamaSession, p_signed_player_info : String) -> NakamaAsyncResult: - return _api_client.unlink_facebook_instant_game_async( + return _api_client.unlink_facebook_instant_game_async.call( p_session, NakamaAPI.ApiAccountFacebookInstantGame.create(NakamaAPI, { "signed_player_info": p_signed_player_info @@ -847,7 +847,7 @@ func unlink_facebook_instant_game_async(p_session : NakamaSession, p_signed_play # Returns a task which represents the asynchronous operation. func unlink_game_center_async(p_session : NakamaSession, p_bundle_id : String, p_player_id : String, p_public_key_url : String, p_salt : String, p_signature : String, p_timestamp_seconds) -> NakamaAsyncResult: - return _api_client.unlink_game_center_async(p_session, + return _api_client.unlink_game_center_async.call(p_session, NakamaAPI.ApiAccountGameCenter.create(NakamaAPI, { "bundle_id": p_bundle_id, "player_id": p_player_id, @@ -862,7 +862,7 @@ func unlink_game_center_async(p_session : NakamaSession, # @param p_token - An OAuth access token from the Google SDK. # Returns a task which represents the asynchronous operation. func unlink_google_async(p_session : NakamaSession, p_token : String) -> NakamaAsyncResult: - return _api_client.unlink_google_async(p_session, NakamaAPI.ApiAccountGoogle.create(NakamaAPI, { + return _api_client.unlink_google_async.call(p_session, NakamaAPI.ApiAccountGoogle.create(NakamaAPI, { "token": p_token })) @@ -871,7 +871,7 @@ func unlink_google_async(p_session : NakamaSession, p_token : String) -> NakamaA # @param p_token - An authentication token from the Steam network. # Returns a task which represents the asynchronous operation. func unlink_steam_async(p_session : NakamaSession, p_token : String) -> NakamaAsyncResult: - return _api_client.unlink_steam_async(p_session, NakamaAPI.ApiAccountSteam.create(NakamaAPI, { + return _api_client.unlink_steam_async.call(p_session, NakamaAPI.ApiAccountSteam.create(NakamaAPI, { "token": p_token })) @@ -886,7 +886,7 @@ func unlink_steam_async(p_session : NakamaSession, p_token : String) -> NakamaAs # Returns a task which represents the asynchronous operation. func update_account_async(p_session : NakamaSession, p_username = null, p_display_name = null, p_avatar_url = null, p_lang_tag = null, p_location = null, p_timezone = null) -> NakamaAsyncResult: - return _api_client.update_account_async(p_session, + return _api_client.update_account_async.call(p_session, NakamaAPI.ApiUpdateAccountRequest.create(NakamaAPI, { "avatar_url": p_avatar_url, "display_name": p_display_name, @@ -908,7 +908,7 @@ func update_account_async(p_session : NakamaSession, p_username = null, p_displa # Returns a task which represents the asynchronous operation. func update_group_async(p_session : NakamaSession, p_group_id : String, p_name = null, p_description = null, p_avatar_url = null, p_lang_tag = null, p_open = null) -> NakamaAsyncResult: - return _api_client.update_group_async(p_session, p_group_id, + return _api_client.update_group_async.call(p_session, p_group_id, NakamaAPI.ApiUpdateGroupRequest.create(NakamaAPI, { "name": p_name, "open": p_open, @@ -922,7 +922,7 @@ func update_group_async(p_session : NakamaSession, # @param p_receipt - The purchase receipt to be validated. # Returns a task which resolves to the validated list of purchase receipts. func validate_purchase_apple_async(p_session : NakamaSession, p_receipt : String): # -> NakamaAPI.ApiValidatePurchaseResponse - return _api_client.validate_purchase_apple_async(p_session, + return _api_client.validate_purchase_apple_async.call(p_session, NakamaAPI.ApiValidatePurchaseAppleRequest.create(NakamaAPI, { "receipt": p_receipt })) @@ -932,7 +932,7 @@ func validate_purchase_apple_async(p_session : NakamaSession, p_receipt : String # @param p_receipt - The purchase receipt to be validated. # Returns a task which resolves to the validated list of purchase receipts. func validate_purchase_google_async(p_session : NakamaSession, p_receipt : String): # -> NakamaAPI.ApiValidatePurchaseResponse - return _api_client.validate_purchase_google_async(p_session, + return _api_client.validate_purchase_google_async.call(p_session, NakamaAPI.ApiValidatePurchaseGoogleRequest.create(NakamaAPI, { "purchase": p_receipt })) @@ -943,7 +943,7 @@ func validate_purchase_google_async(p_session : NakamaSession, p_receipt : Strin # @param p_signature - The signature of the purchase receipt. # Returns a task which resolves to the validated list of purchase receipts. func validate_purchase_huawei_async(p_session : NakamaSession, p_receipt : String, p_signature : String): # -> NakamaAPI.ApiValidatePurchaseResponse - return _api_client.validate_purchase_huawei_async(p_session, + return _api_client.validate_purchase_huawei_async.call(p_session, NakamaAPI.ApiValidatePurchaseHuaweiRequest.create(NakamaAPI, { "purchase": p_receipt, "signature": p_signature @@ -958,7 +958,7 @@ func validate_purchase_huawei_async(p_session : NakamaSession, p_receipt : Strin # Returns a task which resolves to the leaderboard record object written. func write_leaderboard_record_async(p_session : NakamaSession, p_leaderboard_id : String, p_score : int, p_subscore : int = 0, p_metadata = null): # -> NakamaAPI.ApiLeaderboardRecord: - return _api_client.write_leaderboard_record_async(p_session, p_leaderboard_id, + return _api_client.write_leaderboard_record_async.call(p_session, p_leaderboard_id, NakamaAPI.WriteLeaderboardRecordRequestLeaderboardRecordWrite.create(NakamaAPI, { "metadata": p_metadata, "score": str(p_score), @@ -976,7 +976,7 @@ func write_storage_objects_async(p_session : NakamaSession, p_objects : Array): continue # TODO Exceptions var write_obj : NakamaWriteStorageObject = obj writes.append(write_obj.as_write().serialize()) - return _api_client.write_storage_objects_async(p_session, + return _api_client.write_storage_objects_async.call(p_session, NakamaAPI.ApiWriteStorageObjectsRequest.create(NakamaAPI, { "objects": writes })) @@ -990,7 +990,7 @@ func write_storage_objects_async(p_session : NakamaSession, p_objects : Array): # Returns a task which resolves to the tournament record object written. func write_tournament_record_async(p_session : NakamaSession, p_tournament_id : String, p_score : int, p_subscore : int = 0, p_metadata = null): # -> NakamaAPI.ApiLeaderboardRecord: - return _api_client.write_tournament_record_async(p_session, p_tournament_id, + return _api_client.write_tournament_record_async.call(p_session, p_tournament_id, NakamaAPI.WriteTournamentRecordRequestTournamentRecordWrite.create(NakamaAPI, { "metadata": p_metadata, "score": str(p_score), @@ -1006,7 +1006,7 @@ func write_tournament_record_async(p_session : NakamaSession, # Returns a task which resolves to the tournament record object written. func write_tournament_record2_async(p_session : NakamaSession, p_tournament_id : String, p_score : int, p_subscore : int = 0, p_metadata = null): # -> NakamaAPI.ApiLeaderboardRecord: - return _api_client.write_tournament_record2_async(p_session, p_tournament_id, + return _api_client.write_tournament_record2_async.call(p_session, p_tournament_id, NakamaAPI.WriteTournamentRecordRequestTournamentRecordWrite.create(NakamaAPI, { "metadata": p_metadata, "score": str(p_score), From 93ed2a2792337e01441d520be5b06713c84fdefa Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 19:20:38 +0000 Subject: [PATCH 30/33] SwitchTYPE_INT to packed --- addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd b/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd index e94d72c..6c7b98f 100644 --- a/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd +++ b/addons/com.heroiclabs.nakama/utils/NakamaSerializer.gd @@ -26,7 +26,7 @@ static func serialize(p_obj : Object) -> Dictionary: continue arr.append(serialize(e)) out[k] = arr - TYPE_INT_ARRAY, TYPE_STRING_ARRAY: # Array of ints, bools, or strings + TYPE_PACKED_INT32_ARRAY, TYPE_PACKED_STRING_ARRAY: # Array of ints, bools, or strings var arr = [] for e in val: if content == TYPE_BOOL: @@ -74,7 +74,7 @@ static func deserialize(p_ns : GDScript, p_cls_name : String, p_dict : Dictionar var type_cmp = type if typeof(type) == TYPE_STRING: # A class type_cmp = TYPE_DICTIONARY - if type_cmp == TYPE_STRING_ARRAY or type_cmp == TYPE_INT_ARRAY: # A specialized array + if type_cmp == TYPE_PACKED_STRING_ARRAY or type_cmp == TYPE_PACKED_INT32_ARRAY: # A specialized array type_cmp = TYPE_ARRAY var content_cmp = content @@ -108,7 +108,7 @@ static func deserialize(p_ns : GDScript, p_cls_name : String, p_dict : Dictionar elif type_cmp == TYPE_ARRAY: var v match content: - TYPE_INT, TYPE_BOOL: v = PackedIntArray() + TYPE_INT, TYPE_BOOL: v = PackedInt32Array() TYPE_STRING: v = PackedStringArray() _: v = Array() for e in val: From 7b70d89007bbb690c754a5152d07449b48faf1a3 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 19:22:33 +0000 Subject: [PATCH 31/33] * Swap const to var as type support is missing * Remove GDScriptFunctionState * Fix connects * Swap json to new json object * Swap to async where possible --- .../socket/NakamaSocket.gd | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd index 441386a..9971292 100644 --- a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd +++ b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd @@ -3,7 +3,7 @@ extends RefCounted # A socket to interact with Nakama server. class_name NakamaSocket -const ChannelType = NakamaRTMessage.ChannelJoin.ChannelType +var ChannelType = NakamaRTMessage.ChannelJoin.ChannelType # Emitted when a socket is closed. signal closed() @@ -72,7 +72,7 @@ var _weak_ref : WeakRef var _base_uri : String var _responses : Dictionary var _last_id : int = 1 -var _conn : GDScriptFunctionState = null +var _conn = null var logger : NakamaLogger = null func _resume_conn(p_err : int): @@ -99,10 +99,10 @@ func _init(p_adapter : NakamaSocketAdapter, port = ":%d" % p_port _base_uri = "%s://%s%s" % [p_scheme, p_host, port] _free_adapter = p_free_adapter - _adapter.connect("closed", self, "_closed") - _adapter.connect("connected", self, "_connected") - _adapter.connect("received_error", self, "_connection_error") - _adapter.connect("received", self, "_received") + _adapter.connect("closed", _closed) + _adapter.connect("connected", _connected) + _adapter.connect("received_error", _connection_error) + _adapter.connect("received", _received) func _notification(what): if what == NOTIFICATION_PREDELETE: @@ -137,12 +137,14 @@ func _connected(): _resume_conn(OK) func _received(p_bytes : PackedByteArray): + var json = JSON.new() + var json_str = p_bytes.get_string_from_utf8() - var json := JSON.parse(json_str) - if json.error != OK or typeof(json.result) != TYPE_DICTIONARY: + var json_error := json.parse(json_str) + if json_error != OK or typeof(json.get_data()) != TYPE_DICTIONARY: logger.error("Unable to parse response: %s" % json_str) return - var dict : Dictionary = json.result + var dict : Dictionary = json.get_data() var cid = dict.get("cid") if cid: if _responses.has(cid): @@ -232,7 +234,7 @@ func _parse_result(p_responses : Dictionary, p_id : String, p_type, p_ns : GDScr result_key = p_type.get_result_key() # Here we yield and wait - var data = yield() # Manually resumed + var data = await # Manually resumed call_deferred("_survive", p_responses[p_id]) p_responses.erase(p_id) # Remove this request from the list of responses @@ -270,18 +272,18 @@ func _send_async(p_message, p_parse_type = NakamaAsyncResult, p_ns = NakamaRTAPI var id = str(_last_id) _last_id += 1 _responses[id] = _parse_result(_responses, id, p_parse_type, p_ns, p_result_key) - var json := JSON.print({ + + var json_obj = JSON.new() + + var json := json_obj.stringify({ "cid": id, msg: p_message.serialize() }) - var err = _adapter.send(json.to_utf8()) + var err = _adapter.send(json) if err != OK: call_deferred("_cancel_response", id) return _responses[id] - -func _connect_function(): - return yield() # Manually resumed - + # If the socket is connected. func is_connected_to_host(): return _adapter.is_connected_to_host() @@ -302,9 +304,7 @@ func close(): func connect_async(p_session : NakamaSession, p_appear_online : bool = false, p_connect_timeout : int = 3): var uri = "%s/ws?lang=en&status=%s&token=%s" % [_base_uri, str(p_appear_online).to_lower(), p_session.token] logger.debug("Connecting to host: %s" % uri) - _adapter.connect_to_host(uri, p_connect_timeout) - _conn = _connect_function() - return _conn + return await _adapter.connect_to_host(uri, p_connect_timeout) # Join the matchmaker pool and search for opponents on the server. # @param p_query - The matchmaker query to search for opponents. @@ -331,7 +331,7 @@ func create_match_async(): # @param p_user_ids - The IDs of users. # @param p_usernames - The usernames of the users. # Returns a task which resolves to the current statuses for the users. -func follow_users_async(p_ids : PackedStringArray, p_usernames : PackedStringArray = []) -> NakamaRTAPI.Status: +func follow_users_async(p_ids : PackedStringArray, p_usernames : PackedStringArray) -> NakamaRTAPI.Status: return _send_async(NakamaRTMessage.StatusFollow.new(p_ids, p_usernames), NakamaRTAPI.Status) # Join a chat channel on the server. From d0e11e66357956355ae0621484794637f8bfa532 Mon Sep 17 00:00:00 2001 From: Elgan Date: Fri, 18 Mar 2022 19:23:05 +0000 Subject: [PATCH 32/33] Replace yield. We need a new design --- addons/com.heroiclabs.nakama/socket/NakamaSocket.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd index 9971292..3e1f98f 100644 --- a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd +++ b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd @@ -234,7 +234,7 @@ func _parse_result(p_responses : Dictionary, p_id : String, p_type, p_ns : GDScr result_key = p_type.get_result_key() # Here we yield and wait - var data = await # Manually resumed + var data = yield() # Manually resumed call_deferred("_survive", p_responses[p_id]) p_responses.erase(p_id) # Remove this request from the list of responses From 36b131f2fa987d17384973f52819775c6a15c5fd Mon Sep 17 00:00:00 2001 From: Elgan Date: Thu, 7 Apr 2022 09:10:06 +0100 Subject: [PATCH 33/33] Switch to await conn --- addons/com.heroiclabs.nakama/socket/NakamaSocket.gd | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd index 3e1f98f..e9993cc 100644 --- a/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd +++ b/addons/com.heroiclabs.nakama/socket/NakamaSocket.gd @@ -234,13 +234,14 @@ func _parse_result(p_responses : Dictionary, p_id : String, p_type, p_ns : GDScr result_key = p_type.get_result_key() # Here we yield and wait - var data = yield() # Manually resumed + var data = await _conn # Manually resumed call_deferred("_survive", p_responses[p_id]) p_responses.erase(p_id) # Remove this request from the list of responses # We got an exception, maybe the task was cancelled? if data is NakamaException: return p_type.new(data as NakamaException) + # Error from server if data.has("error"): var err = data["error"] @@ -271,7 +272,7 @@ func _send_async(p_message, p_parse_type = NakamaAsyncResult, p_ns = NakamaRTAPI msg = p_message.get_msg_key() var id = str(_last_id) _last_id += 1 - _responses[id] = _parse_result(_responses, id, p_parse_type, p_ns, p_result_key) + _responses[id] = _parse_result.call(_responses, id, p_parse_type, p_ns, p_result_key) var json_obj = JSON.new() @@ -279,7 +280,7 @@ func _send_async(p_message, p_parse_type = NakamaAsyncResult, p_ns = NakamaRTAPI "cid": id, msg: p_message.serialize() }) - var err = _adapter.send(json) + var err = _adapter.send.call(json) if err != OK: call_deferred("_cancel_response", id) return _responses[id]