Is there a message/event that gets sent on shutdown?

Post here your suggestions for new possible features in SmartFoxServer.

Moderators: Lapo, Bax

flarb
Posts: 131
Joined: 15 Oct 2007, 21:07
Location: Home of the Body Bag
Contact:

Is there a message/event that gets sent on shutdown?

Postby flarb » 20 Jul 2009, 18:38

As far as I can tell, there is no event that is fired off when you initiiate a server restart/shutdown via the console or admin panel. I want to display a warning message in the game when I initiate a server shutdown. I figured it would be cool if there was an internalevent in the server plug-in and then I'd just send a message to all attached clients that the game is shutting down when this event is fired off. Is this not possible? If not, can you add it?
flarb
Posts: 131
Joined: 15 Oct 2007, 21:07
Location: Home of the Body Bag
Contact:

Also....

Postby flarb » 20 Jul 2009, 21:31

Also....

I think the shutdown feature needs a bit of extras.

Firstly, is there a way to make the shutdown happen over a longer period than 10 seconds?

I think that the shutdown feature from the command line and admin console needs to do a few things:

* Specify a time for shutdown (10 seconds, 30, seconds, a minute, etc.)

* Send an admin message at a certain interval over that time period....so it will send out a message that says "the server will be shutting down in 30 seconds..." then "10 seconds" etc.

* Have an internal event for all plug-ins when the server is about to shut down. That way they can save out any info they need etc.

A lot of this can be done with the scheduling API--so I think that at the very least we need the ability to set the time interval of the shut down event through the command line and admin panel, and then a special internalevent for shutdown to do any plug-in specific processing.
flarb
Posts: 131
Joined: 15 Oct 2007, 21:07
Location: Home of the Body Bag
Contact:

Postby flarb » 20 Jul 2009, 22:27

Oh also---it would be great if CanLogin in the extension helper interface would always return false if the server is set to be shut down.
User avatar
Flying_Banana
Posts: 42
Joined: 04 May 2014, 07:03

Re: Is there a message/event that gets sent on shutdown?

Postby Flying_Banana » 15 Jun 2015, 04:35

I'm also interested on whether there is a method of detecting server shutdown.

I need an entry point to perform some tasks before server shutdown, like closing database connections, saving some data, etc. Is there a workaround?
User avatar
Lapo
Site Admin
Posts: 19314
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Is there a message/event that gets sent on shutdown?

Postby Lapo » 15 Jun 2015, 07:20

Hi,
all you need is adding a "shutdown hook" to the JVM so that it is executed prior to shut down.
We have discussed this already in several places.

See here:
viewtopic.php?f=18&t=16796&p=73192

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “Features Wish List”

Who is online

Users browsing this forum: No registered users and 1 guest