void Chat::removeUserFromAllChannels(Player* player) { ChannelList list = getChannelList(player); while (!list.empty()) { ChatChannel* channel = list.front(); list.pop_front(); channel->removeUser(player); if (channel->getOwner() == player->getGUID()) { deleteChannel(player, channel->getId()); } } for (NormalChannelMap::iterator it = m_normalChannels.begin(); it != m_normalChannels.end(); ++it) { it->second->removeUser(player); } for (GuildChannelMap::iterator it = m_guildChannels.begin(); it != m_guildChannels.end(); ++it) { it->second->removeUser(player); } }
void Chat::removeUserFromAllChannels(Player* player) { ChannelList list = getChannelList(player); while(list.size()){ ChatChannel *channel = list.front(); list.pop_front(); channel->removeUser(player); if(channel->getOwner() == player->getGUID()) deleteChannel(player, channel->getId()); } }
int main(int argc, char *argv[]) { pthread_mutex_init(&printMutex, NULL); if (init() != 0) { printMsg("could not initiate HAL"); return -1; } else { printMsg("successfully initialized HAL; wlan0 = %p\n", wlan0Handle); } pthread_cond_init(&eventCacheCondition, NULL); pthread_mutex_init(&eventCacheMutex, NULL); pthread_t tidEvent; pthread_create(&tidEvent, NULL, &eventThreadFunc, NULL); sleep(2); // let the thread start if (argc < 2 || argv[1][0] != '-') { printf("Usage: halutil [OPTION]\n"); printf(" -s start AP scan test\n"); printf(" -swc start Significant Wifi change test\n"); printf(" -h start Hotlist APs scan test\n"); printf(" -ss stop scan test\n"); printf(" -max_ap Max AP for scan \n"); printf(" -base_period Base period for scan \n"); printf(" -threshold Threshold scan test\n"); printf(" -avg_RSSI samples for averaging RSSI\n"); printf(" -ap_loss samples to confirm AP loss\n"); printf(" -ap_breach APs breaching threshold\n"); printf(" -ch_threshold Change in threshold\n"); printf(" -wt_event Waiting event for test\n"); printf(" -low_th Low threshold for hotlist APs\n"); printf(" -hight_th High threshold for hotlist APs\n"); printf(" -hotlist_bssids BSSIDs for hotlist test\n"); printf(" -stats print link layer statistics\n"); printf(" -get_ch_list <a/bg/abg/a_nodfs/abg_nodfs/dfs> Get channel list\n"); printf(" -get_feature_set Get Feature set\n"); printf(" -get_feature_matrix Get concurrent feature matrix\n"); printf(" -rtt Run RTT on nearby APs\n"); printf(" -rtt_samples Run RTT on nearby APs\n"); printf(" -scan_mac_oui XY:AB:CD\n"); printf(" -nodfs <0|1> Turn OFF/ON non-DFS locales\n"); goto cleanup; } memset(mac_oui, 0, 3); if (strcmp(argv[1], "-s") == 0) { readTestOptions(argc, argv); setPnoMacOui(); testScan(); }else if(strcmp(argv[1], "-swc") == 0){ readTestOptions(argc, argv); setPnoMacOui(); trackSignificantChange(); }else if (strcmp(argv[1], "-ss") == 0) { // Stop scan so clear the OUI too setPnoMacOui(); testStopScan(); }else if ((strcmp(argv[1], "-h") == 0) || (strcmp(argv[1], "-hotlist_bssids") == 0)) { readTestOptions(argc, argv); setPnoMacOui(); testHotlistAPs(); }else if (strcmp(argv[1], "-stats") == 0) { getLinkStats(); } else if ((strcmp(argv[1], "-rtt") == 0)) { readTestOptions(argc, argv); testRTT(); } else if ((strcmp(argv[1], "-get_ch_list") == 0)) { readTestOptions(argc, argv); getChannelList(); } else if ((strcmp(argv[1], "-get_feature_set") == 0)) { getFeatureSet(); } else if ((strcmp(argv[1], "-get_feature_matrix") == 0)) { getFeatureSetMatrix(); } else if ((strcmp(argv[1], "-scan_mac_oui") == 0)) { readTestOptions(argc, argv); setPnoMacOui(); testScan(); } else if (strcmp(argv[1], "-nodfs") == 0) { u32 nodfs = 0; if (argc > 2) nodfs = (u32)atoi(argv[2]); wifi_set_nodfs_flag(wlan0Handle, nodfs); } cleanup: cleanup(); return 0; }