setRoomVariable when you create a room...

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

User avatar
JarochoCity
Posts: 180
Joined: 01 Dec 2005, 01:22
Location: Mexico
Contact:

setRoomVariable when you create a room...

Postby JarochoCity » 10 Apr 2006, 06:24

If i create a room owned by the server with an extension and when i create the room i wanna attach a Variable to the room it was created but with out join it, i mean when is creating the room, how can i do it?
User avatar
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Postby Virusescu » 10 Apr 2006, 06:59

First create the room and then set the variables from the server extension.
You are confusing the Client framework with the serverSide frame work. You don't need to join a room in order to have access to it's properties. You are THE server when you program your extensions.

The code would look similar to this

Code: Select all

var roomObj = {}
roomObj.name = "A new Room"
roomObj.maxU = 25

var newRoom = _server.createRoom(roomObj, null)

if (newRoom != null){
   trace("Great the room was created -> add your vars here");
        vars = new Array();
        vars.push({name:"varone",val:12,priv:false,persistent:true});
        vars.push({name:"vartwo",val:"Some string",priv:false,persistent:true});
       _server.setRoomVariables(newRoom, null, vars, false, true);
}
else{
   trace("A problem occurred, better check the server logs");
}

This should work
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
User avatar
JarochoCity
Posts: 180
Joined: 01 Dec 2005, 01:22
Location: Mexico
Contact:

Thanks, that works...

Postby JarochoCity » 10 Apr 2006, 15:13

Thanks, that works and i just reset the server and it tells me:

Your IP addr. is not allowed to connect as admin.

Always happend that to me and i need to reset it manually and i don't have the power to get into the server =S what do you recommend me?
wallis2xk
Posts: 43
Joined: 01 Sep 2006, 10:00
Location: United Kingdom

Postby wallis2xk » 07 Aug 2007, 13:57

I've been getting

"Your IP addr. is not allowed to connect as admin."

quite often recently when I'm trying to log in after restarting the server (v1.5.5) from the Admin panel (v1.3.5), and it's quite frustrating that I then have to go and restart it again manually. Any ideas?
User avatar
Lapo
Site Admin
Posts: 21596
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 09 Aug 2007, 13:09

Hi,
we're not able to reproduce this issue.
I've additionally run a test where I restarted the server 10 times and reconnected with the admin tool which was restricted to a single IP address.

Maybe you can send us an email and we can try some live test on your side
Lapo
--
gotoAndPlay()
...addicted to flash games
Ganius
Posts: 92
Joined: 13 Feb 2007, 12:49

Postby Ganius » 29 Aug 2007, 13:47

Hi.

I ran into this problem today running Pro 1.5.5 (not patched).

No restrictions on IP, never happened before in weeks of restarting the server through the admin tool, just happened today.

Physically rebooted server and all good.

Perhaps a bug...

Cheers,
G.
User avatar
Lapo
Site Admin
Posts: 21596
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 30 Aug 2007, 03:29

I am adding this in our to-check list for the next release, thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 9 guests