void PMC_Usr::process (void) { Protocol_Record *prp = this->get_each_friend (); Drwho_Node *np = prp->get_drwho_list (); if (np == 0) ACE_DEBUG ((LM_DEBUG, "<unknown>")); else { // First try to get a login session that is active... for (; np != 0; np = np->next_) if (np->active_count_ > 0) { ACE_DEBUG ((LM_DEBUG, "%s ", np->get_host_name ())); if (Options::get_opt (Options::USE_VERBOSE_FORMAT) == 0) return; } for (np = prp->get_drwho_list (); np != 0; np = np->next_) if (np->active_count_ == 0) { ACE_DEBUG ((LM_DEBUG, "%s ", np->get_host_name ())); if (Options::get_opt (Options::USE_VERBOSE_FORMAT) == 0) return; } } }
void PM_Client::process (void) { const char *(Protocol_Record::*get_name)(void); if (Options::get_opt (Options::PRINT_LOGIN_NAME)) get_name = &Protocol_Record::get_login; else get_name = &Protocol_Record::get_real; int active_friends = 0; int users = this->Protocol_Manager::get_total_users (); ACE_DEBUG ((LM_DEBUG, "------------------------\n")); if (Options::get_opt (Options::PRINT_LOGIN_NAME)) this->max_key_length = MAXUSERIDNAMELEN; // Goes through the queue of all the logged in friends and prints // out the associated information. for (Protocol_Record *prp = this->Protocol_Manager::get_each_friend (); prp != 0; prp = this->Protocol_Manager::get_each_friend ()) { ACE_DEBUG ((LM_DEBUG, "%c%-*s [", (prp->is_active_ != 0 ? '*' : ' '), this->max_key_length, (prp->*get_name) ())); for (Drwho_Node *np = prp->get_drwho_list (); ;) { ACE_DEBUG ((LM_DEBUG, np->get_host_name (), stdout)); active_friends += np->get_active_count (); if (np->get_inactive_count () != 0) { if (np->get_active_count () != 0) ACE_DEBUG ((LM_DEBUG, "*(%d)", np->get_active_count ())); } else if (np->get_active_count () > 1) ACE_DEBUG ((LM_DEBUG, "*(%d)", np->get_active_count ())); else if (np->get_active_count () == 1) ACE_DEBUG ((LM_DEBUG, "*")); np = np->next_; if (np == 0) break; else ACE_DEBUG ((LM_DEBUG, " ")); } ACE_DEBUG ((LM_DEBUG, "]\n")); } ACE_DEBUG ((LM_DEBUG, "------------------------\n")); ACE_DEBUG ((LM_DEBUG, "friends: %d\tusers: %d\n", active_friends, users)); }