本文整理汇总了C++中ArenaTeam::create方法的典型用法代码示例。如果您正苦于以下问题:C++ ArenaTeam::create方法的具体用法?C++ ArenaTeam::create怎么用?C++ ArenaTeam::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArenaTeam
的用法示例。
在下文中一共展示了ArenaTeam::create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleTurnInPetitionOpcode
//.........这里部分代码省略.........
if(type == 9)
{
if(objmgr.GetGuildByName(name))
{
SendGuildCommandResult(GUILD_CREATE_S, name, GUILD_NAME_EXISTS);
delete result;
return;
}
}
else
{
if(objmgr.GetArenaTeamByName(name))
{
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, name, "", ERR_ARENA_TEAM_NAME_EXISTS_S);
delete result;
return;
}
}
// and at last charter item check
Item *item = _player->GetItemByGuid(petitionguid);
if(!item)
{
delete result;
return;
}
// OK!
// delete charter item
_player->DestroyItem(item->GetBagSlot(),item->GetSlot(), true);
if(type == 9) // create guild
{
Guild* guild = new Guild;
if(!guild->create(_player->GetGUID(), name))
{
delete guild;
delete result;
return;
}
// register guild and add guildmaster
objmgr.AddGuild(guild);
// add members
for(uint8 i = 0; i < signs; ++i)
{
Field* fields = result->Fetch();
guild->AddMember(fields[0].GetUInt64(), guild->GetLowestRank());
result->NextRow();
}
}
else // or arena team
{
ArenaTeam* at = new ArenaTeam;
if(!at->create(_player->GetGUID(), type, name))
{
sLog.outError("PetitionsHandler: arena team create failed.");
delete at;
delete result;
return;
}
CHECK_PACKET_SIZE(recv_data, 8+5*4);