Issue with joinRoomInRange API with Corona Labs

0 votes

In tic tac toe example, I just changed line 64 as : 

appWarpClient.joinRoomInRange (1, 1, false) to

appWarpClient.joinRoomInRange (1, 4, false)

and at line 88 

appWarpClient.createTurnRoom ("TicTacToeRoom", ROOM_ADMIN, 4, roomPropertiesTable, 30)

And this doesn't work.  What is expected is that the second client will connect to the room created by the first one. What is actually happening is, both clients are creating new rooms i.e. second client does not identify the first created room.

I have seen other posts where it is mentioned that joinRoomInRange API for corona doesn't work but could't find any substantial pointers. 


asked Jul 28, 2014 in AppWarp by Vibhu Bhola (10 points)
edited Jul 29, 2014 by Vibhu Bhola

1 Answer

0 votes
Hey Vibhu,
This is not a Corona SDK specific bug. This bug was occurring because of the boundary condition check on our server. The bug has been detected and will be rectified in our next server update scheduled on 4 August 2014
Meanwhile you can use a quick trick by creating a room with one more maximum user than required. For example if you are going to join a room with minimum 1 user and maximum user 4 then create a room with at-least 5 maximum users. 
answered Jul 29, 2014 by Suyash Mohan (900 points)
Well, that's what we suspected. Thanks for the confirmation and eagerly looking forward to 4th August patch.

However the trick that you've mentioned above will not work (checked and it is not working). Based on our analysis, I assume that the current boundary condition for joinRoomInRange in your server check rooms with users > minUsers instead of users >= minUsers when minUsers != maxUsers .

Because of this, when admin user creates a room and joins, the other users are not able to find this room. The reason - other users are searching for rooms with users > minUsers not users >= minUsers, and because none of the users are able to join the room dynamically, the lower boundary condition is never satisfied unless minUser = 0 .

This explains why appWarpClient.joinRoomInRange (1, 4, false) was not able to find the rooms with 1 user because it was looking for rooms with users > 1.  

FYI - I am mentioning this in detail in interest of other developers who might stumble upon this problem.
Hey Vibhu,

Your guess is slightly wrong. This is not the exact condition that is causing error. We are checking for > comparison between maximum limit of room and maxUsers passed in joinRoomInRange API instead of >= comparison. Therefore if you created a room with maximum limit of users = 4 and tried joining a room with minUsers = 1 and maxUsers = 4, the API failed as 4 > 4 returns false.

I tested the same TicTacToe example with following modifications and it worked.
Line 64 : appWarpClient.joinRoomInRange (1, 4, false)
Line 88 : appWarpClient.createTurnRoom ("TicTacToeRoom", ROOM_ADMIN, 5, roomPropertiesTable, 30)

However using 5 instead of 4 in Line 64, causes a failure in the API.
Hey Suyash,

Would like to follow up if the boundary condition fix has been implemented in 4th August patch ?
Hi, would like to follow up if the boundary condition fix has been implemented already ?
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on