summaryrefslogtreecommitdiff
path: root/csgo-loader/csgo-server/Server.cpp
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2018-12-29 22:15:34 +1300
committerboris <wzn@moneybot.cc>2018-12-29 22:15:34 +1300
commit0340821cc614fda2a94a96c255d16105dd2f6f9a (patch)
tree77338a110f4c784c2a6c20fd25abfc49666cacca /csgo-loader/csgo-server/Server.cpp
parentbdb6ac5f940008bcd836e3c5f0a708f4b8f04865 (diff)
tcp is being autistic -_-
Diffstat (limited to 'csgo-loader/csgo-server/Server.cpp')
-rw-r--r--csgo-loader/csgo-server/Server.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/csgo-loader/csgo-server/Server.cpp b/csgo-loader/csgo-server/Server.cpp
index 3b6bdea..c475542 100644
--- a/csgo-loader/csgo-server/Server.cpp
+++ b/csgo-loader/csgo-server/Server.cpp
@@ -1,8 +1,14 @@
#include <Server.hpp>
-void ConnectionHandler(Networking::TCPConnection &)
+void ConnectionHandler(Networking::TCPConnection &Connection)
{
+ ByteArray Bytes = Connection.ReceiveBytes();
+ for(auto &It : Bytes)
+ printf("%02x ", It);
+ printf("\n");
+
+ Connection.SendBytes(Bytes);
}
int __stdcall WinMain(HINSTANCE, HINSTANCE, char*, int)
@@ -14,13 +20,13 @@ int __stdcall WinMain(HINSTANCE, HINSTANCE, char*, int)
// Create an instance of the TCP server.
Networking::TCPServer Server;
+ // Attach our connection handler.
+ Server += ConnectionHandler;
+
bool Result = Server.Start(SERVER_PORT);
if(Result)
{
- // Attach our connection handler.
- Server += ConnectionHandler;
-
// Accept any incoming connections.
for(;;)
Server.AcceptConnection();