cgisca / PGSGP

Play Games Services plugin for Godot Game Engine - Android
MIT License
217 stars 61 forks source link

Ambiguity about is_player_connected() #26

Closed HanouaJ closed 4 years ago

HanouaJ commented 4 years ago

It is not clear what is the role of the function is_player_connected(), I assumed it is used to check if the player is already connected or not but It always returns a null.

There must be a way to check if the sign-in to Google Play Games Services was successful and if the player is connected, I tried the _on_player_is_already_connected but it is never called.

ja-kub commented 4 years ago

As it was figured out by @hlfstr here: https://github.com/cgisca/PGSGP/issues/5#issuecomment-606391442 the callback for _on_player_is_already_connected() requires 2 parameters. So the following will work:

func _on_player_is_already_connected(status : bool, id : String) -> void:
    print("hello from _on_player_is_already_connected\nStatus: %s | ID: %s" % [status,id])

@cgisca should update README.md, because currently it's misleading.

cgisca commented 4 years ago

Please check the new version of the plugin. is_player_connected() is now synchronous and you can call it directly without waiting to get the response in the callback. Please take attention that it has a different name -> isSignedIn() .

Check if signed in: var is_signed_in: bool = play_games_services.isSignedIn()

Closing the issue

Losatu commented 3 years ago

There is no such function "is_player_connected()".

grafik