PDA

View Full Version : createRoom issue



wallis2xk
08-29-2006, 03:47 PM
Hi,

I'd been trying to use to use the createRoom(roomOb, auto) functionality so when a room already exists calling createRoom joins you to the room. It wasn't working for me, so I had a look through the ES class and came across this in the createRoom function:



if (auto == undefined || auto == "true") {
auto = true;
} else {
auto = false;
}

which is overwriting the auto value if you supply auto as a proper Boolean. I just took out the else to solve it and is working nicely now.

jobem
08-29-2006, 08:26 PM
Hi Dave,

I'm not sure what your problem was, but there is no bug here. The code you pasted works fine and this is a feature that is used by nearly everyone. Nevertheless, I'm glad its working for you now!

wallis2xk
08-29-2006, 11:53 PM
Hi Jobe,

Well, the problem I had was that in ElectroServer.as (the latest one) the createRoom function goes


function createRoom(roomOb:Object, auto:Boolean) {
//roomOb properties: zone, roomName, hidden, numbered, UserVariablesEnabled, Description
//Password, Capacity, roomVariables
if (auto == undefined || auto == "true") {
auto = true;
} else {
auto = false;
}
trace("auto=" + auto);
....

and if, for example, you go

createRoom(obj, true);

the auto variable will turn to false as it doesn't satisfy the first two conditions. As you say this is a common function, so I guess most people are either leaving the auto parameter out if they want autojoin, or setting it to false if they don't. But if they set it to true like I did, I'd imagine they'd come up against the same problem.