diff --git a/fxmanifest.lua b/fxmanifest.lua index 5a3fe39..a20c335 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -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/*" } - diff --git a/impl.lua b/impl.lua index 277efc7..dbd8a0c 100644 --- a/impl.lua +++ b/impl.lua @@ -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 diff --git a/main.lua b/main.lua index 431be57..a2530bf 100644 --- a/main.lua +++ b/main.lua @@ -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