No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

90 líneas
1.5 KiB

  1. define([
  2. 'globals',
  3. 'server',
  4. 'world/atlas',
  5. 'components/components',
  6. 'leaderboard/leaderboard',
  7. 'security/io',
  8. 'misc/mods',
  9. 'mtx/mtx',
  10. 'config/animations',
  11. 'config/skins',
  12. 'config/factions',
  13. 'config/classes',
  14. 'config/spellsConfig',
  15. 'config/spells',
  16. 'items/config/types',
  17. 'security/sheets'
  18. ], function (
  19. globals,
  20. server,
  21. atlas,
  22. components,
  23. leaderboard,
  24. io,
  25. mods,
  26. mtx,
  27. animations,
  28. skins,
  29. factions,
  30. classes,
  31. spellsConfig,
  32. spells,
  33. itemTypes,
  34. sheets
  35. ) {
  36. return {
  37. init: function () {
  38. io.init(this.onDbReady.bind(this));
  39. },
  40. onDbReady: function () {
  41. setInterval(function () {
  42. global.gc();
  43. }, 60000);
  44. process.on('uncaughtException', this.onError.bind(this));
  45. animations.init();
  46. mods.init(this.onModsLoaded.bind(this));
  47. },
  48. onModsLoaded: function () {
  49. globals.init();
  50. classes.init();
  51. spellsConfig.init();
  52. spells.init();
  53. itemTypes.init();
  54. components.init(this.onComponentsReady.bind(this));
  55. },
  56. onComponentsReady: function () {
  57. skins.init();
  58. factions.init();
  59. server.init(this.onServerReady.bind(this));
  60. },
  61. onServerReady: function () {
  62. atlas.init();
  63. leaderboard.init();
  64. sheets.init();
  65. },
  66. onError: function (e) {
  67. if (e.toString().indexOf('ERR_IPC_CHANNEL_CLOSED') > -1)
  68. return;
  69. console.log('Error Logged: ' + e.toString());
  70. io.set({
  71. ent: new Date(),
  72. field: 'error',
  73. value: e.toString() + ' | ' + e.stack.toString(),
  74. callback: function () {
  75. process.exit();
  76. }
  77. });
  78. }
  79. };
  80. });