aboutsummaryrefslogtreecommitdiff
path: root/src/server/bnetserver/Server/Session.cpp
diff options
context:
space:
mode:
authorRoc13x <roc13x@gmail.com>2018-04-18 18:27:45 +0100
committerShauren <shauren.trinity@gmail.com>2018-04-18 20:27:45 +0300
commit11c3c456b7e135cb749e65d47e39cdc8f267a599 (patch)
tree2afe4910602e4de007f34380d3ebbb081944864b /src/server/bnetserver/Server/Session.cpp
parentcd5a704fc1629d5f606535b3756195fb311b5ef2 (diff)
Core/Bnet: Improve client ban messages (#21837)
* Don't hide banned game accounts from list. * Display proper ban messages with suspension time remaining. * More appropriate error codes for bans and locks
Diffstat (limited to 'src/server/bnetserver/Server/Session.cpp')
-rw-r--r--src/server/bnetserver/Server/Session.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/server/bnetserver/Server/Session.cpp b/src/server/bnetserver/Server/Session.cpp
index d1106f7a42b..55a6827854a 100644
--- a/src/server/bnetserver/Server/Session.cpp
+++ b/src/server/bnetserver/Server/Session.cpp
@@ -52,11 +52,12 @@ void Battlenet::Session::AccountInfo::LoadResult(PreparedQueryResult result)
void Battlenet::Session::GameAccountInfo::LoadResult(Field* fields)
{
- // a.id, a.username, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, ab.unbandate = ab.bandate, aa.gmlevel
+ // a.id, a.username, ab.unbandate, ab.unbandate = ab.bandate, aa.gmlevel
Id = fields[0].GetUInt32();
Name = fields[1].GetString();
- IsBanned = fields[2].GetUInt64() != 0;
- IsPermanenetlyBanned = fields[3].GetUInt64() != 0;
+ UnbanDate = fields[2].GetUInt32();
+ IsPermanenetlyBanned = fields[3].GetUInt32() != 0;
+ IsBanned = IsPermanenetlyBanned || UnbanDate > time(nullptr);
SecurityLevel = AccountTypes(fields[4].GetUInt8());
std::size_t hashPos = Name.find('#');
@@ -371,12 +372,9 @@ uint32 Battlenet::Session::VerifyWebCredentials(std::string const& webCredential
logonResult.mutable_account_id()->set_high(UI64LIT(0x100000000000000));
for (auto itr = _accountInfo->GameAccounts.begin(); itr != _accountInfo->GameAccounts.end(); ++itr)
{
- if (!itr->second.IsBanned)
- {
- EntityId* gameAccountId = logonResult.add_game_account_id();
- gameAccountId->set_low(itr->second.Id);
- gameAccountId->set_high(UI64LIT(0x200000200576F57));
- }
+ EntityId* gameAccountId = logonResult.add_game_account_id();
+ gameAccountId->set_low(itr->second.Id);
+ gameAccountId->set_high(UI64LIT(0x200000200576F57));
}
if (!_ipCountry.empty())
@@ -436,6 +434,7 @@ uint32 Battlenet::Session::HandleGetGameAccountState(account::v1::GetGameAccount
{
response->mutable_state()->mutable_game_status()->set_is_suspended(itr->second.IsBanned);
response->mutable_state()->mutable_game_status()->set_is_banned(itr->second.IsPermanenetlyBanned);
+ response->mutable_state()->mutable_game_status()->set_suspension_expires(uint64(itr->second.UnbanDate) * 1000000);
}
response->mutable_state()->mutable_game_status()->set_program(5730135); // WoW
@@ -508,6 +507,11 @@ uint32 Battlenet::Session::GetRealmListTicket(std::unordered_map<std::string, Va
if (!_gameAccountInfo)
return ERROR_UTIL_SERVER_INVALID_IDENTITY_ARGS;
+ if (_gameAccountInfo->IsPermanenetlyBanned)
+ return ERROR_GAME_ACCOUNT_BANNED;
+ else if (_gameAccountInfo->IsBanned)
+ return ERROR_GAME_ACCOUNT_SUSPENDED;
+
bool clientInfoOk = false;
if (Variant const* clientInfo = GetParam(params, "Param_ClientInfo"))
{