当前位置: 首页>>代码示例>>C++>>正文


C++ Battleground::GetID方法代码示例

本文整理汇总了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;
	}
}
开发者ID:Sylica2013,项目名称:Antrix,代码行数:28,代码来源:BattlegroundHandler.cpp

示例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;
	}
}
开发者ID:Sylica2013,项目名称:Antrix,代码行数:28,代码来源:BattlegroundHandler.cpp


注:本文中的Battleground::GetID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。