diff --git a/src/game/Server/Opcodes.h b/src/game/Server/Opcodes.h index 54a020f2e..a3b8d5d44 100644 --- a/src/game/Server/Opcodes.h +++ b/src/game/Server/Opcodes.h @@ -42,9 +42,9 @@ enum Opcodes { MSG_WOW_CONNECTION = 0x4F57, // 4.3.4 15595 - SMSG_AUTH_CHALLENGE = 0x0221, // 5.3.0 17055 + SMSG_AUTH_CHALLENGE = 0x0949, // 5.4.8 18414 CMSG_AUTH_SESSION = 0x14DA, // 5.4.1 17538 - SMSG_AUTH_RESPONSE = 0x15A0, // 5.4.7 18019 + SMSG_AUTH_RESPONSE = 0x0ABA, // 5.4.8 18414 MSG_NULL_ACTION = 0x1001, CMSG_BOOTME = 0x1002, CMSG_DBLOOKUP = 0x1003, diff --git a/src/game/Server/WorldSession.cpp b/src/game/Server/WorldSession.cpp index 698df8638..f3d109de6 100644 --- a/src/game/Server/WorldSession.cpp +++ b/src/game/Server/WorldSession.cpp @@ -847,18 +847,20 @@ void WorldSession::SendAuthWaitQue(uint32 position) if (position == 0) { WorldPacket packet(SMSG_AUTH_RESPONSE, 1); - packet.WriteBit(false); // no account data - packet.WriteBit(false); // no queue + packet.WriteBit(0); + packet.WriteBit(0); packet << uint8(AUTH_OK); + packet.FlushBits(); SendPacket(&packet); } else { WorldPacket packet(SMSG_AUTH_RESPONSE, 6); - packet.WriteBit(false); // has account data - packet.WriteBit(true); // has queue - packet.WriteBit(false); // unk queue-related + packet.WriteBit(0); + packet.WriteBit(1); + packet.WriteBit(0); packet << uint8(AUTH_WAIT_QUEUE); + packet.FlushBits(); packet << uint32(position); SendPacket(&packet); } diff --git a/src/game/Server/WorldSocket.cpp b/src/game/Server/WorldSocket.cpp index c54020dd0..8fccdbffa 100644 --- a/src/game/Server/WorldSocket.cpp +++ b/src/game/Server/WorldSocket.cpp @@ -308,7 +308,31 @@ int WorldSocket::HandleWowConnection(WorldPacket& recvPacket) { std::string ClientToServerMsg; recvPacket >> ClientToServerMsg; - return 0; + + DEBUG_LOG("Received MSG_WOW_CONNECTION FROM %s", m_Session ? m_Session->GetRemoteAddress().c_str() : ""); + if (strcmp(ClientToServerMsg.c_str(), "D OF WARCRAFT CONNECTION - CLIENT TO SERVER") != 0) + { + sLog.outError("WorldSocket::ProcessIncoming: received wrong data in MSG_WOW_CONNECTION."); + return -1; + } + + return SendAuthChallenge(); +} + +int WorldSocket::SendAuthChallenge() +{ + DEBUG_LOG("Sending SMSG_AUTH_CHALLENGE"); + WorldPacket packet(SMSG_AUTH_CHALLENGE, 37); + packet << uint16(0); + + for (int i = 0; i < 8; i++) + packet << uint32(0); + + packet << uint8(1); + packet << uint32(m_Seed); + + return SendPacket(packet); + } int WorldSocket::close(int) diff --git a/src/game/Server/WorldSocket.h b/src/game/Server/WorldSocket.h index 05f75b615..4c6ce0a04 100644 --- a/src/game/Server/WorldSocket.h +++ b/src/game/Server/WorldSocket.h @@ -70,7 +70,7 @@ typedef ACE_Acceptor< WorldSocket, ACE_SOCK_ACCEPTOR > WorldAcceptor; * a queue where it stores packet if there is no place on * the queue. The reason this is done, is because the server * does really a lot of small-size writes to it, and it doesn't - * Scale well to allocate memory for every. When something is + * scale well to allocate memory for every. When something is * written to the output buffer the socket is not immediately * activated for output (again for the same reason), there * is 10ms celling (thats why there is Update() override method). @@ -136,6 +136,7 @@ class WorldSocket : protected WorldHandler /// Called on open ,the void* is the acceptor. int HandleWowConnection(WorldPacket& recvPacket); + int SendAuthChallenge(); virtual int open(void*) override;