aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Server/Program.cs
diff options
context:
space:
mode:
authorpfg <[email protected]>2017-03-07 17:33:44 -0800
committerpfg <[email protected]>2017-03-07 17:33:44 -0800
commitb20d77edd1227b2ce53b65b0752972bd65a36e84 (patch)
treeb15615591e009c9aa472ba5d95374a064c50e8b1 /ShiftOS.Server/Program.cs
parent4989356d6797335b44060ae94c9af34404773506 (diff)
parent449d43d22c1d12ce6aa0243fbb4ea94481ff8f4c (diff)
downloadshiftos_thereturn-b20d77edd1227b2ce53b65b0752972bd65a36e84.tar.gz
shiftos_thereturn-b20d77edd1227b2ce53b65b0752972bd65a36e84.tar.bz2
shiftos_thereturn-b20d77edd1227b2ce53b65b0752972bd65a36e84.zip
Merge branch 'master' of https://github.com/shiftos-game/ShiftOS
Diffstat (limited to 'ShiftOS.Server/Program.cs')
-rw-r--r--ShiftOS.Server/Program.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/ShiftOS.Server/Program.cs b/ShiftOS.Server/Program.cs
index 7e5a517..9093c35 100644
--- a/ShiftOS.Server/Program.cs
+++ b/ShiftOS.Server/Program.cs
@@ -123,6 +123,27 @@ namespace ShiftOS.Server
Console.WriteLine("Client connected.");
server.DispatchTo(a.Guid, new NetObject("welcome", new ServerMessage { Name = "Welcome", Contents = a.Guid.ToString(), GUID = "Server" }));
};
+
+ server.OnClientDisconnected += (o, a) =>
+ {
+ Console.WriteLine("Client disconnected.");
+ };
+
+ server.OnClientRejected += (o, a) =>
+ {
+ Console.WriteLine("FUCK. Something HORRIBLE JUST HAPPENED.");
+ };
+
+ AppDomain.CurrentDomain.UnhandledException += (o, a) =>
+ {
+ ChatBackend.Broadcast("**Automatic Broadcast:** The multi-user domain is restarting because of a crash.");
+#if DEBUG
+ ChatBackend.Broadcast("Crash summary: " + a.ExceptionObject.ToString());
+#endif
+ if(server.IsOnline == true)
+ server.Stop();
+ System.Diagnostics.Process.Start("ShiftOS.Server.exe");
+ };
server.OnReceived += (o, a) =>
{