本文整理汇总了C++中Battleground::GetID方法的典型用法代码示例。如果您正苦于以下问题:C++ Battleground::GetID方法的具体用法?C++ Battleground::GetID怎么用?C++ Battleground::GetID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Battleground
的用法示例。
在下文中一共展示了Battleground::GetID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleArenaJoinOpcode
void WorldSession::HandleArenaJoinOpcode(WorldPacket &recv_data)
{
if(!_player->IsInWorld()) return;
CHECK_PACKET_SIZE(recv_data, 11);
sLog.outString("BATTLEGROUND: Recieved CMSG_ARENA_JOIN");
uint64 unk1;
uint8 arenatype; // 0 - 2vs2 , 1 - 3vs3, 2 - 5vs5
uint16 unk2;
recv_data >> unk1 >> arenatype >> unk2; // dunno yet how to handle this.
Battleground *bg = sBattlegroundMgr.GetBattlegroundByInstanceID(0,5); // search for the first instance for now...
if(!bg)
return;
WorldPacket *pkt = sBattlegroundMgr.BuildBattlegroundStatusPacket(0, 5, 1, 1, 0x00FFFF00, 0); // put w8ting status.
SendPacket(pkt);
delete pkt;
if(bg->HasFreeSlots(sBattlegroundMgr.GenerateTeamByRace(GetPlayer()->getRace())))
{
GetPlayer()->m_bgBattlegroundID = bg->GetID();
pkt = sBattlegroundMgr.BuildBattlegroundStatusPacket(0, 5, 1, 2, 120, 0); // ask for player to join
SendPacket(pkt);
delete pkt;
}
}
示例2: HandleBattleMasterJoinOpcode
void WorldSession::HandleBattleMasterJoinOpcode(WorldPacket &recv_data)
{
if(!_player->IsInWorld()) return;
CHECK_PACKET_SIZE(recv_data, 17);
sLog.outString("BATTLEGROUND: Recieved CMSG_BATTLEMASTER_JOIN");
uint64 guid;
uint32 BattleGroundType;
uint32 instance;
uint8 unk;
recv_data >> guid >> BattleGroundType >> instance >> unk;
WorldPacket *pkt = sBattlegroundMgr.BuildBattlegroundStatusPacket(0, BattleGroundType, (instance==0 ? 1 : instance), 1, 0x00FFFF00, 0);
SendPacket(pkt);
delete pkt;
Battleground *bg = sBattlegroundMgr.GetBattlegroundByInstanceID(instance,BattleGroundType);
if(!bg)
return;
if(bg->HasFreeSlots(sBattlegroundMgr.GenerateTeamByRace(GetPlayer()->getRace())))
{
GetPlayer()->m_bgBattlegroundID = bg->GetID();
pkt = sBattlegroundMgr.BuildBattlegroundStatusPacket(0, BattleGroundType, (instance==0 ? 1 : instance), 2, 120, 0);
SendPacket(pkt);
delete pkt;
}
}