Add /g command

This commit is contained in:
Salanto 2021-01-09 14:50:43 +01:00
parent ed9e86e183
commit 3f148c9c66
2 changed files with 11 additions and 1 deletions

View File

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

View File

@ -371,6 +371,14 @@ void AOClient::cmdPos(int argc, QStringList argv)
sendServerMessage("Position changed to " + pos + ".");
}
void AOClient::cmdG(int argc, QStringList argv)
{
QString sender_name = ooc_name;
QString sender_message = argv.join(" ");
server->broadcast(AOPacket("CT", {"[G]" + sender_name, sender_message}));
return;
}
QStringList AOClient::buildAreaList(int area_idx)
{
QStringList entries;