aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.cpp13
-rw-r--r--src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.h29
-rw-r--r--src/server/authserver/Server/BattlenetPackets/WoWRealmPackets.cpp37
-rw-r--r--src/server/authserver/Server/BattlenetSession.cpp4
4 files changed, 49 insertions, 34 deletions
diff --git a/src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.cpp b/src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.cpp
index 58560e663de..4d9c4476295 100644
--- a/src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.cpp
+++ b/src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.cpp
@@ -18,7 +18,7 @@
#include "AuthenticationPackets.h"
#include "Util.h"
-void Battlenet::Authentication::LogonRequest::Read()
+void Battlenet::Authentication::LogonRequest3::Read()
{
Program = _stream.ReadFourCC();
Platform = _stream.ReadFourCC();
@@ -35,17 +35,21 @@ void Battlenet::Authentication::LogonRequest::Read()
if (_stream.Read<uint32>(1))
Login = _stream.ReadString(9, 3);
+
+ Compatibility = _stream.Read<uint64>(64);
}
-std::string Battlenet::Authentication::LogonRequest::ToString() const
+std::string Battlenet::Authentication::LogonRequest3::ToString() const
{
std::ostringstream stream;
- stream << "Battlenet::Authentication::LogonRequest Program: " << Program << ", Platform: " << Platform << ", Locale: " << Locale;
+ stream << "Battlenet::Authentication::LogonRequest3 Program: " << Program << ", Platform: " << Platform << ", Locale: " << Locale;
for (Component const& component : Components)
stream << std::endl << "Battlenet::Component Program: " << component.Program << ", Platform: " << component.Platform << ", Build: " << component.Build;
if (!Login.empty())
- stream << std::endl << "Battlenet::Authentication::LogonRequest Login: " << Login;
+ stream << std::endl << " Login: " << Login;
+
+ stream << " Compatibility: " << Compatibility;
return stream.str();
}
@@ -189,6 +193,7 @@ void Battlenet::Authentication::LogonResponse::Write()
_stream.Write(GameAccountFlags, 64);
_stream.Write(FailedLogins, 32);
+ _stream.Write(false, 1); // RaF
}
else
{
diff --git a/src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.h b/src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.h
index 5f079db65b3..44e3d7e18b8 100644
--- a/src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.h
+++ b/src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.h
@@ -26,23 +26,27 @@ namespace Battlenet
{
enum Opcode
{
- CMSG_LOGON_REQUEST = 0x0,
- CMSG_RESUME_REQUEST = 0x1,
- CMSG_PROOF_RESPONSE = 0x2,
-
- SMSG_LOGON_RESPONSE = 0x0,
- SMSG_RESUME_RESPONSE = 0x1,
- SMSG_PROOF_REQUEST = 0x2,
- SMSG_PATCH = 0x3, // Not implemented
- SMSG_AUTHORIZED_LICENSES = 0x4 // Not implemented
+ CMSG_LOGON_REQUEST = 0x0, // Deprecated
+ CMSG_RESUME_REQUEST = 0x1,
+ CMSG_PROOF_RESPONSE = 0x2,
+ CMSG_GENERATE_SINGLE_SIGN_ON_TOKEN_REQUEST_2 = 0x8, // Not implemented
+ CMSG_LOGON_REQUEST_3 = 0x9,
+ CMSG_SINGLE_SIGN_ON_REQUEST_3 = 0xA, // Not implemented
+
+ SMSG_LOGON_RESPONSE = 0x0,
+ SMSG_RESUME_RESPONSE = 0x1,
+ SMSG_PROOF_REQUEST = 0x2,
+ SMSG_PATCH = 0x3, // Not implemented
+ SMSG_AUTHORIZED_LICENSES = 0x4, // Not implemented
+ SMSG_GENERATE_SINGLE_SIGN_ON_TOKEN_REQUEST_2 = 0x8 // Not implemented
};
- class LogonRequest final : public ClientPacket
+ class LogonRequest3 final : public ClientPacket
{
public:
- LogonRequest(PacketHeader const& header, BitStream& stream) : ClientPacket(header, stream)
+ LogonRequest3(PacketHeader const& header, BitStream& stream) : ClientPacket(header, stream)
{
- ASSERT(header == PacketHeader(CMSG_LOGON_REQUEST, AUTHENTICATION) && "Invalid packet header for LogonRequest");
+ ASSERT(header == PacketHeader(CMSG_LOGON_REQUEST_3, AUTHENTICATION) && "Invalid packet header for LogonRequest3");
}
void Read() override;
@@ -53,6 +57,7 @@ namespace Battlenet
std::string Locale;
std::vector<Component> Components;
std::string Login;
+ uint64 Compatibility;
};
class ResumeRequest final : public ClientPacket
diff --git a/src/server/authserver/Server/BattlenetPackets/WoWRealmPackets.cpp b/src/server/authserver/Server/BattlenetPackets/WoWRealmPackets.cpp
index c1341e18c7d..76577670a50 100644
--- a/src/server/authserver/Server/BattlenetPackets/WoWRealmPackets.cpp
+++ b/src/server/authserver/Server/BattlenetPackets/WoWRealmPackets.cpp
@@ -33,9 +33,10 @@ void Battlenet::WoWRealm::ListSubscribeResponse::Write()
_stream.Write(CharacterCounts.size(), 7);
for (CharacterCountEntry const& entry : CharacterCounts)
{
+ _stream.Write(entry.Realm.Region, 8);
+ _stream.Write(0, 12);
_stream.Write(entry.Realm.Battlegroup, 8);
_stream.Write(entry.Realm.Index, 32);
- _stream.Write(entry.Realm.Region, 8);
_stream.Write(entry.CharacterCount, 16);
}
@@ -75,11 +76,12 @@ void Battlenet::WoWRealm::ListUpdate::Write()
_stream.Write(UpdateState, 1);
if (UpdateState == UPDATE)
{
- _stream.Write(Type + -std::numeric_limits<int32>::min(), 32);
+ _stream.Write(Timezone, 32);
_stream.WriteFloat(Population);
- _stream.Write(Flags, 8);
_stream.Write(Lock, 8);
- _stream.Write(Timezone, 32);
+ _stream.Write(0, 19);
+ _stream.Write(Type + -std::numeric_limits<int32>::min(), 32);
+ _stream.WriteString(Name, 10);
_stream.Write(!Version.empty(), 1);
if (!Version.empty())
{
@@ -96,12 +98,13 @@ void Battlenet::WoWRealm::ListUpdate::Write()
_stream.WriteBytes(&port, 2);
}
- _stream.WriteString(Name, 10);
+ _stream.Write(Flags, 8);
}
+ _stream.Write(Region, 8);
+ _stream.Write(0, 12);
_stream.Write(Battlegroup, 8);
_stream.Write(Index, 32);
- _stream.Write(Region, 8);
}
std::string Battlenet::WoWRealm::ListUpdate::ToString() const
@@ -118,10 +121,12 @@ std::string Battlenet::WoWRealm::ListUpdate::ToString() const
void Battlenet::WoWRealm::JoinRequestV2::Read()
{
+ ClientSeed = _stream.Read<uint32>(32);
+ _stream.Read<uint32>(20);
+ Realm.Region = _stream.Read<uint8>(8);
+ _stream.Read<uint32>(12);
Realm.Battlegroup = _stream.Read<uint8>(8);
Realm.Index = _stream.Read<uint32>(32);
- Realm.Region = _stream.Read<uint8>(8);
- ClientSeed = _stream.Read<uint32>(32);
}
std::string Battlenet::WoWRealm::JoinRequestV2::ToString() const
@@ -138,27 +143,27 @@ void Battlenet::WoWRealm::JoinResponseV2::Write()
if (Response == SUCCESS)
{
_stream.Write(ServerSeed, 32);
- _stream.Write(IPv6.size(), 5);
- for (tcp::endpoint const& addr : IPv6)
+ _stream.Write(IPv4.size(), 5);
+ for (tcp::endpoint const& addr : IPv4)
{
- boost::asio::ip::address_v6::bytes_type ip = addr.address().to_v6().to_bytes();
+ boost::asio::ip::address_v4::bytes_type ip = addr.address().to_v4().to_bytes();
uint16 port = addr.port();
EndianConvertReverse(port);
- _stream.WriteBytes(ip.data(), 16);
+ _stream.WriteBytes(ip.data(), 4);
_stream.WriteBytes(&port, 2);
}
- _stream.Write(IPv4.size(), 5);
- for (tcp::endpoint const& addr : IPv4)
+ _stream.Write(IPv6.size(), 5);
+ for (tcp::endpoint const& addr : IPv6)
{
- boost::asio::ip::address_v4::bytes_type ip = addr.address().to_v4().to_bytes();
+ boost::asio::ip::address_v6::bytes_type ip = addr.address().to_v6().to_bytes();
uint16 port = addr.port();
EndianConvertReverse(port);
- _stream.WriteBytes(ip.data(), 4);
+ _stream.WriteBytes(ip.data(), 16);
_stream.WriteBytes(&port, 2);
}
}
diff --git a/src/server/authserver/Server/BattlenetSession.cpp b/src/server/authserver/Server/BattlenetSession.cpp
index 2242a3ee4eb..860c557b46a 100644
--- a/src/server/authserver/Server/BattlenetSession.cpp
+++ b/src/server/authserver/Server/BattlenetSession.cpp
@@ -30,7 +30,7 @@ std::map<Battlenet::PacketHeader, Battlenet::Session::PacketHandler> InitHandler
{
std::map<Battlenet::PacketHeader, Battlenet::Session::PacketHandler> handlers;
- handlers[Battlenet::PacketHeader(Battlenet::Authentication::CMSG_LOGON_REQUEST, Battlenet::AUTHENTICATION)] = &Battlenet::Session::HandleLogonRequest;
+ handlers[Battlenet::PacketHeader(Battlenet::Authentication::CMSG_LOGON_REQUEST_3, Battlenet::AUTHENTICATION)] = &Battlenet::Session::HandleLogonRequest;
handlers[Battlenet::PacketHeader(Battlenet::Authentication::CMSG_RESUME_REQUEST, Battlenet::AUTHENTICATION)] = &Battlenet::Session::HandleResumeRequest;
handlers[Battlenet::PacketHeader(Battlenet::Authentication::CMSG_PROOF_RESPONSE, Battlenet::AUTHENTICATION)] = &Battlenet::Session::HandleProofResponse;
@@ -126,7 +126,7 @@ bool Battlenet::Session::HandleLogonRequest(PacketHeader& header, BitStream& pac
return true;
}
- Authentication::LogonRequest info(header, packet);
+ Authentication::LogonRequest3 info(header, packet);
info.Read();
if (info.Program != "WoW")