• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem with global save

MUTANO

New Member
Joined
Jan 10, 2009
Messages
39
Reaction score
2
Location
Brazil - Santa Catarina
Hello!

I need help with my overall save ...

I put to save at 7:00 hrs in config.lua, the server gives messages to the correct time but the time to give it hangs shutdown and not restart, so the screen is locked ot the shutdown message and no one can do loggin.

The config.lua is as follows:

globalSaveEnabled = true
globalSaveHour = 7
shutdownAtGlobalSave = true
cleanMapAtGlobalSave = true

How could I fix that?

I appreciate any help in advance!
 
In reality I want is that it gives the shutdown, what matters is less clean and save it because the server does automatically from time to time, but it would be important to save before shutdown course.
 
I don't know what the problem is.

Try using a custom script that allows you to save every 48 hours.

XML code:
Code:
<globalevent name="globalsave" time="3:00" event="script" value="globalsave.lua"/>

LUA code:
Code:
function prepareShutdown(minutes) if(minutes <= 0) then
        doSetGameState(GAMESTATE_SHUTDOWN)
        return false
    end
 
 
    if(minutes == 1) then
        doBroadcastMessage("Server is going down in " .. minutes .. " minute for global save, please log out now!")
    elseif(minutes <= 3) then
        doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save, please log out.")
    else
        doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save.")
    end
 
 
    shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1)
    return true
end
 
 
function onTime(interval)
	if os.date('%H') == "3" and getWorldUpTime() > 20*60*60 then
		return prepareShutdown(10)
	end
return TRUE
end
 
I don't know what the problem is.

Try using a custom script that allows you to save every 48 hours.

XML code:
Code:
<globalevent name="globalsave" time="3:00" event="script" value="globalsave.lua"/>

LUA code:
Code:
function prepareShutdown(minutes) if(minutes <= 0) then
        doSetGameState(GAMESTATE_SHUTDOWN)
        return false
    end
 
 
    if(minutes == 1) then
        doBroadcastMessage("Server is going down in " .. minutes .. " minute for global save, please log out now!")
    elseif(minutes <= 3) then
        doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save, please log out.")
    else
        doBroadcastMessage("Server is going down in " .. minutes .. " minutes for global save.")
    end
 
 
    shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1)
    return true
end
 
 
function onTime(interval)
	if os.date('%H') == "3" and getWorldUpTime() > 20*60*60 then
		return prepareShutdown(10)
	end
return TRUE
end


do you know how to make to open server 5 minutes after shutdown? in globalevents

also where i can find function doSetGameState(GAMESTATE_SHUTDOWN)?
 
Just what I need! But there was an error ...

[Warning - Event :: loadScript] OnTimer Event not found (data/globalevents/scripts/globalsave.lua)

has a solution? :huh:

EDIT ----

I made this change and it worked

function onTimer(interval)
if os.date('%H') == "3" and getWorldUpTime() > 20*60*60 then
return prepareShutdown(10)
end
return TRUE
end

I'll take the test...

- - - Updated - - -

I was giving everything right, however it appeared that message...

Preparing to shutdown the server- done.

...and caught :(

My distro is in trouble? how to solve?

Please help-me
 
Last edited:
Back
Top