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

GlobalEvent Lag Protection onStart

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
I do not know if it happens only with my server but when I open I got much lag at the beginning.
Not only me, but everyone, in some cases, caused death and complaints.
How it works? It will close server after open, only Tutors, Senior Tutors, Community Managers and Gamemasters will be able to login, after 5min Server will open automatically.

Lua:
local delay = 300000 -- 5 minutes as default

local function DisableProtection()
	broadcastMessage("Server has been opened.", MESSAGE_EVENT_ADVANCE)
	doSetGameState(GAMESTATE_NORMAL)
    return true
end

function onStartup()
	doSetGameState(GAMESTATE_CLOSED)
	addEvent(DisableProtection, delay)
	return true
end


Mod version made by Lessaire.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Server: Delayed Open" version="20121025" author="LucasFerraz" contact="author@otland" enabled="yes">

    <globalevent name="init_delayed_open"    type="startup"      event="script" ><![CDATA[

local delay = 300000 -- 5 minutes as default
 
local function DisableProtection()
    broadcastMessage("Server has been opened.", MESSAGE_EVENT_ADVANCE)
    doSetGameState(GAMESTATE_NORMAL)
    return true
end
 
function onStartup()
    doSetGameState(GAMESTATE_CLOSED)
    addEvent(DisableProtection, delay)
    return true
end

        ]]></globalevent>

</mod>
 
Last edited:
~/mods/Server_DelayOpen.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Server: Delayed Open" version="20121025" author="LucasFerrez" contact="author@otland" enabled="yes">

    <globalevent name="init_delayed_open"    type="startup"      event="script" ><![CDATA[

local delay = 300000 -- 5 minutes as default
 
local function DisableProtection()
    broadcastMessage("Server has been opened.", MESSAGE_EVENT_ADVANCE)
    doSetGameState(GAMESTATE_NORMAL)
    return true
end
 
function onStartup()
    doSetGameState(GAMESTATE_CLOSED)
    addEvent(DisableProtection, delay)
    return true
end

        ]]></globalevent>

</mod>
 
Back
Top