This commit is contained in:
scatterflower 2021-01-03 18:19:48 -06:00
parent b04703ea88
commit ed9e86e183
3 changed files with 19 additions and 2 deletions

View File

@ -122,6 +122,7 @@ class AOClient : public QObject {
QString emote = "";
QString offset = "";
QString flipping = "";
QString pos = "";
struct PacketInfo {
unsigned long long acl_mask;
@ -169,6 +170,7 @@ class AOClient : public QObject {
void cmdRemovePerms(int argc, QStringList argv);
void cmdListUsers(int argc, QStringList argv);
void cmdLogout(int argc, QStringList argv);
void cmdPos(int argc, QStringList argv);
// Command helper functions
QStringList buildAreaList(int area_idx);
@ -199,7 +201,8 @@ class AOClient : public QObject {
{"addperm", {ACLFlags.value("MODIFY_USERS"), 2, &AOClient::cmdAddPerms}},
{"removeperm", {ACLFlags.value("MODIFY_USERS"), 2, &AOClient::cmdRemovePerms}},
{"listusers", {ACLFlags.value("MODIFY_USERS"), 0, &AOClient::cmdListUsers}},
{"logout", {ACLFlags.value("NONE"), 0, &AOClient::cmdLogout}}
{"logout", {ACLFlags.value("NONE"), 0, &AOClient::cmdLogout}},
{"pos", {ACLFlags.value("NONE"), 1, &AOClient::cmdPos}}
};
QString partial_packet;

View File

@ -359,7 +359,16 @@ void AOClient::cmdLogout(int argc, QStringList argv)
authenticated = false;
moderator_name = "";
sendServerMessage("You have been logged out.");
return;
}
void AOClient::cmdPos(int argc, QStringList argv)
{
if (argv[0] != "def" && argv[0] != "hld" && argv[0] != "pro" && argv[0] != "hlp" && argv[0] != "wit" && argv[0] != "jud" && argv[0] != "jur" && argv[0] != "sea") {
sendServerMessage("Invalid position!");
return;
}
pos = argv[0];
sendServerMessage("Position changed to " + pos + ".");
}
QStringList AOClient::buildAreaList(int area_idx)

View File

@ -138,6 +138,8 @@ void AOClient::pktSelectChar(AreaData* area, int argc, QStringList argv, AOPacke
current_char = "";
}
pos = "";
server->updateCharsTaken(area);
sendPacket("PV", {"271828", "CID", argv[1]});
}
@ -148,6 +150,9 @@ void AOClient::pktIcChat(AreaData* area, int argc, QStringList argv, AOPacket pa
if (validated_packet.header == "INVALID")
return;
if (pos != "")
validated_packet.contents[5] = pos;
area->logger->logIC(this, &validated_packet);
server->broadcast(validated_packet, current_area);
}