private void Handle_Player_Leave_Match( CMatchPlayerLeftMessage message )
        {
            if ( Match == null )
            {
                throw new CApplicationException( "Received a match player leave notice when no match exists" );
            }

            bool is_self_remove = message.PlayerID == CClientLogicalThread.Instance.ConnectedID;

            switch ( message.Reason )
            {
                case EMatchRemovalReason.Match_Shutdown:
                    CClientResource.Output_Text< EClientTextID >( EClientTextID.Client_Match_Shutdown );
                    break;

                case EMatchRemovalReason.Player_Disconnect_Timeout:
                    CClientResource.Output_Text< EClientTextID >( EClientTextID.Client_Match_Player_Removed_Disconnect_Timeout, CClientPlayerInfoManager.Instance.Get_Player_Name( message.PlayerID ) );
                    break;

                case EMatchRemovalReason.Player_Request:
                    if ( is_self_remove )
                    {
                        CClientResource.Output_Text< EClientTextID >( EClientTextID.Client_Match_Player_Removed_By_Request_Self );
                    }
                    else
                    {
                        CClientResource.Output_Text< EClientTextID >( EClientTextID.Client_Match_Player_Removed_By_Request, CClientPlayerInfoManager.Instance.Get_Player_Name( message.PlayerID ) );
                    }
                    break;
            }

            if ( is_self_remove )
            {
                Set_Match( null );
                CClientLogicalThread.Instance.Add_UI_Notification( new CUIScreenStateNotification( EUIScreenState.Chat_Idle ) );
            }
            else
            {
                Match.Remove_Member( message.PlayerID );
            }
        }
        public void Remove_From_Match( EMatchInstanceID match_id, EPersistenceID player_id, EMatchRemovalReason reason )
        {
            CServerMatchInstance match_instance = Get_Match_Instance( match_id );
            if ( match_instance == null )
            {
                return;
            }

            if ( CConnectedPlayerManager.Instance.Is_Connected( player_id ) )
            {
                CAsyncBackendOperations.Join_General_Channel( player_id, EMessageRequestID.Invalid );
            }

            CConnectedPlayer player = CConnectedPlayerManager.Instance.Get_Player_By_Persistence_ID( player_id );
            player.On_Leave_Match();

            CMatchPlayerLeftMessage leave_message = new CMatchPlayerLeftMessage( player_id, reason );
            bool is_match_shutdown = Is_Shutdown_Reason( reason );
            if ( is_match_shutdown )
            {
                CServerMessageRouter.Send_Message_To_Player( leave_message, player_id );
            }
            else
            {
                match_instance.Send_Message_To_Members( leave_message, EPersistenceID.Invalid );
            }

            match_instance.Remove_Member( player_id );

            if ( match_instance.MemberCount == 0 )
            {
                Shutdown_Match( match_id, EMatchDestroyedReason.Match_Empty );
            }
        }