• 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 z clean/save

Monte321

Banned User
Joined
Jul 21, 2009
Messages
137
Reaction score
0
Mam problem na swoim servie z cleanem i z savem. Otoz gdy robi sie clean badz save wywala z otka 20 osob lub 30 osob. Skrypty mam z tfsa 0.4 wiec co tutaj moze byc zle?

nikt nie pomoze?
 
Last edited by a moderator:
No jakoś dziwnie miał trzymać dla mnie a tu nagle zajebia.com startuje :w00t: :w00t: :w00t: :w00t: :w00t: :w00t: :w00t: :w00t: :w00t:

##nie no taki żarcik "komandosik"
 
Last edited:
function executeclean()
docleanmap()
dobroadcastmessage("game map cleaned, next clean in 2 hours.")
return true
end

function onthink(interval)
dobroadcastmessage("game map cleaning within 30 seconds, please pick up your items!")
addevent(executeclean, 30000)
return true
end

clean!

local config = {
broadcast = {120, 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)
if(table.maxn(config.broadcast) == 0) then
dosaveserver(config.shallow)
else
executesave(config.delay)
end

return true
end

save!
 
Z tego co wiem to jest tak w 0.4 (też tak miałem), że podczas save ustawia GAMESTATE_MAINTAIN przez co nie można się zalogować i wywala wielu graczy (Server is under maintenance, please re-connect in a while) gdy save jest za długi (zabezpieczenie przed crashami itp.), najlepiej to zrób by save trwał jak najkrócej, możesz też w source to zmienić by nie zamykał serwera podczas save:
game.cpp znajdź
Code:
 void Game::saveGameState(bool shallow)
i poniżej usuń
Code:
 if(gameState == GAMESTATE_NORMAL)
 setGameState(GAMESTATE_MAINTAIN);
oraz usuń
Code:
 	if(gameState == GAMESTATE_MAINTAIN)
	setGameState(GAMESTATE_NORMAL);
Tnx dla hermesika za pomoc
 
Donaj mam tak zrobie, zobacze scorpion co Twoj sposob da, przy 350+ graczach nie da sie mniej niz 40 sekund save
 
nie lepiej globalsave i cleanonglobalsave i shutdownonglobalsave i restarter i nie mie cnabow ktorzy beda wymuszali uzywanie cleana?
 
Back
Top