当前位置: 首页>>代码示例>>C++>>正文


C++ CDPCacheSrvr::DestroyPlayer方法代码示例

本文整理汇总了C++中CDPCacheSrvr::DestroyPlayer方法的典型用法代码示例。如果您正苦于以下问题:C++ CDPCacheSrvr::DestroyPlayer方法的具体用法?C++ CDPCacheSrvr::DestroyPlayer怎么用?C++ CDPCacheSrvr::DestroyPlayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDPCacheSrvr的用法示例。


在下文中一共展示了CDPCacheSrvr::DestroyPlayer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnQueryDestroyPlayer

void CDPClient::OnQueryDestroyPlayer( CAr & ar, DPID dpid, LPVOID lpBuffer, u_long uBufSize )
{
	DWORD dwSerial;
	ar >> dwSerial;
	u_long idPlayer;
	ar >> idPlayer;

	CMclAutoLock	Lock( CPlayerMng::Instance()->m_AddRemoveLock );

	CPlayer* pPlayer	= CPlayerMng::Instance()->GetPlayerBySerial( dwSerial );
	if( pPlayer )
	{
		// 성공적으로 찾았으니까 접속을 끊는다. 
		g_DPCacheSrvr.DestroyPlayer( pPlayer->GetNetworkId() );	// 소켓연결이 끊기고, PACKETTYPE_LEAVE가 월드서버로 간다.
#ifdef __MA_VER11_07	// cache 서버에서 loginserver로 유저접속끊낌을 알려주는 부분
		g_DPCoreClient.SendDestroyPlayer( pPlayer );// coresvr를 통해 loginsvr 에도 끊낌을 알려준다
#endif // __MA_VER11_07	// cache 서버에서 loginserver로 유저접속끊낌을 알려주는 부분
		return;	
	}

	WriteError( "OnQueryDestroyPlayer - idPlayer:%d GetPlayer return NULL.", idPlayer );

	// 찾지 못해도, 끊었다고 알려준다.
	BEFORESENDSOLE( out, PACKETTYPE_LEAVE, DPID_UNKNOWN );
	out << idPlayer;
	LPBYTE lpBuf = out.GetBuffer( &nBufSize );
	g_DPClientArray.SendToServer( dpid, lpBuf, nBufSize );
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:28,代码来源:DPClient.cpp

示例2: OnJoin

void CDPCoreClient::OnJoin( CAr & ar, DPID dpid )
{
	CMclAutoLock	Lock( CPlayerMng::Instance()->m_AddRemoveLock );

	DWORD dwSerial;
	BYTE byData;
	ar >> dwSerial;
	ar >> byData;	// 사용하지 않는다.

	CPlayer* pPlayer	= CPlayerMng::Instance()->GetPlayerBySerial( dwSerial );
	if( pPlayer == NULL )
	{
		WriteLog( "CDPCoreClient::OnJoin - player not found" );
		return;
	}

	CDPClient* pClient = g_DPClientArray.GetClient( pPlayer->GetChannel(), pPlayer->GetWorld(), D3DXVECTOR3(0.0f, 0.0f, 0.0f) );
	if( pClient )
	{
		pPlayer->SetClient( pClient );
		pClient->SendJoin( pPlayer );
	}
	else
	{
		WriteLog( "CDPCoreClient.OnJoin: server not found id: %d account: %s player: %s world: %d",
			      pPlayer->GetPlayerId(), pPlayer->GetAccount(), pPlayer->GetPlayer(), pPlayer->GetWorld() );
		g_DPCacheSrvr.DestroyPlayer( dpid );
	}
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:29,代码来源:DPCoreClient.cpp

示例3: OnLeave

void CDPCoreClient::OnLeave( CAr & ar, DPID dpid )
{
	CMclAutoLock	Lock( CPlayerMng::Instance()->m_AddRemoveLock );

	DWORD dwSerial;
	ar >> dwSerial;
	CPlayer* pPlayer = CPlayerMng::Instance()->GetPlayerBySerial( dwSerial );  // dpid가 serial번호이다.
	if( pPlayer )
		g_DPCacheSrvr.DestroyPlayer( dpid );
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:10,代码来源:DPCoreClient.cpp

示例4: OnKillPlayer

void CDPCoreClient::OnKillPlayer( CAr & ar, DPID dpid )
{
	g_DPCacheSrvr.DestroyPlayer( dpid );
}
开发者ID:KerwinMa,项目名称:AerothFlyffSource,代码行数:4,代码来源:DPCoreClient.cpp


注:本文中的CDPCacheSrvr::DestroyPlayer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。