Add /need command

This commit is contained in:
Salanto 2021-01-09 22:24:32 +01:00
parent 3f148c9c66
commit 296426d163
2 changed files with 10 additions and 1 deletions

View File

@ -172,6 +172,7 @@ class AOClient : public QObject {
void cmdLogout(int argc, QStringList argv);
void cmdPos(int argc, QStringList argv);
void cmdG(int argc, QStringList argv);
void cmdNeed(int argc, QStringList argv);
// Command helper functions
QStringList buildAreaList(int area_idx);
@ -204,7 +205,8 @@ class AOClient : public QObject {
{"listusers", {ACLFlags.value("MODIFY_USERS"), 0, &AOClient::cmdListUsers}},
{"logout", {ACLFlags.value("NONE"), 0, &AOClient::cmdLogout}},
{"pos", {ACLFlags.value("NONE"), 1, &AOClient::cmdPos}},
{"g", {ACLFlags.value("NONE"), 1, &AOClient::cmdG}}
{"g", {ACLFlags.value("NONE"), 1, &AOClient::cmdG}},
{"need", {ACLFlags.value("NONE"), 1, &AOClient::cmdNeed}}
};
QString partial_packet;

View File

@ -379,6 +379,13 @@ void AOClient::cmdG(int argc, QStringList argv)
return;
}
void AOClient::cmdNeed(int argc, QStringList argv)
{
QString sender_area = server->area_names.value(current_area);
QString sender_message = argv.join(" ");
server->broadcast(AOPacket("CT", {"=== Advert ===","[" + sender_area + "] needs " + sender_message}));
}
QStringList AOClient::buildAreaList(int area_idx)
{
QStringList entries;