From bdb6ac5f940008bcd836e3c5f0a708f4b8f04865 Mon Sep 17 00:00:00 2001 From: boris Date: Sat, 29 Dec 2018 20:59:57 +1300 Subject: protection shit --- csgo-loader/csgo-server/Networking/TCPServer.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'csgo-loader/csgo-server/Networking/TCPServer.cpp') diff --git a/csgo-loader/csgo-server/Networking/TCPServer.cpp b/csgo-loader/csgo-server/Networking/TCPServer.cpp index dbd109d..739cbdd 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("[ <= ] %s disconnected!\n", m_IpAddress); if(m_Socket) closesocket(m_Socket); @@ -18,10 +18,12 @@ namespace Networking // Send data. int32_t Result = send(m_Socket, (char *)Bytes.data(), (int)Bytes.size(), 0); - printf("[=>] Sending %zd bytes to %s.\n", Bytes.size(), m_IpAddress); + if(m_IpAddress) + + printf("[ => ] Sending %zd bytes to %s.\n", Bytes.size(), m_IpAddress); if(Result == -1) - printf("[=>] Failed to send %zd bytes to %s. (Socket %04Ix)\n", Bytes.size(), m_IpAddress, m_Socket); + printf("[ => ] Failed to send %zd bytes to %s. (Socket %04Ix)\n", Bytes.size(), m_IpAddress, m_Socket); } ByteArray TCPConnection::ReceiveRawBytes() @@ -49,7 +51,7 @@ namespace Networking break; } - printf("[<=] Received %zd bytes from %s.\n", ReceivedBytes.size(), m_IpAddress); + printf("[ <= ] Received %zd bytes from %s.\n", ReceivedBytes.size(), m_IpAddress); return ReceivedBytes; } @@ -88,8 +90,8 @@ namespace Networking // Set up server context. m_Context.sin_addr.s_addr = INADDR_ANY; - m_Context.sin_family = AF_INET; - m_Context.sin_port = htons(ServerPort); + m_Context.sin_family = AF_INET; + m_Context.sin_port = htons(ServerPort); int32_t Bind = bind(m_Socket, (sockaddr *)&m_Context, sizeof sockaddr_in); -- cgit v1.2.3