diff options
Diffstat (limited to 'csgo-loader/csgo-server/Server.cpp')
| -rw-r--r-- | csgo-loader/csgo-server/Server.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/csgo-loader/csgo-server/Server.cpp b/csgo-loader/csgo-server/Server.cpp new file mode 100644 index 0000000..ca6deb4 --- /dev/null +++ b/csgo-loader/csgo-server/Server.cpp @@ -0,0 +1,33 @@ +#include <Networking/TCPServer.hpp>
+#include <Login/RemoteLogin.hpp>
+
+void ConnectionHandler(Networking::TCPConnection &Connection) {
+ Login::RemoteLoginServer LoginServer;
+
+ ByteArray RawLoginHeader = Connection.ReceiveBytes();
+ LoginServer.Start(RawLoginHeader);
+
+ ByteArray RawServerResponse = LoginServer.GetResponse();
+ Connection.SendBytes(RawServerResponse);
+}
+
+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;
+}
\ No newline at end of file |
