public static void LoadServer() { Globals.CommandLine = CommandProcessor.ParseCommand(Environment.CommandLine); string startFolder; int overridePath = Globals.CommandLine.FindCommandArg("-overridepath"); if (overridePath > -1) { startFolder = Globals.CommandLine[overridePath + 1]; } else { startFolder = System.Windows.Forms.Application.StartupPath; } Globals.LiveTime = new System.Diagnostics.Stopwatch(); Globals.LiveTime.Start(); resetEvent = new ManualResetEvent(false); IO.IO.Initialize(startFolder); Settings.Initialize(); Settings.LoadConfig(); Settings.LoadNews(); Players.PlayerID.Initialize(); Players.PlayerID.LoadIDInfo(); Forms.LoadingUI loading = new Forms.LoadingUI(); loading.Text = "Loading..."; loading.Show(); Thread t = new Thread(new ParameterizedThreadStart(LoadServerBackground)); t.Start(loading); }
public static void LoadServer() { Globals.CommandLine = CommandProcessor.ParseCommand(Environment.CommandLine); string startFolder; int overridePath = Globals.CommandLine.FindCommandArg("-overridepath"); if (overridePath > -1) { startFolder = Globals.CommandLine[overridePath + 1]; } else { startFolder = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); } Globals.LiveTime = new System.Diagnostics.Stopwatch(); Globals.LiveTime.Start(); resetEvent = new ManualResetEvent(false); IO.IO.Initialize(startFolder); Settings.Initialize(); Settings.LoadConfig(); Settings.LoadNews(); Players.PlayerID.Initialize(); Players.PlayerID.LoadIDInfo(); //ForwardPorts(); Thread t = new Thread(new ParameterizedThreadStart(LoadServerBackground)); t.Start(); if (!string.IsNullOrEmpty(Settings.DiscordBotToken)) { var discordThread = new Thread(new ThreadStart(() => { new DiscordManager().Run(Settings.DiscordBotToken); })); discordThread.Start(); } }