|
@@ -14,7 +14,8 @@ Client::Client(App *app, ActiveClient* ac):
|
|
|
myApp(app),
|
|
|
myConnectionRetries(0),
|
|
|
myOnServerFlag(false),
|
|
|
- myMutedFlag(false),
|
|
|
+ mySpamMutedFlag(false),
|
|
|
+ myQWMutedFlag(false),
|
|
|
myJoinMessageTimer(new QTimer()),
|
|
|
myJoinMessagePrinted(false)
|
|
|
{
|
|
@@ -90,9 +91,14 @@ void Client::retryConnection()
|
|
|
myConnectionRetries++;
|
|
|
}
|
|
|
|
|
|
-bool Client::isMuted() const
|
|
|
+bool Client::isQWMuted() const
|
|
|
{
|
|
|
- return myMutedFlag;
|
|
|
+ return myQWMutedFlag;
|
|
|
+}
|
|
|
+
|
|
|
+bool Client::isSpamMuted() const
|
|
|
+{
|
|
|
+ return mySpamMutedFlag;
|
|
|
}
|
|
|
|
|
|
void Client::parsePrintedLine()
|
|
@@ -130,7 +136,7 @@ void Client::parsePrintedLine()
|
|
|
QString nick(myPrintLine.left(lastMatchSize));
|
|
|
QString message(myPrintLine.right(myPrintLine.size() - lastMatchSize));
|
|
|
|
|
|
- QRegExp regex("^:\\s+\\.(spam|qw|help|mute|unmute)\\s*(.+)$");
|
|
|
+ QRegExp regex("^:\\s+\\.(spam|qw|help|qw_mute|qw_unmute|spam_mute|spam_unmute)\\s*(.+)$");
|
|
|
if(regex.indexIn(message) == -1)
|
|
|
return;
|
|
|
|
|
@@ -156,8 +162,8 @@ void Client::parsePrintedLine()
|
|
|
if(command == "help")
|
|
|
{
|
|
|
say("> Commands:");
|
|
|
- say("> Broadcast message: .qw <message> and .spam <message>");
|
|
|
- say("> Mute/Unmute the bot: .mute and .unmute");
|
|
|
+ say("> Broadcast a message: .qw <message> and .spam <message>, beware of the floodprot limits 600s for .qw and 300s for .spam");
|
|
|
+ say("> Mute/Unmute: .qw_mute and .qw_unmute or .spam_mute or .spam_unmute");
|
|
|
say("> .help to show this help message.");
|
|
|
return;
|
|
|
}
|
|
@@ -206,17 +212,31 @@ void Client::parsePrintedLine()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if(command == "mute")
|
|
|
+ if(command == "qw_mute")
|
|
|
+ {
|
|
|
+ say("> .qw Frequency Muted.");
|
|
|
+ myQWMutedFlag = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(command == "qw_unmute")
|
|
|
+ {
|
|
|
+ say("> .qw Frequency Unmuted.");
|
|
|
+ myQWMutedFlag = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(command == "spam_mute")
|
|
|
{
|
|
|
- say("> Muted!");
|
|
|
- myMutedFlag = true;
|
|
|
+ say("> .spam Frequency Muted.");
|
|
|
+ mySpamMutedFlag = true;
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if(command == "unmute")
|
|
|
+ if(command == "spam_unmute")
|
|
|
{
|
|
|
- say("> Unmuted!");
|
|
|
- myMutedFlag = false;
|
|
|
+ say("> .spam Frequency Unmuted.");
|
|
|
+ mySpamMutedFlag = false;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
@@ -263,7 +283,7 @@ void Client::onLevelChanged(int, const char *levelName, float, float, float, flo
|
|
|
{
|
|
|
print(QString(levelName) + "\n");
|
|
|
myDownloadProgressPrintedFlag = false;
|
|
|
- myMutedFlag = false;
|
|
|
+ mySpamMutedFlag = false;
|
|
|
}
|
|
|
|
|
|
void Client::onChallenge()
|