From 0340821cc614fda2a94a96c255d16105dd2f6f9a Mon Sep 17 00:00:00 2001 From: boris Date: Sat, 29 Dec 2018 22:15:34 +1300 Subject: tcp is being autistic -_- --- csgo-loader/csgo-server/Server.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'csgo-loader/csgo-server/Server.cpp') 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 -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(); -- cgit v1.2.3