Core/CharacterHandler: fixed guid reading in PlayerLoginOpcode handler

thanks to Nay && Shauren
This commit is contained in:
Rat
2011-11-26 20:38:00 +01:00
parent e97527c24e
commit 8cf3fde329

View File

@@ -842,7 +842,22 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data)
sLog->outStaticDebug("WORLD: Recvd Player Logon Message");
recv_data >> playerGuid;
BitStream* mask = recv_data.ReadBitStream(8);
ByteBuffer* bytes = new ByteBuffer(8, true);
if ((*mask)[6]) (*bytes)[5] = recv_data.ReadUInt8() ^ 1;
if ((*mask)[0]) (*bytes)[0] = recv_data.ReadUInt8() ^ 1;
if ((*mask)[4]) (*bytes)[3] = recv_data.ReadUInt8() ^ 1;
if ((*mask)[1]) (*bytes)[4] = recv_data.ReadUInt8() ^ 1;
if ((*mask)[2]) (*bytes)[7] = recv_data.ReadUInt8() ^ 1;
if ((*mask)[5]) (*bytes)[2] = recv_data.ReadUInt8() ^ 1;
if ((*mask)[7]) (*bytes)[6] = recv_data.ReadUInt8() ^ 1;
if ((*mask)[3]) (*bytes)[1] = recv_data.ReadUInt8() ^ 1;
playerGuid = BitConverter::ToUInt64((*bytes));
sLog->outDebug(LOG_FILTER_NETWORKIO, "Character (Guid: %u) logging in", playerGuid);
if (!CharCanLogin(GUID_LOPART(playerGuid)))
{