feat(server): lan identifer

Create fake identifier when using sv_lan
This commit is contained in:
Andyyy7666
2025-01-17 20:52:28 +01:00
parent 4ff4f487a1
commit dea7ac6c8f
3 changed files with 33 additions and 5 deletions

View File

@@ -426,7 +426,7 @@ end
---@param info table
---@return table
function NDCore.newCharacter(src, info)
local identifier = GetPlayerIdentifierByType(src, Config.characterIdentifier)
local identifier = NDCore.getPlayerIdentifierByType(src, Config.characterIdentifier)
if not identifier then return end
local charInfo = {
@@ -468,7 +468,7 @@ end
function NDCore.fetchCharacter(id, src)
local result
if src then
result = MySQL.query.await("SELECT * FROM nd_characters WHERE charid = ? and identifier = ?", {id, GetPlayerIdentifierByType(src, Config.characterIdentifier)})
result = MySQL.query.await("SELECT * FROM nd_characters WHERE charid = ? and identifier = ?", {id, NDCore.getPlayerIdentifierByType(src, Config.characterIdentifier)})
else
result = MySQL.query.await("SELECT * FROM nd_characters WHERE charid = ?", {id})
end
@@ -497,7 +497,7 @@ end
---@return table
function NDCore.fetchAllCharacters(src)
local characters = {}
local result = MySQL.query.await("SELECT * FROM nd_characters WHERE identifier = ?", {GetPlayerIdentifierByType(src, Config.characterIdentifier)})
local result = MySQL.query.await("SELECT * FROM nd_characters WHERE identifier = ?", {NDCore.getPlayerIdentifierByType(src, Config.characterIdentifier)})
for i=1, #result do
local info = result[i]