• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MyGetCurrentThreadID函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MyGetCurrentThreadID函数的典型用法代码示例。如果您正苦于以下问题:C++ MyGetCurrentThreadID函数的具体用法?C++ MyGetCurrentThreadID怎么用?C++ MyGetCurrentThreadID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: Assert

uint WGNotifyMailHandler::Execute( WGNotifyMail* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION

	PlayerID_t PlayerID = pPacket->GetPlayerID() ;
	GamePlayer* pGamePlayer = g_pPlayerPool->GetPlayer(PlayerID) ;
	if( pGamePlayer==NULL )
	{
		Assert(FALSE) ;
		return PACKET_EXE_CONTINUE ;
	}

	Obj_Human* pHuman = pGamePlayer->GetHuman() ;
	Assert( pHuman ) ;

	Scene* pScene = pHuman->getScene() ;
	if( pScene==NULL ) return PACKET_EXE_CONTINUE ;

	if( pPlayer->IsServerPlayer() )
	{//服务器收到世界服务器发来的数据
		Assert( MyGetCurrentThreadID()==g_pServerManager->m_ThreadID ) ;

		pScene->SendPacket( pPacket, PlayerID ) ;

		g_pLog->FastSaveLog( LOG_FILE_1, "WGNotifyMailHandler: ServerPlayer MailCount=%d",
			pPacket->GetMailCount() ) ;

		return PACKET_EXE_NOTREMOVE ;
	}
	else if( pPlayer->IsGamePlayer() )
	{//场景收到Cache里的消息
		Assert( MyGetCurrentThreadID()==pScene->m_ThreadID ) ;

		GCNotifyMail Msg ;

		Msg.SetMailCount( pPacket->GetMailCount() ) ;

		pGamePlayer->SendPacket( &Msg ) ;

		g_pLog->FastSaveLog( LOG_FILE_1, "WGNotifyMailHandler: GamePlayer MailCount=%d",
			pPacket->GetMailCount() ) ;
	}
	else
	{
		Assert(FALSE) ;
	}

	return PACKET_EXE_CONTINUE ;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR ;
}
开发者ID:uvbs,项目名称:wx2Server,代码行数:53,代码来源:WGNotifyMailHandler.cpp


示例2: Assert

UINT CGCharMoodStateHandler::Execute( CGCharMoodState* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION
	GamePlayer* pGamePlayer = (GamePlayer*)pPlayer ;
	Assert( pGamePlayer != NULL ) ;
	if ( pGamePlayer == NULL )
	{
		g_pLog->FastSaveLog( LOG_FILE_1, "CGCharMoodStateHandler: Error (pGamePlayer == NULL) " ) ;
		return PACKET_EXE_CONTINUE ;
	}

	Obj_Human* pHuman = pGamePlayer->GetHuman() ;
	Assert( pHuman != NULL ) ;
	if ( pHuman == NULL )
	{
		g_pLog->FastSaveLog( LOG_FILE_1, "CGCharMoodStateHandler: Error (pHuman == NULL) " ) ;
		return PACKET_EXE_CONTINUE ;
	}

	Scene* pScene = pHuman->getScene() ;
	Assert( pScene != NULL ) ;
	if ( pScene == NULL )
	{
		g_pLog->FastSaveLog( LOG_FILE_1, "CGCharMoodStateHandler: Error Obj = %d (pScene == NULL) ", pHuman->GetID() ) ;
		return PACKET_EXE_CONTINUE ;
	}

	//检查线程执行资源是否正确
	Assert( MyGetCurrentThreadID()==pScene->m_ThreadID ) ;
	if ( MyGetCurrentThreadID() != pScene->m_ThreadID )
	{
		g_pLog->FastSaveLog( LOG_FILE_1, "CGCharMoodStateHandler: Error Obj = %d (MyGetCurrentThreadID() != pScene->m_ThreadID) ", pHuman->GetID() ) ;
		return PACKET_EXE_CONTINUE ;
	}

	ORESULT oResult = pHuman->GetHumanAI()->PushCommand_MoodState(pPacket->getMoodState());
	if ( OR_FAILED( oResult ) )
	{
		pHuman->SendOperateResultMsg(oResult);
	}

	g_pLog->FastSaveLog( LOG_FILE_1, "CGCharMoodStateHandler: ok obj=%d guid=%X scene=%d", 
		pHuman->GetID(), pHuman->GetGUID(), pScene->SceneID() ) ;

	return PACKET_EXE_CONTINUE ;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR ;
}
开发者ID:brock7,项目名称:TianLong,代码行数:50,代码来源:CGCharMoodStateHandler.cpp


