mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
mysql-async v3.0.1 support
This commit is contained in:
+2
-13
@@ -1,5 +1,4 @@
|
|||||||
WhiteList = {}
|
WhiteList = {}
|
||||||
local hasSqlRun = false
|
|
||||||
|
|
||||||
function loadWhiteList(cb)
|
function loadWhiteList(cb)
|
||||||
Whitelist = {}
|
Whitelist = {}
|
||||||
@@ -9,26 +8,16 @@ function loadWhiteList(cb)
|
|||||||
table.insert(WhiteList, tostring(identifiers[i].identifier):lower())
|
table.insert(WhiteList, tostring(identifiers[i].identifier):lower())
|
||||||
end
|
end
|
||||||
|
|
||||||
hasSqlRun = true
|
|
||||||
|
|
||||||
if cb ~= nil then
|
if cb ~= nil then
|
||||||
cb()
|
cb()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
AddEventHandler('onMySQLReady', function()
|
MySQL.ready(function()
|
||||||
loadWhiteList()
|
loadWhiteList()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
Citizen.CreateThread(function()
|
|
||||||
Citizen.Wait(10000)
|
|
||||||
|
|
||||||
if not hasSqlRun then
|
|
||||||
loadWhiteList()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
AddEventHandler('playerConnecting', function(name, setCallback, deferrals)
|
AddEventHandler('playerConnecting', function(name, setCallback, deferrals)
|
||||||
-- Mark this connection as deferred, this is to prevent problems while checking player identifiers.
|
-- Mark this connection as deferred, this is to prevent problems while checking player identifiers.
|
||||||
deferrals.defer()
|
deferrals.defer()
|
||||||
@@ -67,4 +56,4 @@ AddEventHandler('playerConnecting', function(name, setCallback, deferrals)
|
|||||||
else
|
else
|
||||||
deferrals.done(kickReason)
|
deferrals.done(kickReason)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user