onRoomAdded no variables!
Posted: 25 Nov 2005, 23:35
Hello, great product you have here 
Although I do have a problem. I'm not sure if I'm donig something wrong or if it's the server's problem. (I doubt it)
Well, People can create rooms (acting like servers, like you would in Counter Strike) and they autojoin it, but when I test in the server list, it shows the getName() and all of that, but it does NOT just any of the variables I assigned,
And to recieve the servers,
All of it shows up, but the map variable, which should be "de_dust".
By the way, I have another question. Does onRoomListUpdate get called whenever a server variable changes AND when a new server is created?
Although I do have a problem. I'm not sure if I'm donig something wrong or if it's the server's problem. (I doubt it)
Well, People can create rooms (acting like servers, like you would in Counter Strike) and they autojoin it, but when I test in the server list, it shows the getName() and all of that, but it does NOT just any of the variables I assigned,
Code: Select all
game = {}
game.name = nam
game.password = ""
game.maxUsers = 10
game.maxSpectators = 0
game.isGame = true
game.isTemp = true
game.vars = []
game.vars.push( {name:"map", val:"de_dust"} )
smartfox.createRoom(game)Code: Select all
smartfox.onRoomAdded = function(roomObj) {
o = roomObj
if(o.isGame()) {
newServer = {ID:1, Server:o.getName(),Players:o.getUserCount()+"/"+o.getMaxUsers(),Map:o.variables.map}
servers.addItem(newServer)
}
}
By the way, I have another question. Does onRoomListUpdate get called whenever a server variable changes AND when a new server is created?