本文整理汇总了C++中LPCHARACTER::SetObserverMode方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::SetObserverMode方法的具体用法?C++ LPCHARACTER::SetObserverMode怎么用?C++ LPCHARACTER::SetObserverMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::SetObserverMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IncMember
void CWarMap::IncMember(LPCHARACTER ch)
{
if (!ch->IsPC())
return;
sys_log(0, "WarMap::IncMember");
DWORD gid = 0;
if (ch->GetGuild())
gid = ch->GetGuild()->GetID();
bool isWarMember = ch->GetQuestFlag("war.is_war_member") > 0 ? true : false;
if (isWarMember && gid != m_TeamData[0].dwID && gid != m_TeamData[1].dwID)
{
ch->SetQuestFlag("war.is_war_member", 0);
isWarMember = false;
}
if (isWarMember)
{
if (gid == m_TeamData[0].dwID)
{
m_TeamData[0].AppendMember(ch);
}
else if (gid == m_TeamData[1].dwID)
{
m_TeamData[1].AppendMember(ch);
}
event_cancel(&m_pkTimeoutEvent);
sys_log(0, "WarMap +m %u(cur:%d, acc:%d) vs %u(cur:%d, acc:%d)",
m_TeamData[0].dwID, m_TeamData[0].GetCurJointerCount(), m_TeamData[0].GetAccumulatedJoinerCount(),
m_TeamData[1].dwID, m_TeamData[1].GetCurJointerCount(), m_TeamData[1].GetAccumulatedJoinerCount());
}
else
{
++m_iObserverCount;
sys_log(0, "WarMap +o %d", m_iObserverCount);
ch->SetObserverMode(true);
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("관전 모드로 길드전에 참가하셨습니다."));
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("자신을 선택하시면 밖으로 나갈 수 있는 <관람 종료> 버튼이 나옵니다."));
}
UpdateUserCount();
m_set_pkChr.insert(ch);
LPDESC d = ch->GetDesc();
SendWarPacket(d);
SendScorePacket(0, d);
SendScorePacket(1, d);
}
示例2: DecMember
void CWarMap::DecMember(LPCHARACTER ch)
{
if (!ch->IsPC())
return;
sys_log(0, "WarMap::DecMember");
DWORD gid = 0;
if (ch->GetGuild())
gid = ch->GetGuild()->GetID();
if (!ch->IsObserverMode())
{
if (gid == m_TeamData[0].dwID)
m_TeamData[0].RemoveMember(ch);
else if (gid == m_TeamData[1].dwID)
m_TeamData[1].RemoveMember(ch);
if (m_kMapInfo.bType == WAR_MAP_TYPE_FLAG)
{
CAffect * pkAff = ch->FindAffect(AFFECT_WAR_FLAG);
if (pkAff)
{
BYTE idx;
if (GetTeamIndex(pkAff->lApplyValue, idx))
AddFlag(idx, ch->GetX(), ch->GetY());
ch->RemoveAffect(AFFECT_WAR_FLAG);
}
}
sys_log(0, "WarMap -m %u(cur:%d, acc:%d) vs %u(cur:%d, acc:%d)",
m_TeamData[0].dwID, m_TeamData[0].GetCurJointerCount(), m_TeamData[0].GetAccumulatedJoinerCount(),
m_TeamData[1].dwID, m_TeamData[1].GetCurJointerCount(), m_TeamData[1].GetAccumulatedJoinerCount());
CheckWarEnd();
ch->SetQuestFlag("war.is_war_member", 0);
}
else
{
--m_iObserverCount;
sys_log(0, "WarMap -o %d", m_iObserverCount);
ch->SetObserverMode(false);
}
UpdateUserCount();
m_set_pkChr.erase(ch);
}