Listen only for non SimShutdown Network.Disconnect firing so that we don't quite the program before all bots have actually logged off.

remove-scene-viewer
Justin Clark-Casey (justincc) 2011-11-01 21:47:14 +00:00
parent 53f3b76a84
commit 40750b44a0
1 changed files with 7 additions and 1 deletions

View File

@ -398,7 +398,13 @@ namespace pCampBot
// (args.Reason == NetworkManager.DisconnectType.SimShutdown // (args.Reason == NetworkManager.DisconnectType.SimShutdown
// || args.Reason == NetworkManager.DisconnectType.NetworkTimeout) // || args.Reason == NetworkManager.DisconnectType.NetworkTimeout)
// && OnDisconnected != null) // && OnDisconnected != null)
if (OnDisconnected != null)
if (
(args.Reason == NetworkManager.DisconnectType.ClientInitiated
|| args.Reason == NetworkManager.DisconnectType.ServerInitiated
|| args.Reason == NetworkManager.DisconnectType.NetworkTimeout)
&& OnDisconnected != null)
// if (OnDisconnected != null)
{ {
OnDisconnected(this, EventType.DISCONNECTED); OnDisconnected(this, EventType.DISCONNECTED);
} }