コード例 #1
0
uint CGReturnTeamFollowHandler::Execute( CGReturnTeamFollow* 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 );

	TeamInfo* pTeamInfo = pHuman->GetTeamInfo();
	if( pTeamInfo->HasTeam() == FALSE )
	{
		Assert(FALSE);
		return PACKET_EXE_CONTINUE;
	}

	const TEAMMEMBER* pLeaderInfo = pTeamInfo->Leader();
	// 这里不对自己是否队长进行检查

	if( pLeaderInfo->m_SceneID != pScene->SceneID() )
	{ // 不在同一个场景
		g_pLog->FastSaveLog( LOG_FILE_1, "CGReturnTeamFollow: GUID=%X is not in the same scene with team leader.", 
			pHuman->GetGUID() );
		return PACKET_EXE_CONTINUE;
	}

	Obj_Human* pLeader = pScene->GetHumanManager()->GetHuman( pLeaderInfo->m_ObjID );
	if( pLeader==NULL )
	{ // 没有找到队长
		g_pLog->FastSaveLog( LOG_FILE_1, "CGReturnTeamFollow: GUID=%X can't find team leader.", 
			pHuman->GetGUID() );
		return PACKET_EXE_CONTINUE;
	}

	// 如果自己正在摆摊,则不允许跟随
	if(pHuman->m_StallBox.GetStallStatus() == ServerStallBox::STALL_OPEN)
	{
		GCTeamFollowErr Msg;
		Msg.SetError( TF_ERROR_STALL_OPEN );

		pGamePlayer->SendPacket( &Msg );

		g_pLog->FastSaveLog( LOG_FILE_1, "CGReturnTeamFollow: GUID=%X can't follow when open stall.", 
			pHuman->GetGUID() );
		return PACKET_EXE_CONTINUE;
	}

	if( pPacket->GetReturn() )
	{ // 同意跟随
		// 检查跟队长之间的距离是否超过 10 米
		if( pHuman->IsInValidRadius(pLeader, (FLOAT)g_Config.m_ConfigInfo.m_nAvailableFollowDist) == FALSE )
		{ // 超过则返回错误信息
			GCTeamFollowErr Msg;
			Msg.SetError( TF_ERROR_TOO_FAR );

			pGamePlayer->SendPacket( &Msg );

			g_pLog->FastSaveLog( LOG_FILE_1, "CGReturnTeamFollow: GUID=%X can't follow for the distance.", 
				pHuman->GetGUID() );
			return PACKET_EXE_CONTINUE;
		}

		// 检查队长是否出于组队跟随状态
		if( pLeader->__GetTeamFollowFlag() == FALSE )
		{ // 队长不处于组队跟随状态,可能队长已经主动取消跟随了
			GCTeamFollowErr Msg;
			Msg.SetError( TF_ERROR_NOT_IN_FOLLOW_MODE );

			pGamePlayer->SendPacket( &Msg );

			g_pLog->FastSaveLog( LOG_FILE_1, "CGReturnTeamFollow: GUID=%X can't follow for not in follow mode.", 
				pHuman->GetGUID() );
			return PACKET_EXE_CONTINUE;
		}

		if ( pHuman->__GetTeamFollowFlag() )
		{ // 如果已经处于此状态,则返回
			return PACKET_EXE_CONTINUE;
		}

		pHuman->__SetTeamFollowFlag( TRUE );

		_FOLLOWEDMEMBER MyInfo;
		MyInfo.m_GUID = pHuman->GetGUID();
		MyInfo.m_pHuman = pHuman;

		// 将新的跟随列表发给可见范围内所有客户端
		// 只有队长有这个列表,这样可以进行优化
		GCTeamFollowList Msg;
		Msg.SetObjID( pLeader->GetID() );

		INT nMaxFollowedCount = pLeader->__GetFollowedMembersCount();

		for( INT i=0; i<nMaxFollowedCount; ++i )
		{ // 所有跟随者加上自己,自己加上每个跟随者
			Obj_Human* pMember;
			const _FOLLOWEDMEMBER* pFollowedMember;

			pFollowedMember = pLeader->__GetFollowedMember(i);

			pMember = pFollowedMember->m_pHuman;
			if( pMember!=NULL )
			{ // 没有断线并且在同一场景
				pMember->__AddFollowedMember( MyInfo );
			}

			pHuman->__AddFollowedMember( *pFollowedMember );
			Msg.AddFollowMember( pFollowedMember->m_GUID );
		}

		pHuman->__AddFollowedMember( MyInfo ); // 自己加上自己
		pHuman->GetHumanAI()->PushCommand_TeamFollow();

		Msg.AddFollowMember( MyInfo.m_GUID );

		//GCNotifyTeamInfo notifyMsg;
		//notifyMsg.SetObjID( pHuman->GetID() );
		//notifyMsg.SetHaveTeamFlag( pTeamInfo->HasTeam() );
		//notifyMsg.SetTeamLeaderFlag( pTeamInfo->IsLeader() );
		//notifyMsg.SetTeamFullFlag( pTeamInfo->IsFull() );
		//notifyMsg.SetTeamFollowFlag( pHuman->__GetTeamFollowFlag() );
		//pScene->BroadCast( &notifyMsg, pHuman );

		pScene->BroadCast( &Msg, pLeader, TRUE ); // 发送跟随列表给所有客户端,以供路线模拟

		GCReturnTeamFollow RetMsg;
		RetMsg.SetReturn( TF_RESULT_ENTER_FOLLOW );
		RetMsg.SetGUID( pHuman->GetGUID() );

		pGamePlayer->SendPacket( &RetMsg ); // 发给自己
		pLeader->GetPlayer()->SendPacket( &RetMsg ); // 发给队长

		// 这里需要通知 world GWEnterTeamFollow
		GWEnterTeamFollow* pMsg = (GWEnterTeamFollow*)g_pPacketFactoryManager->CreatePacket(PACKET_GW_ENTER_TEAMFOLLOW);

		pMsg->SetGUID( pHuman->GetGUID() );

		g_pServerManager->SendPacket( pMsg, INVALID_ID );

		g_pLog->FastSaveLog( LOG_FILE_1, "CGReturnTeamFollow: GUID=%X success.", 
			pHuman->GetGUID() );
		return PACKET_EXE_CONTINUE;
	}
	else
	{ // 不同意跟随
		GCReturnTeamFollow Msg;
		Msg.SetReturn( TF_RESULT_REFUSE_FOLLOW );
		Msg.SetGUID( pHuman->GetGUID() );

		pLeader->GetPlayer()->SendPacket( &Msg );

		g_pLog->FastSaveLog( LOG_FILE_1, "CGReturnTeamFollow: GUID=%X refuse to follow.", 
			pHuman->GetGUID() );
		return PACKET_EXE_CONTINUE;
	}
	return PACKET_EXE_CONTINUE;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR;
}
コード例 #2
0
ファイル: WGTeamListHandler.cpp プロジェクト: brock7/TianLong
UINT WGTeamListHandler::Execute( WGTeamList* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION

	PlayerID_t PlayerID = pPacket->GetPlayerID();
	GamePlayer* pGamePlayer = g_pPlayerPool->GetPlayer(PlayerID);
	if( pGamePlayer==NULL )
	{
		g_pLog->FastSaveLog( LOG_FILE_3, "WGTeamListHandler::Execute pGamePlayer==NULL" );
		return PACKET_EXE_CONTINUE;
	}

	if (pGamePlayer->m_HumanGUID != pPacket->GetGUID())
	{
		g_pLog->FastSaveLog( LOG_FILE_3, "WGTeamListHandler::Execute pGamePlayer->m_HumanGUID[%d] != pPacket->GetGUID()[%d]",pGamePlayer->m_HumanGUID, pPacket->GetGUID());
		return PACKET_EXE_CONTINUE;
	}

	Obj_Human* pHuman = pGamePlayer->GetHuman();
	Assert( pHuman );
	Scene* pScene = pHuman->getScene();
	if( !pScene )
	{
		g_pLog->FastSaveLog( LOG_FILE_3, "WGTeamListHandler::Execute pHuman->getScene() == NULL" );
		return PACKET_EXE_CONTINUE;
	}

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

		pScene->SendPacket( pPacket, PlayerID );

		g_pLog->FastSaveLog( LOG_FILE_1, "WGTeamListHandler: ServerPlayer (GUID=%X, TeamID=%d) ",
			pHuman->GetGUID(), pPacket->GetTeamID() );

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

		TeamInfo* pTeamInfo = pHuman->GetTeamInfo();
		if ( pTeamInfo->HasTeam() )
		{ // 只要客户端请求完成的队伍信息,就清空服务器端的队伍列表
			pTeamInfo->DisMiss();
		}

		pTeamInfo->SetTeamID( pPacket->GetTeamID() );
		pHuman->GetDB()->SetDBTeamID( pPacket->GetTeamID() ) ;
		pTeamInfo->SetMySceneID( pScene->SceneID() );

		GCTeamList Msg;
		Msg.SetTeamID( pPacket->GetTeamID() );

		for( UINT i=0; i<pPacket->GetMemberCount(); ++i )
		{
			const TEAM_LIST_ENTRY& entry = pPacket->GetTeamMember( i );
			TEAM_LIST_ENTRY newEntry;

			TEAMMEMBER Member;
			Member.m_GUID = entry.GetGUID();
			Member.m_SceneID = entry.GetSceneID();
			if ( Member.m_GUID == pGamePlayer->m_HumanGUID )
			{
				Member.m_ObjID = pHuman->GetID();
			}
			else if ( Member.m_SceneID == pScene->SceneID() )
			{
				GamePlayer* ptempGamePlayer = g_pPlayerPool->GetPlayer( entry.GetExtraID() );
				Obj_Human* ptempHuman;

				if ( ptempGamePlayer == NULL )
				{
					Assert(FALSE && "队友失去了连接。");
					Member.m_ObjID = INVALID_ID;
				}
				else if ( (ptempHuman = ptempGamePlayer->GetHuman()) == NULL )
				{
					Assert(FALSE && "队友找不到了……");
					Member.m_ObjID = INVALID_ID;
				}
				else
				{
					Member.m_ObjID = ptempHuman->GetID();
				}
			}
			else
			{
				Member.m_ObjID = INVALID_ID;
			}

			newEntry = entry;
			newEntry.SetExtraID( Member.m_ObjID );

			pTeamInfo->AddMember( &Member );
			Msg.AddTeamMember( newEntry );
		}

		pGamePlayer->SendPacket( &Msg );

		GCNotifyTeamInfo notifyMsg;

		notifyMsg.SetObjID( pHuman->GetID() );
		notifyMsg.SetHaveTeamFlag( pTeamInfo->HasTeam() );

		if ( pTeamInfo->HasTeam() )
		{
			notifyMsg.SetTeamLeaderFlag( pTeamInfo->IsLeader() );
			notifyMsg.SetTeamFullFlag( pTeamInfo->IsFull() );
		}
		else
		{
			notifyMsg.SetTeamLeaderFlag( FALSE );
			notifyMsg.SetTeamFullFlag( FALSE );
		}

		if ( pHuman->getZoneID() != INVALID_ID )
		{
			pScene->BroadCast( &notifyMsg, pHuman );
		}

		g_pLog->FastSaveLog( LOG_FILE_1, "WGTeamListHandler: GamePlayer (to:%d, GUID=%ld, TeamID=%d) ",
			pPacket->GetPlayerID(), pHuman->GetGUID(), pPacket->GetTeamID() );
	}
	else
	{
		Assert(FALSE);
	}

	return PACKET_EXE_CONTINUE;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR;
}
コード例 #3
0
UINT WGTeamFollowListHandler::Execute( WGTeamFollowList* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION

    PlayerID_t PlayerID = pPacket->GetPlayerID();
    GamePlayer* pGamePlayer = g_pPlayerPool->GetPlayer(PlayerID);
    if( pGamePlayer==NULL )
    {
        g_pLog->FastSaveLog( LOG_FILE_3, "WGTeamFollowListHandler::Execute pGamePlayer==NULL" );
        return PACKET_EXE_CONTINUE;
    }

    if (pGamePlayer->m_HumanGUID != pPacket->GetGUID())
    {
        g_pLog->FastSaveLog( LOG_FILE_3, "WGTeamFollowListHandler::Execute pGamePlayer->m_HumanGUID[%d] != pPacket->GetGUID()[%d]",pGamePlayer->m_HumanGUID, pPacket->GetGUID());
        return PACKET_EXE_CONTINUE;
    }

    Obj_Human* pHuman = pGamePlayer->GetHuman();
    Assert( pHuman );
    Scene* pScene = pHuman->getScene();
    if( !pScene )
    {
        g_pLog->FastSaveLog( LOG_FILE_3, "WGTeamFollowListHandler::Execute pHuman->getScene() == NULL" );
        return PACKET_EXE_CONTINUE;
    }

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

        pScene->SendPacket( pPacket, PlayerID );

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

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

        TeamInfo* pTeamInfo = pHuman->GetTeamInfo();
        if( pTeamInfo->HasTeam() == FALSE )
        {
            Assert(FALSE);
            return PACKET_EXE_CONTINUE;
        }

        pHuman->__ClearFollowedMembers(); // 清空旧信息

        _FOLLOWEDMEMBER myInfo;
        myInfo.m_GUID = pHuman->GetGUID();
        myInfo.m_pHuman = pHuman;

        for( INT i=0; i<pPacket->GetMemberCount(); ++i )
        {
            _FOLLOWEDMEMBER info;
            const TEAMMEMBER* pMember;

            info.m_GUID = pPacket->GetFollowMember(i);
            info.m_pHuman = NULL;
            pMember = pTeamInfo->GetTeamMemberByGUID( info.m_GUID );

            if ( pMember->m_SceneID == pScene->SceneID() )
            {
                info.m_pHuman = pScene->GetHumanManager()->GetHuman( pMember->m_ObjID );

                if ( info.m_pHuman!=NULL )
                {
                    if ( info.m_pHuman->GetGUID()!=pMember->m_GUID )
                    { // 宁缺勿滥
                        info.m_pHuman = NULL;
                    }
                    else
                    { // 让跟随队友把自己加进去,以更新 pHuman 指针
                        info.m_pHuman->__AddFollowedMember( myInfo );
                    }
                }
            }

            pHuman->__AddFollowedMember( info );
        }

        if ( pPacket->GetMemberCount()>0 )
        {
            pHuman->__SetTeamFollowFlag( TRUE );

            GCReturnTeamFollow Msg; // 通知客户端进入跟随状态
            Msg.SetGUID( pHuman->GetGUID() );
            Msg.SetReturn( TF_RESULT_FOLLOW_FLAG );
            pGamePlayer->SendPacket( &Msg );
        }
        else
        { // 队长断线退出,World 可能发送一个空的列表过来
            pHuman->__SetTeamFollowFlag( FALSE );
            pHuman->GetHumanAI()->PushCommand_StopTeamFollow();

            GCReturnTeamFollow Msg; // 通知客户端进入跟随状态
            Msg.SetGUID( pHuman->GetGUID() );
            Msg.SetReturn( TF_RESULT_STOP_FOLLOW );
            pGamePlayer->SendPacket( &Msg );
        }

        if ( pTeamInfo->IsLeader() )
        { // 队长
            GCTeamFollowList Msg;
            Msg.SetObjID( pHuman->GetID() );

            for( INT i=1; i<pHuman->__GetFollowedMembersCount(); ++i )
            {
                Obj_Human* pMember;

                pMember = pHuman->__GetFollowedMember(i)->m_pHuman;
                Msg.AddFollowMember( pHuman->__GetFollowedMember(i)->m_GUID );

                if ( pMember!=NULL && pMember->getZoneID()!=INVALID_ID )
                { // 必须进入了场景才跟随
                    pMember->GetHumanAI()->PushCommand_TeamFollow();
                }
            }

            if ( pHuman->getZoneID() != INVALID_ID )
            {
                pScene->BroadCast( &Msg, pHuman, TRUE );
            }
        }
        else if ( pPacket->GetMemberCount()>0 )
        { // 是跟随者
            Obj_Human* pLeader = pHuman->__GetFollowedMember(0)->m_pHuman;

            if ( pLeader!=NULL && pLeader->getZoneID()!=INVALID_ID )
            { // 必须进入了场景才跟随
                pHuman->GetHumanAI()->PushCommand_TeamFollow();
            }
        }

        g_pLog->FastSaveLog( LOG_FILE_1, "WGTeamFollowListHandler: GamePlayer (GUID=%X) ",
            pHuman->GetGUID() );
    }
    else
    {
        Assert(FALSE);
    }

    return PACKET_EXE_CONTINUE;

