Rewrite(Core/BanManager): Rewrite Ban system (#1576)

* Added ban manager
* Delete ban functions in world class
* Separate ban account to (ban account, ban ip, ban character)
* Support world announce
This commit is contained in:
Kargatum
2019-03-25 10:00:17 +07:00
committed by GitHub
parent a9c4c14ef2
commit 1f4f318705
12 changed files with 473 additions and 220 deletions
+2 -1
View File
@@ -17,6 +17,7 @@
#include "Util.h"
#include "Warden.h"
#include "AccountMgr.h"
#include "BanManager.h"
Warden::Warden() : _session(NULL), _inputCrypto(16), _outputCrypto(16), _checkTimer(10000/*10 sec*/), _clientResponseTimer(0),
_dataSent(false), _previousTimestamp(0), _module(NULL), _initialized(false)
@@ -227,7 +228,7 @@ std::string Warden::Penalty(WardenCheck* check /*= NULL*/, uint16 checkFailed /*
duration << sWorld->getIntConfig(CONFIG_WARDEN_CLIENT_BAN_DURATION) << "s";
std::string accountName;
AccountMgr::GetName(_session->GetAccountId(), accountName);
sWorld->BanAccount(BAN_ACCOUNT, accountName, ((longBan && false /*ZOMG!*/) ? "1209600s" : duration.str()), banReason, "Server");
sBan->BanAccount(accountName, ((longBan && false /*ZOMG!*/) ? "1209600s" : duration.str()), banReason, "Server");
return "Ban";
}