Shaun před 2 roky
rodič
revize
405591e71e
2 změnil soubory, kde provedl 7 přidání a 4 odebrání
  1. +5
    -4
      src/server/world/atlas.js
  2. +2
    -0
      src/server/world/worker.js

+ 5
- 4
src/server/world/atlas.js Zobrazit soubor

@@ -128,15 +128,16 @@ module.exports = {
mapList.mapList.filter(m => !m.disabled).forEach(m => this.spawnMap(m));
},
spawnMap: function (map) {
let worker = childProcess.fork('./world/worker');
let thread = {
const worker = childProcess.fork('./world/worker', [map.name]);

const thread = {
id: this.nextId++,
name: map.name,
path: map.path,
worker: worker
worker
};

let onMessage = this.onMessage.bind(this, thread);
const onMessage = this.onMessage.bind(this, thread);
worker.on('message', function (m) {
onMessage(m);
});


+ 2
- 0
src/server/world/worker.js Zobrazit soubor

@@ -22,6 +22,8 @@ const itemEffects = require('../items/itemEffects');
const profanities = require('../misc/profanities');
const eventEmitter = require('../misc/events');

instancer.mapName = process.argv[2];

let onCpnsReady = async function () {
factions.init();
skins.init();


Načítá se…
Zrušit
Uložit