Hello i wrote a Global Save script, i have two problem's.
Everything works but if I have to worry about these errors?
First:
Second:
And there is my script:
Everything works but if I have to worry about these errors?
First:
Code:
ots: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:38: boost::condition_variable::~condition_variable(): Assertion `!pthread_cond_destroy(&cond)' failed.
Second:
Code:
[5:49:00.673] [Error - GlobalEvent Interface]
[5:49:00.673] In a timer event called from:
[5:49:00.673] data/globalevents/scripts/global.lua:onTime
[5:49:00.673] Description:
[5:49:00.673] (luaAddEvent) Callback parameter should be a function.
And there is my script:
LUA:
function onTime()
return prepareShutdown(math.abs(math.ceil(10)))
end
function prepareShutdown(minutes)
if(minutes <= 0) then
addEvent(close(), 1*1000)
addEvent(global(), 10*1000)
return false
end
if(minutes == 1) then
doBroadcastMessage("Server is going down in " .. minutes .. " minute, please log out now!")
elseif(minutes <= 3) then
doBroadcastMessage("Server is going down in " .. minutes .. " minutes, please log out.")
else
doBroadcastMessage("Server is going down in " .. minutes .. " minutes.")
end
shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1)
return true
end
function close()
doSetGameState(GAMESTATE_CLOSED)
end
function global()
doSetGameState(GAMESTATE_SHUTDOWN)
end