can't reload room extension

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

Moderators: Lapo, Bax

Neznajka
Posts: 10
Joined: 14 Jun 2012, 09:12

can't reload room extension

Postby Neznajka » 02 Feb 2013, 11:53

I'm sorry if there was any question like this, but I searched about 3-4 hours and didn't find something useful.

here is the point code contains 5 rooms. each room is in separate .jar file, it was needed to reload each room without losing room data, maybe it is wrong I can rebuild the extension to be in 1 .jar file. but problem is that room extensions never reload, I tried room reload auto there was no users no reload, going into Zone-Monitor (can reload manually zone in the monitor selected and tab of extensions there is button reload.) doing the same for the room there are no button reload. tried reload room trough Extension manager it throws exception that this feature is not supported yet, what is the right way to reload room extensions ? and is it possible to reload them without restarting the server.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: can't reload room extension

Postby rjgtav » 02 Feb 2013, 12:53

Hello,

Room-level Extensions work a bit different than Zone-level extensions, in terms of reloading. When a zone extension is reloaded, the zone starts using the new extension file and destroys the older one. But when a room extension is reloaded, it isn't updated on the rooms which were already using it. Only new rooms will start using the new extension, while the already existing rooms will keep using the old version.

If you're using static rooms, it is better if you handle the room iteration through a Zone-level extension, which you can easily reload, and then use RoomVariables or the properties property from the Room object in order to store the game state.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Neznajka
Posts: 10
Joined: 14 Jun 2012, 09:12

Re: can't reload room extension

Postby Neznajka » 02 Feb 2013, 13:39

so only way to reload room is to make some timer that checks room clients and if there is no clients in current room then you can reload it ? that is impossible in my case to reload without restart. is there any possible way to create temp room with new extension and when the old room is empty just destroy and replace with temp one ?

I mean you have room Main and you make some room Main-temp I may make some static var in Main that means wait for destroy and Main-temp var that means wait for replace. and when Main is destroyed can I rename Main-temp to Main ? or this is not impossible to ?

why it is impossible because major of my rooms potential will have at least 10-100 clients online = [ I just need to know the way to support application by adding new features. if it is not possible then I think I will need to make something like double rooms like Main 1 and Main 2 and just switch the flags between them and destroy on empty. I mean there is flag that destructs room after it is empty so on next user it will be created with new logic so I load new Main 2 and in zone extension change Main 1 active to false Main 2 to true, and than redirect to Main 2 all users coming to Main 1.

or if there any way to create new rooms? I mean you have room Excample like Main and to make room Main1 by some specific command. so you can easly increase the number and take the oldest application as room for new users.

I just don't understand why room extension have reload mode auto if it means absolutly nothing = [ they could write something like - room have no reload (change extension room recreate).
than I would know how to build my code if I will whana to create rooms. but there are reload modes and some people is writing like they are reloading rooms I thinked that I'm just a noob so I will take time to explore when I will have more time.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: can't reload room extension

Postby rjgtav » 02 Feb 2013, 19:20

Hi,

The Room Extensions reload mode is designed in a way which is better for a lobby based application. Imagine a lobby where you have hundreds of cards games, and you update the room-level extension responsible for handling the game rooms. Instead of reloading the extension in every room, it simply loads that new extension when a new room is created. I've suggested to the team a way to reload the Room-Level extension only if the room is a static room, a room with RoomRemoveMode set to NEVER_REMOVE.

In the mean-time, you can use a Zone-Level extension to handle most if not all the logic, and store the room's state in RoomVariables or in the Room's Properties Object.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Neznajka
Posts: 10
Joined: 14 Jun 2012, 09:12

Re: can't reload room extension

Postby Neznajka » 03 Feb 2013, 07:27

he he here is joke in the start of development that was in zone extension than I decided to place the code by rooms beacuse it is much better to substain delimitered code and easier to code, but now I hear that room extension can not be reloaded = / that is very bad and that is not mentioned eaven in documentation for Extensions, why such a major feature no one explain. than I think I will need to rool back changes and ask flash programmer to send all requests to zone = [
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: can't reload room extension

Postby Lapo » 04 Feb 2013, 09:02

Room Extension code can be re-deployed at runtime and it will be launched by all new Rooms that will be created later.

Typically Room Extensions are useful to run games, if you reload new code while the game is running the whole game will break apart, that's why the new code doesn't affect existing Rooms.

Additionally at run time you might have thousands of Rooms running the same copy of the Extension. Reloading the new Extension a thousand times for each active Room would block the server for a long time making in completely unresponsive.
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Google [Bot] and 42 guests