Code: Select all
var gameRoom:Object = new Object();
gameRoom.name = name;
gameRoom.password = pwd;
gameRoom.maxUsers = 4;
gameRoom.isGame = true;
gameRoom.exitCurrentRoom = true;
var xt = {};
xt.name = "g";
xt.script = "c_GameLogic.as";
gameRoom.extension = xt;
var rVars:Array = [];
rVars.push({name:"st", val:0});
gameRoom.vars = rVars;
smartfox.createRoom(gameRoom);
and I tried to modify the variable "st" in the server.
Code of server side is in the "g" XT (a room level XT attached to the room just created).
Code: Select all
var rVars = [];
rVars.push({name:"st", val:1});
_server.setRoomVariables(room, user, rVars);
I have checked out that room param(Room obj) is the one just created
and user param(User obj) is just the creator.
but it seems that "st" variable is not changed.
do I miss anything ?