This commit is contained in:
Lorraxs 2024-01-15 10:46:41 +07:00
parent 02a5f0d8af
commit 01155f838d
3 changed files with 13 additions and 13 deletions

View File

@ -20,8 +20,8 @@ games {
}
files {
'web/build/index.html',
'web/build/**/*',
'web/build/index.html',
'web/build/**/*',
}
ui_page 'web/build/index.html'
@ -34,13 +34,12 @@ shared_scripts {
}
--[[ client_scripts {
client_scripts {
"client/classes/*",
"client/impl/*"
} ]]
server_script {
}
server_script {
'@oxmysql/lib/MySQL.lua',
"server/classes/*",
"server/impl/*"
}

View File

@ -292,6 +292,7 @@ function NewImpl(name)
local impl = Impl:extend({
name = name,
config = Config[name] or {},
implType = "impl"
})
main:RegisterImpl(name, impl)
return impl

View File

@ -181,7 +181,7 @@ function Main:CheckValidImpl(name, impl)
end
function Main:RegisterImpl(name, impl)
if Config.EnableModules[name] == nil or not Config.EnableModules[name].enabled then
if impl.implType == "impl" and (Config.EnableModules[name] == nil or not Config.EnableModules[name].enabled) then
self:LogWarning("Impl %s not enabled", name)
return
end
@ -225,25 +225,25 @@ function Main:InitImpl()
end
end
for name, impl in pairs(self.impls) do
if Config.EnableModules[name] and Config.EnableModules[name].priority == 1 then
if impl.implType ~= "impl" or (Config.EnableModules[name] and Config.EnableModules[name].priority == 1) then
self.initializedImpls[name] = impl(self)
end
end
self:LogInfo("All priority 1 initialized")
for name, impl in pairs(self.initializedImpls) do
if Config.EnableModules[name] and Config.EnableModules[name].priority == 1 then
if impl.implType ~= "impl" or (Config.EnableModules[name] and Config.EnableModules[name].priority == 1) then
impl:OnReady()
end
end
else
for name, impl in pairs(self.impls) do
if Config.EnableModules[name] and Config.EnableModules[name].priority == 1 then
if impl.implType ~= "impl" or (Config.EnableModules[name] and Config.EnableModules[name].priority == 1) then
self.initializedImpls[name] = impl(self)
end
end
self:LogInfo("All priority 1 initialized")
for name, impl in pairs(self.initializedImpls) do
if Config.EnableModules[name] and Config.EnableModules[name].priority == 1 then
if impl.implType ~= "impl" or (Config.EnableModules[name] and Config.EnableModules[name].priority == 1) then
impl:OnReady()
end
end
@ -333,7 +333,7 @@ end
main = Main:Init()
local origAddEventHandler = AddEventHandler
--[[ local origAddEventHandler = AddEventHandler
function AddEventHandler(eventName, ...)
if RegisteredEvents[eventName] then
main:LogWarning("Event %s already registered. Removing", eventName)
@ -351,7 +351,7 @@ function RegisterNetEvent(eventName, ...)
end
RegisteredEvents[eventName] = origRegisterNetEvent(eventName, ...)
return RegisteredEvents[eventName]
end
end ]]
Citizen.CreateThread(function()
while GetGameTimer() < main.lastTimeImplRegistered + 1000 do