diff --git a/include/aoclient.h b/include/aoclient.h index 1c2f799..bfdf32f 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -161,6 +161,13 @@ class AOClient : public QObject { */ bool global_enabled = true; + /** + * @brief If true, the client's messages will be sent in first-person mode. + * + * @see AOClient::cmdFirstPerson + */ + bool first_person = false; + /** * @brief If true, the client may not use in-character chat. */ @@ -1528,6 +1535,15 @@ class AOClient : public QObject { */ void cmdS(int argc, QStringList argv); + /** + * @brief Toggle whether the client's messages will be sent in first person mode. + * + * @details No arguments. + * + * @iscommand + */ + void cmdFirstPerson(int argc, QStringList argv); + ///@} /** @@ -1983,7 +1999,8 @@ class AOClient : public QObject { {"charselect", {ACLFlags.value("NONE"), 0, &AOClient::cmdCharSelect}}, {"togglemusic", {ACLFlags.value("CM"), 0, &AOClient::cmdToggleMusic}}, {"a", {ACLFlags.value("NONE"), 2, &AOClient::cmdA}}, - {"s", {ACLFlags.value("NONE"), 0, &AOClient::cmdS}} + {"s", {ACLFlags.value("NONE"), 0, &AOClient::cmdS}}, + {"firstperson", {ACLFlags.value("NONE"), 0, &AOClient::cmdFirstPerson}}, }; /** diff --git a/src/commands/area.cpp b/src/commands/area.cpp index 8ae19af..705c400 100644 --- a/src/commands/area.cpp +++ b/src/commands/area.cpp @@ -260,14 +260,14 @@ void AOClient::cmdBgLock(int argc, QStringList argv) { AreaData* area = server->areas[current_area]; area->bg_locked = true; - server->broadcast(AOPacket("CT", {"Server", current_char + " locked the background.", "1"}), current_area); + server->broadcast(AOPacket("CT", {server->server_name, current_char + " locked the background.", "1"}), current_area); } void AOClient::cmdBgUnlock(int argc, QStringList argv) { AreaData* area = server->areas[current_area]; area->bg_locked = false; - server->broadcast(AOPacket("CT", {"Server", current_char + " unlocked the background.", "1"}), current_area); + server->broadcast(AOPacket("CT", {server->server_name, current_char + " unlocked the background.", "1"}), current_area); } void AOClient::cmdStatus(int argc, QStringList argv) @@ -291,7 +291,7 @@ void AOClient::cmdStatus(int argc, QStringList argv) return; } arup(ARUPType::STATUS, true); - sendServerMessageArea(ooc_name + " changed status to " + arg); + server->broadcast(AOPacket("CT", {server->server_name, current_char + " changed status to " + arg.toUpper(), "1"}), current_area); } void AOClient::cmdJudgeLog(int argc, QStringList argv) diff --git a/src/commands/messaging.cpp b/src/commands/messaging.cpp index 044169d..2df2c15 100644 --- a/src/commands/messaging.cpp +++ b/src/commands/messaging.cpp @@ -445,3 +445,10 @@ void AOClient::cmdS(int argc, QStringList argv) server->broadcast(AOPacket("CT", {"[CM]" + sender_name, ooc_message}), i); } } + +void AOClient::cmdFirstPerson(int argc, QStringList argv) +{ + first_person = !first_person; + QString str_en = first_person ? "enabled" : "disabled"; + sendServerMessage("First person mode " + str_en + "."); +}