/// <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) { // If we are exiting, don't do anything here. if (Exiting) { return; } // Remove client, and call OnUpdate Event try { // Remove client from online list if (Clients.TryRemove(client.PlayerId, out client) && !client.Disposed) { client.Dispose(); } // Add player to database queue var status = new PlayerStatusUpdate(client, LoginStatus.Disconnected); PlayerStatusQueue.Enqueue(status); } catch (Exception e) { Program.ErrorLog.Write("An Error occured at [GpcmServer._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(); } } catch (Exception e) { Program.ErrorLog.Write("An Error occured at [GpcmServer._OnDisconnect] : Generating Exception Log"); ExceptionHandler.GenerateExceptionLog(e); } }