_server.setRoomVariables

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

alvin3343
Posts: 80
Joined: 24 Jan 2006, 09:37

_server.setRoomVariables

Postby alvin3343 » 26 Feb 2006, 02:38

well, I set a room variable in the client when a client create the game room:

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 ?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 26 Feb 2006, 21:48

Hi alvin3343,
I tested your code and it works fine for me. I can't reproduce the problem.

What version are you currently using? Beta 1.4.0beta3?
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 17 guests