本文整理汇总了C++中LPDESC::IsPhase方法的典型用法代码示例。如果您正苦于以下问题:C++ LPDESC::IsPhase方法的具体用法?C++ LPDESC::IsPhase怎么用?C++ LPDESC::IsPhase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPDESC
的用法示例。
在下文中一共展示了LPDESC::IsPhase方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Packet
void CPVP::Packet(bool bDelete)
{
if (!m_players[0].dwVID || !m_players[1].dwVID)
{
if (bDelete)
sys_err("null vid when removing %u %u", m_players[0].dwVID, m_players[0].dwVID);
return;
}
TPacketGCPVP pack;
pack.bHeader = HEADER_GC_PVP;
if (bDelete)
{
pack.bMode = PVP_MODE_NONE;
pack.dwVIDSrc = m_players[0].dwVID;
pack.dwVIDDst = m_players[1].dwVID;
}
else if (IsFight())
{
pack.bMode = PVP_MODE_FIGHT;
pack.dwVIDSrc = m_players[0].dwVID;
pack.dwVIDDst = m_players[1].dwVID;
}
else
{
pack.bMode = m_bRevenge ? PVP_MODE_REVENGE : PVP_MODE_AGREE;
if (m_players[0].bAgree)
{
pack.dwVIDSrc = m_players[0].dwVID;
pack.dwVIDDst = m_players[1].dwVID;
}
else
{
pack.dwVIDSrc = m_players[1].dwVID;
pack.dwVIDDst = m_players[0].dwVID;
}
}
const DESC_MANAGER::DESC_SET & c_rSet = DESC_MANAGER::instance().GetClientSet();
DESC_MANAGER::DESC_SET::const_iterator it = c_rSet.begin();
while (it != c_rSet.end())
{
LPDESC d = *it++;
if (d->IsPhase(PHASE_GAME) || d->IsPhase(PHASE_DEAD))
d->Packet(&pack, sizeof(pack));
}
}
示例2: DestroyClosed
void DESC_MANAGER::DestroyClosed()
{
DESC_SET::iterator i = m_set_pkDesc.begin();
while (i != m_set_pkDesc.end())
{
LPDESC d = *i;
DESC_SET::iterator ci = i;
++i;
if (d->IsPhase(PHASE_CLOSE))
{
if (d->GetType() == DESC_TYPE_CONNECTOR)
{
LPCLIENT_DESC client_desc = (LPCLIENT_DESC)d;
if (client_desc->IsRetryWhenClosed())
{
client_desc->Reset();
continue;
}
}
DestroyDesc(d, false);
m_set_pkDesc.erase(ci);
}
}
}
示例3: Handshake
void CInputProcessor::Handshake(LPDESC d, const char * c_pData)
{
TPacketCGHandshake * p = (TPacketCGHandshake *) c_pData;
if (d->GetHandshake() != p->dwHandshake)
{
sys_err("Invalid Handshake on %d", d->GetSocket());
d->SetPhase(PHASE_CLOSE);
}
else
{
if (d->IsPhase(PHASE_HANDSHAKE))
{
if (d->HandshakeProcess(p->dwTime, p->lDelta, false))
{
#ifdef _IMPROVED_PACKET_ENCRYPTION_
d->SendKeyAgreement();
#else
if (g_bAuthServer)
d->SetPhase(PHASE_AUTH);
else
d->SetPhase(PHASE_LOGIN);
#endif // #ifdef _IMPROVED_PACKET_ENCRYPTION_
}
}
else
d->HandshakeProcess(p->dwTime, p->lDelta, true);
}
}
示例4: Destroy
void DESC_MANAGER::Destroy()
{
if (m_bDestroyed) {
return;
}
m_bDestroyed = true;
DESC_SET::iterator i = m_set_pkDesc.begin();
while (i != m_set_pkDesc.end())
{
LPDESC d = *i;
DESC_SET::iterator ci = i;
++i;
if (d->GetType() == DESC_TYPE_CONNECTOR)
continue;
if (d->IsPhase(PHASE_P2P))
continue;
DestroyDesc(d, false);
m_set_pkDesc.erase(ci);
}
i = m_set_pkDesc.begin();
while (i != m_set_pkDesc.end())
{
LPDESC d = *i;
DESC_SET::iterator ci = i;
++i;
DestroyDesc(d, false);
m_set_pkDesc.erase(ci);
}
m_set_pkClientDesc.clear();
//m_AccountIDMap.clear();
m_map_loginName.clear();
m_map_handle.clear();
Initialize();
}