mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 20:41:41 +09:00
Fixed Potential desync issue
This commit is contained in:
@@ -14,18 +14,11 @@ end
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local ext, var
|
||||||
local concat = table.concat
|
local concat = table.concat
|
||||||
|
|
||||||
local External = {}
|
local External = {}
|
||||||
|
|
||||||
--- Makes local links to the data is global.ext if it exists
|
|
||||||
local ext, var
|
|
||||||
Event.on_load(function()
|
|
||||||
ext = global.ext
|
|
||||||
if ext then var = ext.var end
|
|
||||||
end)
|
|
||||||
|
|
||||||
--[[-- Checks that local links are valid, will try to add the links if invalid
|
--[[-- Checks that local links are valid, will try to add the links if invalid
|
||||||
@treturn boolean If the external data is valid, if false you should not call any other methods from External
|
@treturn boolean If the external data is valid, if false you should not call any other methods from External
|
||||||
|
|
||||||
@@ -36,14 +29,14 @@ end
|
|||||||
|
|
||||||
]]
|
]]
|
||||||
function External.valid()
|
function External.valid()
|
||||||
if ext ~= nil and ext == global.ext then
|
if global.ext == nil then return false end
|
||||||
return true
|
if ext == global.ext and var == ext.var then
|
||||||
elseif global.ext ~= nil then
|
return var ~= nil
|
||||||
|
else
|
||||||
ext = global.ext
|
ext = global.ext
|
||||||
var = ext.var
|
var = ext.var
|
||||||
return var ~= nil
|
return var ~= nil
|
||||||
end
|
end
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[-- Gets a table of all the servers, key is the server id, value is the server details
|
--[[-- Gets a table of all the servers, key is the server id, value is the server details
|
||||||
|
|||||||
Reference in New Issue
Block a user