Laudson1995
New Member
- Joined
- Jan 25, 2019
- Messages
- 37
- Solutions
- 1
- Reaction score
- 3
Onde posso fazer isso? Configurei o comandoSe o servidor estiver ocupado salvando dados do mapa, isso pode ser a causa caso o mapa seja muito grande. Tente desativá-lo e teste novamente. Depende do que está salvando ou limpando o mapa simultaneamente, e também de quais processos estão executando todas essas tarefas; pode ser que esteja atingindo seu limite de capacidade!
serve para 12:00 e sem desligamento, apenas uma vez por dia.Onde posso fazer isso? Configurei o comandoservepara 12:00 e sem desligamento, apenas uma vez por dia.
First, the problem lies in the moment the server save.refresh
First, the problem lies in the moment the server save.
You need to check the serve save script, whether in lua or src, and analyze the loops it goes through; excessive reading and writing of information can cause this, or in the last case, your machine is insufficient for such a large server.
Also, avoid printing text in loops, this causes slowness!
Without a script or at least knowing which distri you are using, it's difficult to help!
I read the script and i see some line's maybe this because of the freeze.you see any erro in the script? =
local function serverSave(interval)
if configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL_CLEAN_MAP) then
cleanMap()
end
saveServer()
local message = string.format(SAVE_INTERVAL_CONFIG_TIME > 1 and "Server save complete. Next save in %d %ss!" or "Server save complete. Next save in %d %s!", SAVE_INTERVAL_CONFIG_TIME, SAVE_INTERVAL_TYPE)
Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT)
logger.info(message)
Webhook.sendMessage("Server save", message, WEBHOOK_COLOR_WARNING)
end
local save = GlobalEvent("save")
function save.onTime(interval)
local remainingTime = 60 * 1000
if configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL) then
local message = "The server will save all accounts within " .. (remainingTime / 1000) .. " seconds. \z
You might lag or freeze for 5 seconds, please find a safe place."
Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT)
logger.info(string.format(message, SAVE_INTERVAL_CONFIG_TIME, SAVE_INTERVAL_TYPE))
addEvent(serverSave, remainingTime, interval)
return true
end
return not configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL)
end
if SAVE_INTERVAL_TIME ~= 0 then
save:interval(SAVE_INTERVAL_CONFIG_TIME * SAVE_INTERVAL_TIME)
else
return logger.error(string.format("[save.onTime] - Save interval type '%s' is not valid, use 'second', 'minute' or 'hour'", SAVE_INTERVAL_TYPE))
end
save:register()
Post automatically merged:
put when he is working i say for you, but you see anything in this script on the task accept?I read the script and i see some line's maybe this because of the freeze.
take a backup from your server-save file and try my code.
local function serverSave()
saveServer()
local message = string.format(
SAVE_INTERVAL_CONFIG_TIME > 1 and
"Server save complete. Next save in %d %ss!" or
"Server save complete. Next save in %d %s!",
SAVE_INTERVAL_CONFIG_TIME,
SAVE_INTERVAL_TYPE
)
Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT)
logger.info(message)
end
local save = GlobalEvent("save")
function save.onTime(interval)
if not configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL) then
return true
end
local remainingTime = 60 -- seconds
Game.broadcastMessage(
"The server will save all accounts in 60 seconds.\nYou may experience a short lag.",
MESSAGE_GAME_HIGHLIGHT
)
logger.info("Server save scheduled in 60 seconds.")
addEvent(serverSave, remainingTime * 1000)
return true
end
if SAVE_INTERVAL_TIME ~= 0 then
save:interval(SAVE_INTERVAL_CONFIG_TIME * SAVE_INTERVAL_TIME)
else
logger.error(string.format(
"[save.onTime] Invalid save interval type: %s (use second/minute/hour)",
SAVE_INTERVAL_TYPE
))
end
save:register()
if configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL_CLEAN_MAP) then
cleanMap()
end
LUA:if configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL_CLEAN_MAP) then cleanMap() end
Your problem might be with the active map clearing, this will scan the map and remove pickable/corpses items.
The problem is that this can remove items from the map if there's no control over them!
this script fiex this problem?I read the script and i see some line's maybe this because of the freeze.
take a backup from your server-save file and try my code.
local function serverSave()
saveServer()
local message = string.format(
SAVE_INTERVAL_CONFIG_TIME > 1 and
"Server save complete. Next save in %d %ss!" or
"Server save complete. Next save in %d %s!",
SAVE_INTERVAL_CONFIG_TIME,
SAVE_INTERVAL_TYPE
)
Game.broadcastMessage(message, MESSAGE_GAME_HIGHLIGHT)
logger.info(message)
end
local save = GlobalEvent("save")
function save.onTime(interval)
if not configManager.getBoolean(configKeys.TOGGLE_SAVE_INTERVAL) then
return true
end
local remainingTime = 60 -- seconds
Game.broadcastMessage(
"The server will save all accounts in 60 seconds.\nYou may experience a short lag.",
MESSAGE_GAME_HIGHLIGHT
)
logger.info("Server save scheduled in 60 seconds.")
addEvent(serverSave, remainingTime * 1000)
return true
end
if SAVE_INTERVAL_TIME ~= 0 then
save:interval(SAVE_INTERVAL_CONFIG_TIME * SAVE_INTERVAL_TIME)
else
logger.error(string.format(
"[save.onTime] Invalid save interval type: %s (use second/minute/hour)",
SAVE_INTERVAL_TYPE
))
end
save:register()