Forum Multiplayer Setting room IDs and other issues

Discussion and help relating to the PlayerIO Multiplayer API.

Setting room IDs and other issues

Postby DJamieson » May 15th, 2010, 3:10 pm

A small criticism to start off with: (hopefully useful for improving your fine service)
I believe that setting roomID to null no longer works (whereas previously it would make the server handle room ID allocation and the like). Im not sure why this is - I found it useful - but the sample tic-tac-toe game no longer works, as a result. (The other demo games may have issues, Ive not tested).

Anyway, so now I have to set room ID myself. Thats simple enough done - but is there a way to check if a room already exists, without joining? If I create some simple code, like join room MyGame + Math.random*1000, theres a decent chance that people will start joining each others games by mistakes. Also, itd be nice to be able to set private rooms.

Secondly, I seem to be getting the message "initData is deprecated, please use data" when I connect. I have no idea what is causing this, I cant see it in my code anywhere.

Lastly, I seem to be having strange problems when I have a player ingame, leave him for some time, then quit him out the game. It seems that there is a timeout, and when a timed-out player quits, they send a message for the server to remove a null player from playerlist, and the whole thing crashes.
You can see the error here:
http://i652.photobucket.com/albums/uu24 ... /infec.png
(apologies, I forgot to get a more detailed crash report).

Any help with these issues would be appreciated.
DJamieson
 
Posts: 29
Joined: March 4th, 2010, 5:43 pm

Re: Setting room IDs and other issues

Postby Oliver » May 17th, 2010, 10:38 am

I believe that setting roomID to null no longer works (whereas previously it would make the server handle room ID allocation and the like). Im not sure why this is - I found it useful - but the sample tic-tac-toe game no longer works, as a result. (The other demo games may have issues, Ive not tested).


Correct. The problem is only for createJoinRoom(). We've changed the behavior when specifying roomid=null from "create room and join it" to "join existing room or create new one" which is causing some issues. We might change it back; we just need to see what the scope of the issues are. There are good arguments for both solutions, so it's one of those tradeoff solutions.

Anyway, so now I have to set room ID myself. Thats simple enough done - but is there a way to check if a room already exists, without joining? If I create some simple code, like join room MyGame + Math.random*1000, theres a decent chance that people will start joining each others games by mistakes. Also, itd be nice to be able to set private rooms.


The easiest solution would be to switch from createJoinRoom to using createRoom and joinRoom. If you call createRoom with roomId=null, it'll always create a new room for you.

Secondly, I seem to be getting the message "initData is deprecated, please use data" when I connect. I have no idea what is causing this, I cant see it in my code anywhere.


That's odd... you should only be seeing that if you're using an old version of the api -- Are you using the newest available version?

Lastly, I seem to be having strange problems when I have a player ingame, leave him for some time, then quit him out the game. It seems that there is a timeout, and when a timed-out player quits, they send a message for the server to remove a null player from playerlist, and the whole thing crashes.
You can see the error here:
http://i652.photobucket.com/albums/uu24 ... /infec.png
(apologies, I forgot to get a more detailed crash report).


That's a bug we're trying to hunt down. Thanks for the report, everything helps.

Hope you'll still use Player.IO despite these issues.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am


Return to Multiplayer