aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/commands/admin/addmod.js
diff options
context:
space:
mode:
authorNeel Kamath <neelkamath@protonmail.com>2018-05-13 12:39:55 +0200
committerNeel Kamath <neelkamath@protonmail.com>2018-05-13 12:39:55 +0200
commit2bb5ced363b692a5696b176bc317fe525c0c05df (patch)
tree1532d9456c5f2b25ac05f7cec620a3af890eff83 /server/src/commands/admin/addmod.js
parentRe-add module documentation (diff)
downloadhackchat-2bb5ced363b692a5696b176bc317fe525c0c05df.tar.gz
hackchat-2bb5ced363b692a5696b176bc317fe525c0c05df.zip
Flatten
Diffstat (limited to 'server/src/commands/admin/addmod.js')
-rw-r--r--server/src/commands/admin/addmod.js47
1 files changed, 0 insertions, 47 deletions
diff --git a/server/src/commands/admin/addmod.js b/server/src/commands/admin/addmod.js
deleted file mode 100644
index 4c13b22..0000000
--- a/server/src/commands/admin/addmod.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Description: Adds the target trip to the mod list then elevates the uType
-*/
-
-exports.run = async (core, server, socket, data) => {
- if (socket.uType != 'admin') {
- // ignore if not admin
- return;
- }
-
- let mod = {
- trip: data.trip
- }
-
- core.config.mods.push(mod); // purposely not using `config.set()` to avoid auto-save
-
- let newMod = server.findSockets({ trip: data.trip });
-
- if (newMod.length !== 0) {
- for (let i = 0, l = newMod.length; i < l; i++) {
- newMod[i].uType = 'mod';
-
- server.send({
- cmd: 'info',
- text: 'You are now a mod.'
- }, newMod[i]);
- }
- }
-
- server.reply({
- cmd: 'info',
- text: `Added mod trip: ${data.trip}`
- }, socket);
-
- server.broadcast({
- cmd: 'info',
- text: `Added mod trip: ${data.trip}`
- }, { uType: 'mod' });
-};
-
-exports.requiredData = ['trip'];
-
-exports.info = {
- name: 'addmod',
- usage: 'addmod {trip}',
- description: 'Adds target trip to the config as a mod and upgrades the socket type'
-};