Browse Source

feat #1882

tags/v0.10.6^2
Shaun 2 years ago
parent
commit
405591e71e
2 changed files with 7 additions and 4 deletions
  1. +5
    -4
      src/server/world/atlas.js
  2. +2
    -0
      src/server/world/worker.js

+ 5
- 4
src/server/world/atlas.js View File

@@ -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 View File

@@ -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();


Loading…
Cancel
Save