Ejemplo n.º 1
0
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");
    }
  }
}
Ejemplo n.º 2
0
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);
    }
}
Ejemplo n.º 3
0
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;
}
Ejemplo n.º 4
0
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;
}
Ejemplo n.º 5
0
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;
}