![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "BanMgr.h"
Public Member Functions | |
BanReturn | BanAccount (std::string const &AccountName, std::string const &Duration, std::string const &Reason, std::string const &Author) |
Ban an account, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban. | |
BanReturn | BanAccountByPlayerName (std::string const &CharacterName, std::string const &Duration, std::string const &Reason, std::string const &Author) |
Ban an account by player name, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban. | |
BanReturn | BanIP (std::string const &IP, std::string const &Duration, std::string const &Reason, std::string const &Author) |
Ban an IP address, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban. | |
BanReturn | BanCharacter (std::string const &CharacterName, std::string const &Duration, std::string const &Reason, std::string const &Author) |
Ban an character, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban. | |
bool | RemoveBanAccount (std::string const &AccountName) |
Remove a ban from an account. | |
bool | RemoveBanAccountByPlayerName (std::string const &CharacterName) |
Remove a ban from an player name. | |
bool | RemoveBanIP (std::string const &IP) |
Remove a ban from an account. | |
bool | RemoveBanCharacter (std::string const &CharacterName) |
Remove a ban from a character. | |
Static Public Member Functions | |
static BanMgr * | instance () |
BanReturn BanMgr::BanAccount | ( | std::string const & | AccountName, |
std::string const & | Duration, | ||
std::string const & | Reason, | ||
std::string const & | Author | ||
) |
Ban an account, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban.
References BAN_LONGER_EXISTS, BAN_NOTFOUND, BAN_SUCCESS, BAN_SYNTAX_ERROR, CONFIG_SHOW_BAN_IN_WORLD, GameTime::GetGameTime(), AccountMgr::GetId(), LANG_BAN_ACCOUNT_YOUBANNEDMESSAGE_WORLD, LANG_BAN_ACCOUNT_YOUPERMBANNEDMESSAGE_WORLD, LOGIN_INS_ACCOUNT_BANNED, LOGIN_SEL_ACCOUNT_BANNED, LOGIN_UPD_ACCOUNT_NOT_BANNED, LoginDatabase, secsToTimeString(), ChatHandler::SendWorldText(), PreparedStatementBase::SetData(), sWorld, sWorldSessionMgr, and TimeStringToSecs().
BanReturn BanMgr::BanAccountByPlayerName | ( | std::string const & | CharacterName, |
std::string const & | Duration, | ||
std::string const & | Reason, | ||
std::string const & | Author | ||
) |
Ban an account by player name, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban.
References BAN_LONGER_EXISTS, BAN_NOTFOUND, BAN_SUCCESS, BAN_SYNTAX_ERROR, CONFIG_SHOW_BAN_IN_WORLD, GameTime::GetGameTime(), AccountMgr::GetName(), LANG_BAN_ACCOUNT_YOUBANNEDMESSAGE_WORLD, LANG_BAN_ACCOUNT_YOUPERMBANNEDMESSAGE_WORLD, LOGIN_INS_ACCOUNT_BANNED, LOGIN_SEL_ACCOUNT_BANNED, LOGIN_UPD_ACCOUNT_NOT_BANNED, LoginDatabase, sCharacterCache, secsToTimeString(), ChatHandler::SendWorldText(), PreparedStatementBase::SetData(), sWorld, sWorldSessionMgr, and TimeStringToSecs().
BanReturn BanMgr::BanCharacter | ( | std::string const & | CharacterName, |
std::string const & | Duration, | ||
std::string const & | Reason, | ||
std::string const & | Author | ||
) |
Ban an character, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban.
Pick a player to ban if not online
References BAN_NOTFOUND, BAN_SUCCESS, CHAR_INS_CHARACTER_BAN, CHAR_UPD_CHARACTER_BAN, CharacterDatabase, CONFIG_SHOW_BAN_IN_WORLD, ObjectAccessor::FindPlayerByName(), ObjectGuid::GetCounter(), Object::GetGUID(), Player::GetSession(), WorldSession::KickPlayer(), LANG_BAN_CHARACTER_YOUBANNEDMESSAGE_WORLD, LANG_BAN_CHARACTER_YOUPERMBANNEDMESSAGE_WORLD, sCharacterCache, secsToTimeString(), ChatHandler::SendWorldText(), PreparedStatementBase::SetData(), sWorld, and TimeStringToSecs().
BanReturn BanMgr::BanIP | ( | std::string const & | IP, |
std::string const & | Duration, | ||
std::string const & | Reason, | ||
std::string const & | Author | ||
) |
Ban an IP address, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban.
References BAN_SUCCESS, BAN_SYNTAX_ERROR, CONFIG_SHOW_BAN_IN_WORLD, Field::Get(), LANG_BAN_IP_YOUBANNEDMESSAGE_WORLD, LANG_BAN_IP_YOUPERMBANNEDMESSAGE_WORLD, LOGIN_INS_IP_BANNED, LOGIN_SEL_ACCOUNT_BY_IP, LoginDatabase, secsToTimeString(), ChatHandler::SendWorldText(), PreparedStatementBase::SetData(), sWorld, sWorldSessionMgr, and TimeStringToSecs().
|
static |
bool BanMgr::RemoveBanAccount | ( | std::string const & | AccountName | ) |
Remove a ban from an account.
References AccountMgr::GetId(), LOGIN_UPD_ACCOUNT_NOT_BANNED, LoginDatabase, and PreparedStatementBase::SetData().
bool BanMgr::RemoveBanAccountByPlayerName | ( | std::string const & | CharacterName | ) |
Remove a ban from an player name.
References LOGIN_UPD_ACCOUNT_NOT_BANNED, LoginDatabase, sCharacterCache, and PreparedStatementBase::SetData().
bool BanMgr::RemoveBanCharacter | ( | std::string const & | CharacterName | ) |
Remove a ban from a character.
Pick a player to ban if not online
References CHAR_UPD_CHARACTER_BAN, CharacterDatabase, ObjectAccessor::FindPlayerByName(), ObjectGuid::GetCounter(), Object::GetGUID(), sCharacterCache, and PreparedStatementBase::SetData().
bool BanMgr::RemoveBanIP | ( | std::string const & | IP | ) |
Remove a ban from an account.
References LOGIN_DEL_IP_NOT_BANNED, LoginDatabase, and PreparedStatementBase::SetData().