diff --git a/include/aoclient.h b/include/aoclient.h index 1415187..627eebe 100644 --- a/include/aoclient.h +++ b/include/aoclient.h @@ -1558,6 +1558,15 @@ class AOClient : public QObject { */ void cmdAddStatement(int argc, QStringList argv); + + /** + * @brief Sends a list of the testimony to OOC of the requesting client + * + * @details Retrieves all stored IC-Messages of the area and dumps them into OOC with some formatting. + * + */ + void cmdTestimony(int argc, QStringList argv); + /** * @brief Saves a testimony recording to the servers storage. * @@ -1869,6 +1878,7 @@ class AOClient : public QObject { {"ungimp", {ACLFlags.value("MUTE"), 1, &AOClient::cmdUnGimp}}, {"baninfo", {ACLFlags.value("BAN"), 1, &AOClient::cmdBanInfo}}, {"testify", {ACLFlags.value("CM"), 0, &AOClient::cmdTestify}}, + {"testimony", {ACLFlags.value("NONE"), 0, &AOClient::cmdTestimony}}, {"examine", {ACLFlags.value("CM"), 0, &AOClient::cmdExamine}}, {"pause", {ACLFlags.value("CM"), 0, &AOClient::cmdPauseTestimony}}, {"delete", {ACLFlags.value("CM"), 0, &AOClient::cmdDeleteStatement}}, diff --git a/src/commands/casing.cpp b/src/commands/casing.cpp index 4bb8cfd..3a43ac5 100644 --- a/src/commands/casing.cpp +++ b/src/commands/casing.cpp @@ -130,6 +130,24 @@ void AOClient::cmdExamine(int argc, QStringList argv) sendServerMessage("Unable to start replay without prior examination."); } +void AOClient::cmdTestimony(int argc, QStringList argv) +{ + AreaData* area = server->areas[current_area]; + if (area->testimony.size() -1 < 1) { + sendServerMessage("Unable to display empty testimony."); + return; + } + + QString ooc_message; + for (int i = 1; i <= area->testimony.size() -1; i++) + { + QStringList packet = area->testimony.at(i); + QString ic_message = packet[4]; + ooc_message.append( "[" + QString::number(i) + "]" + ic_message + "\n"); + } + sendServerMessage(ooc_message); +} + void AOClient::cmdDeleteStatement(int argc, QStringList argv) { AreaData* area = server->areas[current_area];