void PrivateChatChannel::excludePlayer(Player* player, Player* excludePlayer) { if(player != excludePlayer && removeInvited(excludePlayer)){ removeUser(excludePlayer); std::string msg; msg = excludePlayer->getName(); msg += " has been excluded."; player->sendTextMessage(MSG_INFO_DESCR, msg.c_str()); excludePlayer->sendClosePrivate(getId()); } }
void PrivateChatChannel::excludePlayer(const Player& player, Player& excludePlayer) { if (removeInvited(excludePlayer)) { removeUser(excludePlayer); std::ostringstream ss; ss << excludePlayer.getName() << " has been excluded."; player.sendTextMessage(MSG_INFO_DESCR, ss.str()); excludePlayer.sendClosePrivate(getId()); for (const auto& it : users) { it.second->sendChannelEvent(id, excludePlayer.getName(), CHANNELEVENT_EXCLUDE); } } }
void PrivateChatChannel::excludePlayer(Player* player, Player* excludePlayer) { if(player == excludePlayer || !removeInvited(excludePlayer)) return; std::string msg = excludePlayer->getName(); msg += " has been excluded."; player->sendTextMessage(MSG_INFO_DESCR, msg.c_str()); removeUser(excludePlayer); excludePlayer->sendClosePrivate(getId()); Player* tmpPlayer = NULL; for(UsersMap::iterator cit = m_users.begin(); cit != m_users.end(); ++cit) { if((tmpPlayer = cit->second->getPlayer())) tmpPlayer->sendChannelEvent(m_id, excludePlayer->getName(), CHANNELEVENT_EXCLUDE); } }