From 3a3d0fc3d4733f8908e23a03f860d76340479ec4 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Tue, 11 Jun 2019 23:53:30 +0200 Subject: Reorganize Project structure --- .../networking/commands/login/listServers.js | 43 ---------------------- 1 file changed, 43 deletions(-) delete mode 100644 WebInterface/NodeJSServer/src/js/modules/networking/commands/login/listServers.js (limited to 'WebInterface/NodeJSServer/src/js/modules/networking/commands/login/listServers.js') diff --git a/WebInterface/NodeJSServer/src/js/modules/networking/commands/login/listServers.js b/WebInterface/NodeJSServer/src/js/modules/networking/commands/login/listServers.js deleted file mode 100644 index 2c2bc11..0000000 --- a/WebInterface/NodeJSServer/src/js/modules/networking/commands/login/listServers.js +++ /dev/null @@ -1,43 +0,0 @@ -import Command from '../_command'; - -/** - * Handles serverList commands - */ -export default class ListServers extends Command { - /** - * Registers interface for communication with other objects - * @param {Interface} iface - */ - constructor(iface) { - super(iface); - this.registerPublic('listServers', 'listServers'); - this.refreshing = false; - } - - /** - * Requests server list from the server - */ - listServers() { - if (this.refreshing) return; // If already refreshing, no new request - - let listFn = (groups) => { - // Populate server listing - this.iface.callMethod('serverListing', 'flushElements'); - this.iface.callMethod('serverListing', 'addElements', groups, this.iface); - // Unbind network function - this.iface.callMethod('networker', 'removeHandler', 'ListGroups'); - this.refreshing = false; - }; - let errorHandler = (err) => { - this.refreshing = false; - console.error(err.toString()); - }; - - this.iface.callMethod('networker', 'registerHandler', - 'ListGroups', listFn); - this.iface.callMethod('networker', 'sendRequest', - 'GetGroups', errorHandler); - - this.refreshing = true; - } -} -- cgit v1.2.3-70-g09d2