Skip to content

Commit

Permalink
Server save script improvements (#3192)
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires authored Sep 20, 2021
1 parent 7b8e41f commit c9a65a8
Showing 1 changed file with 15 additions and 8 deletions.
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()
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

0 comments on commit c9a65a8

Please sign in to comment.