-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server/impl): add onServerStop event #2670
base: master
Are you sure you want to change the base?
Conversation
IMO |
Does txadmin handle when a crash occours?
|
That's I said .... u wont be able to hear |
Did you actually test to see if this works? I'm not quite sure how FXServer handles shutting down but will the resources last long enough to even handle this event? One might assume that someone would try to asynchronous tasks with this too (like saving players) which would also probably not work because the server could be shut down before the resource gets a chance to execute.
This seems like a very weird take, the server can't trigger events if its crashing so nothing can handle this. Doing handling this event when the server is in an inconsistent state doesn't sound like something that should be supported by anything anyways. |
Yeah, in my case I'm saving some info of the player into DB, this is a bit random because I get different times, may be the delay that take the server to close the process. In that case TXAdmin trigger the event, wait some time and then kill the server process |
5147028
to
962be88
Compare
Goal of this PR
Added an event to handle necessary actions when the server is stopped. Currently I need to use txadmin to know when the server is going to stop with the
txAdmin:events:serverShuttingDown
event.How is this PR achieving the goal
Created an event that is executed when the quit is requested and when the quit is forced using CTRL+C.
This PR applies to the following area(s)
Server
Successfully tested on
Platforms: Windows
Checklist