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