This commit is contained in:
WolverinDEV
2019-08-16 16:13:52 +02:00
parent bae6a56ed3
commit aa3de59652
14 changed files with 454 additions and 279 deletions
+2 -2
View File
@@ -209,8 +209,8 @@ void TSServer::testBanStateChange(const std::shared_ptr<ConnectedClient>& invoke
this->forEachClient([&](shared_ptr<ConnectedClient> client) {
auto ban = client->resolveActiveBan(client->getPeerIp());
if(ban) {
debugMessage(this->getServerId(), "Found online client with a active ban. ({})", CLIENT_STR_LOG_PREFIX_(client));
auto entryTime = ban->until.time_since_epoch().count() > 0 ? (uint64_t) duration_cast<seconds>(ban->until - system_clock::now()).count() : 0UL;
logMessage(this->getServerId(), "Client {} was online, but had an ban whcih effect him has been registered. Disconnecting client.", CLIENT_STR_LOG_PREFIX_(client));
auto entryTime = ban->until.time_since_epoch().count() > 0 ? (uint64_t) chrono::ceil<seconds>(ban->until - system_clock::now()).count() : 0UL;
this->notify_client_ban(client, invoker, ban->reason, entryTime);
client->closeConnection(system_clock::now() + seconds(1));
}