• 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!

Lua [Help] Server save lasts more than 30 seconds

Aldo Axel

New Member
Joined
Jul 14, 2014
Messages
70
Reaction score
4
Greetings Otlanders, my issue is the next, i got a TFS 0.4 8.6, and my server when it saves, it freezes more than 30 seconds, i mean, server saving takes time at least 35-40 seconds, and disconnect from the server for a while.
Is a problem with the save script, or maybe a bad configuration in my conig.lua, please any feat, tell me in the comments, for your attention thanks.
 
Well, I thought the script was the same as the common ones, so here's my friend:
Lua:
local config = {
    broadcast = {30},
    shallow = "no",
    delay = 120,
    events = 30
}

config.shallow = getBooleanFromString(config.shallow)

local function executeSave(seconds)
    if(isInArray(config.broadcast, seconds)) then
        local text = ""
        if(not config.shallow) then
            text = "Full s"
        else
            text = "S"
        end

        text = text .. "erver save within " .. seconds .. " seconds, please mind it may freeze!"
        doBroadcastMessage(text)
    end

    if(seconds > 0) then
        addEvent(executeSave, config.events * 1000, seconds - config.events)
    else
        doSaveServer(config.shallow)
    end
end

function onThink(interval, lastExecution, thinkInterval)
    if(table.maxn(config.broadcast) == 0) then
        doSaveServer(config.shallow)
    else
        executeSave(config.delay)
    end

    return true
end
 
Are you sure that you use this script? Because the script looks fine to me. Maybe you use Global save? Please check that.
 
Back
Top