-- Arcfall OTCv8 — single-server config
-- Generated 2026-05-06.  Edit Servers entry below if hostname changes.
APP_NAME = "Arcfall"
APP_VERSION = 1341
DEFAULT_LAYOUT = "retro"

-- All OTCv8 default services disabled (we don't use otclient.ovh)
Services = {
  website  = "",
  updater  = "",
  stats    = "",
  crash    = "",
  feedback = "",
  status   = ""
}

-- Servers: format is "host:port:version"
-- Server compiled with _MULTIPLATFORM77 -> accepts 770-772 only.
-- Use 772 (top of the supported range).
--
-- ArcfallTest is a parallel sandbox instance on the same EC2 box,
-- ports 7271/7272, isolated DB+filesystem. Now exposed publicly for remote
-- testing (requires AWS security-group inbound TCP 7271-7272 to be open).
-- Select "ArcfallTest" in the server dropdown to play the dev sandbox.
Servers = {
  Arcfall     = "play.arc-fall.com:7171:772",
  ArcfallTest = "play.arc-fall.com:7271:772"
}

-- Don't show "ANOTHER" custom server option on the login screen
ALLOW_CUSTOM_SERVERS = false

g_app.setName("Arcfall")

-- 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

-- settings
g_configs.loadSettings("/config.otml")

-- set layout
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)

-- load mods
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

-- crash reporter / updater disabled because Services.* are blank
loadModules()
