summaryrefslogtreecommitdiffhomepage
path: root/Starserver/Main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Starserver/Main.cpp')
-rw-r--r--Starserver/Main.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/Starserver/Main.cpp b/Starserver/Main.cpp
new file mode 100644
index 0000000..0063060
--- /dev/null
+++ b/Starserver/Main.cpp
@@ -0,0 +1,40 @@
+/* Starshatter: The Open Source Project
+ Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors
+ Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors
+ Copyright (c) 1997-2006, Destroyer Studios LLC.
+*/
+
+#include "MachineInfo.h"
+#include "NetLayer.h"
+#include "Panic.h"
+#include "StarServer.h"
+#include "Token.h"
+#include "Utils.h"
+
+
+int dump_missions = 0;
+
+
+int
+main(int argc, char * argv[])
+{
+ AssignErrLog(fopen("serverlog.txt", "wb"));
+ MachineInfo::DescribeMachine();
+ int result = 1;
+ try {
+ NetLayer net;
+ StarServer server;
+ if (server.Init(nullptr, nullptr, nullptr, 0))
+ result = server.Run();
+ }
+ catch (const char* err) {
+ Print("Exception: %s\n", err);
+ }
+ Token::close();
+ if (Panic::Panicked()) {
+ Print("PANIC: %s\n", Panic::Message());
+ result = 1;
+ }
+ CloseErrLog();
+ return result;
+}