summaryrefslogtreecommitdiff
path: root/csgo-loader/csgo-server/Server.cpp
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2018-12-19 00:13:24 +1300
committerboris <wzn@moneybot.cc>2018-12-19 00:13:24 +1300
commit77b52da44b263df4884be2f35f885d8edccbb6fa (patch)
tree54a9a07c67d507cb5120ae7e4ee86669dfec7c6b /csgo-loader/csgo-server/Server.cpp
parent1270999026bd77165edfffebfce277a34761710c (diff)
added new loader project :)
merry christmas
Diffstat (limited to 'csgo-loader/csgo-server/Server.cpp')
-rw-r--r--csgo-loader/csgo-server/Server.cpp33
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