Browse Source

fixes #1192

tags/v0.4.3^2
Shaun Kichenbrand 4 years ago
parent
commit
a0ab8b5825
2 changed files with 25 additions and 1 deletions
  1. +7
    -1
      src/server/components/extensions/socialCommands.js
  2. +18
    -0
      src/server/components/social/rezone.js

+ 7
- 1
src/server/components/extensions/socialCommands.js View File

@@ -6,6 +6,7 @@ let factions = require('../../config/factions');
let connections = require('../../security/connections');

const ban = require('../social/ban');
const rezone = require('../social/rezone');
const canChat = require('../social/canChat');

let commandRoles = {
@@ -40,7 +41,8 @@ let commandRoles = {
getXp: 10,
setPassword: 10,
giveSkin: 10,
getMaterials: 10
getMaterials: 10,
rezone: 10
};

//Commands that should be run on the main thread (not the zone thread)
@@ -680,5 +682,9 @@ module.exports = {

ban: function (msg) {
ban(this, msg);
},

rezone: function (msg) {
rezone(this, msg);
}
};

+ 18
- 0
src/server/components/social/rezone.js View File

@@ -0,0 +1,18 @@
module.exports = async (cpnSocial, targetZone) => {
const { obj } = cpnSocial;

obj.fireEvent('beforeRezone');

obj.destroyed = true;

const simpleObj = obj.getSimple(true, false, true);

process.send({
method: 'rezone',
id: obj.serverId,
args: {
obj: simpleObj,
newZone: targetZone
}
});
};

Loading…
Cancel
Save