Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please help 😭 #32

Open
izzyaboi opened this issue Sep 7, 2020 · 4 comments
Open

Please help 😭 #32

izzyaboi opened this issue Sep 7, 2020 · 4 comments

Comments

@izzyaboi
Copy link

izzyaboi commented Sep 7, 2020

Im getting this error after trying to run this function (trying to connect to the server)

These are all the variables associated with the function
var client := Nakama.create_client(Server_KEY, "127.0.0.1", 7350, "http")
var Session : NakamaSession
var Socket : NakamaSocket

func Connect_to_server_async():
Socket = Nakama.create_socket_from(client)
var result : NakamaAsyncResult = yield(Socket.connect_async(Session), "completed")
if not result.is_exception():
Socket.connect("closed", self, "Nakama_Socket_Closed")
return OK
return ERR_CANT_CONNECT

Invalid get index 'token' (on base: 'Nil').

@novabyte
Copy link
Member

novabyte commented Sep 7, 2020

@izzyaboi Is your Session var initialized? Have you authenticated the game client before you use the session to open a socket? https://github.com/heroiclabs/nakama-godot#authenticate

@izzyaboi
Copy link
Author

izzyaboi commented Sep 7, 2020

@izzyaboi Is your Session var initialized? Have you authenticated the game client before you use the session to open a socket? https://github.com/heroiclabs/nakama-godot#authenticate

I think so but i might be wrong you be the judge of that, this is my code and the error code im getting @novabyte
Annotation 2020-09-07 202512
Annotation 2020-09-07 202539
Annotation 2020-09-07 202559

@novabyte
Copy link
Member

novabyte commented Sep 8, 2020

@izzyaboi From your code I can't immediately see why the code does not work but instead of trying to use a global variable for Session why do you not return it from the authenticate_user function after yield and pass that in so that it can be used to connect the socket?

@izzyaboi
Copy link
Author

izzyaboi commented Sep 8, 2020

finally got it working i restarted everything and just made a new project overall, thanks for ur effort to help are u one of the nakama developers? good job with this module it makes everything to do with multiplayer 200 times easier im still impressed with the server storage mechanism, thanks for helping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants