Przeglądaj źródła

another fix for #1376

tags/v0.5
Big Bad Waffle 4 lat temu
rodzic
commit
0cb219fe8d
1 zmienionych plików z 9 dodań i 9 usunięć
  1. +9
    -9
      src/server/events/events.js

+ 9
- 9
src/server/events/events.js Wyświetl plik

@@ -26,21 +26,21 @@ module.exports = {
const zoneEventPath = zonePath + '/' + zoneName + '/events';

const paths = ['config/globalEvents', zoneEventPath];
const files = [];
paths.forEach(p => {
if (!fs.existsSync(p))
return;

const files = fs.readdirSync(p)
.map(f => ('../' + p + '/' + f));
files.push(...fs.readdirSync(p).map(f => ('../' + p + '/' + f)));
});

this.instance.eventEmitter.emit('onBeforeGetEventList', zoneName, files);
this.instance.eventEmitter.emit('onBeforeGetEventList', zoneName, files);

files.forEach(f => {
const e = require(f);
if (!e.disabled)
this.configs.push(extend({}, e));
}, this);
});
files.forEach(f => {
const e = require(f);
if (!e.disabled)
this.configs.push(extend({}, e));
}, this);
},

getEvent: function (name) {


Ładowanie…
Anuluj
Zapisz