本文整理汇总了C++中LPCHARACTER::SetParty方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::SetParty方法的具体用法?C++ LPCHARACTER::SetParty怎么用?C++ LPCHARACTER::SetParty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::SetParty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Link
void CParty::Link(LPCHARACTER pkChr)
{
TMemberMap::iterator it;
if (pkChr->IsPC())
it = m_memberMap.find(pkChr->GetPlayerID());
else
it = m_memberMap.find(pkChr->GetVID());
if (it == m_memberMap.end())
{
sys_err("%s is not member of this party", pkChr->GetName());
return;
}
// 플레이어 파티일 경우 업데이트 이벤트 생성
if (m_bPCParty && !m_eventUpdate)
{
party_update_event_info* info = AllocEventInfo<party_update_event_info>();
info->pid = m_dwLeaderPID;
m_eventUpdate = event_create(party_update_event, info, PASSES_PER_SEC(3));
}
if (it->second.bRole == PARTY_ROLE_LEADER)
m_pkChrLeader = pkChr;
sys_log(2, "PARTY[%d] %s linked to party", GetLeaderPID(), pkChr->GetName());
it->second.pCharacter = pkChr;
pkChr->SetParty(this);
if (pkChr->IsPC())
{
if (it->second.strName.empty())
{
it->second.strName = pkChr->GetName();
}
SendPartyJoinOneToAll(pkChr->GetPlayerID());
SendPartyJoinAllToOne(pkChr);
SendPartyLinkOneToAll(pkChr);
SendPartyLinkAllToOne(pkChr);
SendPartyInfoAllToOne(pkChr);
SendPartyInfoOneToAll(pkChr);
SendParameter(pkChr);
//sys_log(0, "PARTY-DUNGEON connect %p %p", this, GetDungeon());
if (GetDungeon() && GetDungeon()->GetMapIndex() == pkChr->GetMapIndex())
{
pkChr->SetDungeon(GetDungeon());
}
RequestSetMemberLevel(pkChr->GetPlayerID(), pkChr->GetLevel());
}
}
示例2: GetLeaderPID
void CParty::P2PQuit(DWORD dwPID)
{
TMemberMap::iterator it = m_memberMap.find(dwPID);
if (it == m_memberMap.end())
return;
if (m_bPCParty)
SendPartyRemoveOneToAll(dwPID);
if (it == m_itNextOwner)
IncreaseOwnership();
if (m_bPCParty)
RemoveBonusForOne(dwPID);
LPCHARACTER ch = it->second.pCharacter;
BYTE bRole = it->second.bRole;
m_memberMap.erase(it);
sys_log(2, "PARTY[%d] MemberCountChange %d -> %d", GetLeaderPID(), GetMemberCount(), GetMemberCount() - 1);
if (bRole < PARTY_ROLE_MAX_NUM)
{
--m_anRoleCount[bRole];
}
else
{
sys_err("ROLE_COUNT_QUIT_ERROR: INDEX(%d) > MAX(%d)", bRole, PARTY_ROLE_MAX_NUM);
}
if (ch)
{
ch->SetParty(NULL);
ComputeRolePoint(ch, bRole, false);
}
if (m_bPCParty)
CPartyManager::instance().SetPartyMember(dwPID, NULL);
// 리더가 나가면 파티는 해산되어야 한다.
if (bRole == PARTY_ROLE_LEADER)
CPartyManager::instance().DeleteParty(this);
// 이 아래는 코드를 추가하지 말 것!!! 위 DeleteParty 하면 this는 없다.
}
示例3: Unlink
void CParty::Unlink(LPCHARACTER pkChr)
{
TMemberMap::iterator it;
if (pkChr->IsPC())
it = m_memberMap.find(pkChr->GetPlayerID());
else
it = m_memberMap.find(pkChr->GetVID());
if (it == m_memberMap.end())
{
sys_err("%s is not member of this party", pkChr->GetName());
return;
}
if (pkChr->IsPC())
{
SendPartyUnlinkOneToAll(pkChr);
//SendPartyUnlinkAllToOne(pkChr); // 끊기는 것이므로 구지 Unlink 패킷을 보낼 필요 없다.
if (it->second.bRole == PARTY_ROLE_LEADER)
{
RemoveBonus();
if (it->second.pCharacter->GetDungeon())
{
// TODO: 던젼에 있으면 나머지도 나간다
FExitDungeon f;
ForEachNearMember(f);
}
}
}
if (it->second.bRole == PARTY_ROLE_LEADER)
m_pkChrLeader = NULL;
it->second.pCharacter = NULL;
pkChr->SetParty(NULL);
}