implement modchat
This commit is contained in:
parent
f43a498efa
commit
8b4929223c
@ -78,6 +78,7 @@ class AOClient : public QObject {
|
|||||||
{"EVI_MOD", 1ULL << 6},
|
{"EVI_MOD", 1ULL << 6},
|
||||||
{"MOTD", 1ULL << 7},
|
{"MOTD", 1ULL << 7},
|
||||||
{"ANNOUNCE", 1ULL << 8},
|
{"ANNOUNCE", 1ULL << 8},
|
||||||
|
{"MODCHAT", 1ULL << 9},
|
||||||
{"SUPER", ~0ULL}
|
{"SUPER", ~0ULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -218,6 +219,7 @@ class AOClient : public QObject {
|
|||||||
void cmdBan(int argc, QStringList argv);
|
void cmdBan(int argc, QStringList argv);
|
||||||
void cmdKick(int argc, QStringList argv);
|
void cmdKick(int argc, QStringList argv);
|
||||||
void cmdAnnounce(int argc, QStringList argv);
|
void cmdAnnounce(int argc, QStringList argv);
|
||||||
|
void cmdM(int argc, QStringList argv);
|
||||||
// Casing/RP
|
// Casing/RP
|
||||||
void cmdPlay(int argc, QStringList argv);
|
void cmdPlay(int argc, QStringList argv);
|
||||||
void cmdNeed(int argc, QStringList argv);
|
void cmdNeed(int argc, QStringList argv);
|
||||||
@ -305,6 +307,7 @@ class AOClient : public QObject {
|
|||||||
{"evidence_mod", {ACLFlags.value("EVI_MOD"), 1, &AOClient::cmdEvidenceMod}},
|
{"evidence_mod", {ACLFlags.value("EVI_MOD"), 1, &AOClient::cmdEvidenceMod}},
|
||||||
{"motd", {ACLFlags.value("NONE"), 0, &AOClient::cmdMOTD}},
|
{"motd", {ACLFlags.value("NONE"), 0, &AOClient::cmdMOTD}},
|
||||||
{"announce", {ACLFlags.value("ANNOUNCE"), 1, &AOClient::cmdAnnounce}},
|
{"announce", {ACLFlags.value("ANNOUNCE"), 1, &AOClient::cmdAnnounce}},
|
||||||
|
{"m", {ACLFlags.value("MODCHAT"), 1, &AOClient::cmdM}},
|
||||||
};
|
};
|
||||||
|
|
||||||
QString partial_packet;
|
QString partial_packet;
|
||||||
|
@ -879,6 +879,17 @@ void AOClient::cmdAnnounce(int argc, QStringList argv)
|
|||||||
sendServerBroadcast("=== Announcement ===\r\n" + argv.join(" ") + "\r\n=============");
|
sendServerBroadcast("=== Announcement ===\r\n" + argv.join(" ") + "\r\n=============");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AOClient::cmdM(int argc, QStringList argv)
|
||||||
|
{
|
||||||
|
QString sender_name = ooc_name;
|
||||||
|
QString sender_message = argv.join(" ");
|
||||||
|
for (AOClient* client : server->clients) {
|
||||||
|
if (client->checkAuth(ACLFlags.value("MODCHAT")))
|
||||||
|
client->sendPacket("CT", {"[M]" + sender_name, sender_message});
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QStringList AOClient::buildAreaList(int area_idx)
|
QStringList AOClient::buildAreaList(int area_idx)
|
||||||
{
|
{
|
||||||
QStringList entries;
|
QStringList entries;
|
||||||
|
Loading…
Reference in New Issue
Block a user