mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-12-16 08:59:46 +01:00
Version 0.95 BETA
This commit is contained in:
76
init.lua
Normal file
76
init.lua
Normal file
@@ -0,0 +1,76 @@
|
||||
-- CONFIG
|
||||
APP_NAME = "otclientv8" -- important, change it, it's name for config dir and files in appdata
|
||||
APP_VERSION = 1337 -- client version for updater and login to indentify outdated client
|
||||
|
||||
-- If you don't use updater or other service, set it to updater = ""
|
||||
Services = {
|
||||
website = "http://otclient.ovh", -- currently not used
|
||||
updater = "http://otclient.ovh/api/updater.php",
|
||||
news = "http://otclient.ovh/api/news.php",
|
||||
stats = "",
|
||||
crash = "http://otclient.ovh/api/crash.php",
|
||||
feedback = "http://otclient.ovh/api/feedback.php"
|
||||
}
|
||||
|
||||
-- Servers accept http login url or ip:port:version
|
||||
Servers = {
|
||||
OTClientV8 = "http://otclient.ovh/api/login.php",
|
||||
OTClientV8proxy = "http://otclient.ovh/api/login.php?proxy=1",
|
||||
OTClientV8c = "otclient.ovh:7171:1099"
|
||||
}
|
||||
ALLOW_CUSTOM_SERVERS = true -- if true it will show option ANOTHER on server list
|
||||
-- CONFIG END
|
||||
|
||||
-- print first terminal message
|
||||
g_logger.info(os.date("== application started at %b %d %Y %X"))
|
||||
g_logger.info(g_app.getName() .. ' ' .. g_app.getVersion() .. ' rev ' .. g_app.getBuildRevision() .. ' (' .. g_app.getBuildCommit() .. ') made by ' .. g_app.getAuthor() .. ' built on ' .. g_app.getBuildDate() .. ' for arch ' .. g_app.getBuildArch())
|
||||
|
||||
if not g_resources.directoryExists("/data") then
|
||||
g_logger.fatal("Data dir doesn't exist.")
|
||||
end
|
||||
|
||||
if not g_resources.directoryExists("/modules") then
|
||||
g_logger.fatal("Modules dir doesn't exist.")
|
||||
end
|
||||
|
||||
-- send and delete crash report if exist
|
||||
if Services.crash ~= nil and Services.crash:len() > 4 then
|
||||
local crashLog = g_resources.readCrashLog(false)
|
||||
local crashLogTxt = g_resources.readCrashLog(true)
|
||||
local normalLog = g_logger.getLastLog()
|
||||
local crashed = false
|
||||
if crashLog:len() > 0 then
|
||||
g_http.post(Services.crash .. "?txt=0", crashLog)
|
||||
crashed = true
|
||||
end
|
||||
if crashLogTxt:len() > 0 then
|
||||
g_http.post(Services.crash .. "?txt=1", crashLogTxt)
|
||||
crashed = true
|
||||
end
|
||||
if crashed and normalLog:len() > 0 then
|
||||
g_http.post(Services.crash .. "?txt=2", normalLog)
|
||||
end
|
||||
g_resources.deleteCrashLog()
|
||||
end
|
||||
|
||||
-- settings
|
||||
g_configs.loadSettings("/config.otml")
|
||||
|
||||
-- load mods
|
||||
g_modules.discoverModules()
|
||||
|
||||
-- libraries modules 0-99
|
||||
g_modules.autoLoadModules(99)
|
||||
g_modules.ensureModuleLoaded("corelib")
|
||||
g_modules.ensureModuleLoaded("gamelib")
|
||||
|
||||
-- client modules 100-499
|
||||
g_modules.autoLoadModules(499)
|
||||
g_modules.ensureModuleLoaded("client")
|
||||
|
||||
-- game modules 500-999
|
||||
g_modules.autoLoadModules(999)
|
||||
g_modules.ensureModuleLoaded("game_interface")
|
||||
|
||||
-- mods 1000-9999
|
||||
g_modules.autoLoadModules(9999)
|
||||
Reference in New Issue
Block a user