Skip to content
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

Server save script improvements #3192

Merged
3 commits merged into from
Sep 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions data/globalevents/scripts/serversave.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
local function ServerSave()
omarcopires marked this conversation as resolved.
Show resolved Hide resolved
if configManager.getBoolean(configKeys.SERVER_SAVE_CLEAN_MAP) then
cleanMap()
end

if configManager.getBoolean(configKeys.SERVER_SAVE_CLOSE) then
Game.setGameState(GAME_STATE_CLOSED)
end

if configManager.getBoolean(configKeys.SERVER_SAVE_SHUTDOWN) then
Game.setGameState(GAME_STATE_SHUTDOWN)
else
local closeAtServerSave = configManager.getBoolean(configKeys.SERVER_SAVE_CLOSE)
if closeAtServerSave then
Game.setGameState(GAME_STATE_CLOSED)
end

saveServer()

if configManager.getBoolean(configKeys.SERVER_SAVE_CLEAN_MAP) then
cleanMap()
end

if closeAtServerSave then
Game.setGameState(GAME_STATE_NORMAL)
end
end
end

Expand Down