diff options
| author | boris <wzn@moneybot.cc> | 2018-12-29 22:15:34 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-12-29 22:15:34 +1300 |
| commit | 0340821cc614fda2a94a96c255d16105dd2f6f9a (patch) | |
| tree | 77338a110f4c784c2a6c20fd25abfc49666cacca /csgo-loader/csgo-server/Networking/TCPServer.cpp | |
| parent | bdb6ac5f940008bcd836e3c5f0a708f4b8f04865 (diff) | |
tcp is being autistic -_-
Diffstat (limited to 'csgo-loader/csgo-server/Networking/TCPServer.cpp')
| -rw-r--r-- | csgo-loader/csgo-server/Networking/TCPServer.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/csgo-loader/csgo-server/Networking/TCPServer.cpp b/csgo-loader/csgo-server/Networking/TCPServer.cpp index 739cbdd..c381c85 100644 --- a/csgo-loader/csgo-server/Networking/TCPServer.cpp +++ b/csgo-loader/csgo-server/Networking/TCPServer.cpp @@ -4,7 +4,7 @@ namespace Networking {
void TCPConnection::Close()
{
- printf("[ <= ] %s disconnected!\n", m_IpAddress);
+ printf("[ <= ] disconnected\n");
if(m_Socket)
closesocket(m_Socket);
@@ -20,10 +20,10 @@ namespace Networking if(m_IpAddress)
- printf("[ => ] Sending %zd bytes to %s.\n", Bytes.size(), m_IpAddress);
+ printf("[ => ] %zd bytes\n", Bytes.size());
if(Result == -1)
- printf("[ => ] Failed to send %zd bytes to %s. (Socket %04Ix)\n", Bytes.size(), m_IpAddress, m_Socket);
+ printf("[ => ] %zd bytes failed (%d)\n", Bytes.size(), WSAGetLastError());
}
ByteArray TCPConnection::ReceiveRawBytes()
@@ -43,7 +43,7 @@ namespace Networking // Emplace all received bytes.
for(int n = 0; n < Received; ++n)
{
- ReceivedBytes.push_back(RecvBuffer[n]);
+ ReceivedBytes.emplace_back(RecvBuffer[n]);
}
// No more bytes left to receive.
@@ -51,7 +51,7 @@ namespace Networking break;
}
- printf("[ <= ] Received %zd bytes from %s.\n", ReceivedBytes.size(), m_IpAddress);
+ printf("[ <= ] %zd bytes\n", ReceivedBytes.size());
return ReceivedBytes;
}
@@ -126,6 +126,14 @@ namespace Networking ByteArray EncryptionKey = Connection.GetEncryptionKey();
Connection.SendRawBytes(EncryptionKey);
+ // Print out handshake header
+ printf("[ => ] Handshake: ");
+
+ for(auto &It : EncryptionKey)
+ printf("%02x ", It);
+
+ printf("\n");
+
// Detach a thread to handle the connection.
std::thread thread([&]
{
|
