newby
Active Member
- Joined
- Jun 11, 2016
- Messages
- 183
- Reaction score
- 43
Is it possible to restart the server only with LUA script?
I did this script to save players, clean the map and this stuff
<globalevent name="full ss" time="03:47" event="script" value="fullserversave.lua"/>
But i would like to shutdown the server and re-open to apply new updates
Is it possible?
I did this script to save players, clean the map and this stuff
<globalevent name="full ss" time="03:47" event="script" value="fullserversave.lua"/>
Code:
function onTime()
doBroadcastMessage('Server is going down for a global save within 5 minutes. Please logout.')
addEvent(CloseServer, 5 * 60 * 1000)
return true
end
function CloseServer()
local state = GAMESTATE_CLOSED
doSetGameState(state)
addEvent(ServerSave, 3 * 60 * 1000)
return true
end
function ServerSave()
doSaveServer()
addEvent(ServerClean, 3 * 60 * 1000, cid, experience)
return true
end
function ServerClean()
doCleanMap()
addEvent(OpenServer, 3 * 60 * 1000)
return true
end
function OpenServer()
local state = GAMESTATE_NORMAL
doSetGameState(state)
return true
end
But i would like to shutdown the server and re-open to apply new updates
Is it possible?