summaryrefslogtreecommitdiff
path: root/csgo-loader/csgo-server/Server.cpp
blob: ada748ba3b82424f46aafbe13db65bc514e14aad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <Networking/TCPServer.hpp>
#include <Login/RemoteLogin.hpp>

// ik inda like penigs tbh
void ConnectionHandler(Networking::TCPConnection &Connection)
{
	Login::RemoteLoginServer LoginServer;

	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;
	}

	// Add a connection handler to the server.
	Server += ConnectionHandler;

	// Accept incoming connections.
	while(true)
	{
		Server.AcceptConnection();
	}

	return 0;
}