diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-10-04 00:48:04 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-10-04 19:13:54 +0200 |
commit | cc95d7ebbe573e5c9e7eddf924ac67d2838a5685 (patch) | |
tree | 48d323d0b542b84008b80bb21d33f4361cdce13a | |
parent | 973df92043a53f309b54eb667f3e6c70d3e86bf3 (diff) |
Core/Authserver: Updated battle.net structures to 6.0.2.18973
-rw-r--r-- | contrib/Connection Patcher/Connection Patcher.csproj | 1 | ||||
-rw-r--r-- | contrib/Connection Patcher/Offsets/Windows.cs | 40 | ||||
-rw-r--r-- | contrib/Connection Patcher/Patches/Mac.cs | 21 | ||||
-rw-r--r-- | contrib/Connection Patcher/Patches/Windows.cs | 22 | ||||
-rw-r--r-- | contrib/Connection Patcher/Patterns/Mac.cs | 10 | ||||
-rw-r--r-- | contrib/Connection Patcher/Patterns/Windows.cs | 12 | ||||
-rw-r--r-- | contrib/Connection Patcher/Program.cs | 113 | ||||
-rw-r--r-- | sql/base/auth_database.sql | 14 | ||||
-rw-r--r-- | sql/updates/auth/2014_10_04_00_auth_6x.sql | 8 | ||||
-rw-r--r-- | src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.cpp | 13 | ||||
-rw-r--r-- | src/server/authserver/Server/BattlenetPackets/AuthenticationPackets.h | 29 | ||||
-rw-r--r-- | src/server/authserver/Server/BattlenetPackets/WoWRealmPackets.cpp | 37 | ||||
-rw-r--r-- | src/server/authserver/Server/BattlenetSession.cpp | 4 |
13 files changed, 140 insertions, 184 deletions
diff --git a/contrib/Connection Patcher/Connection Patcher.csproj b/contrib/Connection Patcher/Connection Patcher.csproj index 8ad5a631aed..7ee4bf6f972 100644 --- a/contrib/Connection Patcher/Connection Patcher.csproj +++ b/contrib/Connection Patcher/Connection Patcher.csproj @@ -46,7 +46,6 @@ <ItemGroup> <Compile Include="Constants\BinaryTypes.cs" /> <Compile Include="Helper.cs" /> - <Compile Include="Offsets\Windows.cs" /> <Compile Include="Patcher.cs" /> <Compile Include="Patches\Mac.cs" /> <Compile Include="Patches\Windows.cs" /> diff --git a/contrib/Connection Patcher/Offsets/Windows.cs b/contrib/Connection Patcher/Offsets/Windows.cs deleted file mode 100644 index 4f2f32708cc..00000000000 --- a/contrib/Connection Patcher/Offsets/Windows.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/> - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -namespace Connection_Patcher.Offsets -{ - static class Windows - { - public static class x86 - { - public static readonly long BNet = 0xD3259; - public static readonly long Send = 0x889CA; - public static readonly long Recv = 0x86EEE; - public static readonly long Signature = 0x20B79; - public static readonly long RealmList = 0x228D6C; - } - - public static class x64 - { - public static readonly long BNet = 0; - public static readonly long Send = 0xAAB6B; - public static readonly long Recv = 0xA9FA3; - public static readonly long Signature = 0; - public static readonly long RealmList = 0x2BB33C; - } - } -} diff --git a/contrib/Connection Patcher/Patches/Mac.cs b/contrib/Connection Patcher/Patches/Mac.cs index 583d1398354..aab9e57c240 100644 --- a/contrib/Connection Patcher/Patches/Mac.cs +++ b/contrib/Connection Patcher/Patches/Mac.cs @@ -20,25 +20,12 @@ namespace Connection_Patcher.Patches { class Mac { - public static class x86 - { - public static byte[] BNet = { }; - public static byte[] Send = { }; - public static byte[] Recv = { }; - public static byte[] Password = { 0x0F, 0x85 }; - public static byte[] Signature = { }; - } - public static class x64 { - //public static byte[] BNet = { 0xB8, 0xD5, 0xF8, 0x7F, 0x82, 0x89, 0x47, 0x0C, 0x5D, 0xC3, 0x90, 0x90, 0x90 }; - public static byte[] BNet = { }; - //public static byte[] Send = { 0x90, 0x31, 0xDB }; - public static byte[] Send = { }; - public static byte[] Recv = { }; - public static byte[] Password = { 0x0F, 0x85 }; - //public static byte[] Signature = { 0x45, 0x31, 0xED, 0x4D, 0x89, 0xFC, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xEB }; - public static byte[] Signature = { }; + public static byte[] BNet = { 0xB8, 0xD5, 0xF8, 0x7F, 0x82, 0x89, 0x47, 0x0C, 0x5D, 0xC3, 0x90, 0x90, 0x90 }; + public static byte[] Connect = { }; + public static byte[] Password = { 0x0F, 0x85 }; + public static byte[] Signature = { 0x45, 0x31, 0xED, 0x4D, 0x89, 0xFC, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xEB }; } } } diff --git a/contrib/Connection Patcher/Patches/Windows.cs b/contrib/Connection Patcher/Patches/Windows.cs index feb10507084..c76f71312fb 100644 --- a/contrib/Connection Patcher/Patches/Windows.cs +++ b/contrib/Connection Patcher/Patches/Windows.cs @@ -22,25 +22,19 @@ namespace Connection_Patcher.Patches { public static class x86 { - public static byte[] BNet = { 0x89, 0x48, 0x08, 0xC7, 0x40, 0x0C, 0xD5, 0xF8, 0x7F, 0x82, 0x90 }; - public static byte[] Send = { 0xBA, 0x00, 0x00, 0x00, 0x00, 0x90, 0xEB }; - public static byte[] Recv = { 0xB8, 0x00, 0x00, 0x00, 0x00 }; - public static byte[] Password = { 0x75 }; - public static byte[] Signature = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xE9 }; - public static byte[] RealmList = { 0x08 }; - public static byte[] RealmListBn = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + public static byte[] BNet = { 0xC7, 0x40, 0x0C, 0xD5, 0xF8, 0x7F, 0x82 }; + public static byte[] Connect = { 0xEB }; + public static byte[] Password = { 0x75 }; + public static byte[] Signature = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xEB }; } public static class x64 { - //public static byte[] BNet = { 0xB8, 0xD5, 0xF8, 0x7F, 0x82, 0x89, 0x41, 0x0C, 0x48, 0x8B, 0xC1, 0xC3 }; - public static byte[] BNet = { }; - public static byte[] Send = { 0x45, 0x33, 0xED, 0x90, 0x90, 0x90 }; - public static byte[] Recv = { 0xB8, 0x00, 0x00, 0x00, 0x00, 0x90 }; + public static byte[] BNet = { 0xB8, 0xD5, 0xF8, 0x7F, 0x82, 0x89, 0x41, 0x0C, 0x48, 0x8B, 0xC1, 0xC3 }; + public static byte[] Portal = new byte[18]; + public static byte[] Connect = { 0xEB }; public static byte[] Password = { 0x75 }; - public static byte[] RealmList = { 0x4C, 0x8B, 0xEA }; - //public static byte[] Signature = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xE9 }; - public static byte[] Signature = { }; + public static byte[] Signature = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xE9 }; } } } diff --git a/contrib/Connection Patcher/Patterns/Mac.cs b/contrib/Connection Patcher/Patterns/Mac.cs index d518aa3c78f..fa89a667105 100644 --- a/contrib/Connection Patcher/Patterns/Mac.cs +++ b/contrib/Connection Patcher/Patterns/Mac.cs @@ -20,14 +20,12 @@ namespace Connection_Patcher.Patterns { class Mac { - public static class x86 - { - public static byte[] Password = { 0x0F, 0x84, 0xE3, 0x00, 0x00, 0x00, 0x8B, 0x03, 0x8B, 0x40, 0x04 }; - } - public static class x64 { - public static byte[] Password = { 0x0F, 0x84, 0x00, 0xFF, 0xFF, 0xFF, 0x49, 0x8B, 0x45, 0x00, 0xB9, 0x40 }; + public static byte[] BNet = { 0x8B, 0x06, 0x89, 0x47, 0x0C, 0x5D, 0xC3 }; + public static byte[] Connect = { }; + public static byte[] Password = { 0x0F, 0x84, 0x00, 0xFF, 0xFF, 0xFF, 0x49, 0x8B, 0x45, 0x00, 0xB9, 0x40 }; + public static byte[] Signature = { 0xE8, 0x00, 0x00, 0x00, 0x00, 0x45, 0x31, 0xED, 0x4D, 0x89, 0xFC, 0x84, 0xC0, 0x75 }; } } } diff --git a/contrib/Connection Patcher/Patterns/Windows.cs b/contrib/Connection Patcher/Patterns/Windows.cs index f8bde67dddb..fef0c47d465 100644 --- a/contrib/Connection Patcher/Patterns/Windows.cs +++ b/contrib/Connection Patcher/Patterns/Windows.cs @@ -22,13 +22,19 @@ namespace Connection_Patcher.Patterns { public static class x86 { - public static byte[] Password = { 0x74, 0x89, 0x8B, 0x16, 0x8B, 0x42, 0x04 }; - public static byte[] RealmListBn = { 0x2E, 0x6C, 0x6F, 0x67, 0x6F, 0x6E, 0x2E, 0x62, 0x61, 0x74, 0x74, 0x6C, 0x65, 0x2E, 0x6E, 0x65, 0x74 }; + public static byte[] BNet = { 0x8B, 0x75, 0x08, 0x8D, 0x78, 0x0C }; + public static byte[] Connect = { 0x74, 0x33, 0x6A, 0x04, 0xFF, 0x75, 0xF8 }; + public static byte[] Password = { 0x74, 0x89, 0x8B, 0x16, 0x8B, 0x42, 0x04 }; + public static byte[] Signature = { 0xE8, 0x00, 0x00, 0x00, 0x00, 0x84, 0xC0, 0x75, 0x5F, 0x33, 0xC0 }; } public static class x64 { - public static byte[] Password = { 0x74, 0x84, 0x48, 0x8B, 0x03 }; + public static byte[] BNet = { 0x8B, 0x02, 0x89, 0x41, 0x0C, 0x48, 0x8B, 0xC1, 0xC3 }; + public static byte[] Portal = { 0x2E, 0x6C, 0x6F, 0x67, 0x6F, 0x6E, 0x2E, 0x62, 0x61, 0x74, 0x74, 0x6C, 0x65, 0x2E, 0x6E, 0x65, 0x74, 0x00 }; + public static byte[] Connect = { 0x74, 0x2C, 0x48, 0x8D, 0x4C, 0x24, 0x78 }; + public static byte[] Password = { 0x74, 0x84, 0x48, 0x8B, 0x03 }; + public static byte[] Signature = { 0xE8, 0x00, 0x00, 0x00, 0x00, 0x84, 0xC0, 0x0F, 0x85, 0x88, 0x00, 0x00, 0x00, 0x45, 0x33, 0xC0 }; } } } diff --git a/contrib/Connection Patcher/Program.cs b/contrib/Connection Patcher/Program.cs index 956741b625b..579f47a09f8 100644 --- a/contrib/Connection Patcher/Program.cs +++ b/contrib/Connection Patcher/Program.cs @@ -42,23 +42,18 @@ namespace Connection_Patcher var modulePath = ""; var moduleFile = ""; - // Let's use Win32 as default module - var patchSend = Patches.Windows.x86.Send; - var offsetSend = Offsets.Windows.x86.Send; - var patchRecv = Patches.Windows.x86.Recv; - var offsetRecv = Offsets.Windows.x86.Recv; - var patchBNet = Patches.Windows.x86.BNet; - var offsetBNet = Offsets.Windows.x86.BNet; - var patchSignature = Patches.Windows.x86.Signature; - var offsetSignature = Offsets.Windows.x86.Signature; - var fileName = args[0].Replace(".exe", "_Patched.exe"); - var battleNetFileName = args[0].Replace("Wow.exe", "Battle.net.dll"); - var modulePatch = Patches.Windows.x86.Password; - var modulePattern = Patterns.Windows.x86.Password; - var realmListPatch = Patches.Windows.x86.RealmList; - var realmListoffset = Offsets.Windows.x86.RealmList; - var realmListBnPatch = Patches.Windows.x86.RealmListBn; - var realmListBnPattern = Patterns.Windows.x86.RealmListBn; + // Let's use Win64 as default module + var modulePatch = Patches.Windows.x64.Password; + var modulePattern = Patterns.Windows.x64.Password; + var patchBNet = Patches.Windows.x64.BNet; + var patternBNet = Patterns.Windows.x64.BNet; + var patchPortal = Patches.Windows.x64.Portal; + var patternPortal = Patterns.Windows.x64.Portal; + var patchConnect = Patches.Windows.x64.Connect; + var patternConnect = Patterns.Windows.x64.Connect; + var patchSignature = Patches.Windows.x64.Signature; + var patternSignature = Patterns.Windows.x64.Signature; + var fileName = ""; Console.ForegroundColor = ConsoleColor.White; Console.Write("Creating patched binaries for "); @@ -69,54 +64,51 @@ namespace Connection_Patcher { case BinaryTypes.Pe32: Console.WriteLine("Win32 client..."); - modulePath = commonAppData + "/Blizzard Entertainment/Battle.net/Cache/"; - moduleFile = "8f52906a2c85b416a595702251570f96d3522f39237603115f2f1ab24962043c.auth"; + patchBNet = Patches.Windows.x86.BNet; + patternBNet = Patterns.Windows.x86.BNet; + patchConnect = Patches.Windows.x86.Connect; + patternConnect = Patterns.Windows.x86.Connect; + patchSignature = Patches.Windows.x86.Signature; + patternSignature = Patterns.Windows.x86.Signature; + fileName = patcher.Binary.Replace(".exe", "") + "_Patched.exe"; + + modulePath = commonAppData + "/Blizzard Entertainment/Battle.net/Cache/"; + moduleFile = "8f52906a2c85b416a595702251570f96d3522f39237603115f2f1ab24962043c.auth"; + modulePatch = Patches.Windows.x86.Password; + modulePattern = Patterns.Windows.x86.Password; + break; + case BinaryTypes.Pe64: + Console.WriteLine("Win64 client..."); + fileName = patcher.Binary.Replace(".exe", "") + "_Patched.exe"; + + modulePath = commonAppData + "/Blizzard Entertainment/Battle.net/Cache/"; + moduleFile = "0a3afee2cade3a0e8b458c4b4660104cac7fc50e2ca9bef0d708942e77f15c1d.auth"; + break; + case BinaryTypes.Mach32: + throw new NotSupportedException("Type: " + patcher.Type + " not supported!"); + case BinaryTypes.Mach64: + Console.WriteLine("Mac client..."); + patchBNet = Patches.Mac.x64.BNet; + patternBNet = Patterns.Mac.x64.BNet; + patchConnect = Patterns.Windows.x64.Connect; + patternConnect = Patterns.Windows.x64.Connect; + patchSignature = Patches.Mac.x64.Signature; + patternSignature = Patterns.Mac.x64.Signature; + fileName = patcher.Binary + " Patched"; + + modulePath = "/Users/Shared/Blizzard/Battle.net/Cache/"; + moduleFile = "97eeb2e28e9e56ed6a22d09f44e2ff43c93315e006bbad43bafc0defaa6f50ae.auth"; + modulePatch = Patches.Mac.x64.Password; + modulePattern = Patterns.Mac.x64.Password; break; - //case BinaryTypes.Pe64: - // Console.WriteLine("Win64 client..."); - // fileName = patcher.Binary.Replace(".exe", "") + "_Patched.exe"; - - // modulePath = commonAppData + "/Blizzard Entertainment/Battle.net/Cache/"; - // moduleFile = "0a3afee2cade3a0e8b458c4b4660104cac7fc50e2ca9bef0d708942e77f15c1d.auth"; - // break; - //case BinaryTypes.Mach32: - // break; - //case BinaryTypes.Mach64: - // Console.WriteLine("Mc64 client..."); - // patchBNet = Patches.Mac.x64.BNet; - // patternBNet = Patterns.Mac.x64.BNet; - // patchSend = Patches.Mac.x64.Send; - // patternSend = Patterns.Mac.x64.Send; - // patchSignature = Patches.Mac.x64.Signature; - // patternSignature = Patterns.Mac.x64.Signature; - // fileName = patcher.Binary + " Patched"; - - // modulePath = "/Users/Shared/Blizzard/Battle.net/Cache/"; - // moduleFile = "97eeb2e28e9e56ed6a22d09f44e2ff43c93315e006bbad43bafc0defaa6f50ae.auth"; - // modulePatch = Patches.Mac.x64.Password; - // modulePattern = Patterns.Mac.x64.Password; - // break; default: throw new NotSupportedException("Type: " + patcher.Type + " not supported!"); } - if (!File.Exists(battleNetFileName + "_backup")) - { - File.Copy(battleNetFileName, battleNetFileName + "_backup"); - File.SetAttributes(battleNetFileName + "_backup", File.GetAttributes(battleNetFileName + "_backup") | FileAttributes.ReadOnly); - } - - using (var bnpatcher = new Patcher(battleNetFileName)) - { - bnpatcher.Patch(patchBNet, null, offsetBNet); - bnpatcher.Patch(patchSignature, null, offsetSignature); - bnpatcher.Patch(realmListBnPatch, realmListBnPattern); - bnpatcher.Finish(); - } - - patcher.Patch(patchSend, null, offsetSend); - patcher.Patch(patchRecv, null, offsetRecv); - patcher.Patch(realmListPatch, null, realmListoffset); + patcher.Patch(patchBNet, patternBNet); + patcher.Patch(patchPortal, patternPortal); + patcher.Patch(patchConnect, patternConnect); + patcher.Patch(patchSignature, patternSignature); patcher.Binary = fileName; @@ -139,6 +131,7 @@ namespace Connection_Patcher Console.ForegroundColor = ConsoleColor.Gray; Thread.Sleep(5000); + Environment.Exit(0); } diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index e5f45f9ff5c..d743e393618 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -216,15 +216,11 @@ CREATE TABLE `battlenet_components` ( LOCK TABLES `battlenet_components` WRITE; /*!40000 ALTER TABLE `battlenet_components` DISABLE KEYS */; INSERT INTO `battlenet_components` VALUES -('Bnet','Cmp1',3), -('Bnet','Win',26487), -('Bnet','Wn64',26487), -('Tool','Win',2736), -('WoW','base',15595), -('WoW','enGB',15595), -('WoW','enUS',15595), -('WoW','Win',15595), -('WoW','Wn64',15595); +('Bnet','Win',37165), +('Bnet','Wn64',37165), +('WoW','base',18973), +('WoWB','Win',18973), +('WoWB','Wn64',18973); /*!40000 ALTER TABLE `battlenet_components` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/auth/2014_10_04_00_auth_6x.sql b/sql/updates/auth/2014_10_04_00_auth_6x.sql new file mode 100644 index 00000000000..61731b408b6 --- /dev/null +++ b/sql/updates/auth/2014_10_04_00_auth_6x.sql @@ -0,0 +1,8 @@ +DELETE FROM `battlenet_components` WHERE `Build`=18973 AND `Program`!='Bnet'; +DELETE FROM `battlenet_components` WHERE `Build`=37165 AND `Program`='Bnet'; +INSERT INTO `battlenet_components` VALUES +('Bnet','Win',37165), +('Bnet','Wn64',37165), +('WoW','base',18973), +('WoWB','Win',18973), +('WoWB','Wn64',18973); 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") |