use shutdown hook
This commit is contained in:
parent
f79d477886
commit
269dd2be19
@ -456,13 +456,19 @@ local function createInterface()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local isShuttingDownManually = false
|
||||||
|
hook.Add( "ShutDown", "CFC_DisconnectInterface_MarkShutdown", function()
|
||||||
|
isShuttingDownManually = true
|
||||||
|
end )
|
||||||
|
|
||||||
hook.Add( "CFC_CrashTick", "CFC_DisconnectInterface_InterfaceUpdate", function( isCrashing, _timeDown, _apiState )
|
hook.Add( "CFC_CrashTick", "CFC_DisconnectInterface_InterfaceUpdate", function( isCrashing, _timeDown, _apiState )
|
||||||
timeDown = _timeDown
|
timeDown = _timeDown
|
||||||
if _apiState ~= CFCCrashAPI.PINGING_API then
|
if _apiState ~= CFCCrashAPI.PINGING_API then
|
||||||
apiState = _apiState
|
apiState = _apiState
|
||||||
end
|
end
|
||||||
|
|
||||||
if isCrashing then
|
if isCrashing and not isShuttingDownManually then
|
||||||
-- Open interface if server is crashing, API has responded, interface isn't already open, and interface has not yet been opened
|
-- Open interface if server is crashing, API has responded, interface isn't already open, and interface has not yet been opened
|
||||||
if _apiState == CFCCrashAPI.PINGING_API or _apiState == CFCCrashAPI.SERVER_UP then return end
|
if _apiState == CFCCrashAPI.PINGING_API or _apiState == CFCCrashAPI.SERVER_UP then return end
|
||||||
if interfaceDerma or previouslyShown then return end
|
if interfaceDerma or previouslyShown then return end
|
||||||
|
Loading…
Reference in New Issue
Block a user