Core/Networking: PoC changes to the way packets are handled

This is a rewrite of the way we send SMSG opcodes, the reasoning behind this is to make fixing packets sent in multiple places easier, and allow for clearer documentation of the packet fields.

Included SMSG_AUTH_RESPONSE and SMSG_AUCTION_COMMAND_RESULT as two examples.
This commit is contained in:
DDuarte
2014-10-30 02:04:54 +00:00
parent 386b97c485
commit 7b2274a744
14 changed files with 477 additions and 112 deletions
+1 -24
View File
@@ -21,6 +21,7 @@
*/
#include "WorldSocket.h"
#include "Packet.h"
#include <zlib.h>
#include "Config.h"
#include "Common.h"
@@ -684,30 +685,6 @@ void WorldSession::Handle_Deprecated(WorldPacket& recvPacket)
, GetOpcodeNameForLogging(static_cast<OpcodeClient>(recvPacket.GetOpcode())).c_str(), GetPlayerInfo().c_str());
}
void WorldSession::SendAuthWaitQue(uint32 position)
{
if (position == 0)
{
WorldPacket packet(SMSG_AUTH_RESPONSE, 2);
packet << uint8(AUTH_OK);
packet.WriteBit(0); // has account info
packet.WriteBit(0); // has queue info
packet.FlushBits();
SendPacket(&packet);
}
else
{
WorldPacket packet(SMSG_AUTH_RESPONSE, 6);
packet << uint8(AUTH_WAIT_QUEUE);
packet.WriteBit(0); // has account info
packet.WriteBit(1); // has queue info
packet << uint32(position);
packet.WriteBit(0); // unk queue bool
packet.FlushBits();
SendPacket(&packet);
}
}
void WorldSession::LoadGlobalAccountData()
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_DATA);