summaryrefslogtreecommitdiff
path: root/csgo-loader/csgo-server/Networking/TCPServer.cpp
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2018-12-29 20:59:57 +1300
committerboris <wzn@moneybot.cc>2018-12-29 20:59:57 +1300
commitbdb6ac5f940008bcd836e3c5f0a708f4b8f04865 (patch)
tree9d3ba5e0816dfd6295f8e38e1a865d061f1168e1 /csgo-loader/csgo-server/Networking/TCPServer.cpp
parent81a3987fc17f99d2092018ac266882f4533cc27e (diff)
protection shit
Diffstat (limited to 'csgo-loader/csgo-server/Networking/TCPServer.cpp')
-rw-r--r--csgo-loader/csgo-server/Networking/TCPServer.cpp14
1 files changed, 8 insertions, 6 deletions
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);