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


C++ Obj_Character::AskMsg_BaseAttrib方法代码示例

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


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

示例1: Execute

uint CGCharAskBaseAttribHandler::Execute( CGCharAskBaseAttrib* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION

	GamePlayer* pGamePlayer = (GamePlayer*)pPlayer ;
	Assert( pGamePlayer ) ;

	Obj_Human* pHuman = pGamePlayer->GetHuman() ;
	Assert( pHuman ) ;
	
	Scene* pScene = pHuman->getScene() ;
	if( pScene==NULL )
	{
		Assert(FALSE) ;
		return PACKET_EXE_ERROR ;
	}

	//检查线程执行资源是否正确
	Assert( MyGetCurrentThreadID()==pScene->m_ThreadID ) ;

	ObjID_t ObjID = pPacket->getTargetID() ;
	if( ObjID == INVALID_ID )
	{
		return PACKET_EXE_ERROR ;
	}
	
	Obj* pObj = pScene->GetObjManager()->GetObj( ObjID ) ;
	if( pObj==NULL )
	{
		g_pLog->FastSaveLog( LOG_FILE_1, "CGCharAskBaseAttribHandler: not find obj=%d", ObjID ) ;
		return PACKET_EXE_CONTINUE ;
	}

	if( !IsCharacterObj( pObj->GetObjType() ) )
	{
		g_pLog->FastSaveLog( LOG_FILE_1, "CGCharAskBaseAttribHandler: not character obj=%d", ObjID ) ;
		return PACKET_EXE_CONTINUE ;
	}

	Obj_Character* pCharacter = (Obj_Character*)pObj ;
	pCharacter->AskMsg_BaseAttrib( pHuman );

	//影响效率关掉Log
	//g_pLog->FastSaveLog( LOG_FILE_1, "CGCharAskBaseAttribHandler: obj=%d", ObjID ) ;

	return PACKET_EXE_CONTINUE ;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR ;
}
开发者ID:,项目名称:,代码行数:51,代码来源:

示例2: Execute

UINT CGCharAskBaseAttribHandler::Execute( CGCharAskBaseAttrib* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION

    GamePlayer* pGamePlayer = (GamePlayer*)pPlayer ;
    Assert( pGamePlayer ) ;

    Obj_Human* pHuman = pGamePlayer->GetHuman() ;
    Assert( pHuman ) ;
    
    Scene* pScene = pHuman->getScene() ;
    if( pScene==NULL )
    {
        Assert(FALSE) ;
        return PACKET_EXE_ERROR ;
    }

    //检查线程执行资源是否正确
    Assert( MyGetCurrentThreadID()==pScene->m_ThreadID ) ;

    ObjID_t ObjID = pPacket->getTargetID() ;
    if( ObjID == INVALID_ID )
    {
        Assert(FALSE) ;
        return PACKET_EXE_ERROR ;
    }
    
    Obj* pObj = pScene->GetObjManager()->GetObj( ObjID ) ;
    if( pObj==NULL )
    {
        g_pLog->FastSaveLog( LOG_FILE_1, "CGCharAskBaseAttribHandler: not find obj=%d", ObjID ) ;
        return PACKET_EXE_CONTINUE ;
    }

    if( !IsCharacterObj( pObj->GetObjType() ) )
    {
        g_pLog->FastSaveLog( LOG_FILE_1, "CGCharAskBaseAttribHandler: not character obj=%d", ObjID ) ;
        return PACKET_EXE_CONTINUE ;
    }

    Obj_Character* pCharacter = (Obj_Character*)pObj ;
    pCharacter->AskMsg_BaseAttrib( pHuman );

    //GCCharBaseAttrib Msg ;
    //BOOL bResult = pCharacter->FillAttribMsg( &Msg, TRUE );
    //if ( bResult )
    //{
    //    pGamePlayer->SendPacket( &Msg ) ;

    //    g_pLog->FastSaveLog( LOG_FILE_1, "CGCharAskBaseAttribHandler: ok obj=%d scene=%d", 
    //        ObjID, pScene->SceneID() ) ;
    //}
    //else
    //{
    //    g_pLog->FastSaveLog( LOG_FILE_1, "Error: CGCharAskBaseAttribHandler: obj=%d scene=%d", 
    //        ObjID, pScene->SceneID() ) ;
    //}
    g_pLog->FastSaveLog( LOG_FILE_1, "CGCharAskBaseAttribHandler: obj=%d", ObjID ) ;

    return PACKET_EXE_CONTINUE ;

__LEAVE_FUNCTION

    return PACKET_EXE_ERROR ;
}
开发者ID:gangzi4494,项目名称:web-pap,代码行数:65,代码来源:CGCharAskBaseAttribHandler.cpp


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