void SimpleChatWidget::updateUsers() { if (userList_) { userList_->clear(); SimpleChatServer::UserSet users = server_.users(); UserMap oldUsers = users_; users_.clear(); for (SimpleChatServer::UserSet::iterator i = users.begin(); i != users.end(); ++i) { WCheckBox *w = new WCheckBox(escapeText(*i), userList_); w->setInline(false); UserMap::const_iterator j = oldUsers.find(*i); if (j != oldUsers.end()) w->setChecked(j->second); else w->setChecked(true); users_[*i] = w->isChecked(); w->changed().connect(this, &SimpleChatWidget::updateUser); if (*i == user_) w->setStyleClass("chat-self"); } } }
void MFModel::updateVectorsWithOneTime(UserMap um){ map<int, User*>::iterator umIter ; for(umIter = um.begin(); umIter != um.end(); umIter++){ int userID = umIter->first; User *user = umIter->second; updateVectorsWithOneUser(userID, user); } }
CHttpConn* GetHttpConnByUuid(uint32_t uuid) { CHttpConn* pConn = NULL; UserMap::iterator it = g_uuidConnMap.find(uuid); if (it != g_uuidConnMap.end()) { pConn = (CHttpConn *)it->second; } return pConn; }
User* getUserPtrbyId(int id,int allownewtype){ UserMap::iterator iter; iter =userlist.find(id); if(iter!=userlist.end()){ return iter->second; } if(allownewtype==NOALLOWNEW) return NULL; User *newuser=new User(id); userlist.insert(UserMap::value_type(id,newuser)); return newuser; }
void player_list(void) { UserMap users; ServerPrx server; server = meta->getServer(serverId, ctx); users = server->getUsers(ctx); cout << "SID Name Ping" << endl; for (UserMap::iterator ii=users.begin(); ii != users.end(); ii++) cout << setw(8) << right << (*ii).first << " " << (*ii).second.name << " " << (*ii).second.udpPing << endl; }