Merge pull request #1811 from ASTROWwwW/feat/edition-detection

feat(esx_lib): add isEnhanced game edition detection
This commit is contained in:
_Not_
2026-08-04 18:26:44 -05:00
committed by GitHub
2 changed files with 19 additions and 1 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ SetMapName("San Andreas")
SetGameType("ESX Legacy")
local oneSyncState = GetConvar("onesync", "off")
local isEnhanced = xLib.isEnhanced()
local newPlayer = "INSERT INTO `users` SET `accounts` = ?, `identifier` = ?, `ssn` = ?, `group` = ?"
local loadPlayer = "SELECT `accounts`, `ssn`, `job`, `job_grade`, `group`, `position`, `inventory`, `skin`, `loadout`, `metadata`"
@@ -151,7 +152,7 @@ if not Config.Multichar then
return deferrals.done(("[ESX] ESX Requires a minimum Artifact version of 10188, Please update your server."))
end
if oneSyncState == "off" or oneSyncState == "legacy" then
if not isEnhanced and (oneSyncState == "off" or oneSyncState == "legacy") then
return deferrals.done(("[ESX] ESX Requires Onesync Infinity to work. This server currently has Onesync set to: %s"):format(oneSyncState))
end
@@ -0,0 +1,17 @@
local ENHANCED_GAME_NAMES <const> = {
["gta5enhanced"] = true,
["gta5_enhanced"] = true
}
local isEnhanced
if IsDuplicityVersion() then
isEnhanced = ENHANCED_GAME_NAMES[GetConvar("gamename", "gta5")] == true
else
isEnhanced = type(IsGameEnhancedVersion) == "function" and IsGameEnhancedVersion() == true
end
---@return boolean
return function()
return isEnhanced
end