/* ******************************************************************* * Function: * * Description: * * Parameters: * * Returns: * ******************************************************************* */ bool xDistributedSession::isFull() { return getNumUsers() >= getMaxUsers(); int maxplayers = -1; if (getProperty(E_DC_S_NP_MAX_USERS)) { xDistributedInteger* maxPlayersP = (xDistributedInteger*)getProperty(E_DC_S_NP_MAX_USERS); if (maxPlayersP) { maxplayers = maxPlayersP->mLastServerValue; return getNumUsers() < getMaxUsers(); } } return true; }
void Channel::removeUser(Client *user, bool sendpart, char *reason, bool closeChan) { std::list<chanClient *>::iterator it = user_list.begin(); char *nullreason = "\0"; if(reason == NULL) { reason = nullreason; } char *unick; user->getUserInfo(&unick,NULL,NULL,NULL); sendToAllWithMode((int)EUserMode_ShowJoins,":SERVER!SERVER@* NOTICE :%s has parted %s",unick,getName()); while(it != user_list.end()) { chanClient *c=(chanClient *)*it; if(c->client == user) { if(sendpart) { if(this->auditorium != 2) { if(this->auditorium == 1) { if(c->voice || c->halfop || c->op || c->owner) sendMessage(c->invisible,false,user,"PART %s :%s",getName(),reason); } else { sendMessage(c->invisible,false,user,"PART %s :%s",getName(),reason); } } else { user->messageSend(user,"PART %s :%s",getName(),reason); } } customKey *key; std::list<customKey *>::iterator it2 = c->userKeys->begin(); while(it2 != c->userKeys->end()) { key = *it2; free((void *)key); it2++; } delete c->userKeys; free(c); user_list.erase(it); break; } it++; } if(getNumUsers(true) < 1 && !stayopen && closeChan) { deleteChannel(this); } }
bool ServerEntity::isNearlyFull() const { return getNumUsers() + USER_OVERFLOW_AMT >= getCapacity(); }
bool ServerEntity::isFull() const { return getNumUsers() >= getCapacity(); }