improve modcall message

This commit is contained in:
in1tiate 2022-05-14 21:23:55 -05:00
parent eab5c992f3
commit 69e6c1f32a

View File

@ -447,20 +447,28 @@ void AOClient::pktModCall(AreaData* area, int argc, QStringList argv, AOPacket p
Q_UNUSED(argc);
Q_UNUSED(argv);
for (AOClient* client : qAsConst(server->m_clients)) {
if (client->m_authenticated)
client->sendPacket(packet);
}
emit logModcall((m_current_char + " " + m_showname), m_ipid, m_ooc_name, server->m_areas[m_current_area]->name());
if (ConfigManager::discordModcallWebhookEnabled()) {
QString l_name = m_ooc_name;
if (m_ooc_name.isEmpty())
l_name = m_current_char;
QString l_areaName = area->name();
emit server->modcallWebhookRequest(l_name, l_areaName, packet.contents[0],server->getAreaBuffer(l_areaName));
QString l_modcallNotice = "!!!MODCALL!!!\nArea: " + l_areaName + "\nCaller: " + l_name + "\n";
if (!packet.contents[0].isEmpty())
l_modcallNotice.append("Reason: " + packet.contents[0]);
else
l_modcallNotice.append("No reason given.");
for (AOClient* client : qAsConst(server->m_clients)) {
if (client->m_authenticated) {
client->sendPacket(AOPacket("ZZ", {l_modcallNotice}));
}
}
emit logModcall((m_current_char + " " + m_showname), m_ipid, m_ooc_name, server->m_areas[m_current_area]->name());
if (ConfigManager::discordModcallWebhookEnabled())
emit server->modcallWebhookRequest(l_name, l_areaName, packet.contents[0],server->getAreaBuffer(l_areaName));
}
void AOClient::pktAddEvidence(AreaData* area, int argc, QStringList argv, AOPacket packet)