From 73e5c5ccfe408e58eb4bb927c71a77e0fceb22c4 Mon Sep 17 00:00:00 2001 From: neelkamath Date: Fri, 11 May 2018 20:46:12 +0530 Subject: Remove forgettable, unused, occasionally harmful (w.r.t. ES6) directive --- server/src/commands/admin/reload.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'server/src/commands/admin/reload.js') diff --git a/server/src/commands/admin/reload.js b/server/src/commands/admin/reload.js index 387ae97..4e22a95 100644 --- a/server/src/commands/admin/reload.js +++ b/server/src/commands/admin/reload.js @@ -2,8 +2,6 @@ Description: Clears and resets the command modules, outputting any errors */ -'use strict'; - exports.run = async (core, server, socket, data) => { if (socket.uType != 'admin') { // ignore if not admin -- cgit v1.2.1 From acbad15f2bc4a6733407bc17e1a5b4190ed3b287 Mon Sep 17 00:00:00 2001 From: neelkamath Date: Sat, 12 May 2018 14:13:12 +0530 Subject: Remove unused object fields --- server/src/commands/admin/reload.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'server/src/commands/admin/reload.js') diff --git a/server/src/commands/admin/reload.js b/server/src/commands/admin/reload.js index 4e22a95..40de059 100644 --- a/server/src/commands/admin/reload.js +++ b/server/src/commands/admin/reload.js @@ -28,7 +28,4 @@ exports.run = async (core, server, socket, data) => { }, { uType: 'mod' }); }; -exports.info = { - name: 'reload', - description: '(Re)loads any new commands into memory, outputs errors if any' -}; +exports.info = { name: 'reload' }; -- cgit v1.2.1 From 343157350f627b9495184246a90033a1c41f1a2c Mon Sep 17 00:00:00 2001 From: Neel Kamath Date: Sun, 13 May 2018 16:03:22 +0530 Subject: Re-add module documentation --- server/src/commands/admin/reload.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'server/src/commands/admin/reload.js') diff --git a/server/src/commands/admin/reload.js b/server/src/commands/admin/reload.js index 40de059..e2cfbe6 100644 --- a/server/src/commands/admin/reload.js +++ b/server/src/commands/admin/reload.js @@ -28,4 +28,8 @@ exports.run = async (core, server, socket, data) => { }, { uType: 'mod' }); }; -exports.info = { name: 'reload' }; +exports.info = { + name: 'reload', + description: '(Re)loads any new commands into memory, outputs errors if any' +}; + -- cgit v1.2.1 From 2bb5ced363b692a5696b176bc317fe525c0c05df Mon Sep 17 00:00:00 2001 From: Neel Kamath Date: Sun, 13 May 2018 16:09:55 +0530 Subject: Flatten --- server/src/commands/admin/reload.js | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 server/src/commands/admin/reload.js (limited to 'server/src/commands/admin/reload.js') diff --git a/server/src/commands/admin/reload.js b/server/src/commands/admin/reload.js deleted file mode 100644 index e2cfbe6..0000000 --- a/server/src/commands/admin/reload.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - Description: Clears and resets the command modules, outputting any errors -*/ - -exports.run = async (core, server, socket, data) => { - if (socket.uType != 'admin') { - // ignore if not admin - return; - } - - let loadResult = core.managers.dynamicImports.reloadDirCache('src/commands'); - loadResult += core.commands.loadCommands(); - - if (loadResult == '') { - loadResult = `Loaded ${core.commands._commands.length} commands, 0 errors`; - } else { - loadResult = `Loaded ${core.commands._commands.length} commands, error(s): ${loadResult}`; - } - - server.reply({ - cmd: 'info', - text: loadResult - }, socket); - - server.broadcast({ - cmd: 'info', - text: loadResult - }, { uType: 'mod' }); -}; - -exports.info = { - name: 'reload', - description: '(Re)loads any new commands into memory, outputs errors if any' -}; - -- cgit v1.2.1 From 949404cd1aad8492ae0338130f16054adfa38ab7 Mon Sep 17 00:00:00 2001 From: Neel Kamath Date: Sun, 13 May 2018 16:37:56 +0530 Subject: Prevent fucking shit up --- server/src/commands/admin/reload.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 server/src/commands/admin/reload.js (limited to 'server/src/commands/admin/reload.js') diff --git a/server/src/commands/admin/reload.js b/server/src/commands/admin/reload.js new file mode 100644 index 0000000..e2cfbe6 --- /dev/null +++ b/server/src/commands/admin/reload.js @@ -0,0 +1,35 @@ +/* + Description: Clears and resets the command modules, outputting any errors +*/ + +exports.run = async (core, server, socket, data) => { + if (socket.uType != 'admin') { + // ignore if not admin + return; + } + + let loadResult = core.managers.dynamicImports.reloadDirCache('src/commands'); + loadResult += core.commands.loadCommands(); + + if (loadResult == '') { + loadResult = `Loaded ${core.commands._commands.length} commands, 0 errors`; + } else { + loadResult = `Loaded ${core.commands._commands.length} commands, error(s): ${loadResult}`; + } + + server.reply({ + cmd: 'info', + text: loadResult + }, socket); + + server.broadcast({ + cmd: 'info', + text: loadResult + }, { uType: 'mod' }); +}; + +exports.info = { + name: 'reload', + description: '(Re)loads any new commands into memory, outputs errors if any' +}; + -- cgit v1.2.1