* add webfiles command

* only show chars who are swapping

Co-Authored-By: Salanto <62221668+Salanto@users.noreply.github.com>

* whitespace wow

---------

Co-authored-by: Salanto <62221668+Salanto@users.noreply.github.com>
This commit is contained in:
stonedDiscord 2024-09-09 19:02:06 +02:00 committed by GitHub
parent eade738e68
commit cf5cadb45c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 26 additions and 0 deletions

View File

@ -139,6 +139,7 @@ const QMap<QString, AOClient::CommandInfo> AOClient::COMMANDS{
{"togglemessage", {{ACLRole::CM}, 0, &AOClient::cmdToggleAreaMessageOnJoin}},
{"clearmessage", {{ACLRole::CM}, 0, &AOClient::cmdClearAreaMessage}},
{"areamessage", {{ACLRole::CM}, 0, &AOClient::cmdAreaMessage}},
{"webfiles", {{ACLRole::NONE}, 0, &AOClient::cmdWebfiles}},
{"addsong", {{ACLRole::CM}, 1, &AOClient::cmdAddSong}},
{"addcategory", {{ACLRole::CM}, 1, &AOClient::cmdAddCategory}},
{"removeentry", {{ACLRole::CM}, 1, &AOClient::cmdRemoveCategorySong}},

View File

@ -1038,6 +1038,15 @@ class AOClient : public QObject
*/
void cmdToggleShouts(int argc, QStringList argv);
/**
* @brief Generates a download link for characters who are iniswapping
*
* @details No arguments.
*
* @iscommand
*/
void cmdWebfiles(int argc, QStringList argv);
///@}
/**

View File

@ -472,3 +472,19 @@ void AOClient::cmdClearAreaMessage(int argc, QStringList argv)
if (l_area->sendAreaMessageOnJoin()) // Turn off the automatic sending.
cmdToggleAreaMessageOnJoin(0, QStringList{}); // Dummy values.
}
void AOClient::cmdWebfiles(int argc, QStringList argv)
{
const QVector<AOClient *> l_clients = server->getClients();
QStringList l_weblinks;
for (AOClient *l_client : l_clients) {
if (l_client->m_current_iniswap.isEmpty() || l_client->areaId() != areaId()) {
continue;
}
if (l_client->character().toLower() != l_client->m_current_iniswap.toLower()) {
l_weblinks.append("https://attorneyonline.github.io/webDownloader/index.html?char=" + l_client->m_current_iniswap);
}
}
sendServerMessage("Character files:\n" + l_weblinks.join("\n"));
}