Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

81 строка
1.9 KiB

  1. require('./globals');
  2. let server = require('./server');
  3. let components = require('./components/components');
  4. let mods = require('./misc/mods');
  5. let animations = require('./config/animations');
  6. let skins = require('./config/skins');
  7. let factions = require('./config/factions');
  8. let classes = require('./config/spirits');
  9. let spellsConfig = require('./config/spellsConfig');
  10. let spells = require('./config/spells');
  11. let itemTypes = require('./items/config/types');
  12. let recipes = require('./config/recipes/recipes');
  13. let mapList = require('./config/maps/mapList');
  14. let sheets = require('./security/sheets');
  15. let fixes = require('./fixes/fixes');
  16. let profanities = require('./misc/profanities');
  17. const routerConfig = require('./security/routerConfig');
  18. let startup = {
  19. init: function () {
  20. io.init(this.onDbReady.bind(this));
  21. },
  22. onDbReady: async function () {
  23. await fixes.fixDb();
  24. process.on('unhandledRejection', this.onError.bind(this));
  25. process.on('uncaughtException', this.onError.bind(this));
  26. await mods.init();
  27. this.onModsLoaded();
  28. },
  29. onModsLoaded: function () {
  30. animations.init();
  31. routerConfig.init();
  32. classes.init();
  33. spellsConfig.init();
  34. spells.init();
  35. recipes.init();
  36. itemTypes.init();
  37. profanities.init();
  38. mapList.init();
  39. components.init(this.onComponentsReady.bind(this));
  40. },
  41. onComponentsReady: async function () {
  42. skins.init();
  43. factions.init();
  44. await clientConfig.init();
  45. server.init(this.onServerReady.bind(this));
  46. },
  47. onServerReady: async function () {
  48. await leaderboard.init();
  49. atlas.init();
  50. sheets.init();
  51. },
  52. onError: async function (e) {
  53. if (e.toString().indexOf('ERR_IPC_CHANNEL_CLOSED') > -1)
  54. return;
  55. _.log('Error Logged: ' + e.toString());
  56. _.log(e.stack);
  57. await io.setAsync({
  58. key: new Date(),
  59. table: 'error',
  60. value: e.toString() + ' | ' + e.stack.toString()
  61. });
  62. process.exit();
  63. }
  64. };
  65. startup.init();