Konijima Posted July 7, 2022 Share Posted July 7, 2022 Hello it's me yet again, Some mods require to save files or data into files that are kept into memory. The ability to save that data when ever the server is going to shutdown would be a blessing. Suggestion Adding a server event named 'OnServerShuttingDown' that allow server mods to do a finalization work when the server is shutting down. Result Saving files and data when the server is shutting down. Link to comment Share on other sites More sharing options...
EnigmaGrey Posted July 8, 2022 Share Posted July 8, 2022 Wouldn't that be the OnSave event? Always call save before quit so that the game has time to complete it's save. Link to comment Share on other sites More sharing options...
Konijima Posted July 8, 2022 Author Share Posted July 8, 2022 You know what, I will test that thanks. I'll confirm here if it does it. Link to comment Share on other sites More sharing options...
Konijima Posted July 8, 2022 Author Share Posted July 8, 2022 15 minutes ago, EnigmaGrey said: Wouldn't that be the OnSave event? Always call save before quit so that the game has time to complete it's save. OnSave seem to be only a client sided event after looking at the source. Added this into a server script file. Called `save` and `quit` and no print. Link to comment Share on other sites More sharing options...
Konijima Posted July 8, 2022 Author Share Posted July 8, 2022 (edited) So now that I think about it. If adding a OnServerSave method, could probably get a param that specify if the shutdown signal has been given. Would probably be good to trigger that event before the saving of the GlobalModData so that we can still change stuff in it. local function onServerSave(isShuttingDown) if isShuttingDown then -- do something before saving only if shutting down end -- save stuff end Events.OnServerSave.Add(onServerSave); Edited July 8, 2022 by Konijima Adding specification. duh7 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now