本文整理汇总了C++中CCharEntity::ReloadPartyDec方法的典型用法代码示例。如果您正苦于以下问题:C++ CCharEntity::ReloadPartyDec方法的具体用法?C++ CCharEntity::ReloadPartyDec怎么用?C++ CCharEntity::ReloadPartyDec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCharEntity
的用法示例。
在下文中一共展示了CCharEntity::ReloadPartyDec方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReloadParty
void CParty::ReloadParty()
{
//check if partyflags have changed
int ret = Sql_Query(SqlHandle, "SELECT charid, partyflag FROM accounts_parties WHERE partyid = %d;", m_PartyID);
if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) > 0)
{
uint8 j = 0;
while (Sql_NextRow(SqlHandle) == SQL_SUCCESS)
{
uint32 charid = Sql_GetUIntData(SqlHandle, 0);
uint16 memberflags = Sql_GetUIntData(SqlHandle, 1);
if (memberflags & PARTY_LEADER)
{
bool found = false;
for (auto member : members)
{
if (member->id == charid)
{
m_PLeader = member;
found = true;
}
}
if (!found)
{
m_PLeader = NULL;
}
}
if (memberflags & PARTY_QM)
{
bool found = false;
for (auto member : members)
{
if (member->id == charid)
{
m_PQuaterMaster = member;
found = true;
}
}
if (!found)
{
m_PQuaterMaster = NULL;
}
}
}
}
//alliance
if (this->m_PAlliance != NULL)
{
for (uint8 a = 0; a < m_PAlliance->partyList.size(); ++a)
{
for (uint8 i = 0; i < m_PAlliance->partyList.at(a)->members.size(); ++i)
{
CCharEntity* PChar = (CCharEntity*)m_PAlliance->partyList.at(a)->members.at(i);
PChar->ReloadPartyDec();
uint16 alliance = 0;
PChar->pushPacket(new CPartyDefinePacket(m_PAlliance->partyList.at(a)));
int ret = Sql_Query(SqlHandle, "SELECT chars.charid, chars.charname, partyflag, pos_zone, partyid FROM accounts_parties \
LEFT JOIN chars ON accounts_parties.charid = chars.charid WHERE \
allianceid = %d ORDER BY partyflag & %u, timestamp;",
m_PAlliance->m_AllianceID, PARTY_SECOND | PARTY_THIRD);
if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) > 0)
{
uint8 j = 0;
while (Sql_NextRow(SqlHandle) == SQL_SUCCESS)
{
if (Sql_GetUIntData(SqlHandle, 2) & (PARTY_SECOND | PARTY_THIRD) != alliance)
{
alliance = Sql_GetUIntData(SqlHandle, 2) & (PARTY_SECOND | PARTY_THIRD);
j = 0;
}
CCharEntity* PPartyMember = zoneutils::GetChar(Sql_GetUIntData(SqlHandle, 0));
if (PPartyMember)
{
PChar->pushPacket(new CPartyMemberUpdatePacket(PPartyMember, j, PChar->getZone()));
}
else
{
PChar->pushPacket(new CPartyMemberUpdatePacket(
Sql_GetUIntData(SqlHandle, 0), Sql_GetData(SqlHandle, 1),
Sql_GetUIntData(SqlHandle, 2), Sql_GetUIntData(SqlHandle, 3)));
}
j++;
}
}
}
}
}
else
//regular party
for (uint8 i = 0; i < members.size(); ++i)
示例2: ReloadParty
void CParty::ReloadParty()
{
auto info = GetPartyInfo();
//alliance
if (this->m_PAlliance != nullptr)
{
for (auto&& party : m_PAlliance->partyList)
{
party->RefreshFlags(info);
for (auto&& member : party->members)
{
CCharEntity* PChar = (CCharEntity*)member;
PChar->ReloadPartyDec();
uint16 alliance = 0;
PChar->pushPacket(new CPartyDefinePacket(party));
//auto effects = std::make_unique<CPartyEffectsPacket>();
uint8 j = 0;
for (auto&& memberinfo : info)
{
if ((memberinfo.flags & (PARTY_SECOND | PARTY_THIRD)) != alliance)
{
alliance = memberinfo.flags & (PARTY_SECOND | PARTY_THIRD);
j = 0;
}
auto PPartyMember = zoneutils::GetChar(memberinfo.id);
if (PPartyMember)
{
PChar->pushPacket(new CPartyMemberUpdatePacket(PPartyMember, j, memberinfo.flags, PChar->getZone()));
//if (memberinfo.partyid == party->GetPartyID() && PPartyMember != PChar)
// effects->AddMemberEffects(PChar);
}
else
{
uint16 zoneid = memberinfo.zone == 0 ? memberinfo.prev_zone : memberinfo.zone;
PChar->pushPacket(new CPartyMemberUpdatePacket(
memberinfo.id, (const int8*)memberinfo.name.c_str(),
memberinfo.flags, j, zoneid));
}
j++;
}
//PChar->pushPacket(effects.release());
}
}
}
else
{
RefreshFlags(info);
//regular party
for (uint8 i = 0; i < members.size(); ++i)
{
CCharEntity* PChar = (CCharEntity*)members.at(i);
PChar->PLatentEffectContainer->CheckLatentsPartyJobs();
PChar->PLatentEffectContainer->CheckLatentsPartyMembers(members.size());
PChar->PLatentEffectContainer->CheckLatentsPartyAvatar();
PChar->ReloadPartyDec();
PChar->pushPacket(new CPartyDefinePacket(this));
//auto effects = std::make_unique<CPartyEffectsPacket>();
uint8 j = 0;
for (auto&& memberinfo : info)
{
auto PPartyMember = zoneutils::GetChar(memberinfo.id);
if (PPartyMember)
{
PChar->pushPacket(new CPartyMemberUpdatePacket(PPartyMember, j, memberinfo.flags, PChar->getZone()));
//if (PPartyMember != PChar)
// effects->AddMemberEffects(PChar);
}
else
{
uint16 zoneid = memberinfo.zone == 0 ? memberinfo.prev_zone : memberinfo.zone;
PChar->pushPacket(new CPartyMemberUpdatePacket(
memberinfo.id, (const int8*)memberinfo.name.c_str(),
memberinfo.flags, j, zoneid));
//effects->AddMemberEffects(memberinfo.id);
}
j++;
}
//PChar->pushPacket(effects.release());
}
}
}