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