Core/Battle.net: Fixed client crashes happening when reconnecting too soon after being kicked

This commit is contained in:
Shauren
2019-10-08 15:29:34 +02:00
committed by funjoker
parent e596504d93
commit 7b15c4029b
3 changed files with 14 additions and 7 deletions

View File

@@ -97,13 +97,16 @@ void WorldListener::HandleToonOnlineStatusChange(Battlenet::RealmHandle const& r
{
if (online)
{
Battlenet::WoWRealm::ToonReady* toonReady = new Battlenet::WoWRealm::ToonReady();
toonReady->Realm = realm;
toonReady->Guid = toonHandle.Guid;
toonReady->Name = toonHandle.Name;
session->AsyncWrite(toonReady);
if (!session->IsToonOnline())
{
Battlenet::WoWRealm::ToonReady* toonReady = new Battlenet::WoWRealm::ToonReady();
toonReady->Realm = realm;
toonReady->Guid = toonHandle.Guid;
toonReady->Name = toonHandle.Name;
session->AsyncWrite(toonReady);
}
}
else
else if (session->IsToonOnline())
session->AsyncWrite(new Battlenet::WoWRealm::ToonLoggedOut());
}
}

View File

@@ -71,7 +71,7 @@ void Battlenet::GameAccountInfo::LoadResult(Field* fields)
Battlenet::Session::Session(tcp::socket&& socket) : Socket(std::move(socket)), _accountInfo(new AccountInfo()), _gameAccountInfo(nullptr), _locale(),
_os(), _build(0), _ipCountry(), I(), s(), v(), b(), B(), K(),
_reconnectProof(), _crypt(), _authed(false), _subscribedToRealmListUpdates(false)
_reconnectProof(), _crypt(), _authed(false), _subscribedToRealmListUpdates(false), _toonOnline(false)
{
static uint8 const N_Bytes[] =
{

View File

@@ -121,6 +121,9 @@ namespace Battlenet
uint32 GetAccountId() const { return _accountInfo->Id; }
uint32 GetGameAccountId() const { return _gameAccountInfo->Id; }
bool IsToonOnline() const { return _toonOnline; }
void SetToonOnline(bool online) { _toonOnline = online; }
bool IsSubscribedToRealmListUpdates() const { return _subscribedToRealmListUpdates; }
void AsyncWrite(ServerPacket* packet);
@@ -185,6 +188,7 @@ namespace Battlenet
PacketCrypt _crypt;
bool _authed;
bool _subscribedToRealmListUpdates;
bool _toonOnline;
QueryCallbackProcessor _queryProcessor;
};