Ruthless Reign
New Member
- Joined
- Dec 23, 2009
- Messages
- 5
- Reaction score
- 1
I am trying to add a server save the occurs every 30 mins. I am using TFS 1.0. I tried copying the global event for the daily server save and changing 'time' to 'interval' my script looks like this:
In globalevents.xml;
In intervalserversave.lua;
I know the script isn't setup for 30 mins right now but I was putting it as a shorter time to test it. I just wanna make it functional before I put in the actual time.
I used to work on OT's a few years ago been out of the game for a bit. This used to be controlled in the config file so I was a little confused why it was no longer there. If anyone knows how i could add a parameter to the config file that will control an interval server save without shutting down the server. Please let me know. Thank you!
In globalevents.xml;
Code:
<globalevent name="Server Save Hourly" interval="600000" script="intervalserversave.lua"/>
Code:
local shutdownAtServerSave = false
local cleanMapAtServerSave = false
local function serverSave()
if shutdownAtServerSave then
Game.setGameState(GAME_STATE_SHUTDOWN)
else
Game.setGameState(GAME_STATE_NORMAL)
if cleanMapAtServerSave then
cleanMap()
end
Game.setGameState(GAME_STATE_NORMAL)
end
end
local function secondServerSaveWarning()
broadcastMessage("2nd Warning.", MESSAGE_STATUS_WARNING)
addEvent(serverSave, 1000)
end
local function firstServerSaveWarning()
broadcastMessage("1st Warning.", MESSAGE_STATUS_WARNING)
addEvent(secondServerSaveWarning, 12000)
end
function onThink(interval, lastExecution)
Game.setGameState(GAME_STATE_NORMAL)
addEvent(firstServerSaveWarning, 10000)
return not shutdownAtServerSave
end
I know the script isn't setup for 30 mins right now but I was putting it as a shorter time to test it. I just wanna make it functional before I put in the actual time.
I used to work on OT's a few years ago been out of the game for a bit. This used to be controlled in the config file so I was a little confused why it was no longer there. If anyone knows how i could add a parameter to the config file that will control an interval server save without shutting down the server. Please let me know. Thank you!