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

Set offline on startup.

Teddy

SweStream.se
Joined
Oct 2, 2008
Messages
3,797
Reaction score
10
Location
Sweden 172
Hello when my server crash all online players are still on "who is online" on the website and they will stay online untill they relogg..?
Do anyone know how to fix this problem or are there any script that set all players offline when server start up?
 
When the server "crashes" it closes the entire thing down so when you start back up nobody should be able to log in until it's set and ready, unless you have a lag time before they can connect to their char directly after it starts back up. As for the webpage, I'm assuming it has a specific amount of waiting time before recieving updates from the server, eg:
You first get it configured and you open your server, default I am guessing the waiting time is 30 minutes, before those first 30 minutes your webpage says 0 players
After the first 30 minutes your webpage says X players online and so on and so forth.
 
XML:
	<globalevent name="serverstart" type="start" event="script" value="start.lua"/>

LUA:
function onStartup()
	db.executeQuery("UPDATE `players` SET `online` = 0 WHERE `world_id` = " .. getConfigValue('worldId') .. ";")
	return true
end

Didn't tested
 
[18:37:12.694] [Error - GlobalEvent Interface]
[18:37:12.695] data/globalevents/scripts/start.lua:onStartup
[18:37:12.696] Description:
[18:37:12.696] data/globalevents/scripts/start.lua:2: attempt to call field 'exe
cuteQuery' (a nil value)
[18:37:12.697] stack traceback:
[18:37:12.698] data/globalevents/scripts/start.lua:2: in function <data/globale
vents/scripts/start.lua:1>
 
Back
Top