本文整理汇总了C++中PrivateChatChannel::getOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ PrivateChatChannel::getOwner方法的具体用法?C++ PrivateChatChannel::getOwner怎么用?C++ PrivateChatChannel::getOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PrivateChatChannel
的用法示例。
在下文中一共展示了PrivateChatChannel::getOwner方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeUserFromAllChannels
void Chat::removeUserFromAllChannels(const Player& player)
{
for (auto& it : normalChannels) {
it.second.removeUser(player);
}
for (auto& it : partyChannels) {
it.second.removeUser(player);
}
for (auto& it : guildChannels) {
it.second.removeUser(player);
}
auto it = privateChannels.begin();
while (it != privateChannels.end()) {
PrivateChatChannel* channel = &it->second;
channel->removeInvite(player.getGUID());
channel->removeUser(player);
if (channel->getOwner() == player.getGUID()) {
channel->closeChannel();
it = privateChannels.erase(it);
} else {
++it;
}
}
}
示例2: getPrivateChannel
PrivateChatChannel* Chat::getPrivateChannel(const Player& player)
{
for (PrivateChannelMap::iterator it = privateChannels.begin(); it != privateChannels.end(); ++it) {
PrivateChatChannel* channel = it->second;
if (channel->getOwner() == player.getGUID()) {
return channel;
}
}
return NULL;
}
示例3: getChannelList
ChannelList Chat::getChannelList(Player* player)
{
ChannelList list;
NormalChannelMap::iterator itn;
PrivateChannelMap::iterator it;
bool gotPrivate = false;
// If has guild
if(player->getGuildId() && player->getGuildName().length()){
ChatChannel *channel = getChannel(player, CHANNEL_GUILD);
if(channel)
list.push_back(channel);
else if((channel = createChannel(player, CHANNEL_GUILD)))
list.push_back(channel);
}
if(player->getParty()){
ChatChannel *channel = getChannel(player, CHANNEL_PARTY);
if(channel)
list.push_back(channel);
else if((channel = createChannel(player, CHANNEL_PARTY)))
list.push_back(channel);
}
for(itn = m_normalChannels.begin(); itn != m_normalChannels.end(); ++itn){
if(!player->hasFlag(PlayerFlag_CannotBeMuted)){
if(itn->first == CHANNEL_TRADE && player->getVocationId() == 0)
continue;
if(itn->first == CHANNEL_TRADE_ROOK && player->getVocationId() != 0)
continue;
}
ChatChannel *channel = itn->second;
list.push_back(channel);
}
for(it = m_privateChannels.begin(); it != m_privateChannels.end(); ++it){
PrivateChatChannel* channel = it->second;
if(channel){
if(channel->isInvited(player))
list.push_back(channel);
if(channel->getOwner() == player->getGUID())
gotPrivate = true;
}
}
if(!gotPrivate)
list.push_front(dummyPrivate);
return list;
}
示例4: getPrivateChannel
PrivateChatChannel* Chat::getPrivateChannel(Player* player)
{
if(!player || player->isRemoved())
return NULL;
PrivateChatChannel* channel = NULL;
for(PrivateChannelMap::iterator it = m_privateChannels.begin(); it != m_privateChannels.end(); ++it)
{
if((channel = it->second) && channel->getOwner() == player->getGUID())
return channel;
}
return NULL;
}
示例5: getChannelList
ChannelList Chat::getChannelList(Player* player)
{
ChannelList list;
NormalChannelMap::iterator itn;
PrivateChannelMap::iterator it;
bool gotPrivate = false;
// If has guild
if(player->getGuildId() && player->getGuildName().length()){
ChatChannel *channel = getChannel(player, 0x00);
if(channel)
list.push_back(channel);
else if((channel = createChannel(player, 0x00)))
list.push_back(channel);
}
for(itn = m_normalChannels.begin(); itn != m_normalChannels.end(); ++itn){
if(itn->first == 0x03 && !player->hasFlag(PlayerFlag_CanAnswerRuleViolations)){ //Rule violations channel
continue;
}
ChatChannel *channel = itn->second;
list.push_back(channel);
}
for(it = m_privateChannels.begin(); it != m_privateChannels.end(); ++it){
PrivateChatChannel* channel = it->second;
if(channel){
if(channel->isInvited(player))
list.push_back(channel);
if(channel->getOwner() == player->getGUID())
gotPrivate = true;
}
}
if(!gotPrivate)
list.push_front(dummyPrivate);
return list;
}
示例6: removeUserFromAllChannels
void Chat::removeUserFromAllChannels(const Player& player)
{
for (auto& it : normalChannels) {
it.second.removeUser(player);
}
for (const auto& it : partyChannels) {
it.second->removeUser(player);
}
for (const auto& it : guildChannels) {
it.second->removeUser(player);
}
for (const auto& it : privateChannels) {
PrivateChatChannel* channel = it.second;
channel->removeUser(player);
if (channel->getOwner() == player.getGUID()) {
deleteChannel(player, channel->getId());
}
}
}
示例7: getChannelList
ChannelList Chat::getChannelList(Player* player)
{
ChannelList list;
if(!player || player->isRemoved())
return list;
ChatChannel* channel = NULL;
if(player->getParty() && ((channel = getChannel(player, CHANNEL_PARTY)) || (channel = createChannel(player, CHANNEL_PARTY))))
list.push_back(channel);
if(player->getGuildId() && player->getGuildName().length() && ((channel = getChannel(
player, CHANNEL_GUILD)) || (channel = createChannel(player, CHANNEL_GUILD))))
list.push_back(channel);
for(NormalChannelMap::iterator it = m_normalChannels.begin(); it != m_normalChannels.end(); ++it)
{
if((channel = getChannel(player, it->first)))
list.push_back(it->second);
}
bool hasPrivate = false;
PrivateChatChannel* privChannel = NULL;
for(PrivateChannelMap::iterator pit = m_privateChannels.begin(); pit != m_privateChannels.end(); ++pit)
{
if(!(privChannel = pit->second))
continue;
if(privChannel->isInvited(player))
list.push_back(privChannel);
if(privChannel->getOwner() == player->getGUID())
hasPrivate = true;
}
if(!hasPrivate && player->isPremium())
list.push_front(dummyPrivate);
return list;
}
示例8: removeUserFromAllChannels
void Chat::removeUserFromAllChannels(Player* player)
{
for (NormalChannelMap::iterator it = m_normalChannels.begin(), end = m_normalChannels.end(); it != end; ++it) {
it->second->removeUser(player);
}
for (PartyChannelMap::iterator it = m_partyChannels.begin(), end = m_partyChannels.end(); it != end; ++it) {
it->second->removeUser(player);
}
for (GuildChannelMap::iterator it = m_guildChannels.begin(), end = m_guildChannels.end(); it != end; ++it) {
it->second->removeUser(player);
}
for (PrivateChannelMap::iterator it = m_privateChannels.begin(), end = m_privateChannels.end(); it != end; ++it) {
PrivateChatChannel* channel = it->second;
channel->removeUser(player);
if (channel->getOwner() == player->getGUID()) {
deleteChannel(player, channel->getId());
}
}
}