/// <summary> /// Callback for when a connection had disconnected /// </summary> /// <param name="client">The client object whom is disconnecting</param> private void GpcmClient_OnDisconnect(GpcmClient client) { // Remove client, and call OnUpdate Event try { // Remove client from online list if (Clients.TryRemove(client.PlayerId, out client) && !client.Disposed) { client.Dispose(); } // Call Event OnClientsUpdate(this, EventArgs.Empty); } catch (Exception e) { L.LogError("An Error occured at [GpcmServer.GpcmClient_OnDisconnect] : Generating Exception Log"); ExceptionHandler.GenerateExceptionLog(e); } }
/// <summary> /// Callback for when a connection had disconnected /// </summary> /// <param name="client">The client object whom is disconnecting</param> private void GpcmClient_OnDisconnect(GpcmClient client) { // Remove client, and call OnUpdate Event try { // Remove client from online list if (Clients.TryRemove(client.PlayerId, out client) && !client.Disposed) client.Dispose(); // Call Event OnClientsUpdate(this, EventArgs.Empty); } catch (Exception e) { Program.ErrorLog.Write("An Error occured at [GpcmServer.GpcmClient_OnDisconnect] : Generating Exception Log"); ExceptionHandler.GenerateExceptionLog(e); } }