From 07b2107898fcfb8b664eff134539aac7afed7ff1 Mon Sep 17 00:00:00 2001 From: Atikur Rahaman Santo <55808925+ARSSANTO@users.noreply.github.com> Date: Fri, 26 Nov 2021 19:37:53 +0600 Subject: [PATCH 1/3] is logged in --- client/loops.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/loops.lua b/client/loops.lua index 94bf46a..ad79218 100644 --- a/client/loops.lua +++ b/client/loops.lua @@ -1,7 +1,7 @@ CreateThread(function() while true do Wait(0) - if LocalPlayer.state['isLoggedIn'] then + if LocalPlayer.state.isLoggedIn then Wait((1000 * 60) * QBCore.Config.UpdateInterval) TriggerServerEvent('QBCore:UpdatePlayer') end @@ -11,7 +11,7 @@ end) CreateThread(function() while true do Wait(QBCore.Config.StatusInterval) - if LocalPlayer.state['isLoggedIn'] then + if LocalPlayer.state.isLoggedIn then if QBCore.Functions.GetPlayerData().metadata['hunger'] <= 0 or QBCore.Functions.GetPlayerData().metadata['thirst'] <= 0 then local ped = PlayerPedId() @@ -20,4 +20,4 @@ CreateThread(function() end end end -end) \ No newline at end of file +end) From b921b70989ec353cc50528f3e76a0194c9589dbc Mon Sep 17 00:00:00 2001 From: Jamie <63130054+Jamie-D-T@users.noreply.github.com> Date: Sat, 27 Nov 2021 00:28:56 +0000 Subject: [PATCH 2/3] Update commands.lua Fixed the bug with /me --- server/commands.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/commands.lua b/server/commands.lua index 5a6775d..a2f153d 100644 --- a/server/commands.lua +++ b/server/commands.lua @@ -214,7 +214,7 @@ end, 'user') -- Me command -QBCore.Commands.Add('me', 'Show local message', {name = 'message', help = 'Message to respond with'}, false, function(source, args) +QBCore.Commands.Add('me', 'Show local message', {{name = 'message', help = 'Message to respond with'}}, false, function(source, args) local src = source local ped = GetPlayerPed(src) local pCoords = GetEntityCoords(ped) From 7c3d1bc97341fd2a2c026ef3574399bbd9e9af2a Mon Sep 17 00:00:00 2001 From: Jack <28160910+JackGamesFTW@users.noreply.github.com> Date: Sun, 28 Nov 2021 17:10:27 +0000 Subject: [PATCH 3/3] Fix security issue --- server/player.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server/player.lua b/server/player.lua index a0cef91..00ff571 100644 --- a/server/player.lua +++ b/server/player.lua @@ -9,9 +9,9 @@ function QBCore.Player.Login(source, citizenid, newData) local src = source if src then if citizenid then - local result = exports.oxmysql:executeSync('SELECT * FROM players WHERE citizenid = ?', { citizenid }) - local PlayerData = result[1] - if PlayerData then + local license = QBCore.Functions.GetIdentifier(src, 'license') + local PlayerData = exports.oxmysql:singleSync('SELECT * FROM players where citizenid = ?', { citizenid }) + if PlayerData and license == PlayerData.license then PlayerData.money = json.decode(PlayerData.money) PlayerData.job = json.decode(PlayerData.job) PlayerData.position = json.decode(PlayerData.position) @@ -22,8 +22,11 @@ function QBCore.Player.Login(source, citizenid, newData) else PlayerData.gang = {} end + QBCore.Player.CheckPlayerData(src, PlayerData) + else + DropPlayer(src, 'You Have Been Kicked For Exploitation') + TriggerEvent('qb-log:server:CreateLog', 'anticheat', 'Anti-Cheat', 'white', GetPlayerName(src) .. ' Has Been Dropped For Character Joining Exploit', false) end - QBCore.Player.CheckPlayerData(src, PlayerData) else QBCore.Player.CheckPlayerData(src, newData) end