__LEAVE_FUNCTION

    return PACKET_EXE_ERROR;
}
コード例 #4
0
UINT WGTeamResultHandler::Execute( WGTeamResult* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION

	PlayerID_t PlayerID = pPacket->GetPlayerID();
	GamePlayer* pGamePlayer = g_pPlayerPool->GetPlayer(PlayerID);
	if( pGamePlayer==NULL )
	{
		g_pLog->FastSaveLog( LOG_FILE_3, "WGTeamResultHandler::Execute pGamePlayer==NULL" );
		return PACKET_EXE_CONTINUE;
	}

	Obj_Human* pHuman = pGamePlayer->GetHuman();
	Assert( pHuman );
	Scene* pScene = pHuman->getScene();
	if( !pScene )
	{
		g_pLog->FastSaveLog( LOG_FILE_3, "WGTeamResultHandler::Execute pHuman->getScene() == NULL" );
		return PACKET_EXE_CONTINUE;
	}

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

		pScene->SendPacket( pPacket, PlayerID );

		g_pLog->FastSaveLog( LOG_FILE_1, "WGTeamResultHandler: ServerPlayer (Return=%d, GUID=%X, TeamID=%d) ",
			pPacket->GetReturn(), pPacket->GetGUID(), pPacket->GetTeamID() );

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

		TeamInfo* pTeamInfo = pHuman->GetTeamInfo();
		GCTeamResult tMsg;
		BOOL bNotifyTeamInfoFlag = FALSE;
		tMsg.SetReturn( pPacket->GetReturn() );
		tMsg.SetGUID( pPacket->GetGUID() );
		tMsg.SetTeamID( pPacket->GetTeamID() );
		tMsg.SetGUIDEx( pPacket->GetGUIDEx() );
		tMsg.SetSceneID( pPacket->GetSceneID() );
		tMsg.SetIcon( pPacket->GetIcon() );
		tMsg.SetName( pPacket->GetName() );
		tMsg.SetDataID( pPacket->GetDataID() );

		switch( pPacket->GetReturn() )
		{
		case TEAM_RESULT_TEAMREFRESH:
		case TEAM_RESULT_MEMBERENTERTEAM:
			{
				if( !pTeamInfo->HasTeam() )
				{
					pTeamInfo->SetTeamID( pPacket->GetTeamID() );
					pHuman->GetDB()->SetDBTeamID( pPacket->GetTeamID() ) ;
					pTeamInfo->SetMySceneID( pScene->SceneID() );
					bNotifyTeamInfoFlag = TRUE;
				}

				TEAMMEMBER Member;
				Member.m_GUID = pPacket->GetGUID();
				Member.m_SceneID = pPacket->GetSceneID();

				if ( Member.m_GUID == pGamePlayer->m_HumanGUID )
				{
					Member.m_ObjID = pHuman->GetID();
				}
				else if ( Member.m_SceneID == pScene->SceneID() )
				{
					GamePlayer* ptempGamePlayer = g_pPlayerPool->GetPlayer(pPacket->GetGUIDEx());
					Obj_Human* ptempHuman;

					if ( ptempGamePlayer == NULL )
					{
						Assert(FALSE && "队友失去了连接。");
					}
					else if ( (ptempHuman = ptempGamePlayer->GetHuman()) == NULL )
					{
						Assert(FALSE && "队友找不到了……");
					}
					else
					{
						Member.m_ObjID = ptempHuman->GetID();
					}
				}
				else
				{
					Member.m_ObjID = INVALID_ID;
				}

				tMsg.SetGUIDEx( Member.m_ObjID ); // 将队友的 ObjID 发出去
				pTeamInfo->AddMember( &Member );

				if ( pTeamInfo->IsFull() )
				{
					bNotifyTeamInfoFlag = TRUE;
				}
			}
			break;
		case TEAM_RESULT_MEMBERLEAVETEAM:
		case TEAM_RESULT_TEAMKICK:
		case TEAM_RESULT_LEADERLEAVETEAM:
			{
				if ( pTeamInfo->IsFull() )
				{ // 队伍不再满
					bNotifyTeamInfoFlag = TRUE;
				}

				if ( pGamePlayer->m_HumanGUID == pPacket->GetGUID() )
				{ // 自己主动离队
					if ( pHuman->__GetTeamFollowFlag() )
					{
						pHuman->__StopTeamFollow(FALSE);
					}

					pTeamInfo->DisMiss();
					pHuman->GetDB()->SetDBTeamID( INVALID_ID ) ;

					bNotifyTeamInfoFlag = TRUE;
				}
				else
				{
					pTeamInfo->DelMember( pPacket->GetGUID() );

					if ( pPacket->GetReturn() == TEAM_RESULT_LEADERLEAVETEAM
					  && pTeamInfo->IsLeader() // 队长退队后,自己变成新队长
					  )
					{
						GCReturnTeamFollow Msg;
						Msg.SetReturn(TF_RESULT_STOP_FOLLOW);
						Msg.SetGUID(pHuman->GetGUID());
						pGamePlayer->SendPacket(&Msg);

						bNotifyTeamInfoFlag = TRUE;
					}
				}
			}
			break;
		case TEAM_RESULT_TEAMDISMISS:
			{
				if ( pTeamInfo->IsLeader() )
				{ // 自己是队长
					if ( pHuman->__GetTeamFollowFlag() )
					{
						pHuman->__StopTeamFollow(FALSE);
					}
				}

				pTeamInfo->DisMiss();
				pHuman->GetDB()->SetDBTeamID( INVALID_ID ) ;
				bNotifyTeamInfoFlag = TRUE;
			}
			break;
		case TEAM_RESULT_TEAMAPPOINT:
			{
				if ( pTeamInfo->IsLeader() )
				{ // 自己是队长
					if ( pHuman->__GetTeamFollowFlag() )
					{
						pHuman->__StopTeamFollow();
					}

					bNotifyTeamInfoFlag = TRUE;
				}

				pTeamInfo->Appoint( pPacket->GetGUIDEx() );

				if ( pTeamInfo->IsLeader() )
				{ // 自己是队长了
					bNotifyTeamInfoFlag = TRUE;
				}
			}
			break;
		case TEAM_RESULT_STARTCHANGESCENE:
			{
				pTeamInfo->StartChangeScene( pPacket->GetGUID() );
			}
			break;
		case TEAM_RESULT_ENTERSCENE:
			{
				if ( pPacket->GetGUID() == pGamePlayer->m_HumanGUID )
				{ // 自己进入
					pTeamInfo->EnterScene( pGamePlayer->m_HumanGUID, pScene->SceneID(),
											pHuman->GetID() );

					if ( pHuman->__GetTeamFollowFlag() )
					{
						_FOLLOWEDMEMBER FollowedMember;

						FollowedMember.m_GUID = pHuman->GetGUID();
						FollowedMember.m_pHuman = pHuman;
						pHuman->__AddFollowedMember( FollowedMember );
					}
				}
				else
				{
					ObjID_t oid;

					if ( pPacket->GetSceneID() == pScene->SceneID() )
					{
						GamePlayer* ptempGamePlayer = g_pPlayerPool->GetPlayer(pPacket->GetGUIDEx());
						Obj_Human* ptempHuman;

						if ( ptempGamePlayer == NULL )
						{
							Assert(FALSE && "队友失去了连接。");
						}
						else if ( (ptempHuman = ptempGamePlayer->GetHuman()) == NULL )
						{
							Assert(FALSE && "队友找不到了……");
						}
						else
						{
							oid = ptempHuman->GetID();

							if ( ptempHuman->__GetTeamFollowFlag() )
							{
								_FOLLOWEDMEMBER FollowedMember;

								FollowedMember.m_GUID = ptempHuman->GetGUID();
								FollowedMember.m_pHuman = ptempHuman;
								pHuman->__AddFollowedMember( FollowedMember );
							}
						}
					}
					else
					{
						oid = INVALID_ID;
					}

					pTeamInfo->EnterScene( pPacket->GetGUID(), pPacket->GetSceneID(), oid );
					tMsg.SetGUIDEx( oid );
				}
			}
			break;
		case TEAM_RESULT_MEMBEROFFLINE:
			{
				pTeamInfo->MemberOffLine( pPacket->GetGUID() );

				GCTeamMemberInfo tmInfoMsg;
				tmInfoMsg.setGUID( pPacket->GetGUID() );
				tmInfoMsg.SetDeadLink( TRUE );

				pGamePlayer->SendPacket( &tmInfoMsg );

				g_pLog->FastSaveLog( LOG_FILE_1, "WGTeamResultHandler: GUID=%X has lost connection.",
					pPacket->GetGUID() );
				return PACKET_EXE_CONTINUE;
			}
			break;
		default :
			{
				Assert(FALSE);
			}
			break;
		};

		pGamePlayer->SendPacket( &tMsg );

		if ( bNotifyTeamInfoFlag == TRUE )
		{
			GCNotifyTeamInfo notifyMsg;
			TeamInfo* pTeamInfo = pHuman->GetTeamInfo();

			notifyMsg.SetObjID( pHuman->GetID() );
			notifyMsg.SetHaveTeamFlag( pTeamInfo->HasTeam() );

			if ( pTeamInfo->HasTeam() )
			{
				notifyMsg.SetTeamLeaderFlag( pTeamInfo->IsLeader() );
				notifyMsg.SetTeamFullFlag( pTeamInfo->IsFull() );
			//	notifyMsg.SetTeamFollowFlag( pHuman->__GetTeamFollowFlag() );
			}
			else
			{
				notifyMsg.SetTeamLeaderFlag( FALSE );
				notifyMsg.SetTeamFullFlag( FALSE );
			//	notifyMsg.SetTeamFollowFlag( FALSE );
			}

			if ( pHuman->getZoneID() != INVALID_ID )
			{
				pScene->BroadCast( &notifyMsg, pHuman );
			}

			g_pLog->FastSaveLog( LOG_FILE_1, "BroadCast GCNotifyTeamInfo..............." );
		}

		g_pLog->FastSaveLog( LOG_FILE_1, "WGTeamResultHandler: GamePlayer (Return=%d, to:%d, GUID=%ld, TeamID=%d, GUIDEx=%X, SceneID=%d) ",
			pPacket->GetReturn(), pPacket->GetPlayerID(), pPacket->GetGUID(), pPacket->GetTeamID(), pPacket->GetGUIDEx(), pPacket->GetSceneID() );
	}
	else
	{
		Assert(FALSE);
	}

	return PACKET_EXE_CONTINUE;

__LEAVE_FUNCTION

	return PACKET_EXE_ERROR;
}