diff options
Diffstat (limited to 'csgo-loader/csgo-server/Server.cpp')
| -rw-r--r-- | csgo-loader/csgo-server/Server.cpp | 14 |
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();
|
