-- Fast Forgotten / Soteria.pl — gotowy klient (nie edytuj, przebuduj: scripts/build-soteria-client.sh)
APP_NAME = "soteria-fast-forgotten"
APP_VERSION = 1341
DEFAULT_LAYOUT = "retro"

Services = {
  website = "https://soteria.pl",
  updater = "",
  stats = "",
  crash = "",
  feedback = "",
  status = ""
}

Servers = {
  ["Soteria"] = "soteria.pl:7171:860"
}

ALLOW_CUSTOM_SERVERS = false

g_app.setName("Soteria")

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

g_configs.loadSettings("/config.otml")

local settings = g_configs.getSettings()
local layout = DEFAULT_LAYOUT
if g_app.isMobile() then
  layout = "mobile"
elseif settings:exists('layout') then
  layout = settings:getValue('layout')
end
g_resources.setLayout(layout)

g_modules.discoverModules()
g_modules.ensureModuleLoaded("corelib")

local function loadModules()
  g_modules.autoLoadModules(99)
  g_modules.ensureModuleLoaded("gamelib")
  g_modules.autoLoadModules(499)
  g_modules.ensureModuleLoaded("client")
  g_modules.autoLoadModules(999)
  g_modules.ensureModuleLoaded("game_interface")
  g_modules.autoLoadModules(9999)
end

loadModules()
