diff options
| author | boris <wzn@moneybot.cc> | 2018-12-27 22:42:05 +1300 |
|---|---|---|
| committer | boris <wzn@moneybot.cc> | 2018-12-27 22:42:05 +1300 |
| commit | 0c194bc8046cb3ecb4e4d0577f36a1d3bde58d11 (patch) | |
| tree | c27c5e71dba4db816cd9ad601a997b974377187e /csgo-loader/csgo-server/Server.cpp | |
| parent | 45adf172a76fc46ca6ca10e17fd534d4f35896c0 (diff) | |
bap
Diffstat (limited to 'csgo-loader/csgo-server/Server.cpp')
| -rw-r--r-- | csgo-loader/csgo-server/Server.cpp | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/csgo-loader/csgo-server/Server.cpp b/csgo-loader/csgo-server/Server.cpp index ada748b..d71a758 100644 --- a/csgo-loader/csgo-server/Server.cpp +++ b/csgo-loader/csgo-server/Server.cpp @@ -1,41 +1,24 @@ -#include <Networking/TCPServer.hpp>
-#include <Login/RemoteLogin.hpp>
+#include <Server.hpp>
-// ik inda like penigs tbh
-void ConnectionHandler(Networking::TCPConnection &Connection)
+int __stdcall WinMain(HINSTANCE, HINSTANCE, char*, int)
{
- Login::RemoteLoginServer LoginServer;
+ // Open a debugging console.
+ Utils::OpenConsole();
- ByteArray RawLoginHeader = Connection.ReceiveBytes();
- LoginServer.Start(RawLoginHeader);
-
- ByteArray RawServerResponse = LoginServer.GetResponse();
- Connection.SendBytes(RawServerResponse);
-}
-
-
-// cIUT <Y :LIFE INOT MAPIECES
-// THJIS IS MYLEAST REAPSPONTRE
-int main()
-{
- Networking::TCPServer Server;
// Create an instance of the TCP server.
- if(!Server.Start(3884))
- {
- printf("[FAIL] Failed to initialise server. (%08lx)\n", WSAGetLastError());
- system("pause");
- return 1;
- }
+ Networking::TCPServer Server;
- // Add a connection handler to the server.
- Server += ConnectionHandler;
+ bool Result = Server.Start(SERVER_PORT);
- // Accept incoming connections.
- while(true)
+ if(Result)
{
- Server.AcceptConnection();
+ for(;;)
+ Server.AcceptConnection();
}
- return 0;
+ if(!Result)
+ printf("[FAIL] Failed to initialise server. (%08lx)\n", WSAGetLastError());
+
+ system("pause");
}
\ No newline at end of file |
