mirror of
https://github.com/edubart/otclient.git
synced 2025-10-21 23:05:54 +02:00
Packages system with .otpkg files
When otclient initializes it tries to find all .otpkg files inside the current search paths (./ ./modules ./addons) and then add them to the front of current search paths. This way .otpkg can contains many modules/addons and modifications in a single file that otclient can recognize. otpkg files can be compressed files supported by PhysFS, which are ZIP (.zip) and LZMA (.7z).
This commit is contained in:
11
init.lua
11
init.lua
@@ -8,18 +8,21 @@ g_logger.setLogFile(g_resources.getWorkDir() .. g_app.getCompactName() .. ".log"
|
||||
g_logger.info(g_app.getName() .. ' ' .. g_app.getVersion() .. ' rev ' .. g_app.getBuildRevision() .. ' (' .. g_app.getBuildCommit() .. ') built on ' .. g_app.getBuildDate() .. ' for arch ' .. g_app.getBuildArch())
|
||||
|
||||
--add base folder to search path
|
||||
g_resources.addToSearchPath(g_resources.getWorkDir())
|
||||
g_resources.addSearchPath(g_resources.getWorkDir())
|
||||
|
||||
-- add modules directory to the search path
|
||||
if not g_resources.addToSearchPath(g_resources.getWorkDir() .. "modules", true) then
|
||||
if not g_resources.addSearchPath(g_resources.getWorkDir() .. "modules", true) then
|
||||
g_logger.fatal("Unable to add modules directory to the search path.")
|
||||
end
|
||||
|
||||
-- try to add addons path too
|
||||
g_resources.addToSearchPath(g_resources.getWorkDir() .. "addons", true)
|
||||
g_resources.addSearchPath(g_resources.getWorkDir() .. "addons", true)
|
||||
|
||||
-- setup directory for saving configurations
|
||||
g_resources.setupWriteDir(g_app.getCompactName())
|
||||
g_resources.setupUserWriteDir(g_app.getCompactName())
|
||||
|
||||
-- search all packages
|
||||
g_resources.searchAndAddPackages('/', '.otpkg', true)
|
||||
|
||||
-- load configurations
|
||||
g_configs.load("/config.otml")
|
||||
|
Reference in New Issue
Block a user