diff options
| author | AShifter <[email protected]> | 2017-06-05 09:49:46 -0600 |
|---|---|---|
| committer | AShifter <[email protected]> | 2017-06-05 09:49:46 -0600 |
| commit | 61c906e596145bbedd60725c6dcee68c34a27907 (patch) | |
| tree | cd7a00d501affe96028bfb21a8dec90c2ee63f2c /ShiftOS.Server/Program.cs | |
| parent | 66ea2cf2fdeeaa025bd22961a0400423233c505d (diff) | |
| parent | 3e11eca70481841b6e2f2253d667944779cfd5fb (diff) | |
| download | shiftos_thereturn-61c906e596145bbedd60725c6dcee68c34a27907.tar.gz shiftos_thereturn-61c906e596145bbedd60725c6dcee68c34a27907.tar.bz2 shiftos_thereturn-61c906e596145bbedd60725c6dcee68c34a27907.zip | |
Merge remote-tracking branch 'refs/remotes/shiftos-game/master'
Diffstat (limited to 'ShiftOS.Server/Program.cs')
| -rw-r--r-- | ShiftOS.Server/Program.cs | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/ShiftOS.Server/Program.cs b/ShiftOS.Server/Program.cs index 97c8a66..5170ccd 100644 --- a/ShiftOS.Server/Program.cs +++ b/ShiftOS.Server/Program.cs @@ -55,17 +55,6 @@ namespace ShiftOS.Server public class Program { /// <summary> - /// The admin username. - /// </summary> - public static string AdminUsername = "admin"; - - /// <summary> - /// The admin password. - /// </summary> - public static string AdminPassword = "admin"; - - - /// <summary> /// The server. /// </summary> public static NetObjectServer server; @@ -86,16 +75,28 @@ namespace ShiftOS.Server /// <param name="args">The command-line arguments.</param> public static void Main(string[] args) { + Thread.Sleep(2000); + AppDomain.CurrentDomain.UnhandledException += (o, a) => + { + System.Diagnostics.Process.Start("ShiftOS.Server.exe"); + Environment.Exit(0); + }; + UserConfig.Get(); System.Timers.Timer tmr = new System.Timers.Timer(5000); tmr.Elapsed += (o, a) => { if (server.IsOnline) { - server.DispatchAll(new NetObject("heartbeat", new ServerMessage + + try { - Name = "heartbeat", - GUID = "server" - })); + server.DispatchAll(new NetObject("heartbeat", new ServerMessage + { + Name = "heartbeat", + GUID = "server" + })); + } + catch { } } }; if (!Directory.Exists("saves")) @@ -154,13 +155,7 @@ namespace ShiftOS.Server Console.WriteLine("FUCK. Something HORRIBLE JUST HAPPENED."); }; - AppDomain.CurrentDomain.UnhandledException += (o, a) => - { - if(server.IsOnline == true) - server.Stop(); - System.Diagnostics.Process.Start("ShiftOS.Server.exe"); - }; - + server.OnReceived += (o, a) => { var obj = a.Data.Object; @@ -207,7 +202,6 @@ namespace ShiftOS.Server task.Wait(); */ - RandomUserGenerator.StartThread(); while (server.IsOnline) { |
