本文整理汇总了C++中BattleGround::isArena方法的典型用法代码示例。如果您正苦于以下问题:C++ BattleGround::isArena方法的具体用法?C++ BattleGround::isArena怎么用?C++ BattleGround::isArena使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BattleGround
的用法示例。
在下文中一共展示了BattleGround::isArena方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendBattleGroundChat
bool CPlayer::SendBattleGroundChat(ChatMsg msgtype, std::string message)
{
// Select distance to broadcast to.
float distance = sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_SAY);
if (msgtype == CHAT_MSG_YELL)
sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_YELL);
else if (msgtype == CHAT_MSG_EMOTE)
sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_TEXTEMOTE);
BattleGround* pBattleGround = GetBattleGround();
if (!pBattleGround || pBattleGround->isArena()) // Only fake chat in BG's. CFBG should not interfere with arenas.
return false;
for (auto& itr : pBattleGround->GetPlayers())
{
if (Player* pPlayer = sObjectMgr.GetPlayer(itr.first))
{
if (GetDistance2d(pPlayer->GetPositionX(), pPlayer->GetPositionY()) <= distance)
{
WorldPacket data(SMSG_MESSAGECHAT, 200);
if (GetTeam() == pPlayer->GetTeam())
ChatHandler::BuildChatPacket(data, msgtype, message.c_str(), LANG_UNIVERSAL, GetChatTag(), GetObjectGuid(), GetName());
else if (msgtype != CHAT_MSG_EMOTE)
ChatHandler::BuildChatPacket(data, msgtype, message.c_str(), pPlayer->GetOTeam() == ALLIANCE ? LANG_ORCISH : LANG_COMMON, GetChatTag(), GetObjectGuid(), GetName());
pPlayer->GetSession()->SendPacket(&data);
}
}
}
return true;
}
示例2: HandlePVPLogDataOpcode
void WorldSession::HandlePVPLogDataOpcode(WorldPacket& /*recv_data*/)
{
DEBUG_LOG("WORLD: Received opcode CMSG_PVP_LOG_DATA");
BattleGround* bg = _player->GetBattleGround();
if (!bg)
return;
// arena finish version will send in BattleGround::EndBattleGround directly
if (bg->isArena())
return;
WorldPacket data;
sBattleGroundMgr.BuildPvpLogDataPacket(&data, bg);
SendPacket(&data);
DEBUG_LOG("WORLD: Sent SMSG_PVP_LOG_DATA Message");
}