serverspy/src/serverspy.cxx
//------------------------------------------------------------------------------
// This function will remove the client with the given name.
//------------------------------------------------------------------------------
This function will remove the client with the given name.
This function will remove the client with the given name .
void AdminDescriptor::RemoveAdmin(char *name) {
    AdminDescriptor *prev = NULL;
    AdminDescriptor *cur  = admin_list;
    while(cur != NULL) {
        if(strcmp(cur->m_Name, name) == 0) {
            closesocket(cur->m_Socket);
            if(prev == NULL) admin_list = cur->m_Next;
            else prev->m_Next = cur->m_Next;
            if(admin_list_last == cur)
                admin_list_last = prev;
            delete cur;
            return;
        }
        prev = cur;
        cur  = cur->m_Next;
    }
}
void AdminDescriptor :: RemoveAdmin ( char * name ) { AdminDescriptor * prev = NULL ; AdminDescriptor * cur = admin_list ; while ( cur != NULL ) { if ( strcmp ( cur -> m_Name , name ) == 0 ) { closesocket ( cur -> m_Socket ) ; if ( prev == NULL ) admin_list = cur -> m_Next ; else prev -> m_Next = cur -> m_Next ; if ( admin_list_last == cur ) admin_list_last = prev ; delete cur ; return ; } prev = cur ; cur = cur -> m_Next ; } }
This function will remove the client with the given name.
This function will remove the client with the given name .