private void Process_Response_Local( CPersistenceRequest request, CPersistenceResponse response )
        {
            switch ( response.RequestType )
            {
                case EPersistenceRequestType.Get_Player_Data:
                    CGetPlayerDataPersistenceRequest get_data_request = request as CGetPlayerDataPersistenceRequest;
                    CGetPlayerDataPersistenceResponse get_data_response = response as CGetPlayerDataPersistenceResponse;
                    if ( get_data_response.PlayerData != null )
                    {
                        Register_Known_Player( get_data_request.PlayerName, get_data_response.PlayerData.ID );
                        Register_Player_Data( get_data_response.PlayerData );
                    }
                    break;

                case EPersistenceRequestType.Get_Player_ID:
                    CGetPlayerIDPersistenceRequest get_id_request = request as CGetPlayerIDPersistenceRequest;
                    CGetPlayerIDPersistenceResponse get_id_response = response as CGetPlayerIDPersistenceResponse;
                    if ( get_id_response.PlayerID != EPersistenceID.Invalid )
                    {
                        Register_Known_Player( get_id_request.PlayerName, get_id_response.PlayerID );
                    }
                    break;

                case EPersistenceRequestType.Add_Ignored_Player:
                    CAddIgnoredPlayerPersistenceRequest add_ignore_request = request as CAddIgnoredPlayerPersistenceRequest;
                    CAddIgnoredPlayerPersistenceResponse add_ignore_response = response as CAddIgnoredPlayerPersistenceResponse;
                    if ( add_ignore_response.Error == EPersistenceError.None && add_ignore_response.Result == EIgnorePlayerResult.Success )
                    {
                        CPersistentPlayerData add_player_data = Get_Player_Data( add_ignore_request.SourcePlayer );
                        if ( add_player_data != null )
                        {
                            add_player_data.IgnoreList.Add( add_ignore_response.IgnoredPlayerID );
                        }
                    }
                    break;

                case EPersistenceRequestType.Remove_Ignored_Player:
                    CRemoveIgnoredPlayerPersistenceRequest remove_ignore_request = request as CRemoveIgnoredPlayerPersistenceRequest;
                    CRemoveIgnoredPlayerPersistenceResponse remove_ignore_response = response as CRemoveIgnoredPlayerPersistenceResponse;
                    if ( remove_ignore_response.Error == EPersistenceError.None && remove_ignore_response.Result == EUnignorePlayerResult.Success )
                    {
                        CPersistentPlayerData remove_player_data = Get_Player_Data( remove_ignore_request.SourcePlayer );
                        if ( remove_player_data != null )
                        {
                            remove_player_data.IgnoreList.Remove( remove_ignore_response.IgnoredPlayerID );
                        }
                    }
                    break;
            }
        }
 public void Submit_Response( CPersistenceResponse response )
 {
     m_UnprocessedResponses.Add( response );
 }
        // Non-public interface
        private void Process_Response( CPersistenceResponse response )
        {
            EPersistenceRequestID request_id = response.RequestID;
            CPersistenceRequest request = null;
            if ( !m_PendingRequests.TryGetValue( request_id, out request ) )
            {
                throw new CApplicationException( "Could not match persistence response with a pending request" );
            }

            Process_Response_Local( request, response );
            request.Handler( response );

            m_PendingRequests.Remove( request_id );
        }
        private void On_Unignore_Persistence_Return( CPersistenceResponse response, EMessageRequestID request_id, EPersistenceID source_player )
        {
            CRemoveIgnoredPlayerPersistenceResponse unignore_response = response as CRemoveIgnoredPlayerPersistenceResponse;
            if ( unignore_response.Error != EPersistenceError.None )
            {
                CServerMessageRouter.Send_Message_To_Player( new CUnignorePlayerResponse( request_id, EPersistenceID.Invalid, EUnignorePlayerResult.Persistence_Error ), source_player );
                return;
            }

            if ( unignore_response.Result != EUnignorePlayerResult.Success )
            {
                CServerMessageRouter.Send_Message_To_Player( new CUnignorePlayerResponse( request_id, EPersistenceID.Invalid, unignore_response.Result ), source_player );
                return;
            }

            CServerMessageRouter.Send_Message_To_Chat_Server( new CRemovePlayerFromChatIgnoreListServerMessage( source_player, unignore_response.IgnoredPlayerID ) );
            CServerMessageRouter.Send_Message_To_Player( new CUnignorePlayerResponse( request_id, unignore_response.IgnoredPlayerID, EUnignorePlayerResult.Success ), source_player );

            CServerLobby lobby = CServerLobbyManager.Instance.Get_Lobby_By_Creator( source_player );
            if ( lobby != null && lobby.IsPublic )
            {
                CServerLobbyBrowserManager.Instance.Notify_Browser_Of_Lobby_Unban_Or_Unignore( unignore_response.IgnoredPlayerID, lobby.ID );
            }
        }