mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-04 08:13:21 +00:00
improvement(server/functions): Send full queries with MySQL.store
This commit is contained in:
+10
-11
@@ -165,7 +165,7 @@ end
|
||||
|
||||
local savePlayers = -1
|
||||
Citizen.CreateThread(function()
|
||||
savePlayers = MySQL.Sync.store("UPDATE users SET ? WHERE ?")
|
||||
savePlayers = MySQL.Sync.store("UPDATE users SET `accounts` = ?, `job` = ?, `job_grade` = ?, `group` = ?, `position`= ?, `inventory`, = ?, `loadout` = ? WHERE `identifier` = ?")
|
||||
end)
|
||||
|
||||
ESX.SavePlayer = function(xPlayer, cb)
|
||||
@@ -173,15 +173,14 @@ ESX.SavePlayer = function(xPlayer, cb)
|
||||
|
||||
table.insert(asyncTasks, function(cb2)
|
||||
MySQL.Async.execute(savePlayers, {
|
||||
{
|
||||
['accounts'] = json.encode(xPlayer.getAccounts(true)),
|
||||
['job'] = xPlayer.job.name,
|
||||
['job_grade'] = xPlayer.job.grade,
|
||||
['group'] = xPlayer.getGroup(),
|
||||
['loadout'] = json.encode(xPlayer.getLoadout(true)),
|
||||
['position'] = json.encode(xPlayer.getCoords()),
|
||||
['inventory'] = json.encode(xPlayer.getInventory(true))
|
||||
}, {['identifier'] = xPlayer.getIdentifier()}
|
||||
json.encode(xPlayer.getAccounts(true)),
|
||||
xPlayer.job.name,
|
||||
xPlayer.job.grade,
|
||||
xPlayer.getGroup(),
|
||||
json.encode(xPlayer.getCoords()),
|
||||
json.encode(xPlayer.getInventory(true)),
|
||||
json.encode(xPlayer.getLoadout(true)),
|
||||
xPlayer.getIdentifier()
|
||||
}, function(rowsChanged)
|
||||
cb2()
|
||||
end)
|
||||
@@ -251,7 +250,7 @@ end
|
||||
|
||||
ESX.GetIdentifier = function(playerId)
|
||||
for k,v in ipairs(GetPlayerIdentifiers(playerId)) do
|
||||
if string.match(v, 'license') then
|
||||
if string.match(v, 'license:') then
|
||||
local identifier = string.gsub(v, 'license:', '')
|
||||
return identifier
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user