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

marian1

O RLY?
Joined
May 22, 2009
Messages
88
Reaction score
0
Witam,
Co jakis czas (raz na dwa-trzy dni) auto-clean crashuje mi serwer.
Wyglada to tak:

w logu
Code:
:> Broadcasted message: "Game map cleaning within 30 seconds, please pick up your items!".
Segmentation fault
The Forgotten Server, version 0.3.5 (Crying Damson)
i tutaj dalej serwer sie laduje

Dodam tylko ze nie dzieje sie tak przy kazdym cleanie tylko przy 'losowych' (najczesciej gdy na serwerze jest ponad 400 graczy - pewnie chodzi tutaj o ilosc zbieranych itemow).

Moj clean.lua z globalevents:
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
oraz clean.lua z talkactions
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 removeLoadedFromMap = false
                local t = string.explode(param, ",")
                if(t[2]) then
                        removeLoadedFromMap = getBooleanFromString(t[2])
                end

                doCleanTile(getCreaturePosition(cid), removeLoadedFromMap)
                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

Bylbym baardzo wdzieczny za jakas wskazowke jak pozbyc sie tego problemu?
dzieki z gory
 
Na pewno talkaction jest odpowiedzialny za automatycznego cleana w TFS'ie...
 
Częściej cleanuj i używaj TEGO talkaction:

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 removeLoadedFromMap = false
		local t = string.explode(param, ",")
		if(t[2]) then
			removeLoadedFromMap = getBooleanFromString(t[2])
		end

		doCleanTile(getCreaturePosition(cid), removeLoadedFromMap)
		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
 
Back
Top