Add /testimony

This commit is contained in:
Salanto 2021-04-18 20:52:27 +02:00
parent 73cd8f1eb9
commit 5eabcc191e
2 changed files with 28 additions and 0 deletions

View File

@ -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}},

View File

@ -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];