diff options
| author | boris <wzn@moneybot.cc> | 2019-01-03 16:51:40 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2019-01-03 16:51:40 +1300 |
| commit | e1f048c8f922613aec1f63791c2191e55cbd5132 (patch) | |
| tree | 887f57c58673e775bff8c1df3f23943ef8ddd6cd /csgo-loader/csgo-client/Networking/TCPClient.cpp | |
| parent | c0f1354a301ce2a2fc867a89fafdde4571c07c02 (diff) | |
ricardo milos :DDDD::D:D:D:
Diffstat (limited to 'csgo-loader/csgo-client/Networking/TCPClient.cpp')
| -rw-r--r-- | csgo-loader/csgo-client/Networking/TCPClient.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/csgo-loader/csgo-client/Networking/TCPClient.cpp b/csgo-loader/csgo-client/Networking/TCPClient.cpp index c20c831..c974f88 100644 --- a/csgo-loader/csgo-client/Networking/TCPClient.cpp +++ b/csgo-loader/csgo-client/Networking/TCPClient.cpp @@ -13,6 +13,22 @@ namespace Networking if(Result == -1)
INFO_ASSERT(STR("[000F:00002B00] Server closed the connection unexpectedly."));
+
+ WRAP_IF_DEBUG(
+ size_t BreakIndex = 0;
+
+ printf("[DEBUG] Sending data (%zd bytes):\n[DEBUG] ", Bytes.size());
+
+ for(auto &Byte : Bytes)
+ {
+ printf("%02x ", Byte);
+
+ if(BreakIndex++ % 8 == 0)
+ printf("\n[DEBUG] ");
+ }
+
+ printf("\n");
+ );
}
ByteArray TCPClient::ReceiveRawBytes()
@@ -40,6 +56,22 @@ namespace Networking break;
}
+ WRAP_IF_DEBUG(
+ size_t BreakIndex = 0;
+
+ printf("[DEBUG] Receiving data (%zd bytes):\n[DEBUG] ", ReceivedBytes.size());
+
+ for(auto &Byte : ReceivedBytes)
+ {
+ printf("%02x ", Byte);
+
+ if(BreakIndex++ % 8 == 0)
+ printf("\n[DEBUG] ");
+ }
+
+ printf("\n");
+ );
+
return ReceivedBytes;
}
@@ -103,11 +135,19 @@ namespace Networking return false;
// Initialise encryption wrapper.
+ WRAP_IF_DEBUG(
+ printf("[DEBUG] Attempting to handshake with server...\n");
+ );
+
ByteArray EncryptionKey = ReceiveRawBytes();
if(EncryptionKey.empty())
return false;
+ WRAP_IF_DEBUG(
+ printf("[DEBUG] Server handshake successful!\n");
+ )
+
std::memcpy(m_EncryptionKey, EncryptionKey.data(), EncryptionKey.size());
return true;
|