示例3: Assert

uint CGCharStopLogicHandler::Execute( CGCharStopLogic* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION
	GamePlayer* pGamePlayer = (GamePlayer*)pPlayer ;
	Assert( pGamePlayer != NULL ) ;
	if ( pGamePlayer == NULL )
	{
		g_pLog->FastSaveLog( LOG_FILE_1, "CGCharStopLogicHandler: Error (pGamePlayer == NULL) " ) ;
		return PACKET_EXE_CONTINUE ;
	}

	Obj_Human* pHuman = pGamePlayer->GetHuman() ;
	Assert( pHuman != NULL ) ;
	if ( pHuman == NULL )
	{
		g_pLog->FastSaveLog( LOG_FILE_1, "CGCharStopLogicHandler: Error (pHuman == NULL) " ) ;
		return PACKET_EXE_CONTINUE ;
	}

	Scene* pScene = pHuman->getScene() ;
	Assert( pScene != NULL ) ;
	if ( pScene == NULL )
	{
		g_pLog->FastSaveLog( LOG_FILE_1, "CGCharStopLogicHandler: Error Obj = %d (pScene == NULL) ", pHuman->GetID() ) ;
		return PACKET_EXE_CONTINUE ;
	}

	//检查线程执行资源是否正确
	Assert( MyGetCurrentThreadID()==pScene->m_ThreadID ) ;
	if ( MyGetCurrentThreadID() != pScene->m_ThreadID )
	{
		g_pLog->FastSaveLog( LOG_FILE_1, "CGCharStopLogicHandler: Error Obj = %d (MyGetCurrentThreadID() != pScene->m_ThreadID) ", pHuman->GetID() ) ;
		return PACKET_EXE_CONTINUE ;
	}

	//中断当前技能逻辑
	AI_Human* pAI = pHuman->GetHumanAI();
	if(NULL!=pAI)
	{
		pAI->ForceInterruptSkill();
	}
	g_pLog->FastSaveLog( LOG_FILE_1, "CGCharStopLogicHandler: S:%d.", pPacket->getObjID()) ;

	return PACKET_EXE_CONTINUE ;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR ;
}
开发者ID:uvbs,项目名称:wx2Server,代码行数:49,代码来源:CGCharStopLogicHandler.cpp


示例4: Assert

uint	CGTopListHandler::Execute(CGTopList* 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 );
	
	GWTopList* pMsg = (GWTopList*)g_pPacketFactoryManager->CreatePacket(PACKET_GW_TOP_LIST);
	pMsg->SetGUID(pHuman->GetGUID());
	pMsg->SetType(pPacket->GetType());
	g_pServerManager->SendPacket( pMsg, INVALID_ID );

	g_pLog->FastSaveLog( LOG_FILE_1, "CGTopListHandler: GUID=%X", pHuman->GetGUID() );

	return PACKET_EXE_CONTINUE;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR;
}
开发者ID:uvbs,项目名称:wx2Server,代码行数:33,代码来源:CGTopListHandler.cpp


示例5: Assert

uint CGLeaveSceneHandler::Execute( CGLeaveScene* 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 ) return PACKET_EXE_CONTINUE ;

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





	g_pLog->FastSaveLog( LOG_FILE_1, "CGLeaveSceneHandler: " ) ;

	return PACKET_EXE_ERROR ;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR ;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:28,代码来源:CGLeaveSceneHandler.cpp


示例6: MyGetCurrentThreadID

