diff options
Diffstat (limited to 'csgo-loader/csgo-client/Networking')
| -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;
|
