add help command
This commit is contained in:
parent
1510d19f5b
commit
a792c063ee
@ -171,6 +171,7 @@ class AOClient : public QObject {
|
|||||||
|
|
||||||
//// Commands
|
//// Commands
|
||||||
void cmdDefault(int argc, QStringList argv);
|
void cmdDefault(int argc, QStringList argv);
|
||||||
|
void cmdHelp(int argc, QStringList argv);
|
||||||
// Authentication
|
// Authentication
|
||||||
void cmdLogin(int argc, QStringList argv);
|
void cmdLogin(int argc, QStringList argv);
|
||||||
void cmdChangeAuth(int argc, QStringList argv);
|
void cmdChangeAuth(int argc, QStringList argv);
|
||||||
@ -276,6 +277,7 @@ class AOClient : public QObject {
|
|||||||
{"switch", {ACLFlags.value("NONE"), 1, &AOClient::cmdSwitch}},
|
{"switch", {ACLFlags.value("NONE"), 1, &AOClient::cmdSwitch}},
|
||||||
{"toggleglobal", {ACLFlags.value("NONE"), 0, &AOClient::cmdToggleGlobal}},
|
{"toggleglobal", {ACLFlags.value("NONE"), 0, &AOClient::cmdToggleGlobal}},
|
||||||
{"mods", {ACLFlags.value("NONE"), 0, &AOClient::cmdMods}},
|
{"mods", {ACLFlags.value("NONE"), 0, &AOClient::cmdMods}},
|
||||||
|
{"help", {ACLFlags.value("NONE"), 0, &AOClient::cmdHelp}},
|
||||||
};
|
};
|
||||||
|
|
||||||
QString partial_packet;
|
QString partial_packet;
|
||||||
|
@ -716,6 +716,20 @@ void AOClient::cmdMods(int argc, QStringList argv)
|
|||||||
sendServerMessage(entries.join("\n"));
|
sendServerMessage(entries.join("\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AOClient::cmdHelp(int argc, QStringList argv)
|
||||||
|
{
|
||||||
|
QStringList entries;
|
||||||
|
entries << "Allowed commands:";
|
||||||
|
QMap<QString, CommandInfo>::const_iterator i;
|
||||||
|
for (i = commands.constBegin(); i!= commands.constEnd(); ++i) {
|
||||||
|
CommandInfo info = i.value();
|
||||||
|
if (checkAuth(info.acl_mask)) {
|
||||||
|
entries << "/" + i.key();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sendServerMessage(entries.join("\n"));
|
||||||
|
}
|
||||||
|
|
||||||
QStringList AOClient::buildAreaList(int area_idx)
|
QStringList AOClient::buildAreaList(int area_idx)
|
||||||
{
|
{
|
||||||
QStringList entries;
|
QStringList entries;
|
||||||
|
Loading…
Reference in New Issue
Block a user