本文整理汇总了C++中MMatchObject::DisconnectHacker方法的典型用法代码示例。如果您正苦于以下问题:C++ MMatchObject::DisconnectHacker方法的具体用法?C++ MMatchObject::DisconnectHacker怎么用?C++ MMatchObject::DisconnectHacker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MMatchObject
的用法示例。
在下文中一共展示了MMatchObject::DisconnectHacker方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnAdminRequestKickPlayer
void MMatchServer::OnAdminRequestKickPlayer(const MUID& uidAdmin, const char* szPlayer)
{
MMatchObject* pObj = GetObject(uidAdmin);
if (pObj == NULL) return;
if (!IsAdminGrade(pObj)) return;
if ((strlen(szPlayer)) < 2) return;
int nRet = MOK;
MMatchObject* pTargetObj = GetPlayerByName(szPlayer);
if (pTargetObj != NULL)
{
#ifdef LOCALE_KOREA
pTargetObj->DisconnectHacker( MMHT_COMMAND_BLOCK_BY_ADMIN );
#else
// Notify Message 필요 -> 관리자 전용 - 해결(특별한 메세지 필요 없음)
Disconnect(pTargetObj->GetUID());
#endif
} else {
nRet = MERR_ADMIN_NO_TARGET;
}
MCommand* pNew = CreateCommand(MC_ADMIN_RESPONSE_KICK_PLAYER, MUID(0,0));
pNew->AddParameter(new MCmdParamInt(nRet));
RouteToListener(pObj, pNew);
}
示例2: AddObjectOnMatchLogin
//.........这里部分代码省略.........
return false;
}
pObj->AddCommListener(uidComm);
pObj->SetObjectType(MOT_PC);
memcpy(pObj->GetAccountInfo(), pSrcAccountInfo, sizeof(MMatchAccountInfo));
memcpy(pObj->GetAccountPenaltyInfo(), pSrcAccountPenaltyInfo, sizeof(MMatchAccountPenaltyInfo));
pObj->SetFreeLoginIP(bFreeLoginIP);
pObj->SetCountryCode3( strCountryCode3 );
pObj->UpdateTickLastPacketRecved();
pObj->UpdateLastHShieldMsgRecved();
if (pCommObj != NULL)
{
pObj->SetPeerAddr(pCommObj->GetIP(), pCommObj->GetIPString(), pCommObj->GetPort());
}
SetClientClockSynchronize(uidComm);
// 프리미엄 IP를 체크한다.
if (MGetServerConfig()->CheckPremiumIP())
{
if (pCommObj)
{
bool bIsPremiumIP = false;
bool bExistPremiumIPCache = false;
bExistPremiumIPCache = MPremiumIPCache()->CheckPremiumIP(pCommObj->GetIP(), bIsPremiumIP);
// 만약 캐쉬에 없으면 직접 DB에서 찾도록 한다.
if (!bExistPremiumIPCache)
{
if (m_MatchDBMgr.CheckPremiumIP(pCommObj->GetIPString(), bIsPremiumIP))
{
// 결과를 캐쉬에 저장
MPremiumIPCache()->AddIP(pCommObj->GetIP(), bIsPremiumIP);
}
else
{
MPremiumIPCache()->OnDBFailed();
}
}
//if (bIsPremiumIP) pObj->GetAccountInfo()->m_nPGrade = MMPG_PREMIUM_IP;
}
}
if (!PreCheckAddObj(uidComm))
{
// 보안 관련 초기화 서버 설정에 문제가 생겼다고 로그인 실패를 리턴한다. //
MCommand* pCmd = CreateCmdMatchResponseLoginFailed(uidComm, MERR_FAILED_AUTHENTICATION);
Post(pCmd);
return false;
}
MCommand* pCmd = CreateCmdMatchResponseLoginOK(uidComm,
AllocUID,
pObj->GetAccountInfo()->m_szUserID,
pObj->GetAccountInfo()->m_nUGrade,
pObj->GetAccountInfo()->m_nPGrade,
pObj->GetAccountInfo()->m_nECoins,
// pObj->GetAntiHackInfo()->m_szRandomValue,
pObj->GetHShieldInfo()->m_pbyGuidReqMsg);
Post(pCmd);
// 접속 로그를 남긴다.
//m_MatchDBMgr.InsertConnLog(pObj->GetAccountInfo()->m_nAID, pObj->GetIPString(), pObj->GetCountryCode3() );
// 접속 로그
MAsyncDBJob_InsertConnLog* pNewJob = new MAsyncDBJob_InsertConnLog(uidComm);
pNewJob->Input(pObj->GetAccountInfo()->m_nAID, pObj->GetIPString(), pObj->GetCountryCode3() );
PostAsyncJob(pNewJob);
// Client DataFile Checksum을 검사한다.
// 2006.2.20 dubble. filelist checksum으로 변경
unsigned long nChecksum = nChecksumPack ^ uidComm.High ^ uidComm.Low;
if( MGetServerConfig()->IsUseFileCrc() && !MMatchAntiHack::CheckClientFileListCRC(nChecksum, pObj->GetUID()) &&
!MGetServerConfig()->IsDebugLoginIPList(pObj->GetIPString()) )
{
LOG(LOG_PROG, "Invalid filelist crc (%u) , UserID(%s)\n ", nChecksum, pObj->GetAccountInfo()->m_szUserID);
// pObj->SetBadFileCRCDisconnectWaitInfo();
pObj->DisconnectHacker( MMHT_BADFILECRC);
}
/*
if (nChecksum != GetItemFileChecksum()) {
LOG(LOG_PROG, "Invalid ZItemChecksum(%u) , UserID(%s) ", nChecksum, pObj->GetAccountInfo()->m_szUserID);
Disconnect(uidComm);
return false;
}
*/
pObj->LoginCompleted();
return true;
}