You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Godot 4 introduced the await keyword for coroutines, it would be nice to use it in this SDK, too. Here is an example with the login_as_new_guest_user call.
Current SDK usage:
func_ready():
# Get the SDK and Initself.aws_game_sdk=get_node("/root/AwsGameSdk")
self.aws_game_sdk.init(self.login_endpoint, self.on_login_error)
# Log in as new guest user firstself.aws_game_sdk.login_as_new_guest_user(self.login_as_guest_callback)
# Called on any login or token refresh failuresfuncon_login_error(message):
print("Login error: "+message)
# Receives a UserInfo object after successful guest loginfunclogin_as_guest_callback(user_info):
print("Received guest login info.")
print(user_info)
# Try linking Steam ID to existing user# NOTE: You need to use the Godot Steamworks SDK (https://godotsteam.com/) to integrate with Steam# Use the GetAuthTicketForWebAPI to get the steam auth token (https://godotsteam.com/functions/users/#getauthticketforwebapi)self.aws_game_sdk.link_steam_id_to_current_user("YourTokenHere", self.on_link_steam_id_response)
func_ready():
# Get the SDK and Initself.aws_game_sdk=get_node("/root/AwsGameSdk")
varres=awaitself.aws_game_sdk.login_as_new_guest_user().async()
ifres.is_error():
print("Error!:"+res.as_error())
returnprint("Received guest login info.")
print(res.get_data())
# Try linking Steam ID to existing user# NOTE: You need to use the Godot Steamworks SDK (https://godotsteam.com/) to integrate with Steam# Use the GetAuthTicketForWebAPI to get the steam auth token (https://godotsteam.com/functions/users/#getauthticketforwebapi)res=awaitaws_game_sdk.link_steam_id_to_current_user("YourTokenHere").async()
The text was updated successfully, but these errors were encountered:
Interesting, thank you for pointing this out. Does the await here yield the execution back and return to this function only after the response comes in? Quick look at the docs it looks like that's the case. The other thing I'd need to investigate is the async() call for a method, is that something that needs to be implemented on the method level?
If you're interested in working on a pull request on this, we'd be happy to include that! But completely fine if not, we'll keep it in the issues then and try to come back to this at a later point
Godot 4 introduced the
await
keyword for coroutines, it would be nice to use it in this SDK, too. Here is an example with thelogin_as_new_guest_user
call.Current SDK usage:
Desired SDK usage (same pattern as in W4 Cloud's SDK )
The text was updated successfully, but these errors were encountered: