本文整理汇总了C++中Charter::GetLeader方法的典型用法代码示例。如果您正苦于以下问题:C++ Charter::GetLeader方法的具体用法?C++ Charter::GetLeader怎么用?C++ Charter::GetLeader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Charter
的用法示例。
在下文中一共展示了Charter::GetLeader方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleCharterSign
void WorldSession::HandleCharterSign( WorldPacket & recv_data )
{
uint64 item_guid;
recv_data >> item_guid;
if( !_player->IsInWorld() )
return;
Charter * c = objmgr.GetCharterByItemGuid(item_guid);
if(c == 0)
return;
if( _player->m_playerInfo->charterId[c->CharterType] != 0 )
{
SendNotification("You cannot sign two charters of the same type.");
return;
}
for(uint32 i = 0; i < 9; ++i)
{
if(c->Signatures[i] == _player->GetGUID())
{
SendNotification("You have already signed that charter.");
return;
}
}
if(c->IsFull())
return;
c->AddSignature(_player->GetLowGUID());
c->SaveToDB();
_player->m_playerInfo->charterId[c->CharterType] = c->GetID();
_player->SaveToDB(false);
Player * l = _player->GetMapMgr()->GetPlayer(c->GetLeader());
if(l == 0)
return;
WorldPacket data(SMSG_PETITION_SIGN_RESULTS, 100);
data << item_guid << _player->GetGUID() << uint32(0);
l->GetSession()->SendPacket(&data);
data.clear();
data << item_guid << (uint64)c->GetLeader() << uint32(0);
SendPacket(&data);
}
示例2: HandleCharterSign
void WorldSession::HandleCharterSign( WorldPacket & recv_data )
{
uint64 item_guid;
recv_data >> item_guid;
Charter * c = objmgr.GetCharterByItemGuid(item_guid);
if( c == NULL )
return;
for(uint32 i = 0; i < c->SignatureCount; ++i)
{
if(c->Signatures[i] == _player->GetGUID())
{
SendNotification(_player->GetSession()->LocalizedWorldSrv(79));
return;
}
}
if(c->IsFull())
return;
c->AddSignature(_player->GetLowGUID());
c->SaveToDB();
_player->m_charters[c->CharterType] = c;
_player->SaveToDB(false);
Player * l = _player->GetMapMgr()->GetPlayer(c->GetLeader());
if(l == 0)
return;
WorldPacket data(SMSG_PETITION_SIGN_RESULTS, 100);
data << item_guid << _player->GetGUID() << uint32(0);
l->GetSession()->SendPacket(&data);
data.clear();
data << item_guid << (uint64)c->GetLeader() << uint32(0);
SendPacket(&data);
}
示例3: HandleCharterTurnInCharter
void WorldSession::HandleCharterTurnInCharter(WorldPacket & recv_data)
{
uint64 mooguid;
recv_data >> mooguid;
Charter * pCharter = objmgr.GetCharterByItemGuid(mooguid);
if(!pCharter) return;
if(pCharter->CharterType == CHARTER_TYPE_GUILD)
{
Charter * gc = pCharter;
if(gc == NULL)
return;
if( gc->GetLeader() != _player->GetLowGUID() )
return;
if(gc->SignatureCount < 9 && Config.MainConfig.GetBoolDefault("Server", "RequireAllSignatures", false))
{
SendNotification("You don't have the required amount of signatures to turn in this petition.");
return;
}
// dont know hacky or not but only solution for now
// If everything is fine create guild
Guild *pGuild = Guild::Create();
pGuild->CreateFromCharter(gc, this);
// Destroy the charter
_player->m_playerInfo->charterId[CHARTER_TYPE_GUILD] = 0;
gc->Destroy();
_player->GetItemInterface()->RemoveItemAmt(ITEM_ENTRY_GUILD_CHARTER, 1);
sHookInterface.OnGuildCreate(_player, pGuild);
}
else
{
/* Arena charter - TODO: Replace with correct messages */
ArenaTeam * team;
uint32 type;
uint32 i;
uint32 icon, iconcolor, bordercolor, border, background;
recv_data >> iconcolor >>icon >> bordercolor >> border >> background;
switch(pCharter->CharterType)
{
case CHARTER_TYPE_ARENA_2V2:
type = ARENA_TEAM_TYPE_2V2;
break;
case CHARTER_TYPE_ARENA_3V3:
type = ARENA_TEAM_TYPE_3V3;
break;
case CHARTER_TYPE_ARENA_5V5:
type = ARENA_TEAM_TYPE_5V5;
break;
default:
SendNotification("Internal Error");
return;
}
if( pCharter->GetLeader() != _player->GetLowGUID() )
return;
if(_player->m_playerInfo->arenaTeam[pCharter->CharterType-1] != NULL)
{
sChatHandler.SystemMessage(this, "You are already in an arena team.");
return;
}
if(pCharter->SignatureCount < pCharter->GetNumberOfSlotsByType() && Config.MainConfig.GetBoolDefault("Server", "RequireAllSignatures", false))
{
sChatHandler.SystemMessage(this, "You don't have the required amount of signatures to turn in this petition.");
return;
}
team = new ArenaTeam(type, objmgr.GenerateArenaTeamId());
team->m_name = pCharter->GuildName;
team->m_emblemColour = iconcolor;
team->m_emblemStyle = icon;
team->m_borderColour = bordercolor;
team->m_borderStyle = border;
team->m_backgroundColour = background;
team->m_leader=_player->GetLowGUID();
team->m_stat_rating=1500;
objmgr.AddArenaTeam(team);
objmgr.UpdateArenaTeamRankings();
team->AddMember(_player->m_playerInfo);
/* Add the members */
for(i = 0; i < pCharter->SignatureCount; ++i)
{
PlayerInfo * info = objmgr.GetPlayerInfo(pCharter->Signatures[i]);
if(info)
{
team->AddMember(info);
//.........这里部分代码省略.........