public BBServer() { // Create a log Log = new NetLog(); // Ignore net events of type 'verbose' Log.IgnoreTypes = NetLogEntryTypes.Verbose; // Quiet, you ! // Save log output to this file Log.OutputFileName = "serverlog.html"; // Create the player list PList = new PlayerList(); }
static void Client_StatusChanged(object sender, NetStatusEventArgs e) { Log.Info(e.Connection + ": " + e.Connection.Status + " - " + e.Reason); // If just connected, begin login procedure if (e.Connection.Status == NetConnectionStatus.Connected) { Program.ChatApplicationBusiness.AskLogin(MainForm.Player, BBMessage.Version); } // If connection drops, inform user and get back to the login form else if (e.Connection.Status == NetConnectionStatus.Disconnected) { try // The following fails if application is exiting { PList = new PlayerList(); Program.ChatApplicationBusiness.OutputSystemText("Disconnected ! Reason : " + e.Reason, null); MainForm.Connect(); } catch { } } }