remove desu
This commit is contained in:
parent
fa72e87e34
commit
5368601b67
@ -240,9 +240,6 @@ class AOClient : public QObject {
|
|||||||
void cmdToggleGlobal(int argc, QStringList argv);
|
void cmdToggleGlobal(int argc, QStringList argv);
|
||||||
void cmdPM(int argc, QStringList argv);
|
void cmdPM(int argc, QStringList argv);
|
||||||
|
|
||||||
// DELETE THIS LATER MARISA
|
|
||||||
void cmdTestDateTime(int argc, QStringList argv);
|
|
||||||
|
|
||||||
// Command helper functions
|
// Command helper functions
|
||||||
QString getAreaTimer(int area_idx, QTimer* timer);
|
QString getAreaTimer(int area_idx, QTimer* timer);
|
||||||
QStringList buildAreaList(int area_idx);
|
QStringList buildAreaList(int area_idx);
|
||||||
@ -313,8 +310,7 @@ class AOClient : public QObject {
|
|||||||
{"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}},
|
{"m", {ACLFlags.value("MODCHAT"), 1, &AOClient::cmdM}},
|
||||||
{"gm", {ACLFlags.value("MODCHAT"), 1, &AOClient::cmdGM}},
|
{"gm", {ACLFlags.value("MODCHAT"), 1, &AOClient::cmdGM}}
|
||||||
{"test", {ACLFlags.value("NONE"), 1, &AOClient::cmdTestDateTime}}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QString partial_packet;
|
QString partial_packet;
|
||||||
|
@ -1049,11 +1049,6 @@ QString AOClient::getAreaTimer(int area_idx, QTimer* timer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AOClient::cmdTestDateTime(int argc, QStringList argv)
|
|
||||||
{
|
|
||||||
qDebug() << parseTime(argv[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
long long AOClient::parseTime(QString input)
|
long long AOClient::parseTime(QString input)
|
||||||
{
|
{
|
||||||
QRegularExpression regex("(?:(?:(?<year>.*?)y)*(?:(?<week>.*?)w)*(?:(?<day>.*?)d)*(?:(?<hr>.*?)h)*(?:(?<min>.*?)m)*(?:(?<sec>.*?)s)*)");
|
QRegularExpression regex("(?:(?:(?<year>.*?)y)*(?:(?<week>.*?)w)*(?:(?<day>.*?)d)*(?:(?<hr>.*?)h)*(?:(?<min>.*?)m)*(?:(?<sec>.*?)s)*)");
|
||||||
@ -1068,14 +1063,11 @@ long long AOClient::parseTime(QString input)
|
|||||||
str_minute = match.captured("min");
|
str_minute = match.captured("min");
|
||||||
str_second = match.captured("sec");
|
str_second = match.captured("sec");
|
||||||
|
|
||||||
qDebug() << str_year << "years," << str_week << "weeks," << str_day << "days," << str_hour << "hours," << str_minute << "minutes," << str_second << "seconds";
|
|
||||||
|
|
||||||
bool is_well_formed = false;
|
bool is_well_formed = false;
|
||||||
QString concat_str(str_year + str_week + str_day + str_hour + str_minute + str_second);
|
QString concat_str(str_year + str_week + str_day + str_hour + str_minute + str_second);
|
||||||
concat_str.toInt(&is_well_formed);
|
concat_str.toInt(&is_well_formed);
|
||||||
|
|
||||||
if (!is_well_formed) {
|
if (!is_well_formed) {
|
||||||
qDebug() << "retard alert!";
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ bool DBManager::isIPBanned(QHostAddress ip)
|
|||||||
if (query.first()) {
|
if (query.first()) {
|
||||||
long long duration = getBanDuration(ip);
|
long long duration = getBanDuration(ip);
|
||||||
long long ban_time = query.value(0).toLongLong();
|
long long ban_time = query.value(0).toLongLong();
|
||||||
qDebug() << ban_time << "duration:" << duration;
|
|
||||||
if (duration == -2)
|
if (duration == -2)
|
||||||
return true;
|
return true;
|
||||||
long long current_time = QDateTime::currentDateTime().toSecsSinceEpoch();
|
long long current_time = QDateTime::currentDateTime().toSecsSinceEpoch();
|
||||||
|
Loading…
Reference in New Issue
Block a user