mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-05 16:39:08 +01:00
Core/Battle.net: Fixed client crashes happening when reconnecting too soon after being kicked
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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[] =
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user