Webfiles (#376)
* 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:
parent
eade738e68
commit
cf5cadb45c
@ -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}},
|
||||
|
@ -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);
|
||||
|
||||
///@}
|
||||
|
||||
/**
|
||||
|
@ -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"));
|
||||
}
|
Loading…
Reference in New Issue
Block a user