Forum Multiplayer creatJoinRoom name cannot be set to null?

Discussion and help relating to the PlayerIO Multiplayer API.

creatJoinRoom name cannot be set to null?

Postby LorenzGames » November 19th, 2010, 9:48 pm

If i try to set the roomId to null when using createJoinRoom i get the following error:
got Error: Sorry, but you can't set room data when using createJoinRoom with roomId==null
LorenzGames
Paid Member
 
Posts: 108
Joined: March 28th, 2010, 3:46 am

Re: creatJoinRoom name cannot be set to null?

Postby Oliver » November 22nd, 2010, 12:56 pm

Hi Lorenz,

roomId=null has a special meaning in createJoinRoom(): It ment "join any open room of this type or create a new one if none exists". We call these 'service rooms'. It was a feature added by request, and only after games were live and using it, we realized that it caused a conflict since roomId==null means something else in createRoom(), namely: "give me a new room".

So what we did was add a check for roomId=='$service-room$' that allowed developers to still get the service room behavior, and tell them to migrate from roomId=null to roomId='$service-room$'.

All of them have done that now, but we've just hadn't removed the old check for roomId==null. We've just done that now, and the next release will work as you expect.

For now, you can use createRoom() followed by joinRoom() to get the behavior you expect...

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

Re: creatJoinRoom name cannot be set to null?

Postby LorenzGames » November 22nd, 2010, 8:31 pm

oh ok... so when next version will be release I will be able to use createJoinRoom with the null?
LorenzGames
Paid Member
 
Posts: 108
Joined: March 28th, 2010, 3:46 am

Re: creatJoinRoom name cannot be set to null?

Postby Henrik » December 2nd, 2010, 3:49 pm

This is now fixed and released, so you can use a null roomId in both CreateRoom and CreateJoinRoom, and both will create a new room for you.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to Multiplayer