aboutsummaryrefslogtreecommitdiff
path: root/src/server/authserver/Server/BattlenetPackets.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2014-05-02 02:55:10 +0200
committerShauren <shauren.trinity@gmail.com>2014-05-02 02:55:10 +0200
commit6955d7c9ad0e55480aa97d9cafd878c6bc3dc426 (patch)
tree2a0b11c84a75607ac9db4c6f0d2382d7157230a7 /src/server/authserver/Server/BattlenetPackets.cpp
parentfea9d275fa0ed8f5b43dc54979cdd5a58afc993b (diff)
Core/Battle.net
* Fixed AuthResult codes * Fixed BitStream::WriteBytes size check * Fixed comparison operator for packet header * Fixed channel for client packets without channel * Implemented loading modules from database
Diffstat (limited to 'src/server/authserver/Server/BattlenetPackets.cpp')
-rw-r--r--src/server/authserver/Server/BattlenetPackets.cpp33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/server/authserver/Server/BattlenetPackets.cpp b/src/server/authserver/Server/BattlenetPackets.cpp
index 80213a0ba33..68a602d8598 100644
--- a/src/server/authserver/Server/BattlenetPackets.cpp
+++ b/src/server/authserver/Server/BattlenetPackets.cpp
@@ -78,14 +78,13 @@ std::string Battlenet::AuthChallenge::ToString() const
void Battlenet::ProofRequest::Write()
{
_stream.Write(Modules.size(), 3);
- for (size_t i = 0; i < Modules.size(); ++i)
+ for (ModuleInfo const* info : Modules)
{
- ModuleInfo& info = Modules[i];
- _stream.WriteBytes(info.AuthString.c_str(), 4);
- _stream.WriteFourCC(info.Locale.c_str());
- _stream.WriteBytes(info.ModuleId, 32);
- _stream.Write(info.BlobSize, 10);
- _stream.WriteBytes(info.Blob, info.BlobSize);
+ _stream.WriteBytes(info->Type.c_str(), 4);
+ _stream.WriteFourCC(info->Region.c_str());
+ _stream.WriteBytes(info->ModuleId, 32);
+ _stream.Write(info->DataSize, 10);
+ _stream.WriteBytes(info->Data, info->DataSize);
}
}
@@ -93,8 +92,8 @@ std::string Battlenet::ProofRequest::ToString() const
{
std::ostringstream stream;
stream << "Battlenet::ProofRequest modules " << Modules.size();
- for (ModuleInfo const& module : Modules)
- stream << std::endl << "Locale " << module.Locale << "ModuleId " << ByteArrayToHexStr(module.ModuleId, 32) << "BlobSize " << module.BlobSize;
+ for (ModuleInfo const* module : Modules)
+ stream << std::endl << "Locale " << module->Region << "ModuleId " << ByteArrayToHexStr(module->ModuleId, 32) << "BlobSize " << module->DataSize;
return stream.str();
}
@@ -138,11 +137,11 @@ void Battlenet::AuthComplete::Write()
for (size_t i = 0; i < Modules.size(); ++i)
{
ModuleInfo& info = Modules[i];
- _stream.WriteBytes(info.AuthString.c_str(), 4);
- _stream.WriteFourCC(info.Locale.c_str());
+ _stream.WriteBytes(info.Type.c_str(), 4);
+ _stream.WriteFourCC(info.Region.c_str());
_stream.WriteBytes(info.ModuleId, 32);
- _stream.Write(info.BlobSize, 10);
- _stream.WriteBytes(info.Blob, info.BlobSize);
+ _stream.Write(info.DataSize, 10);
+ _stream.WriteBytes(info.Data, info.DataSize);
}
_stream.Write(PingTimeout + std::numeric_limits<int32>::min(), 32);
@@ -165,11 +164,11 @@ void Battlenet::AuthComplete::Write()
if (!Modules.empty())
{
ModuleInfo& info = Modules[0];
- _stream.WriteBytes(info.AuthString.c_str(), 4);
- _stream.WriteFourCC(info.Locale.c_str());
+ _stream.WriteBytes(info.Type.c_str(), 4);
+ _stream.WriteFourCC(info.Region.c_str());
_stream.WriteBytes(info.ModuleId, 32);
- _stream.Write(info.BlobSize, 10);
- _stream.WriteBytes(info.Blob, info.BlobSize);
+ _stream.Write(info.DataSize, 10);
+ _stream.WriteBytes(info.Data, info.DataSize);
}
_stream.Write(ErrorType, 2);