Forum Multiplayer createJoinRoomWithRoomId create two separate rooms

Discussion and help relating to the PlayerIO Multiplayer API.

createJoinRoomWithRoomId create two separate rooms

Postby KVADRO » January 1st, 2019, 3:58 pm

Hi.
I use createJoinRoomWithRoomId as: [_multiplayer createJoinRoomWithroomID:nil roomType:@"test" ... ]; (ios), and as far as i understood first client who call this method will create room, and second should join room witch was created by the first player. But, i see that two separate rooms was created, why?
KVADRO
 
Posts: 16
Joined: May 6th, 2018, 8:22 pm

Re: createJoinRoomWithRoomId create two separate rooms

Postby robscherer123 » January 2nd, 2019, 4:08 pm

It should work as long as both rooms are created with the same name. Is it happening every time to test, or only on some rare occasion?
robscherer123
Paid Member
 
Posts: 313
Joined: December 12th, 2012, 8:46 pm

Re: createJoinRoomWithRoomId create two separate rooms

Postby KVADRO » January 2nd, 2019, 4:13 pm

>It should work as long as both rooms are created with the same name
Yes, if i specify specific name in first parameter, two players will join same room. But, i need 'unique' room id, to implement 'return after disconnection' functionality. So, if i specify nil as the first parameter, PIO will generate unique room id for me, and i need this functionality.

>it happening every time to test, or only on some rare occasion
I tried on development server, and, it happens each time i call createJoinRoomWithRoomId
KVADRO
 
Posts: 16
Joined: May 6th, 2018, 8:22 pm

Re: createJoinRoomWithRoomId create two separate rooms

Postby Henrik » March 12th, 2019, 4:44 am

No, every time a client, any client, calls CreateJoinRoom with a null roomid value, PlayerIO will create a random roomid, and have the client join that room.

There's no way for a second client to magically know the roomid the first client created, you have to transmit that piece of information to the second client somehow. And if you want the first client to be able to re-connect to the same room, you need to seend that roomid to the first client as well.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: createJoinRoomWithRoomId create two separate rooms

Postby qugengames » March 22nd, 2019, 10:21 pm

Use "$service-room$" as roomId parameter and your players will be matched :P
qugengames
 
Posts: 36
Joined: April 24th, 2018, 11:19 pm


Return to Multiplayer