putting users in rooms make a lot of them disconnected
Posted: 05 Nov 2010, 13:35
Hi, we have developed the tournment version of a burraco card game turn-based. We have a server-side extension that automatically create the tournment rounds. When a referee click a "start turn" button the extension make a loop in which it creates the game room and put inside users then procede to next room.
We have tested this and everything worked fine, now the tournment is in final test on production server. The first tournment worked fine with about 64 people and extension created the 16 rooms needed with no problem. Now we made a bigger test with 92 people but when we tried to "start turn" a lot of people it's been disconnected from the server. Any idea?
Here is the code that creates the rooms and put users inside them, I have put only relevant code and comment for the part of code I excluded.
We have tested this and everything worked fine, now the tournment is in final test on production server. The first tournment worked fine with about 64 people and extension created the 16 rooms needed with no problem. Now we made a bigger test with 92 people but when we tried to "start turn" a lot of people it's been disconnected from the server. Any idea?
Here is the code that creates the rooms and put users inside them, I have put only relevant code and comment for the part of code I excluded.
Code: Select all
for (var x = 0; x < rounds[numRound].length; x++) {
// create room object newRoomObj with its parameters
// set room variable rVars
newRoom = _server.createRoom(newRoomObj, null, true, true, rVars);
if (newRoom != null) {
var resetRoomVariables = false;
var vars = [];
var uVars;
var nameUser;
var newRoomId = newRoom.getId();
var ok = _server.joinRoom(userNord, LOBBY_ID, false, newRoomId, newRoomObj.pwd, false, true);
if (ok) {
nameUser = String(userNord.getName());
uVars = { };
uVars.table = String(newRoomObj.name);
_server.setUserVariables(userNord, uVars);
} else {
resetRoomVariables = true;
vars.push( { name:"nord", val:"" } );
}
// do the same with other 3 users
if (resetRoomVariables) {
_server.setRoomVariables(newRoom, null, vars);
}
}
}