What's new

Co jakis czas crash przy save lub clean!

Status
Not open for further replies.

szyszek05

Active User
Joined
Apr 7, 2008
Messages
145
Reaction score
1
Witam
Mam problem, otoz na moim serwerze co jakis czas wystepuje crash, ktorego wina jest save albo clean.
Co moze byc przyczyna ?

Prosze o pomoc
Uzywam TFS 0.4, Tibia 8.6, mapka ~40mb

clean.lua
Code:
function executeClean()
	doCleanMap()
	doBroadcastMessage("Game map cleaned, next clean in 2 hours.")
	return true
end
function onThink(interval, lastExecution, thinkInterval)
	doBroadcastMessage("Game map cleaning within 30 seconds, please pick up your items!")
	addEvent(executeClean, 30000)
	return true
end
save.lua
Code:
local config = {
	broadcast = {120},
	shallow = "yes",
	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 = "s"
		else
			text = "S"
		end
		text = text .. "erver save within " .. seconds .. " seconds!"
		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
 

Idk

Senior User
Joined
Aug 5, 2009
Messages
546
Reaction score
68
Age
29
Odp: Co jakis czas crash przy save lub clean!

Ja bym stawia? na map?, ?e podczas save lub clean'u nie mo?e wczyta? lub usun?? danego itemu lub czego?, i silnik pada.
 

dominomm1900

Active User
Joined
Nov 5, 2010
Messages
61
Reaction score
0
Odp: Co jakis czas crash przy save lub clean!

A mo?e wy??cz auto clean i auto save i r?b r?cznie :p
 

Old Sessam

Hello
Joined
Aug 5, 2009
Messages
445
Reaction score
56
Odp: Co jakis czas crash przy save lub clean!

@up
To nie jest ?adne rozwi?zanie.

Spr?buj podmieni? moje clean.lua i save.lua w globalevents

clean.lua
Code:
function executeClean()
	doCleanMap()
	doBroadcastMessage("Game map cleaned, next clean in 2 hours.")
	return true
end

function onThink(interval, lastExecution, thinkInterval)
	doBroadcastMessage("Game map cleaning within 30 seconds, please pick up your items!")
	addEvent(executeClean, 30000)
	return true
end

Code:
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, lastExecution, thinkInterval)
	if(table.maxn(config.broadcast) == 0) then
		doSaveServer(config.shallow)
	else
		executeSave(config.delay)
	end

	return true
end

wejdz jescze do talkactions i zmie? tak?e zawarto?? clean.lua na:

Code:
local cleanEvent = 0

function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Collected " .. doCleanMap() .. " items.")
		return true
	end

	if(param == 'tile') then
		local removeLoaded, t = false, string.explode(param, ",")
		if(t[2]) then
			removeLoaded = getBooleanFromString(t[2])
		end

		doCleanTile(getCreaturePosition(cid), removeLoaded)
		return true
	end

	if(not tonumber(param)) then
		doPlayerSendCancel(cid, "Command requires numeric param.")
		return true
	end

	stopEvent(cleanEvent)
	prepareClean(tonumber(param), cid)
	return true
end

function prepareClean(minutes, cid)
	if(minutes == 0) then
		if(isPlayer(cid)) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cleaned " .. doCleanMap() .. " items.")
		end

		doBroadcastMessage("Game map cleaned.")
	elseif(minutes > 0) then
		if(minutes == 1) then
			doBroadcastMessage("Game map cleaning in " .. minutes .. " minute, please pick up all your items.")
		else
			doBroadcastMessage("Game map cleaning in " .. minutes .. " minutes.")
		end

		cleanEvent = addEvent(prepareClean, 60000, minutes - 1, cid)
	end
end

Napisz czy dzia?a.
 

szyszek05

Active User
Joined
Apr 7, 2008
Messages
145
Reaction score
1
Odp: Co jakis czas crash przy save lub clean!

@up
Podales mi identyczne skrypty.

Gdy robie save lub clean recznie to tez nie raz sie silnik zatnie.
Wydaje mi sie, ze robi sie to wtedy kiedy w tym samym czasie probuje zrobic i clean i save.
Czy to moze byc przyczyna ?
 
Status
Not open for further replies.
Top