Move server commands back into data table.

This commit is contained in:
Vortrex
2021-01-03 03:50:38 -06:00
parent e1204f480f
commit a60f526178

View File

@@ -8,7 +8,33 @@
// TYPE: Server (JavaScript) // TYPE: Server (JavaScript)
// =========================================================================== // ===========================================================================
let serverCommands = { let serverCommands = [];
let builtInCommands = [
"refresh",
"restart",
"stop",
"start",
"reconnect",
"setname",
"connect",
"disconnect",
"say",
"dumpdoc",
];
// ---------------------------------------------------------------------------
function initCommandScript() {
console.log("[Asshat.Command]: Initializing commands script ...");
serverCommands = loadCommands();
console.log("[Asshat.Command]: Initialized commands script!");
}
// ---------------------------------------------------------------------------
function loadCommands() {
return {
account: [ account: [
commandData("login", loginCommand, "<password>", getStaffFlagValue("none"), false, false), commandData("login", loginCommand, "<password>", getStaffFlagValue("none"), false, false),
commandData("register", registerCommand, "<password>", getStaffFlagValue("none"), false, false), commandData("register", registerCommand, "<password>", getStaffFlagValue("none"), false, false),
@@ -267,12 +293,6 @@ let serverCommands = {
], ],
}; };
// ---------------------------------------------------------------------------
function initCommandScript() {
console.log("[Asshat.Command]: Initializing commands script ...");
console.log("[Asshat.Command]: Initialized commands script!");
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -293,6 +313,12 @@ function getCommand(command) {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
function getCommandData(command) {
return getCommand(command);
}
// ---------------------------------------------------------------------------
function getCommands() { function getCommands() {
return serverCommands; return serverCommands;
} }