Basic framework - server loader, plugin manager, chat interface
This commit is contained in:
43
PistonServer/Program.cs
Normal file
43
PistonServer/Program.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using Piston;
|
||||
|
||||
namespace PistonServer
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static MainWindow UserInterface = new MainWindow();
|
||||
public static Dispatcher MainDispatcher { get; private set; }
|
||||
|
||||
[STAThread]
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
ServerManager.Static.RunArgs = new[] { "-console" };
|
||||
MainDispatcher = Dispatcher.CurrentDispatcher;
|
||||
Console.WriteLine(MainDispatcher.Thread.ManagedThreadId);
|
||||
#if DEBUG
|
||||
Directory.SetCurrentDirectory(@"C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\DedicatedServer64");
|
||||
#endif
|
||||
|
||||
if (args.Contains("-nogui"))
|
||||
ServerManager.Static.StartServer();
|
||||
else
|
||||
StartUI();
|
||||
|
||||
Dispatcher.Run();
|
||||
}
|
||||
|
||||
public static void StartUI()
|
||||
{
|
||||
Thread.CurrentThread.Name = "UI Thread";
|
||||
UserInterface.Show();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user