#include void ConnectionHandler(Networking::TCPConnection &Connection) { Login::RemoteLoginServer LoginServer; ByteArray LoginHeader = Connection.ReceiveBytes(); if(!LoginServer.Start(LoginHeader)) return; ByteArray LoginReply = LoginServer.GetResponse(); Connection.SendBytes(LoginReply); } int __stdcall WinMain(HINSTANCE, HINSTANCE, char*, int) { // Open a debugging console. Utils::OpenConsole(); // Create an instance of the TCP server. Networking::TCPServer Server; bool Result = Server.Start(SERVER_PORT); if(Result) { // Attach our connection handler. Server += ConnectionHandler; // Accept any incoming connections. for(;;) Server.AcceptConnection(); } if(!Result) printf("[ E! ] Failed to initialise server. (%08lx)\n", WSAGetLastError()); system("pause"); }