Set room properties for room ext init method to see them

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

grhwood
Posts: 116
Joined: 15 Mar 2011, 04:43

Set room properties for room ext init method to see them

Postby grhwood » 01 Jul 2013, 16:59

Hi,

I was wondering if there is a way to set room properties when creating room so that I can get the properties in room extension init method ? Right now Im using

Room room = createRoom(owner, gameSettings);
room.setProperty(key, value);

but I can not get the property in extension init method.

Thanks,
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Set room properties for room ext init method to see them

Postby Lapo » 01 Jul 2013, 19:46

You can use hidden room variables (not transmitted to the client), but not properties, unless you change the logic a bit:

1) Create the Room
2) Set the properties
3) Invoke a specific method on your Extension, such as go() or start() or whatever else

hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
grhwood
Posts: 116
Joined: 15 Mar 2011, 04:43

Re: Set room properties for room ext init method to see them

Postby grhwood » 03 Jul 2013, 10:43

I fill a feature wishlist here: viewtopic.php?f=32&t=16213
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Set room properties for room ext init method to see them

Postby Lapo » 03 Jul 2013, 10:57

Thanks.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Baidu [Spider] and 52 guests