I accidentally all the things. Init server in the right order.
This commit is contained in:
@@ -33,11 +33,6 @@ namespace Piston
|
||||
private void GetPluginList()
|
||||
{
|
||||
_plugins = typeof(MyPlugins).GetField("m_plugins", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null) as List<IPlugin>;
|
||||
if (_plugins == null)
|
||||
{
|
||||
typeof(MyPlugins).TypeInitializer.Invoke(null, null);
|
||||
GetPluginList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@@ -12,6 +12,7 @@ namespace Piston.Server
|
||||
/// </summary>
|
||||
public static class PistonServer
|
||||
{
|
||||
public static MainWindow UI;
|
||||
public static ServerManager Server;
|
||||
public static MultiplayerManager Multiplayer;
|
||||
public static PluginManager Plugins;
|
||||
@@ -27,6 +28,7 @@ namespace Piston.Server
|
||||
Server = new ServerManager();
|
||||
Multiplayer = new MultiplayerManager(Server);
|
||||
Plugins = new PluginManager();
|
||||
UI = new MainWindow();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -14,15 +14,11 @@ namespace Piston.Server
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static MainWindow UserInterface = new MainWindow();
|
||||
public static Dispatcher MainDispatcher { get; private set; }
|
||||
|
||||
[STAThread]
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Logger.Write("Initializing");
|
||||
PistonServer.Init();
|
||||
PistonServer.Server.RunArgs = new[] { "-console" };
|
||||
MainDispatcher = Dispatcher.CurrentDispatcher;
|
||||
|
||||
if (args.Contains("-nogui"))
|
||||
|
||||
@@ -39,7 +35,7 @@ namespace Piston.Server
|
||||
public static void StartUI()
|
||||
{
|
||||
Thread.CurrentThread.Name = "UI Thread";
|
||||
UserInterface.Show();
|
||||
PistonServer.UI.Show();
|
||||
}
|
||||
|
||||
public static void FullRestart()
|
||||
|
Reference in New Issue
Block a user