本文整理汇总了C++中Group::GetMemberGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ Group::GetMemberGroup方法的具体用法?C++ Group::GetMemberGroup怎么用?C++ Group::GetMemberGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Group
的用法示例。
在下文中一共展示了Group::GetMemberGroup方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleGroupAcceptOpcode
void WorldSession::HandleGroupAcceptOpcode( WorldPacket & /*recv_data*/ )
{
Group *group = GetPlayer()->GetGroupInvite();
if (!group) return;
if(group->GetLeaderGUID() == GetPlayer()->GetGUID())
{
sLog.outError("HandleGroupAcceptOpcode: player %s(%d) tried to accept an invite to his own group", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow());
return;
}
// remove in from ivites in any case
group->RemoveInvite(GetPlayer());
/** error handling **/
/********************/
// not have place
if(group->IsFull())
{
SendPartyResult(PARTY_OP_INVITE, "", PARTY_RESULT_PARTY_FULL);
return;
}
Player* leader = objmgr.GetPlayer(group->GetLeaderGUID());
// forming a new group, create it
if(!group->IsCreated())
{
if( leader )
group->RemoveInvite(leader);
group->Create(group->GetLeaderGUID(), group->GetLeaderName());
objmgr.AddGroup(group);
}
// everything's fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!!
if(!group->AddMember(GetPlayer()->GetGUID(), GetPlayer()->GetName()))
return;
uint8 subgroup = group->GetMemberGroup(GetPlayer()->GetGUID());
}
示例2: HandleMessagechatOpcode
//.........这里部分代码省略.........
if (ChatHandler(this).ParseCommands(msg.c_str()))
break;
if (!processChatmessageFurtherAfterSecurityChecks(msg, lang))
return;
if (msg.empty())
break;
// if player is in battleground, he cannot say to battleground members by /p
Group* group = GetPlayer()->GetOriginalGroup();
if (!group)
{
group = _player->GetGroup();
if (!group || group->isBGGroup())
return;
}
// Playerbot mod: broadcast message to bot members
for(GroupReference* itr = group->GetFirstMember(); itr != NULL; itr=itr->next())
{
Player* player = itr->getSource();
if (player && player->GetPlayerbotAI())
{
player->GetPlayerbotAI()->HandleCommand(msg, *GetPlayer());
GetPlayer()->m_speakTime = 0;
GetPlayer()->m_speakCount = 0;
}
}
// END Playerbot mod
WorldPacket data;
ChatHandler::FillMessageData(&data, this, type, lang, msg.c_str());
group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetObjectGuid()));
break;
}
case CHAT_MSG_GUILD:
{
std::string msg;
recv_data >> msg;
if (msg.empty())
break;
if (ChatHandler(this).ParseCommands(msg.c_str()))
break;
if (!processChatmessageFurtherAfterSecurityChecks(msg, lang))
return;
if (msg.empty())
break;
if (GetPlayer()->GetGuildId())
if (Guild* guild = sGuildMgr.GetGuildById(GetPlayer()->GetGuildId()))
guild->BroadcastToGuild(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
break;
}
case CHAT_MSG_OFFICER:
{
std::string msg;
recv_data >> msg;
if (msg.empty())
示例3: HandleMessagechatOpcode
//.........这里部分代码省略.........
if (GetPlayer()->HasAura(1852) && !receiver->IsGameMaster())
{
SendNotification(GetTrinityString(LANG_GM_SILENCE), GetPlayer()->GetName().c_str());
return;
}
// If player is a Gamemaster and doesn't accept whisper, we auto-whitelist every player that the Gamemaster is talking to
// We also do that if a player is under the required level for whispers.
if (receiver->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) ||
(HasPermission(rbac::RBAC_PERM_CAN_FILTER_WHISPERS) && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID())))
sender->AddWhisperWhiteList(receiver->GetGUID());
GetPlayer()->Whisper(msg, lang, receiver->GetGUID());
} break;
case CHAT_MSG_PARTY:
case CHAT_MSG_PARTY_LEADER:
{
// if player is in battleground, he cannot say to battleground members by /p
Group* group = GetPlayer()->GetOriginalGroup();
if (!group)
{
group = sender->GetGroup();
if (!group || group->isBGGroup())
return;
}
if (type == CHAT_MSG_PARTY_LEADER && !group->IsLeader(sender->GetGUID()))
return;
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
WorldPacket data;
ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), sender, NULL, msg);
group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID()));
} break;
case CHAT_MSG_GUILD:
{
if (GetPlayer()->GetGuildId())
{
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
{
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild);
guild->BroadcastToGuild(this, false, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
}
}
} break;
case CHAT_MSG_OFFICER:
{
if (GetPlayer()->GetGuildId())
{
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
{
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild);
guild->BroadcastToGuild(this, true, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
}
}
} break;
case CHAT_MSG_RAID:
{
// if player is in battleground, he cannot say to battleground members by /ra
Group* group = GetPlayer()->GetOriginalGroup();
if (!group)
{
group = GetPlayer()->GetGroup();
示例4: HandleMessagechatOpcode
//.........这里部分代码省略.........
}
// pussywizard: optimization
/*if (GetPlayer()->HasAura(1852) && !receiver->IsGameMaster())
{
SendNotification(GetTrinityString(LANG_GM_SILENCE), GetPlayer()->GetName().c_str());
return;
}*/
// If player is a Gamemaster and doesn't accept whisper, we auto-whitelist every player that the Gamemaster is talking to
if (!senderIsPlayer && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID()))
sender->AddWhisperWhiteList(receiver->GetGUID());
GetPlayer()->Whisper(msg, lang, receiver->GetGUID());
}
break;
case CHAT_MSG_PARTY:
case CHAT_MSG_PARTY_LEADER:
{
// if player is in battleground, he cannot say to battleground members by /p
Group* group = GetPlayer()->GetOriginalGroup();
if (!group)
{
group = sender->GetGroup();
if (!group || group->isBGGroup())
return;
}
if (type == CHAT_MSG_PARTY_LEADER && !group->IsLeader(sender->GetGUID()))
return;
WorldPacket data;
ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), sender, NULL, msg);
group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID()));
}
break;
case CHAT_MSG_GUILD:
{
if (GetPlayer()->GetGuildId())
{
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
{
guild->BroadcastToGuild(this, false, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
}
}
}
break;
case CHAT_MSG_OFFICER:
{
if (GetPlayer()->GetGuildId())
{
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
{
guild->BroadcastToGuild(this, true, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
}
}
}
break;
case CHAT_MSG_RAID:
{
// if player is in battleground, he cannot say to battleground members by /ra
Group* group = GetPlayer()->GetOriginalGroup();
if (!group)
{
group = GetPlayer()->GetGroup();
if (!group || group->isBGGroup() || !group->isRaidGroup())
示例5: HandleMessagechatOpcode
//.........这里部分代码省略.........
data<<to;
SendPacket(&data);
return;
}
}
GetPlayer()->Whisper(player->GetGUID(), msg, lang);
} break;
case CHAT_MSG_PARTY:
{
std::string msg = "";
recv_data >> msg;
if(msg.empty())
break;
if (ChatHandler(this).ParseCommands(msg.c_str()) > 0)
break;
// strip invisible characters for non-addon messages
if (lang != LANG_ADDON && sWorld.getConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING))
stripLineInvisibleChars(msg);
if(msg.empty())
break;
Group *group = GetPlayer()->GetGroup();
if(!group)
return;
WorldPacket data;
ChatHandler::FillMessageData(&data, this, CHAT_MSG_PARTY, lang, NULL, 0, msg.c_str(),NULL);
group->BroadcastPacket(&data, group->GetMemberGroup(GetPlayer()->GetGUID()));
}
break;
case CHAT_MSG_GUILD:
{
std::string msg = "";
recv_data >> msg;
if(msg.empty())
break;
if (ChatHandler(this).ParseCommands(msg.c_str()) > 0)
break;
// strip invisible characters for non-addon messages
if (lang != LANG_ADDON && sWorld.getConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING))
stripLineInvisibleChars(msg);
if(msg.empty())
break;
if (GetPlayer()->GetGuildId())
{
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
if (guild)
guild->BroadcastToGuild(this, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
}
break;
}
case CHAT_MSG_OFFICER:
{
std::string msg = "";
示例6: HandleChatMessage
//.........这里部分代码省略.........
if (GetPlayer()->HasAura(1852) && !receiver->IsGameMaster())
{
SendNotification(GetTrinityString(LANG_GM_SILENCE), GetPlayer()->GetName().c_str());
return;
}
// If player is a Gamemaster and doesn't accept whisper, we auto-whitelist every player that the Gamemaster is talking to
// We also do that if a player is under the required level for whispers.
if (receiver->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) ||
(HasPermission(rbac::RBAC_PERM_CAN_FILTER_WHISPERS) && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID())))
sender->AddWhisperWhiteList(receiver->GetGUID());
GetPlayer()->Whisper(msg, Language(lang), receiver);
break;
}
case CHAT_MSG_PARTY:
{
// if player is in battleground, he cannot say to battleground members by /p
Group* group = GetPlayer()->GetOriginalGroup();
if (!group)
{
group = sender->GetGroup();
if (!group || group->isBGGroup())
return;
}
if (group->IsLeader(GetPlayer()->GetGUID()))
type = CHAT_MSG_PARTY_LEADER;
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
WorldPackets::Chat::Chat packet;
packet.Initialize(ChatMsg(type), Language(lang), sender, nullptr, msg);
group->BroadcastPacket(packet.Write(), false, group->GetMemberGroup(GetPlayer()->GetGUID()));
break;
}
case CHAT_MSG_GUILD:
{
if (GetPlayer()->GetGuildId())
{
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
{
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild);
guild->BroadcastToGuild(this, false, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
}
}
break;
}
case CHAT_MSG_OFFICER:
{
if (GetPlayer()->GetGuildId())
{
if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId()))
{
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild);
guild->BroadcastToGuild(this, true, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
}
}
break;
}
case CHAT_MSG_RAID:
{
Group* group = GetPlayer()->GetGroup();
if (!group || !group->isRaidGroup() || group->isBGGroup())
示例7: HandleMessagechatOpcode
//.........这里部分代码省略.........
return;
}
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER )
{
uint32 sidea = GetPlayer()->GetTeam();
uint32 sideb = player->GetTeam();
if( sidea != sideb )
{
WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, (to.size()+1));
data<<to;
SendPacket(&data);
return;
}
}
GetPlayer()->Whisper(player->GetGUID(), msg, lang);
GetPlayer()->UpdateSpeakTime();
} break;
case CHAT_MSG_PARTY:
{
std::string msg = "";
recv_data >> msg;
if (sChatHandler.ParseCommands(msg.c_str(), this) > 0)
break;
Group *group = GetPlayer()->groupInfo.group;
if(!group)
return;
WorldPacket data;
sChatHandler.FillMessageData(&data, this, CHAT_MSG_PARTY, lang, NULL, 0, msg.c_str());
group->BroadcastPacket(&data, group->GetMemberGroup(GetPlayer()->GetGUID()));
GetPlayer()->UpdateSpeakTime();
}
break;
case CHAT_MSG_GUILD:
{
std::string msg = "";
recv_data >> msg;
if (sChatHandler.ParseCommands(msg.c_str(), this) > 0)
break;
if (GetPlayer()->GetGuildId())
{
Guild *guild = objmgr.GetGuildById(GetPlayer()->GetGuildId());
if (guild)
{
guild->BroadcastToGuild(this, msg);
GetPlayer()->UpdateSpeakTime();
}
}
break;
}
case CHAT_MSG_OFFICER:
{
std::string msg = "";
recv_data >> msg;
if (sChatHandler.ParseCommands(msg.c_str(), this) > 0)
break;
if (GetPlayer()->GetGuildId())