USER_DISCONNECT before Server restart

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

Moderators: Lapo, Bax

User avatar
Pirisok
Posts: 16
Joined: 06 Jan 2018, 10:11

USER_DISCONNECT before Server restart

Postby Pirisok » 06 Jan 2018, 10:16

Hi
I have a question, i searched but didn't fount anything in forums.

If we restart server in panel or in hard way, does USER_DISCONNECT event for players will call or not ?

I mean , we have some data for players and we want to save them before server restarts , how can i do that ?

thanks in advance.
User avatar
Lapo
Site Admin
Posts: 23007
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: USER_DISCONNECT before Server restart

Postby Lapo » 06 Jan 2018, 13:48

Hello,
Pirisok wrote:Hi
If we restart server in panel or in hard way, does USER_DISCONNECT event for players will call or not ?

USER_DISCONNECT is the name of the server side event. If you're restarting the server your Extension will not be able to react to the event as the current instance is being stopped.

I mean , we have some data for players and we want to save them before server restarts , how can i do that ?

You can add a "shutdown hook" in your code to catch the JVM restart and execute your code.
See this discussion:
viewtopic.php?p=79546#p79546

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

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