UINT SSScenePlayerCountHandler::Execute(SSScenePlayerCount* pPacket, Player* pPlayer )
{
    __ENTER_FUNCTION    
    
        TID CurrentThreadID = MyGetCurrentThreadID();

        if(CurrentThreadID == g_pServerManager->m_ThreadID)
        {
            //修改g_WorldPlayerCounter 中数据
            Assert(pPacket);
            g_WorldPlayerCounter.m_WorldPlayerCount = pPacket->GetTotalPlayerCount();
            //修改场景负载数据
            //todo..
        }
        else
        {
            AssertEx(FALSE,"SSScenePlayerCountHandler 线程资源执行错误!");
        }
        
        Log::SaveLog(LOGIN_LOGFILE,"SSScenePlayerCountHandler::Execute()....OK,WorldPlayerCount = %d",
            g_WorldPlayerCounter.m_WorldPlayerCount);
        return PACKET_EXE_CONTINUE;

    __LEAVE_FUNCTION    

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


示例7: Assert

UINT    WGWorldTimeHandler::Execute(WGWorldTime* pPacket,Player* pPlayer)
{
    __ENTER_FUNCTION

        Assert( MyGetCurrentThreadID()==g_pServerManager->m_ThreadID );
        Assert(pPacket);

        g_WorldTime = pPacket->GetWorldTime();

        for( INT i=0; i<MAX_SCENE; i++ )
        {
            Scene* pScene = g_pSceneManager->GetScene( (SceneID_t)i ) ;
            if( pScene==NULL )
                continue ;

            if( pScene->GetPlayerManager()->GetCount()<=0 )
                continue ;
            
            GCWorldTime* pMsg = (GCWorldTime*)(g_pPacketFactoryManager->CreatePacket(PACKET_GC_WORLDTIME)) ;

            pMsg->SetWorldTime(g_WorldTime);
            pMsg->SetSceneID(pScene->SceneID());

            pScene->SendPacket(pMsg,INVALID_ID);

        }
        
        g_pLog->FastSaveLog( LOG_FILE_1,"WGWorldTimeHandler::Execute()....OK!");

        return PACKET_EXE_CONTINUE ;

    __LEAVE_FUNCTION

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


示例8: ServerSocket

BOOL ServerManager::Init( )
{
__ENTER_FUNCTION

    m_pServerSocket = new ServerSocket( g_Config.m_BillingInfo.m_Port ) ;
    Assert( m_pServerSocket ) ;

    m_pServerSocket->setNonBlocking() ;

    m_SocketID = m_pServerSocket->getSOCKET() ;
    Assert( m_SocketID != INVALID_SOCKET ) ;

    FD_SET(m_SocketID , &m_ReadFDs[SELECT_BAK]);
    FD_SET(m_SocketID , &m_ExceptFDs[SELECT_BAK]);

    m_MinFD = m_MaxFD = m_SocketID;

    m_Timeout[SELECT_BAK].tv_sec = 0;
    m_Timeout[SELECT_BAK].tv_usec = 0;

    m_ThreadID = MyGetCurrentThreadID( ) ;

    for( int i=0; i<OVER_MAX_SERVER; i++ )
    {
        m_aServerHash[i] = INVALID_ID ;
    }


__LEAVE_FUNCTION

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


示例9: Assert

UINT CGExchangeSynchMoneyIIHandler::Execute( CGExchangeSynchMoneyII* 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 ) ;

    //验证
    EXCHANGE_CERTIFY_EACH_OTHER(pHuman)
    EXCHANGE_CERTIFY_ISLOCK(pHuman)

    ObjID_t    DestID = pHuman->m_ExchangBox.m_ObjID;
    Obj_Human* pDestHuman = pScene->GetHumanManager()->GetHuman( DestID );

    EXCHANGE_CERTIFY_STATUS(pHuman, EXCHANGE_SYNCH_DATA)
    EXCHANGE_CERTIFY_STATUS(pDestHuman, EXCHANGE_SYNCH_DATA)
    

    //操作
    UINT    Money     = pPacket->GetMoney();        

    if( Money<= pHuman->GetMoney() )
    {
        pHuman->m_ExchangBox.m_Money = Money;
        g_pLog->FastSaveLog( LOG_FILE_1, "<交易> [%s] 设置交易金钱 [%d]",    pHuman->GetName(), Money ) ;

        //金钱改变不发给自己了,省条消息
        GCExchangeSynchII MsgToTarget;
        MsgToTarget.SetIsMyself(FALSE);
        MsgToTarget.SetOpt(EXCHANGE_MSG::OPT_MONEY);
        MsgToTarget.SetMoney(Money);
        pDestHuman->GetPlayer()->SendPacket(&MsgToTarget);
        return PACKET_EXE_CONTINUE;
    }
    else
    {
        GCExchangeError Msg;
        Msg.SetID(EXCHANGE_MSG::ERR_ILLEGAL);
        pHuman->GetPlayer()->SendPacket(&Msg);
        pHuman->m_ExchangBox.CleanUp();
        return PACKET_EXE_CONTINUE;
    }
    
    __LEAVE_FUNCTION

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


示例10: MyGetCurrentThreadID

UINT    LBAskAuthHandler::Execute(LBAskAuth* pPacket, Player* pPlayer )
{
    __ENTER_FUNCTION
        
        TID CurrentThreadID = MyGetCurrentThreadID();
        
        if(CurrentThreadID == g_pServerManager->m_ThreadID)
        {
            Assert(pPacket);

            ServerPlayer* pServerPlayer  = (ServerPlayer*)pPlayer;

            Assert(pServerPlayer);

            pServerPlayer->SendPacket(pPacket);
        }
        else
        {
            AssertEx(FALSE,"LBAskAuthHandler 线程资源执行错误!");
        }
        
        Log::SaveLog(LOGIN_LOGFILE,"LBAskAuthHandler::Execute() ....OK");

        return PACKET_EXE_CONTINUE;

    __LEAVE_FUNCTION

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


示例11: Assert

uint WGCountryVoteConfirmHandler::Execute( WGCountryVoteConfirm* pPacket, Player* pPlayer )
{
    __ENTER_FUNCTION

    PlayerID_t PlayerID = pPacket->GetPlayerID();
    GamePlayer* pGamePlayer = g_pPlayerPool->GetPlayer(PlayerID);
    if( pGamePlayer==NULL )
    {
        Assert(FALSE);
        return PACKET_EXE_CONTINUE;
    }

    Obj_Human* pHuman = pGamePlayer->GetHuman();
    Assert( pHuman );

    Scene* pScene = pHuman->getScene();
    if( pScene==NULL ) return PACKET_EXE_CONTINUE ;

    if( pPlayer->IsServerPlayer() )
    {   //服务器收到世界服务器发来的数据
        Assert( MyGetCurrentThreadID()==g_pServerManager->m_ThreadID );
        pScene->SendPacket( pPacket, PlayerID );
        return PACKET_EXE_NOTREMOVE;
    }
    else if( pPlayer->IsGamePlayer() )
    {   //场景收到Cache里的消息
        Assert( MyGetCurrentThreadID()==pScene->m_ThreadID );

        GCCountryVoteShow Msg;
        Msg.SetCurVotes(pPacket->GetCurNum());
        Msg.SetLeftTime(pPacket->GetTime());
        Msg.SetPercentVote( ((float)pPacket->GetPercent())/(100.0f));
        pGamePlayer->SendPacket( &Msg );

        g_pLog->FastSaveLog( LOG_FILE_1, "WGCountryVoteConfirmHandler: VoteOn Begin (Guid=%X)!", pHuman->GetGUID());
    }
    else
    {
        Assert(FALSE);
    }

    return PACKET_EXE_CONTINUE;

    __LEAVE_FUNCTION

    return PACKET_EXE_ERROR;
}
开发者ID:uvbs,项目名称:wx2Server,代码行数:47,代码来源:WGCountryVoteConfirmHandler.cpp


示例12: Assert

UINT CGAskDetailAbilityInfoHandler::Execute( CGAskDetailAbilityInfo* 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 = pHuman->GetID();
    if( ObjID == INVALID_ID )
    {
        Assert(FALSE);
        return PACKET_EXE_ERROR;
    }

    Obj_Human *pTarget = (Obj_Human*)(pScene->GetObjManager()->GetObj(pPacket->getTargetID()));
    if( pTarget==NULL )
    {
        Assert( pTarget );
        return PACKET_EXE_ERROR;
    }

    // 权限判断
    // to be continue...
    if ( pTarget->GetObjType() != Obj::OBJ_TYPE_HUMAN )
    {
        return PACKET_EXE_ERROR;
    }

    GCDetailAbilityInfo Msg;

    Msg.setObjID( pTarget->GetID() );

    const _ABILITY_LIST *pAbilityList = pTarget->GetAbilityList();
    Msg.setAbilityList( g_pAbilityManager->MaxAbilityNum(), pAbilityList->m_aABility, pAbilityList->m_aPrescr );

    pGamePlayer->SendPacket( &Msg );

    g_pLog->FastSaveLog( LOG_FILE_1, "CGAskDetailAbilityInfoHandler: ok obj=%d scene=%d", 
        ObjID, pScene->SceneID() );

    return PACKET_EXE_CONTINUE;

__LEAVE_FUNCTION

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


示例13: Assert

uint CGAskJoinMenpaiHandler::Execute( CGAskJoinMenpai* 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 ) ;

	
	
	//设置门派
	//pHuman->GetDB()->SetMenPai(pPacket->GetMenpaiID());

	//设置心法
	

	//设置技能
	

	//通知客户端加入的结果,由客户端自己去用模板内的数据改变自己的值
	//GCJoinMenpai Msg;
	//Msg.SetIsSucceedJoin(JOINMENPAI_SUCCEED);

	//pPlayer = pHuman->GetPlayer();
	//pPlayer->SendPacket( &Msg ) ;

	//INT nTemp = pPacket->GetMenpaiID();
	//INT nNum = g_XinFaDataMgr.m_nSize;

	//_XINFA_LIST   listMenpaiXinfa;

	//for(INT i=0,k=0; i<nNum; i++)
	//{
	//	if( g_XinFaDataMgr.m_vTemplateList[i].MenPai == nTemp)
	//		listMenpaiXinfa.m_aXinFa
	//}

	return PACKET_EXE_CONTINUE ;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR ;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:55,代码来源:CGAskJoinMenpaiHandler.cpp


示例14: Assert

uint CGLockTargetHandler::Execute( CGLockTarget* pPacket, Player* pPlayer )
{
	__ENTER_FUNCTION

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

	Obj_Human* pHuman = pGamePlayer->GetHuman() ;

	if(NULL==pHuman)
	{
		AssertEx(FALSE,"[CGLockTargetHandler::Execute]: NULL Obj_Human pointer found!!");
		return PACKET_EXE_ERROR ;
	}
	Scene* pScene = pHuman->getScene() ;
	if( pScene==NULL )
	{
		Assert(FALSE) ;
		return PACKET_EXE_ERROR ;
	}

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

	ObjID_t nMeID = pHuman->GetID();
	if( nMeID == INVALID_ID )
	{
		Assert(FALSE) ;
		return PACKET_EXE_ERROR ;
	}
	//update target
	if(NULL==pPacket)
	{
		AssertEx(FALSE,"[CGLockTargetHandler::Execute]: NULL packet pointer found!!");
		return PACKET_EXE_ERROR ;
	}

	pHuman->SetLockedTarget(pPacket->getTargetID());
	// 当锁定的目标是NPC时将会触发NPC的泡泡说话
	Obj* pTarget = pScene->GetObjManager()->GetObj(pPacket->getTargetID());
	if (pTarget->GetObjType() == Obj::OBJ_TYPE_MONSTER)
	{
		((Obj_Monster*)pTarget)->ProcessPaoPao();
	}
	
	g_pLog->FastSaveLog( LOG_FILE_1, "CGLockTargetHandler: ok obj=%d scene=%d", 
		nMeID, pScene->SceneID() ) ;

	return PACKET_EXE_CONTINUE ;

	__LEAVE_FUNCTION

	return PACKET_EXE_ERROR ;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:54,代码来源:CGLockTargetHandler.cpp


示例15: Assert

UINT CGIssuePetPlacardHandler::Execute( CGIssuePetPlacard* 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 ) ;

    Obj_Monster *pNpc = (Obj_Monster*)(pScene->GetObjManager()->GetObj(pPacket->GetNpcID()));
    if(pNpc != NULL)
    {
        PetPlacardSystem *pPetPlacardSystem = pNpc->GetPetPlacardSystem();
        if(pPetPlacardSystem == NULL)
        {
            pNpc->CreatePetPlacardSystem();
            pPetPlacardSystem = pNpc->GetPetPlacardSystem();
        }
        if(pPetPlacardSystem != NULL)
        {
            CHAR* pMessage = pPacket->GetMessage();
            BYTE nMessageSize = (BYTE)strlen( pMessage );
            if( nMessageSize >= PET_PLACARD_ITEM_MESSAGE_SIZE ) nMessageSize = PET_PLACARD_ITEM_MESSAGE_SIZE-1;
            pMessage[PET_PLACARD_ITEM_MESSAGE_SIZE-1] = 0;
            ReplaceIllegalString( pMessage, nMessageSize );

            ORESULT oResult = pPetPlacardSystem->IssuePlacard(pHuman, pPacket->GetGUID(), pMessage);
            if(OR_FAILED(oResult))
            {
                pHuman->SendOperateResultMsg(oResult);
            }
        }
    }

    return PACKET_EXE_CONTINUE ;

__LEAVE_FUNCTION

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


示例16: Assert

UINT CGPlayerShopApplyHandler::Execute( CGPlayerShopApply* 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 ) ;

	pScene->GetPlayerShopManager()->ClampComFactor();
	FLOAT CommercialFactor = pScene->GetPlayerShopManager()->GetComFactor();
	UINT Cost = (UINT)(300000*CommercialFactor*2*1.03);
	Cost = 10;

	GCPlayerShopError MsgError;

	//验证是否有资格摆摊
	//if(pHuman->GetLevel()<30)
	//{
	//	MsgError.SetID(PLAYERSHOP_MSG::ERR_NOT_ENOUGH_LEVEL);
	//	pGamePlayer->SendPacket(&MsgError);
	//	g_pLog->FastSaveLog( LOG_FILE_1, "ERROR: CGPlayerShopApplyHandler::Name=%s Level = %d ", pHuman->GetName(), pHuman->GetLevel()) ;
	//	return PACKET_EXE_CONTINUE ;
	//}

	GCPlayerShopApply Msg;
	Msg.SetComFactor(CommercialFactor);
	Msg.SetCost(Cost);
	Msg.SetType(PLAYERSHOP_MSG::TYPE_ITEM);

	//验证完毕,通知客户端确定
	pGamePlayer->SendPacket(&Msg);


	return PACKET_EXE_CONTINUE ;

	__LEAVE_FUNCTION

		return PACKET_EXE_ERROR ;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:50,代码来源:CGPlayerShopApplyHandler.cpp


示例17: Assert

uint CGSetTeamDistribModeHandler::Execute( CGSetTeamDistribMode* 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 ) ;

    BYTE nMode = pPacket->getMode();
    if (nMode>=ITEM_DISTRIB_NUM)
    {
        return PACKET_EXE_ERROR;
    }
    TeamInfo* pTeamInfo = pHuman->GetTeamInfo();
    if (pTeamInfo == NULL)
    {
        return PACKET_EXE_ERROR;
    }
    if (!pTeamInfo->IsLeader())
    {
        return PACKET_EXE_CONTINUE;
    }

    GWSetTeamDistribMode* pMsg = (GWSetTeamDistribMode*)g_pPacketFactoryManager->CreatePacket(PACKET_GW_SETTEAMDISTRIBMODE);
    pMsg->setMode(nMode);
    pMsg->setLeaderID(pHuman->GetGUID());
    pMsg->setTeamID(pTeamInfo->GetTeamID());

    g_pServerManager->SendPacket( pMsg, INVALID_ID ) ;

    g_pLog->FastSaveLog( LOG_FILE_1, "CGSetTeamDistribModeHandler: nMode=%d success", nMode) ;

    return PACKET_EXE_CONTINUE ;

    __LEAVE_FUNCTION

    return PACKET_EXE_ERROR ;
}
开发者ID:uvbs,项目名称:wx2Server,代码行数:50,代码来源:CGSetTeamDistribModeHandler.cpp


示例18: Assert

UINT CGPlayerShopAcquireShopListHandler::Execute( CGPlayerShopAcquireShopList* 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 ) ;
	SHOP_INFO_t aShopList[MAX_SHOP_NUM_PER_SCENE];
	UINT ListIndex = 0;
	PlayerShopManager*	pPlayerShopManager = pScene->GetPlayerShopManager();
	UINT uShopNum = pPlayerShopManager->GetPlayerShopNum();

	for(UINT i = 0; i<uShopNum; i++)
	{
		PlayerShop*	pPlayerShop	= pPlayerShopManager->GetPlayerShopByIndex(i);
		Assert(pPlayerShop);
		aShopList[ListIndex].m_ID				= pPlayerShop->GetShopGUID();
		memcpy(aShopList[ListIndex].m_ShopName, pPlayerShop->GetShopName(), MAX_SHOP_NAME_SIZE);
		aShopList[ListIndex].m_StallNumOnSale	= pPlayerShop->GetNumStallOnSale();
		aShopList[ListIndex].m_StallNumOpened	= pPlayerShop->GetNumStallOpened();
		aShopList[ListIndex++].m_Type			= (BYTE)pPlayerShop->GetShopType();
	}

	GCPlayerShopAcquireShopList Msg;
	Msg.SetShopNum(ListIndex);
    Msg.SetShopList(aShopList);

	pGamePlayer->SendPacket(&Msg);

	g_pLog->FastSaveLog( LOG_FILE_1, "CGPlayerShopAcquireShopList::Name=%s"
		,pHuman->GetName()) ;


	return PACKET_EXE_CONTINUE ;

	__LEAVE_FUNCTION

		return PACKET_EXE_ERROR ;
}
开发者ID:brock7,项目名称:TianLong,代码行数:50,代码来源:CGPlayerShopAcquireShopListHandler.cpp


示例19: Assert

UINT	WGTopListHandler::Execute(WGTopList* pPacket,Player* pPlayer)
{
__ENTER_FUNCTION

	GamePlayer* pGamePlayer = NULL ;
	PlayerID_t PlayerID = pPacket->GetPlayerID();

	if( pPlayer->IsServerPlayer() )
	{
		pGamePlayer = g_pPlayerPool->GetPlayer(PlayerID);
		if( pGamePlayer==NULL )
		{
			Assert(FALSE);
			return PACKET_EXE_CONTINUE;
		}	
	}
	else if( pPlayer->IsGamePlayer() )
	{
		PlayerID = pPlayer->PlayerID() ;
		pGamePlayer = (GamePlayer*)pPlayer ;
	}
	else
	{
		Assert(FALSE) ;
		return PACKET_EXE_CONTINUE ;
	}

	Obj_Human* pHuman = pGamePlayer->GetHuman();
	Assert( pHuman );

	Scene* pScene = pHuman->getScene();
	if( pScene==NULL )
		return PACKET_EXE_CONTINUE ;

	Assert( MyGetCurrentThreadID()==g_pServerManager->m_ThreadID );
	Assert(pPacket);
	
	GCTopList Msg  ;
	WORLD_TOP_LIST* pTop = Msg.GetTopList();
	memcpy(pTop,pPacket->GetTopList(),sizeof(WORLD_TOP_LIST));
	pGamePlayer->SendPacket(&Msg);

	g_pLog->FastSaveLog( LOG_FILE_1,"WGTopListHandler::Execute()....OK!");

	return PACKET_EXE_CONTINUE ;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR ;
}
开发者ID:uvbs,项目名称:wx2Server,代码行数:50,代码来源:WGTopListHandler.cpp


示例20: Assert

UINT CGApplyPrivateInfoHandler::Execute( CGApplyPrivateInfo* 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
    //_PRIVATE_INFO_DB_LOAD PrivateData;

    //PrivateData.m_Age = pPacket->GetAge();
    //PrivateData.m_BloodType = pPacket->GetBloodType();
    //PrivateData.m_CharGUID = pPacket->GetCharGUID();

    //PrivateData.m_Consella = pPacket->GetConsella();
    //PrivateData.m_InfoType = pPacket->GetInfoType();
    //PrivateData.m_Province = pPacket->GetProvince();
    //PrivateData.m_Sex = pPacket->GetSex();
    //PrivateData.m_YearAnimal = pPacket->GetYearAnimal();

    //strncpy(PrivateData.m_City, pPacket->GetCity(), pPacket->GetCityLength());
    //strncpy(PrivateData.m_EmailInfo, pPacket->GetEmailInfo(), pPacket->GetEmailInfoLength());
    //strncpy(PrivateData.m_JobInfo, pPacket->GetJobInfo(), pPacket->GetJobInfoLength());
    //strncpy(PrivateData.m_LuckWord, pPacket->GetLuckWord(), pPacket->GetLuckWordLength());
    //strncpy(PrivateData.m_SchoolInfo, pPacket->GetSchoolInfo(), pPacket->GetSchoolInfoLength());


    //pHuman->GetDB()->SetPrivateInfo(&PrivateData);

    g_pLog->FastSaveLog( LOG_FILE_1, "CGApplyPrivateInfoHandler::ObjName=%s"
        ,pHuman->GetName());

    return PACKET_EXE_CONTINUE ;

__LEAVE_FUNCTION

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MyMalloc函数代码示例发布时间:2022-05-30
下一篇:
C++ MyFree函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap