From fb4c3481d2977a7285e92ee539925f82605cde90 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Wed, 15 Sep 2021 00:44:00 +0200 Subject: [PATCH 1/6] Implement help information loader --- bin/config_sample/text/commandhelp.json | 7 +++++ core/include/config_manager.h | 28 +++++++++++++++++ core/src/config_manager.cpp | 41 ++++++++++++++++++++++++- core/src/server.cpp | 3 ++ 4 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 bin/config_sample/text/commandhelp.json diff --git a/bin/config_sample/text/commandhelp.json b/bin/config_sample/text/commandhelp.json new file mode 100644 index 0000000..f6cbde8 --- /dev/null +++ b/bin/config_sample/text/commandhelp.json @@ -0,0 +1,7 @@ +[ + { + "name": "foo", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + } +] \ No newline at end of file diff --git a/core/include/config_manager.h b/core/include/config_manager.h index e6db121..eedcf42 100644 --- a/core/include/config_manager.h +++ b/core/include/config_manager.h @@ -77,6 +77,13 @@ class ConfigManager { */ static QStringList musiclist(); + /** + * @brief Loads help information into m_help_information. + * + * @return See short description. + */ + static void loadcommandHelp(); + /** * @brief Returns the duration of a song in the songlist. * @param The name of the song where duration is requested @@ -422,6 +429,22 @@ class ConfigManager { */ static qint64 uptime(); + /** + * @brief A struct that contains the help information for a command. + * It's split in the syntax and the explanation text. + */ + struct help { + QString usage; + QString text; + }; + + /** + * @brief Returns a struct with the help information of the command. + * + * @return See short description. + */ + static help commandHelp(QString f_command_name); + /** * @brief Sets the server's authorization type. * @@ -500,6 +523,11 @@ private: */ static QHash* m_musicList; + /** + * @brief QHash containing the help information for all commands registered to the server. + */ + static QHash* m_commands_help; + /** * @brief Returns a stringlist with the contents of a .txt file from config/text/. * diff --git a/core/src/config_manager.cpp b/core/src/config_manager.cpp index 5e21cc6..0935e9c 100644 --- a/core/src/config_manager.cpp +++ b/core/src/config_manager.cpp @@ -25,6 +25,7 @@ QSettings* ConfigManager::m_areas = new QSettings("config/areas.ini", QSettings: ConfigManager::CommandSettings* ConfigManager::m_commands = new CommandSettings(); QElapsedTimer* ConfigManager::m_uptimeTimer = new QElapsedTimer; QHash* ConfigManager::m_musicList = new QHash; +QHash* ConfigManager::m_commands_help = new QHash; bool ConfigManager::verifyServerConfig() { @@ -39,7 +40,8 @@ bool ConfigManager::verifyServerConfig() // Verify config files QStringList l_config_files{"config/config.ini", "config/areas.ini", "config/backgrounds.txt", "config/characters.txt", "config/music.json", - "config/discord.ini", "config/text/8ball.txt", "config/text/gimp.txt", "config/text/praise.txt", "config/text/reprimands.txt"}; + "config/discord.ini", "config/text/8ball.txt", "config/text/gimp.txt", "config/text/praise.txt", + "config/text/reprimands.txt","config/text/commandhelp.json"}; for (const QString &l_file : l_config_files) { if (!fileExists(QFileInfo(l_file))) { qCritical() << l_file + " does not exist!"; @@ -173,6 +175,38 @@ QStringList ConfigManager::musiclist() return l_musiclist; } +void ConfigManager::loadcommandHelp() +{ + QFile l_music_json("config/text/commandhelp.json"); + l_music_json.open(QIODevice::ReadOnly | QIODevice::Text); + + QJsonParseError l_error; + QJsonDocument l_music_list_json = QJsonDocument::fromJson(l_music_json.readAll(), &l_error); + if (!(l_error.error == QJsonParseError::NoError)) { //Non-Terminating error. + qWarning() << "Unable to help information. The following error was encounted : " + l_error.errorString(); + } + + // Akashi expects the helpfile to contain multiple entires, so it always checks for an array first. + QJsonArray l_Json_root_array = l_music_list_json.array(); + QJsonObject l_child_obj; + + for (int i = 0; i <= l_Json_root_array.size() -1; i++){ + l_child_obj = l_Json_root_array.at(i).toObject(); + QString l_name = l_child_obj["name"].toString(); + QString l_usage = l_child_obj["usage"].toString(); + QString l_text = l_child_obj["text"].toString(); + + if (!l_name.isEmpty()) { + help l_help_information; + l_help_information.usage = l_usage; + l_help_information.text = l_text; + + m_commands_help->insert(l_name,l_help_information); + qDebug() << commandHelp("foo").text; + } + } +} + int ConfigManager::songInformation(const QString &f_songName) { return m_musicList->value(f_songName); @@ -540,6 +574,11 @@ qint64 ConfigManager::uptime() return m_uptimeTimer->elapsed(); } +ConfigManager::help ConfigManager::commandHelp(QString f_command_name) +{ + return m_commands_help->value(f_command_name); +} + void ConfigManager::setMotd(const QString f_motd) { m_settings->setValue("Options/motd", f_motd); diff --git a/core/src/server.cpp b/core/src/server.cpp index 8ff9212..7d92017 100644 --- a/core/src/server.cpp +++ b/core/src/server.cpp @@ -97,6 +97,9 @@ void Server::start() this, QOverload::of(&Server::broadcast)); } + //Loads the command help information. This is not stored inside the server. + ConfigManager::loadcommandHelp(); + //Rate-Limiter for IC-Chat connect(&next_message_timer, SIGNAL(timeout()), this, SLOT(allowMessage())); } From 970b0975b4c46739a97ef24344c17020f0f04769 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Wed, 15 Sep 2021 20:27:05 +0200 Subject: [PATCH 2/6] Add command to retrieve help information + Rename old help that displays available commands to commands + Layout basic helpfile --- bin/config_sample/text/commandhelp.json | 637 +++++++++++++++++++++++- core/include/aoclient.h | 10 +- core/src/commands/moderation.cpp | 13 +- 3 files changed, 657 insertions(+), 3 deletions(-) diff --git a/bin/config_sample/text/commandhelp.json b/bin/config_sample/text/commandhelp.json index f6cbde8..f9642d3 100644 --- a/bin/config_sample/text/commandhelp.json +++ b/bin/config_sample/text/commandhelp.json @@ -3,5 +3,640 @@ "name": "foo", "usage": "/foo [baz|qux]", "text": "A sample explanation." - } + }, + { + "name": "foo", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "foo", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "login", + "usage": "/login", + "text": "Activates the login dialogue to enter your credentials. This command takes no arguments." + }, + { + "name": "getareas", + "usage": "/getareas", + "text": "Lists all clients in all areas. This command takes no arguments." + }, + { + "name": "getarea", + "usage": "/getarea", + "text": "Lists all clients in the area the caller is in. This command takes no arguments." + }, + { + "name": "ban", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "kick", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "changeauth", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "rootpass", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "background", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "bg", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "bglock", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "bgunlock", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "adduser", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "listperms", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "addperm", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "removeperm", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "listusers", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "logout", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "pos", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "g", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "need", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "coinflip", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "roll", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "rollp", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "doc", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "cleardoc", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "cm", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "uncm", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "invite", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "uninvite", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "lock", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "area_lock", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "spectatable", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "area_spectate", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "unlock", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "area_unlock", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "timer", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "play", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "areakick", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "area_kick", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "randomchar", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "switch", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "toggleglobal", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "mods", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "commands", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "status", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "forcepos", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "currentmusic", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "pm", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "evidence_mod", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "motd", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "announce", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "m", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "gm", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "mute", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "unmute", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "bans", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "unban", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "removeuser", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "subtheme", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "about", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "evidence_swap", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "notecard", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "notecardreveal", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "notecard_reveal", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "notecardclear", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "notecard_clear", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "8ball", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "lm", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "judgelog", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "allowblankposting", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "allow_blankposting", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "gimp", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "ungimp", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "baninfo", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "testify", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "testimony", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "examine", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "pause", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "delete", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "update", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "add", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "reload", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "disemvovel", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "undisemvovel", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "shake", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "unshake", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "forceimmediate", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "force_noint_pres", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "allowiniswap", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "allow_iniswap", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "afk", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "savetestimony", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "loadtestimony", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "permitsaving", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "mutepm", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "oocmute", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "ooc_mute", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "oocunmute", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "ooc_unmute", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "blockwtce", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "block_wtce", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "unblockwtce", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "unlock_wtce", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "blockdj", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "block_dj", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "unblockdj", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "unblock_dj", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "charcurse", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "uncharcurse", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "charselect", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "togglemusic", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "a", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "s", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "kickuid", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "kick_uid", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "firstperson", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "updateban", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "update_ban", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "changepass", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "ignorebglist", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "ignore_bglist", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "notice", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "noticeg", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "togglejukebox", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, + { + "name": "help", + "usage": "/foo [baz|qux]", + "text": "A sample explanation." + }, ] \ No newline at end of file diff --git a/core/include/aoclient.h b/core/include/aoclient.h index d35a914..9169000 100644 --- a/core/include/aoclient.h +++ b/core/include/aoclient.h @@ -1001,6 +1001,13 @@ class AOClient : public QObject { * * @iscommand */ + void cmdCommands(int argc, QStringList argv); + + /** + * @brief Lists help information to the command requested. Includes syntax and brief explanation. + * + * @details Takes the command name as an argument. + */ void cmdHelp(int argc, QStringList argv); /** @@ -2048,7 +2055,7 @@ class AOClient : public QObject { {"switch", {ACLFlags.value("NONE"), 1, &AOClient::cmdSwitch}}, {"toggleglobal", {ACLFlags.value("NONE"), 0, &AOClient::cmdToggleGlobal}}, {"mods", {ACLFlags.value("NONE"), 0, &AOClient::cmdMods}}, - {"help", {ACLFlags.value("NONE"), 0, &AOClient::cmdHelp}}, + {"commands", {ACLFlags.value("NONE"), 0, &AOClient::cmdCommands}}, {"status", {ACLFlags.value("NONE"), 1, &AOClient::cmdStatus}}, {"forcepos", {ACLFlags.value("CM"), 2, &AOClient::cmdForcePos}}, {"currentmusic", {ACLFlags.value("NONE"), 0, &AOClient::cmdCurrentMusic}}, @@ -2130,6 +2137,7 @@ class AOClient : public QObject { {"notice", {ACLFlags.value("SEND_NOTICE"), 1, &AOClient::cmdNotice}}, {"noticeg", {ACLFlags.value("SEND_NOTICE"), 1, &AOClient::cmdNoticeGlobal}}, {"togglejukebox", {ACLFlags.value("None"), 0, &AOClient::cmdToggleJukebox}}, + {"help", {ACLFlags.value("NONE"), 1, &AOClient::cmdHelp}} }; /** diff --git a/core/src/commands/moderation.cpp b/core/src/commands/moderation.cpp index 35019ba..523dee2 100644 --- a/core/src/commands/moderation.cpp +++ b/core/src/commands/moderation.cpp @@ -149,7 +149,7 @@ void AOClient::cmdMods(int argc, QStringList argv) sendServerMessage(l_entries.join("\n")); } -void AOClient::cmdHelp(int argc, QStringList argv) +void AOClient::cmdCommands(int argc, QStringList argv) { Q_UNUSED(argc); Q_UNUSED(argv); @@ -166,6 +166,17 @@ void AOClient::cmdHelp(int argc, QStringList argv) sendServerMessage(l_entries.join("\n")); } +void AOClient::cmdHelp(int argc, QStringList argv) +{ + if(argc > 1) { + sendServerMessage("Too many arguments. Please only use the command name."); + } + + QString l_command_name = argv[0]; + ConfigManager::help l_command_info = ConfigManager::commandHelp(l_command_name); + sendServerMessage("==Help==\n" +l_command_info.usage + "\n" + l_command_info.text); +} + void AOClient::cmdMOTD(int argc, QStringList argv) { if (argc == 0) { From 650a071006667f6061c0effe526d8f8b4e334f01 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Wed, 15 Sep 2021 22:45:38 +0200 Subject: [PATCH 3/6] Add syntax suggestion on invalid argument + Fill in help file --- bin/config_sample/text/commandhelp.json | 1270 +++++++++++------------ core/src/aoclient.cpp | 1 + 2 files changed, 631 insertions(+), 640 deletions(-) diff --git a/bin/config_sample/text/commandhelp.json b/bin/config_sample/text/commandhelp.json index f9642d3..7be5895 100644 --- a/bin/config_sample/text/commandhelp.json +++ b/bin/config_sample/text/commandhelp.json @@ -1,642 +1,632 @@ [ - { - "name": "foo", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "foo", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "foo", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "login", - "usage": "/login", - "text": "Activates the login dialogue to enter your credentials. This command takes no arguments." - }, - { - "name": "getareas", - "usage": "/getareas", - "text": "Lists all clients in all areas. This command takes no arguments." - }, - { - "name": "getarea", - "usage": "/getarea", - "text": "Lists all clients in the area the caller is in. This command takes no arguments." - }, - { - "name": "ban", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "kick", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "changeauth", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "rootpass", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "background", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "bg", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "bglock", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "bgunlock", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "adduser", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "listperms", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "addperm", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "removeperm", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "listusers", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "logout", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "pos", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "g", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "need", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "coinflip", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "roll", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "rollp", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "doc", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "cleardoc", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "cm", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "uncm", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "invite", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "uninvite", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "lock", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "area_lock", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "spectatable", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "area_spectate", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "unlock", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "area_unlock", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "timer", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "play", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "areakick", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "area_kick", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "randomchar", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "switch", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "toggleglobal", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "mods", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "commands", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "status", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "forcepos", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "currentmusic", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "pm", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "evidence_mod", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "motd", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "announce", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "m", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "gm", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "mute", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "unmute", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "bans", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "unban", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "removeuser", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "subtheme", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "about", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "evidence_swap", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "notecard", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "notecardreveal", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "notecard_reveal", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "notecardclear", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "notecard_clear", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "8ball", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "lm", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "judgelog", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "allowblankposting", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "allow_blankposting", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "gimp", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "ungimp", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "baninfo", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "testify", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "testimony", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "examine", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "pause", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "delete", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "update", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "add", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "reload", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "disemvovel", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "undisemvovel", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "shake", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "unshake", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "forceimmediate", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "force_noint_pres", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "allowiniswap", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "allow_iniswap", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "afk", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "savetestimony", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "loadtestimony", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "permitsaving", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "mutepm", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "oocmute", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "ooc_mute", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "oocunmute", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "ooc_unmute", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "blockwtce", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "block_wtce", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "unblockwtce", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "unlock_wtce", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "blockdj", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "block_dj", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "unblockdj", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "unblock_dj", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "charcurse", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "uncharcurse", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "charselect", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "togglemusic", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "a", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "s", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "kickuid", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "kick_uid", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "firstperson", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "updateban", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "update_ban", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "changepass", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "ignorebglist", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "ignore_bglist", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "notice", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "noticeg", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "togglejukebox", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, - { - "name": "help", - "usage": "/foo [baz|qux]", - "text": "A sample explanation." - }, + { + "name":"foo", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"login", + "usage":"/login", + "text":"Activates the login dialogue to enter your credentials. This command takes no arguments." + }, + { + "name":"getareas", + "usage":"/getareas", + "text":"Lists all clients in all areas. This command takes no arguments." + }, + { + "name":"getarea", + "usage":"/getarea", + "text":"Lists all clients in the area the caller is in. This command takes no arguments." + }, + { + "name":"ban", + "usage":"/ban [IPID|Duration|Reason]", + "text":"Bans a client from the server, orcibly disconnecting them and disallowing their return." + }, + { + "name":"kick", + "usage":"/kick [IPID|Reason]", + "text":"Kicks a client from the server, forcibly disconnecting them." + }, + { + "name":"changeauth", + "usage":"/changeauth", + "text":"A helper to change the authorisation for moderators from simple to advanced." + }, + { + "name":"rootpass", + "usage":"/rootpass [Password]", + "text":"Sets the root user's password." + }, + { + "name":"background", + "usage":"/background [Name]", + "text":"Changes the background of the current area." + }, + { + "name":"bg", + "usage":"/bg [Name]", + "text":"Changes the background of the current area." + }, + { + "name":"bglock", + "usage":"/bglock", + "text":"Locks the background, preventing it from being changed. This command takes no arguments." + }, + { + "name":"bgunlock", + "usage":"/bgunlock", + "text":"Unlocks the background, allowing it to be changed again." + }, + { + "name":"adduser", + "usage":"/adduser [Username|Password]", + "text":"Adds a user to the moderators in advanced authorisation type." + }, + { + "name":"listperms", + "usage":"/listperms *[Username]", + "text":"Lists the permission of a given user. When called with an argument it shows the user's permission." + }, + { + "name":"addperm", + "usage":"/addperm[Username|Permission]", + "text":"Adds permissions to a given user." + }, + { + "name":"removeperm", + "usage":"/removeperm {Username|Permission]", + "text":"Removes permissions from a given user." + }, + { + "name":"listusers", + "usage":"/listusers", + "text":" Lists all users in the server's database. This command takes no arguments." + }, + { + "name":"logout", + "usage":"/logout", + "text":"Logs the caller out from their moderator user. This command takes no arguments." + }, + { + "name":"pos", + "usage":"/pos [Position]", + "text":"Changes the client's position." + }, + { + "name":"g", + "usage":"/g [Message]", + "text":"Sends a global message (i.e., all clients in the server will be able to see it)." + }, + { + "name":"need", + "usage":"/need [Message]", + "text":"A global message expressing that the client needs something (generally: players for something)." + }, + { + "name":"coinflip", + "usage":"/coinflip", + "text":"Flips a coin, returning heads or tails. This command takes no arguments." + }, + { + "name":"roll", + "usage":"/roll [Faces|Dice]", + "text":"Rools dice and sends the results to the area. The first argument is the amount of faces each die should have. The second argument is the amount of dice that should be rolled. Both arguments are optional." + }, + { + "name":"rollp", + "usage":"/foo [baz|qux]", + "text":"Rolls dice, but sends the results in private to the roller. The first argument is the amount of faces each die should have. The second argument is the amount of dice that should be rolled. Both arguments are optional." + }, + { + "name":"doc", + "usage":"/doc [Link/Text]", + "text":"Sets the `/doc` to a custom text." + }, + { + "name":"cleardoc", + "usage":"/cleardoc", + "text":"Sets the `/doc` to `No document.`. This command takes no arguments." + }, + { + "name":"cm", + "usage":"/cm *[ID]", + "text":"Promotes a client to CM status. If called with a user ID as an argument, and the caller is a CM, promotes the target client to CM status." + }, + { + "name":"uncm", + "usage":"/uncm", + "text":"Removes the CM status from the caller. This command takes no arguments." + }, + { + "name":"invite", + "usage":"/invite [ID]", + "text":"Invites a client to the area." + }, + { + "name":"uninvite", + "usage":"/uninvite [ID]", + "text":"Uninvites a client to the area." + }, + { + "name":"lock", + "usage":"/lock", + "text":"Locks the area. This command takes no arguments." + }, + { + "name":"area_lock", + "usage":"/area_lock", + "text":"Locks the area. This command takes no arguments." + }, + { + "name":"spectatable", + "usage":"/spectatable", + "text":"Sets the area to spectatable. This command takes no arguments." + }, + { + "name":"area_spectate", + "usage":"/area_spectate", + "text":"Sets the area to spectatable. This command takes no arguments." + }, + { + "name":"unlock", + "usage":"/unlock", + "text":"Unlocks the area. This command takes no arguments." + }, + { + "name":"area_unlock", + "usage":"/area_unlock", + "text":"Unlocks the area. This command takes no arguments." + }, + { + "name":"timer", + "usage":"/timer *[TimerID|Duration]", + "text":"Gets or sets the global or one of the area-specific timers. If called without arguments, sends an out-of-character message listing the statuses of both the global timer and the area-specific timers. If called with one argument, and that argument is between `0` and `4` (inclusive on both ends), sends an out-of-character message about the status of the given timer, where `0` is the global timer, and the remaining numbers are the first, second, third and fourth timers in the current area." + }, + { + "name":"play", + "usage":"/play [Song]", + "text":"Plays music in the area. Can play either a local file or a URL." + }, + { + "name":"areakick", + "usage":"/areakick [ID]", + "text":"Kicks a client from the area, moving them back to the default area." + }, + { + "name":"area_kick", + "usage":"/area_kick [ID]", + "text":"Kicks a client from the area, moving them back to the default area." + }, + { + "name":"randomchar", + "usage":"/randomchar", + "text":"Picks a new random character for the client. This command takes no arguments." + }, + { + "name":"switch", + "usage":"/switch [CharacterID]", + "text":"Switches to a different character based on character ID." + }, + { + "name":"toggleglobal", + "usage":"/toggleglobal", + "text":"Toggles whether the client will ignore global messages or not." + }, + { + "name":"mods", + "usage":"/mods", + "text":"Lists the currently logged-in moderators on the server." + }, + { + "name":"commands", + "usage":"/commands", + "text":"Lists all the commands that the caller client has the permissions to use. This command takes no arguments." + }, + { + "name":"status", + "usage":"/status [Status]", + "text":"Changes the status of the current area." + }, + { + "name":"forcepos", + "usage":"/forcepos [ID|Position]", + "text":"Forces a client, or all clients in the area, to a specific position. The first argument is the client's ID or * for all client. The second argument is the position to force the clients to." + }, + { + "name":"currentmusic", + "usage":"/currentmusic", + "text":"Returns the currently playing music in the area, and who played it. This command takes no arguments." + }, + { + "name":"pm", + "usage":"/pm [ID|Message]", + "text":"Sends a direct message to another client on the server based on ID." + }, + { + "name":"evidence_mod", + "usage":"/evidence_mod [EvidenceMod]", + "text":"Changes the evidence mod in the area." + }, + { + "name":"motd", + "usage":"/motd *[Message]", + "text":"Gets or sets the server's Message Of The Day. If called without argument, gets the MOTD. If it has a message, sets the message as the MOTD." + }, + { + "name":"announce", + "usage":"/announce [Message]", + "text":"Sends out a decorated global message, for announcements." + }, + { + "name":"m", + "usage":"/m [Message]", + "text":"Sends a message in the server-wide, moderator only chat." + }, + { + "name":"gm", + "usage":"/gm [Message]", + "text":"Sends out a global message that is marked with an `[M]` to mean it is coming from a moderator." + }, + { + "name":"mute", + "usage":"/mute [ClientID]", + "text":"Mutes a client." + }, + { + "name":"unmute", + "usage":"/unmute [ClientID]", + "text":"Removes the muted status from a client." + }, + { + "name":"bans", + "usage":"/bans", + "text":"Lists the last five bans made on the server. This command takes no arguments." + }, + { + "name":"unban", + "usage":"/unban [BanID]", + "text":"Removes a ban from the database." + }, + { + "name":"removeuser", + "usage":"/removeuser [Username]", + "text":"Removes a user from the moderators in `advanced` authorisation type." + }, + { + "name":"subtheme", + "usage":"/subtheme [Theme]", + "text":"Changes the subtheme of the clients in the current area." + }, + { + "name":"about", + "usage":"/about", + "text":"Gives a very brief description of Akashi. This command takes no arguments." + }, + { + "name":"evidence_swap", + "usage":"/foo [EvidenceID|EvidenceID]", + "text":"Changes position of two pieces of evidence in the area." + }, + { + "name":"notecard", + "usage":"/notecard [Message]", + "text":"Writes a note card in the current area. he note card is not readable until all note cards in the area are revealed by a CM. A message will appear to all clients in the area indicating that a note card has been written." + }, + { + "name":"notecardreveal", + "usage":"/notecardreveal", + "text":"Reveals all note cards in the current area. This command takes no arguments." + }, + { + "name":"notecard_reveal", + "usage":"/notecard_reveal", + "text":"Reveals all note cards in the current area. This command takes no arguments." + }, + { + "name":"notecardclear", + "usage":"/notecardclear", + "text":"Erases the client's note card from the area's list of cards. A message will appear to all clients in the area indicating that a note card has been erased. This command takes no arguments." + }, + { + "name":"notecard_clear", + "usage":"/notecard_clear", + "text":"Erases the client's note card from the area's list of cards. A message will appear to all clients in the area indicating that a note card has been erased. This command takes no arguments." + }, + { + "name":"8ball", + "usage":"/8ball [Question]", + "text":"Randomly selects an answer from 8ball.txt to a question." + }, + { + "name":"lm", + "usage":"/lm [Message]", + "text":"Sends out a local message that is marked with an `[M]` to mean it is coming from a moderator." + }, + { + "name":"judgelog", + "usage":"/judgelog", + "text":"ends an out-of-character message with the judgelog of an area. This command takes no arguments." + }, + { + "name":"allowblankposting", + "usage":"allowblankposting", + "text":"Toggle whether or not in-character messages purely consisting of spaces are allowed. Takes no arguments. Against all common sense this also allows you to disable blankposting." + }, + { + "name":"allow_blankposting", + "usage":"/allow_blankposting", + "text":"Toggle whether or not in-character messages purely consisting of spaces are allowed. Takes no arguments. Against all common sense this also allows you to disable blankposting." + }, + { + "name":"gimp", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"ungimp", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"baninfo", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"testify", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"testimony", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"examine", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"pause", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"delete", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"update", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"add", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"reload", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"disemvovel", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"undisemvovel", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"shake", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"unshake", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"forceimmediate", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"force_noint_pres", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"allowiniswap", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"allow_iniswap", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"afk", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"savetestimony", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"loadtestimony", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"permitsaving", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"mutepm", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"oocmute", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"ooc_mute", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"oocunmute", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"ooc_unmute", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"blockwtce", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"block_wtce", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"unblockwtce", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"unlock_wtce", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"blockdj", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"block_dj", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"unblockdj", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"unblock_dj", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"charcurse", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"uncharcurse", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"charselect", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"togglemusic", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"a", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"s", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"kickuid", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"kick_uid", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"firstperson", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"updateban", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"update_ban", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"changepass", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"ignorebglist", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"ignore_bglist", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"notice", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"noticeg", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"togglejukebox", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + }, + { + "name":"help", + "usage":"/foo [baz|qux]", + "text":"A sample explanation." + } ] \ No newline at end of file diff --git a/core/src/aoclient.cpp b/core/src/aoclient.cpp index 7b59c04..87f152a 100644 --- a/core/src/aoclient.cpp +++ b/core/src/aoclient.cpp @@ -200,6 +200,7 @@ void AOClient::handleCommand(QString command, int argc, QStringList argv) if (argc < l_info.minArgs) { sendServerMessage("Invalid command syntax."); + sendServerMessage("The expected syntax for this command is: \n" + ConfigManager::commandHelp(command).usage); return; } From 983a2365fb7455f41158fc954d96f7240c256bdd Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Thu, 16 Sep 2021 23:16:58 +0200 Subject: [PATCH 4/6] Update helpfile for all commands. + Document cmdCharSelect --- bin/config_sample/text/commandhelp.json | 212 ++++++++++++------------ core/include/aoclient.h | 10 +- 2 files changed, 115 insertions(+), 107 deletions(-) diff --git a/bin/config_sample/text/commandhelp.json b/bin/config_sample/text/commandhelp.json index 7be5895..bbeddb1 100644 --- a/bin/config_sample/text/commandhelp.json +++ b/bin/config_sample/text/commandhelp.json @@ -361,193 +361,193 @@ }, { "name":"gimp", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/gimp [ClientID]", + "text":"Replaces a target client's in-character messages with strings randomly selected from gimp.txt. Takes the client id as the only argument." }, { "name":"ungimp", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/ungimp [ClientID]", + "text":"Allows a gimped client to speak normally. User needs to be gimped to be ungimped. Takes the client id as the only argument." }, { "name":"baninfo", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/baninfo [BanID]", + "text":"Looks up info on a ban." }, { "name":"testify", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/testify", + "text":"Enables the testimony recorder in the area. The next message will automatically be used as the title of the testimony. This command takes no arguments." }, { "name":"testimony", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/testimony", + "text":"Outputs the contents of the testimony recorder into OOC. This command takes no arguments." }, { "name":"examine", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/testify", + "text":"Switches the testimony recorder into playback mode. If no testimony has been recorded, this command can't be used. This command takes no arguments." }, { "name":"pause", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/pause", + "text":"Pauses testimony playback. This command takes no arguments." }, { "name":"delete", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/delete", + "text":"Deletes the currently displayed testimony message from the testimony recorder. This command takes no arguments." }, { "name":"update", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/update", + "text":"Updates the currently displayed testimony message with the next message said in IC chat. This command takes no arguments." }, { "name":"add", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/add", + "text":"Adds the next IC message into the testimony recorder after the currently displayed message. This command takes no arguments." }, { "name":"reload", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/reload", + "text":"Reloads the server configuration. This command takes no arguments." }, { "name":"disemvovel", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/disemvovel [ClientID]", + "text":"Disemvovels a user, removing vovels from their IC messages. Takes the client ID as argument." }, { "name":"undisemvovel", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"undisemvovel [ClientID]", + "text":"Removes the disemvovel from a user, allowing them to use vowels again." }, { "name":"shake", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/shake [ClientID]", + "text":"Scrambles the words of a target client's in-character messages. The only argument is the client ID" }, { "name":"unshake", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/unshake [ClientID", + "text":"llows a shaken client to speak normally." }, { "name":"forceimmediate", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/forceimmediate", + "text":"Toggles immediate text processing in the current area. This command takes no arguments." }, { "name":"force_noint_pres", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/force_noint_pres", + "text":"Toggles immediate text processing in the current area. This command takes no arguments." }, { "name":"allowiniswap", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/allowiniswap", + "text":"Toggles whether iniswaps are allowed in the current area. This command takes no arguments." }, { "name":"allow_iniswap", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/allow_iniswap", + "text":"Toggles whether iniswaps are allowed in the current area. This command takes no arguments." }, { "name":"afk", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/afk", + "text":"Toggles whether this client is considered AFK. This command takes no arguments." }, { "name":"savetestimony", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/savetestimony [Name]", + "text":"Saves a testimony recording to the servers storage. Argument is the name of the testimony." }, { "name":"loadtestimony", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/loadtestimony [Name]", + "text":"oads testimony for the testimony replay. Argument is the testimony name." }, { "name":"permitsaving", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/permitsaving [ClientID]", + "text":"Grants a client the temporary permission to save a testimony. Argument is the client ID" }, { "name":"mutepm", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/mutepm", + "text":"oggles whether a client will recieve private messages or not. This command takes no arguments." }, { "name":"oocmute", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/oocmute [ClientID]", + "text":"OOC-mutes a client. Argument is the client ID." }, { "name":"ooc_mute", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/ooc_mute [ClientID]", + "text":"OOC-mutes a client. Argument is the client ID." }, { "name":"oocunmute", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/oocunmute [ClientID", + "text":"Removes the OOC-muted status from a client. Argument is the client ID." }, { "name":"ooc_unmute", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/ooc_unmute [ClientID]", + "text":"Removes the OOC-muted status from a client. Argument is the client ID." }, { "name":"blockwtce", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/blockwtce [ClientID]", + "text":"WTCE-blocks a client. Argument is the client ID." }, { "name":"block_wtce", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/block_wtce [ClientID]", + "text":"WTCE-blocks a client. Argument is the client ID." }, { "name":"unblockwtce", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/unblockwtce [ClientID]", + "text":"WTCE-unblocks a client. Argument is the client ID." }, { "name":"unlock_wtce", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/unblock_wtce [ClientID]", + "text":"WTCE-unblocks a client. Argument is the client ID." }, { "name":"blockdj", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/blockdj [ClientID]", + "text":"DJ-blocks a client. Argument is the client ID." }, { "name":"block_dj", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"block_dj [ClientID]", + "text":"DJ-blocks a client. Argument is the client ID." }, { "name":"unblockdj", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/unblockdj [ClientID]", + "text":"Removes the DJ-blocked status from a client. Argument is the client ID." }, { "name":"unblock_dj", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/unblock_dj [ClientID]", + "text":"Removes the DJ-blocked status from a client. Argument is the client ID." }, { "name":"charcurse", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/charcurse [ClientID|CharacterName]", + "text":"Restricts a target client to a set of characters that they can switch from, blocking them from other characters." }, { "name":"uncharcurse", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"uncharcurse [ClientID]", + "text":"Removes the charcurse status from a client. Argument is the ClientID" }, { "name":"charselect", @@ -556,77 +556,77 @@ }, { "name":"togglemusic", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/tooglemusic", + "text":"Toggles music playing in the current area. This command takes no arguments." }, { "name":"a", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/a [Area|Message]", + "text":"Sends a message to an area that you a CM in." }, { "name":"s", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/s [Message]", + "text":"Send a message to all areas that you are a CM in." }, { "name":"kickuid", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/kickuid [UserID|Message]", + "text":"Kicks a client from the server, forcibly severing its connection to the server. This command only kicks the client with the user ID. Argument is the User ID." }, { "name":"kick_uid", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/kick_uid [UserID|Message]", + "text":"Kicks a client from the server, forcibly severing its connection to the server. This command only kicks the client with the user ID. Argument is the User ID." }, { "name":"firstperson", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/firstperson", + "text":"Toggle whether the client's messages will be sent in first person mode. This command takes no arguments." }, { "name":"updateban", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/updateban [BanID|Field|UpdateValue]", + "text":"Updates a ban in the database, changing either its reason or duration. First argument is the ban ID. Second is the field, 'reason' or 'duration'. Last argument is either the new duration or reason." }, { "name":"update_ban", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/update_ban [BanID|Field|UpdateValue]", + "text":"Updates a ban in the database, changing either its reason or duration. First argument is the ban ID. Second is the field, 'reason' or 'duration'. Last argument is either the new duration or reason." }, { "name":"changepass", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/changepass [Password|*Moderator]", + "text":"Changes a moderator's password. First argument is the new password. Optional second argument is the moderator name." }, { "name":"ignorebglist", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/ignorebglist", + "text":"Toggles whether the BG list is ignored in an area. This command takes no arguments." }, { "name":"ignore_bglist", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/ignore_bglist", + "text":"Toggles whether the BG list is ignored in an area. This command takes no arguments." }, { "name":"notice", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/notice [Message]", + "text":"Pops up a notice for all clients in the targeted area with a given message. Only argument is the message." }, { "name":"noticeg", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/noticeg [Message]", + "text":"Pops up a notice for all clients in the server with a given message. Only argument is the message." }, { "name":"togglejukebox", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/togglejukebox", + "text":"Enables/Disables the Jukebox in the area. This command takes no arguments." }, { "name":"help", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/help [CommandName]", + "text":"Shows you information about a command, if available. Only argument is the command name." } ] \ No newline at end of file diff --git a/core/include/aoclient.h b/core/include/aoclient.h index 9169000..758fed5 100644 --- a/core/include/aoclient.h +++ b/core/include/aoclient.h @@ -1604,6 +1604,14 @@ class AOClient : public QObject { * @iscommand */ void cmdUnCharCurse(int argc, QStringList argv); + + /** + * @brief Forces a client into the charselect screen. + * + * @details The only argument is the **target's ID** whom the client wants to force into charselect. + * + * @iscommand + */ void cmdCharSelect(int argc, QStringList argv); /** @@ -1818,7 +1826,7 @@ class AOClient : public QObject { void cmdToggleMusic(int argc, QStringList argv); /** - * @brief cmdToggleJukebox Toggles jukebox status in the current area. + * @brief Toggles jukebox status in the current area. * * @details No arguments. */ From db0bd7729902245d9949ee75e34f90215416ea80 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Sat, 18 Sep 2021 17:28:14 +0200 Subject: [PATCH 5/6] Apply change suggestions Alternative title : Literally unreadable 2 --- bin/config_sample/text/commandhelp.json | 190 ++++++++++++------------ core/include/config_manager.h | 2 +- core/src/config_manager.cpp | 5 +- core/src/server.cpp | 2 +- 4 files changed, 99 insertions(+), 100 deletions(-) diff --git a/bin/config_sample/text/commandhelp.json b/bin/config_sample/text/commandhelp.json index bbeddb1..562ed5f 100644 --- a/bin/config_sample/text/commandhelp.json +++ b/bin/config_sample/text/commandhelp.json @@ -21,12 +21,12 @@ }, { "name":"ban", - "usage":"/ban [IPID|Duration|Reason]", - "text":"Bans a client from the server, orcibly disconnecting them and disallowing their return." + "usage":"/ban ", + "text":"Bans a client from the server, forcibly disconnecting them and disallowing their return." }, { "name":"kick", - "usage":"/kick [IPID|Reason]", + "usage":"/kick ", "text":"Kicks a client from the server, forcibly disconnecting them." }, { @@ -36,17 +36,17 @@ }, { "name":"rootpass", - "usage":"/rootpass [Password]", + "usage":"/rootpass ", "text":"Sets the root user's password." }, { "name":"background", - "usage":"/background [Name]", + "usage":"/background ", "text":"Changes the background of the current area." }, { "name":"bg", - "usage":"/bg [Name]", + "usage":"/bg ", "text":"Changes the background of the current area." }, { @@ -61,22 +61,22 @@ }, { "name":"adduser", - "usage":"/adduser [Username|Password]", + "usage":"/adduser ", "text":"Adds a user to the moderators in advanced authorisation type." }, { "name":"listperms", - "usage":"/listperms *[Username]", + "usage":"/listperms 'Username'", "text":"Lists the permission of a given user. When called with an argument it shows the user's permission." }, { "name":"addperm", - "usage":"/addperm[Username|Permission]", + "usage":"/addperm ", "text":"Adds permissions to a given user." }, { "name":"removeperm", - "usage":"/removeperm {Username|Permission]", + "usage":"/removeperm ", "text":"Removes permissions from a given user." }, { @@ -91,17 +91,17 @@ }, { "name":"pos", - "usage":"/pos [Position]", + "usage":"/pos ", "text":"Changes the client's position." }, { "name":"g", - "usage":"/g [Message]", + "usage":"/g ", "text":"Sends a global message (i.e., all clients in the server will be able to see it)." }, { "name":"need", - "usage":"/need [Message]", + "usage":"/need ", "text":"A global message expressing that the client needs something (generally: players for something)." }, { @@ -111,17 +111,17 @@ }, { "name":"roll", - "usage":"/roll [Faces|Dice]", + "usage":"/roll 'face' 'die'", "text":"Rools dice and sends the results to the area. The first argument is the amount of faces each die should have. The second argument is the amount of dice that should be rolled. Both arguments are optional." }, { "name":"rollp", - "usage":"/foo [baz|qux]", + "usage":"/rollp 'face' 'die'", "text":"Rolls dice, but sends the results in private to the roller. The first argument is the amount of faces each die should have. The second argument is the amount of dice that should be rolled. Both arguments are optional." }, { "name":"doc", - "usage":"/doc [Link/Text]", + "usage":"/doc ", "text":"Sets the `/doc` to a custom text." }, { @@ -131,7 +131,7 @@ }, { "name":"cm", - "usage":"/cm *[ID]", + "usage":"/cm 'ID'", "text":"Promotes a client to CM status. If called with a user ID as an argument, and the caller is a CM, promotes the target client to CM status." }, { @@ -141,13 +141,13 @@ }, { "name":"invite", - "usage":"/invite [ID]", + "usage":"/invite ", "text":"Invites a client to the area." }, { "name":"uninvite", - "usage":"/uninvite [ID]", - "text":"Uninvites a client to the area." + "usage":"/uninvite ", + "text":"Uninvites a client from. the area." }, { "name":"lock", @@ -181,22 +181,22 @@ }, { "name":"timer", - "usage":"/timer *[TimerID|Duration]", + "usage":"/timer 'Timer' 'Duration'", "text":"Gets or sets the global or one of the area-specific timers. If called without arguments, sends an out-of-character message listing the statuses of both the global timer and the area-specific timers. If called with one argument, and that argument is between `0` and `4` (inclusive on both ends), sends an out-of-character message about the status of the given timer, where `0` is the global timer, and the remaining numbers are the first, second, third and fourth timers in the current area." }, { "name":"play", - "usage":"/play [Song]", + "usage":"/play ", "text":"Plays music in the area. Can play either a local file or a URL." }, { "name":"areakick", - "usage":"/areakick [ID]", + "usage":"/areakick ", "text":"Kicks a client from the area, moving them back to the default area." }, { "name":"area_kick", - "usage":"/area_kick [ID]", + "usage":"/area_kick ", "text":"Kicks a client from the area, moving them back to the default area." }, { @@ -206,7 +206,7 @@ }, { "name":"switch", - "usage":"/switch [CharacterID]", + "usage":"/switch ", "text":"Switches to a different character based on character ID." }, { @@ -226,13 +226,13 @@ }, { "name":"status", - "usage":"/status [Status]", + "usage":"/status ", "text":"Changes the status of the current area." }, { "name":"forcepos", - "usage":"/forcepos [ID|Position]", - "text":"Forces a client, or all clients in the area, to a specific position. The first argument is the client's ID or * for all client. The second argument is the position to force the clients to." + "usage":"/forcepos ", + "text":"Forces a client, or all clients in the area, to a specific position. The first argument is the client's ID or * for all clients. The second argument is the position to force the clients to." }, { "name":"currentmusic", @@ -241,42 +241,42 @@ }, { "name":"pm", - "usage":"/pm [ID|Message]", + "usage":"/pm ", "text":"Sends a direct message to another client on the server based on ID." }, { "name":"evidence_mod", - "usage":"/evidence_mod [EvidenceMod]", + "usage":"/evidence_mod ", "text":"Changes the evidence mod in the area." }, { "name":"motd", - "usage":"/motd *[Message]", - "text":"Gets or sets the server's Message Of The Day. If called without argument, gets the MOTD. If it has a message, sets the message as the MOTD." + "usage":"/motd 'Message'", + "text":"Gets or sets the server's Message Of The Day. If called without an argument, gets the MOTD. If it has a message, sets the message as the MOTD." }, { "name":"announce", - "usage":"/announce [Message]", + "usage":"/announce ", "text":"Sends out a decorated global message, for announcements." }, { "name":"m", - "usage":"/m [Message]", + "usage":"/m ", "text":"Sends a message in the server-wide, moderator only chat." }, { "name":"gm", - "usage":"/gm [Message]", + "usage":"/gm ", "text":"Sends out a global message that is marked with an `[M]` to mean it is coming from a moderator." }, { "name":"mute", - "usage":"/mute [ClientID]", + "usage":"/mute ", "text":"Mutes a client." }, { "name":"unmute", - "usage":"/unmute [ClientID]", + "usage":"/unmute ", "text":"Removes the muted status from a client." }, { @@ -286,17 +286,17 @@ }, { "name":"unban", - "usage":"/unban [BanID]", + "usage":"/unban ", "text":"Removes a ban from the database." }, { "name":"removeuser", - "usage":"/removeuser [Username]", + "usage":"/removeuser ", "text":"Removes a user from the moderators in `advanced` authorisation type." }, { "name":"subtheme", - "usage":"/subtheme [Theme]", + "usage":"/subtheme ", "text":"Changes the subtheme of the clients in the current area." }, { @@ -306,13 +306,13 @@ }, { "name":"evidence_swap", - "usage":"/foo [EvidenceID|EvidenceID]", + "usage":"/evidence_swap ", "text":"Changes position of two pieces of evidence in the area." }, { "name":"notecard", - "usage":"/notecard [Message]", - "text":"Writes a note card in the current area. he note card is not readable until all note cards in the area are revealed by a CM. A message will appear to all clients in the area indicating that a note card has been written." + "usage":"/notecard ", + "text":"Writes a notecard in the current area. The notecard is not readable until all note cards in the area are revealed by a CM. A message will appear to all clients in the area indicating that a notecard has been written." }, { "name":"notecardreveal", @@ -327,21 +327,21 @@ { "name":"notecardclear", "usage":"/notecardclear", - "text":"Erases the client's note card from the area's list of cards. A message will appear to all clients in the area indicating that a note card has been erased. This command takes no arguments." + "text":"Erases the client's notecard from the area's list of cards. A message will appear to all clients in the area indicating that a notecard has been erased. This command takes no arguments." }, { "name":"notecard_clear", "usage":"/notecard_clear", - "text":"Erases the client's note card from the area's list of cards. A message will appear to all clients in the area indicating that a note card has been erased. This command takes no arguments." + "text":"Erases the client's notecard from the area's list of cards. A message will appear to all clients in the area indicating that a notecard has been erased. This command takes no arguments." }, { "name":"8ball", - "usage":"/8ball [Question]", + "usage":"/8ball ", "text":"Randomly selects an answer from 8ball.txt to a question." }, { "name":"lm", - "usage":"/lm [Message]", + "usage":"/lm ", "text":"Sends out a local message that is marked with an `[M]` to mean it is coming from a moderator." }, { @@ -352,26 +352,26 @@ { "name":"allowblankposting", "usage":"allowblankposting", - "text":"Toggle whether or not in-character messages purely consisting of spaces are allowed. Takes no arguments. Against all common sense this also allows you to disable blankposting." + "text":"Toggle whether or not in-character messages purely consisting of spaces are allowed. Takes no arguments. Against all common sense, this also allows you to disable blankposting." }, { "name":"allow_blankposting", "usage":"/allow_blankposting", - "text":"Toggle whether or not in-character messages purely consisting of spaces are allowed. Takes no arguments. Against all common sense this also allows you to disable blankposting." + "text":"Toggle whether or not in-character messages purely consisting of spaces are allowed. Takes no arguments. Against all common sense, this also allows you to disable blankposting." }, { "name":"gimp", - "usage":"/gimp [ClientID]", + "usage":"/gimp ", "text":"Replaces a target client's in-character messages with strings randomly selected from gimp.txt. Takes the client id as the only argument." }, { "name":"ungimp", - "usage":"/ungimp [ClientID]", - "text":"Allows a gimped client to speak normally. User needs to be gimped to be ungimped. Takes the client id as the only argument." + "usage":"/ungimp ", + "text":"Allows a gimped client to speak normally. The user needs to be gimped to be ungimped. Takes the client id as the only argument." }, { "name":"baninfo", - "usage":"/baninfo [BanID]", + "usage":"/baninfo ", "text":"Looks up info on a ban." }, { @@ -416,22 +416,22 @@ }, { "name":"disemvovel", - "usage":"/disemvovel [ClientID]", - "text":"Disemvovels a user, removing vovels from their IC messages. Takes the client ID as argument." + "usage":"/disemvovel ", + "text":"Disemvovels a user, removing vowels from their IC messages. Takes the client ID as an argument." }, { "name":"undisemvovel", - "usage":"undisemvovel [ClientID]", + "usage":"undisemvovel ", "text":"Removes the disemvovel from a user, allowing them to use vowels again." }, { "name":"shake", - "usage":"/shake [ClientID]", + "usage":"/shake ", "text":"Scrambles the words of a target client's in-character messages. The only argument is the client ID" }, { "name":"unshake", - "usage":"/unshake [ClientID", + "usage":"/unshake ", "text":"llows a shaken client to speak normally." }, { @@ -447,7 +447,7 @@ { "name":"allowiniswap", "usage":"/allowiniswap", - "text":"Toggles whether iniswaps are allowed in the current area. This command takes no arguments." + "text":"Toggles whether iniswaps are allowed in the current area. For no apparent reason, this also can be used to disable it. This command takes no arguments." }, { "name":"allow_iniswap", @@ -461,98 +461,98 @@ }, { "name":"savetestimony", - "usage":"/savetestimony [Name]", - "text":"Saves a testimony recording to the servers storage. Argument is the name of the testimony." + "usage":"/savetestimony ", + "text":"Saves a testimony recording to the server's storage. Argument is the name of the testimony." }, { "name":"loadtestimony", - "usage":"/loadtestimony [Name]", - "text":"oads testimony for the testimony replay. Argument is the testimony name." + "usage":"/loadtestimony ", + "text":"Loads testimony for the testimony replay. Argument is the testimony name." }, { "name":"permitsaving", - "usage":"/permitsaving [ClientID]", + "usage":"/permitsaving ", "text":"Grants a client the temporary permission to save a testimony. Argument is the client ID" }, { "name":"mutepm", "usage":"/mutepm", - "text":"oggles whether a client will recieve private messages or not. This command takes no arguments." + "text":"Toggles whether a client will recieve private messages or not. This command takes no arguments." }, { "name":"oocmute", - "usage":"/oocmute [ClientID]", + "usage":"/oocmute ", "text":"OOC-mutes a client. Argument is the client ID." }, { "name":"ooc_mute", - "usage":"/ooc_mute [ClientID]", + "usage":"/ooc_mute ", "text":"OOC-mutes a client. Argument is the client ID." }, { "name":"oocunmute", - "usage":"/oocunmute [ClientID", + "usage":"/oocunmute ", "text":"Removes the OOC-muted status from a client. Argument is the client ID." }, { "name":"ooc_unmute", - "usage":"/ooc_unmute [ClientID]", + "usage":"/ooc_unmute ", "text":"Removes the OOC-muted status from a client. Argument is the client ID." }, { "name":"blockwtce", - "usage":"/blockwtce [ClientID]", + "usage":"/blockwtce ", "text":"WTCE-blocks a client. Argument is the client ID." }, { "name":"block_wtce", - "usage":"/block_wtce [ClientID]", + "usage":"/block_wtce ", "text":"WTCE-blocks a client. Argument is the client ID." }, { "name":"unblockwtce", - "usage":"/unblockwtce [ClientID]", + "usage":"/unblockwtce ", "text":"WTCE-unblocks a client. Argument is the client ID." }, { "name":"unlock_wtce", - "usage":"/unblock_wtce [ClientID]", + "usage":"/unblock_wtce ", "text":"WTCE-unblocks a client. Argument is the client ID." }, { "name":"blockdj", - "usage":"/blockdj [ClientID]", + "usage":"/blockdj ", "text":"DJ-blocks a client. Argument is the client ID." }, { "name":"block_dj", - "usage":"block_dj [ClientID]", + "usage":"block_dj ", "text":"DJ-blocks a client. Argument is the client ID." }, { "name":"unblockdj", - "usage":"/unblockdj [ClientID]", + "usage":"/unblockdj ", "text":"Removes the DJ-blocked status from a client. Argument is the client ID." }, { "name":"unblock_dj", - "usage":"/unblock_dj [ClientID]", + "usage":"/unblock_dj ", "text":"Removes the DJ-blocked status from a client. Argument is the client ID." }, { "name":"charcurse", - "usage":"/charcurse [ClientID|CharacterName]", + "usage":"/charcurse ", "text":"Restricts a target client to a set of characters that they can switch from, blocking them from other characters." }, { "name":"uncharcurse", - "usage":"uncharcurse [ClientID]", + "usage":"uncharcurse ", "text":"Removes the charcurse status from a client. Argument is the ClientID" }, { "name":"charselect", - "usage":"/foo [baz|qux]", - "text":"A sample explanation." + "usage":"/charselect 'ID'", + "text":"Forces yourself into the charselect screen. If used with a client ID, it forces that client back into the charselect screen." }, { "name":"togglemusic", @@ -561,22 +561,22 @@ }, { "name":"a", - "usage":"/a [Area|Message]", + "usage":"/a ", "text":"Sends a message to an area that you a CM in." }, { "name":"s", - "usage":"/s [Message]", + "usage":"/s ", "text":"Send a message to all areas that you are a CM in." }, { "name":"kickuid", - "usage":"/kickuid [UserID|Message]", + "usage":"/kickuid ", "text":"Kicks a client from the server, forcibly severing its connection to the server. This command only kicks the client with the user ID. Argument is the User ID." }, { "name":"kick_uid", - "usage":"/kick_uid [UserID|Message]", + "usage":"/kick_uid ", "text":"Kicks a client from the server, forcibly severing its connection to the server. This command only kicks the client with the user ID. Argument is the User ID." }, { @@ -586,18 +586,18 @@ }, { "name":"updateban", - "usage":"/updateban [BanID|Field|UpdateValue]", + "usage":"/updateban [Duration|Reason]", "text":"Updates a ban in the database, changing either its reason or duration. First argument is the ban ID. Second is the field, 'reason' or 'duration'. Last argument is either the new duration or reason." }, { "name":"update_ban", - "usage":"/update_ban [BanID|Field|UpdateValue]", + "usage":"/update_ban [Duration|Reason]", "text":"Updates a ban in the database, changing either its reason or duration. First argument is the ban ID. Second is the field, 'reason' or 'duration'. Last argument is either the new duration or reason." }, { "name":"changepass", - "usage":"/changepass [Password|*Moderator]", - "text":"Changes a moderator's password. First argument is the new password. Optional second argument is the moderator name." + "usage":"/changepass 'Moderator'", + "text":"Changes a moderator's password. The first argument is the new password. The optional second argument is the moderator name." }, { "name":"ignorebglist", @@ -611,13 +611,13 @@ }, { "name":"notice", - "usage":"/notice [Message]", - "text":"Pops up a notice for all clients in the targeted area with a given message. Only argument is the message." + "usage":"/notice ", + "text":"Pops up a notice for all clients in the targeted area with a given message. The only argument is the message." }, { "name":"noticeg", - "usage":"/noticeg [Message]", - "text":"Pops up a notice for all clients in the server with a given message. Only argument is the message." + "usage":"/noticeg ", + "text":"Pops up a notice for all clients in the server with a given message. The only argument is the message." }, { "name":"togglejukebox", @@ -626,7 +626,7 @@ }, { "name":"help", - "usage":"/help [CommandName]", - "text":"Shows you information about a command, if available. Only argument is the command name." + "usage":"/help ", + "text":"Shows you information about a command, if available. The only argument is the command name. About Syntax : are mandatory arguments. 'Argument' are optional arguments. [Argument|OtherArgument] is that two argument types are valid, but only one can be used." } ] \ No newline at end of file diff --git a/core/include/config_manager.h b/core/include/config_manager.h index eedcf42..9bf095c 100644 --- a/core/include/config_manager.h +++ b/core/include/config_manager.h @@ -82,7 +82,7 @@ class ConfigManager { * * @return See short description. */ - static void loadcommandHelp(); + static void loadCommandHelp(); /** * @brief Returns the duration of a song in the songlist. diff --git a/core/src/config_manager.cpp b/core/src/config_manager.cpp index 0935e9c..ef5fc16 100644 --- a/core/src/config_manager.cpp +++ b/core/src/config_manager.cpp @@ -175,7 +175,7 @@ QStringList ConfigManager::musiclist() return l_musiclist; } -void ConfigManager::loadcommandHelp() +void ConfigManager::loadCommandHelp() { QFile l_music_json("config/text/commandhelp.json"); l_music_json.open(QIODevice::ReadOnly | QIODevice::Text); @@ -183,7 +183,7 @@ void ConfigManager::loadcommandHelp() QJsonParseError l_error; QJsonDocument l_music_list_json = QJsonDocument::fromJson(l_music_json.readAll(), &l_error); if (!(l_error.error == QJsonParseError::NoError)) { //Non-Terminating error. - qWarning() << "Unable to help information. The following error was encounted : " + l_error.errorString(); + qWarning() << "Unable to load help information. The following error occurred: " + l_error.errorString(); } // Akashi expects the helpfile to contain multiple entires, so it always checks for an array first. @@ -202,7 +202,6 @@ void ConfigManager::loadcommandHelp() l_help_information.text = l_text; m_commands_help->insert(l_name,l_help_information); - qDebug() << commandHelp("foo").text; } } } diff --git a/core/src/server.cpp b/core/src/server.cpp index 7d92017..46741bb 100644 --- a/core/src/server.cpp +++ b/core/src/server.cpp @@ -98,7 +98,7 @@ void Server::start() } //Loads the command help information. This is not stored inside the server. - ConfigManager::loadcommandHelp(); + ConfigManager::loadCommandHelp(); //Rate-Limiter for IC-Chat connect(&next_message_timer, SIGNAL(timeout()), this, SLOT(allowMessage())); From 2f6b4b85f421e709710bcdadd469701e09a2aa96 Mon Sep 17 00:00:00 2001 From: Salanto <62221668+Salanto@users.noreply.github.com> Date: Sat, 18 Sep 2021 19:58:17 +0200 Subject: [PATCH 6/6] Literally unreadable, again Co-authored-by: Rosemary Witchaven <32779090+in1tiate@users.noreply.github.com> --- bin/config_sample/text/commandhelp.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/config_sample/text/commandhelp.json b/bin/config_sample/text/commandhelp.json index 562ed5f..4ea9940 100644 --- a/bin/config_sample/text/commandhelp.json +++ b/bin/config_sample/text/commandhelp.json @@ -591,7 +591,7 @@ }, { "name":"update_ban", - "usage":"/update_ban [Duration|Reason]", + "usage":"/update_ban ['duration'|'reason'] ", "text":"Updates a ban in the database, changing either its reason or duration. First argument is the ban ID. Second is the field, 'reason' or 'duration'. Last argument is either the new duration or reason." }, {