private void Apply_Member_Left_Operation( CLobbyMemberLeftOperation operation )
 {
     Remove_Member( operation.PlayerID, false );
 }
        public void Remove_From_Lobby( ELobbyID lobby_id, EPersistenceID player_id, ERemovedFromLobbyReason reason, EMessageRequestID request_id )
        {
            CServerLobby lobby = Get_Lobby( lobby_id );
            if ( lobby == null )
            {
                return;
            }

            CLog.Log( ELoggingChannel.Lobby, ELogLevel.Medium, String.Format( "Removing player {0} from lobby {1} for reason {2}.",
                                                                                                    CConnectedPlayerManager.Get_Player_Log_Name( player_id ),
                                                                                                    Get_Lobby_Log_Description( lobby_id ),
                                                                                                    reason.ToString() ) );

            if ( CConnectedPlayerManager.Instance.Is_Connected( player_id ) && reason != ERemovedFromLobbyReason.Lobby_Destroyed_Game_Started )
            {
                CAsyncBackendOperations.Join_General_Channel( player_id, EMessageRequestID.Invalid );
            }

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

            CLobbyMemberLeftOperation op = new CLobbyMemberLeftOperation( player_id, reason );
            bool is_lobby_shutdown = Is_Channel_Shutdown_Reason( reason );
            if ( is_lobby_shutdown )
            {
                CServerMessageRouter.Send_Message_To_Player( new CLobbyOperationMessage( op ), player_id );
            }
            else
            {
                Send_Message_To_Members( lobby_id, new CLobbyOperationMessage( op ) );
            }

            lobby.Remove_Member( player_id, !is_lobby_shutdown );
        }