Forum Multiplayer Doesn't receive response from server

Discussion and help relating to the PlayerIO Multiplayer API.

Doesn't receive response from server

Postby KVADRO » August 12th, 2018, 8:46 pm

Hello World!

I have a simple room implementation witch overrides UserJoined method. And when this method called, i send back to newly connected player some data.

But, when i upload my dll to PIO servers, on client side i don't receive response, and when i do the same with local development server everything works.

What can cause this problem? (Latest Unity client SDK)
KVADRO
 
Posts: 16
Joined: May 6th, 2018, 8:22 pm

Re: Doesn't receive response from server

Postby Henrik » August 18th, 2018, 10:15 am

You're probably running into a race condition, we don't recommend that you send data to the connecting player in UserJoined, it's for handling server state and notifying other already connected players.

Best practice is to wait until the success callback in CreateJoinRoom has fired, and you've setup all your message handlers. Then you can send a message to the server going "hey, I'm ready on this end, send me the game state".
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Doesn't receive response from server

Postby KVADRO » August 19th, 2018, 9:27 am

Hi Henrik.
Thanks, this helped me.
KVADRO
 
Posts: 16
Joined: May 6th, 2018, 8:22 pm


Return to Multiplayer