Advertisement
martintokio

Untitled

Jul 1st, 2022
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. -- CONFIG
  2. APP_NAME = "otclientv8" -- important, change it, it's name for config dir and files in appdata
  3. APP_VERSION = 1341 -- client version for updater and login to identify outdated client
  4. DEFAULT_LAYOUT = "retro" -- on android it's forced to "mobile", check code bellow
  5.  
  6. -- If you don't use updater or other service, set it to updater = ""
  7. Services = {
  8. website = "http://otclient.ovh", -- currently not used
  9. updater = "http://otclient.ovh/api/updater.php",
  10. stats = "",
  11. crash = "http://otclient.ovh/api/crash.php",
  12. feedback = "http://otclient.ovh/api/feedback.php",
  13. status = "http://otclient.ovh/api/status.php"
  14. }
  15.  
  16. -- Servers accept http login url, websocket login url or ip:port:version
  17. Servers = {
  18. Gunzodus = "login.gunzodus.net:7171:1100",
  19. Ezodus = "login.ezodus.net:7171:1000"
  20. }
  21.  
  22. --Server = "ws://otclient.ovh:3000/"
  23. --Server = "ws://127.0.0.1:88/"
  24. --USE_NEW_ENERGAME = true -- uses entergamev2 based on websockets instead of entergame
  25. ALLOW_CUSTOM_SERVERS = true -- if true it shows option ANOTHER on server list
  26.  
  27. g_app.setName("OTCv8")
  28. -- CONFIG END
  29.  
  30. -- print first terminal message
  31. g_logger.info(os.date("== application started at %b %d %Y %X"))
  32. 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())
  33.  
  34. if not g_resources.directoryExists("/data") then
  35. g_logger.fatal("Data dir doesn't exist.")
  36. end
  37.  
  38. if not g_resources.directoryExists("/modules") then
  39. g_logger.fatal("Modules dir doesn't exist.")
  40. end
  41.  
  42. -- settings
  43. g_configs.loadSettings("/config.otml")
  44.  
  45. -- set layout
  46. local settings = g_configs.getSettings()
  47. local layout = DEFAULT_LAYOUT
  48. if g_app.isMobile() then
  49. layout = "mobile"
  50. elseif settings:exists('layout') then
  51. layout = settings:getValue('layout')
  52. end
  53. g_resources.setLayout(layout)
  54.  
  55. -- load mods
  56. g_modules.discoverModules()
  57. g_modules.ensureModuleLoaded("corelib")
  58.  
  59. local function loadModules()
  60. -- libraries modules 0-99
  61. g_modules.autoLoadModules(99)
  62. g_modules.ensureModuleLoaded("gamelib")
  63.  
  64. -- client modules 100-499
  65. g_modules.autoLoadModules(499)
  66. g_modules.ensureModuleLoaded("client")
  67.  
  68. -- game modules 500-999
  69. g_modules.autoLoadModules(999)
  70. g_modules.ensureModuleLoaded("game_interface")
  71.  
  72. -- mods 1000-9999
  73. g_modules.autoLoadModules(9999)
  74. end
  75.  
  76. -- report crash
  77. if type(Services.crash) == 'string' and Services.crash:len() > 4 and g_modules.getModule("crash_reporter") then
  78. g_modules.ensureModuleLoaded("crash_reporter")
  79. end
  80.  
  81. -- run updater, must use data.zip
  82. if type(Services.updater) == 'string' and Services.updater:len() > 4
  83. and g_resources.isLoadedFromArchive() and g_modules.getModule("updater") then
  84. g_modules.ensureModuleLoaded("updater")
  85. return Updater.init(loadModules)
  86. end
  87. loadModules()
  88.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement