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


C++ USER::GetGuildID方法代码示例

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


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

示例1: Execute

uint GWCityApplyNewCityHandler::Execute( GWCityApplyNewCity* pPacket, Player* pPlayer )
{
	__ENTER_FUNCTION

		ServerPlayer* pServerPlayer = (ServerPlayer*)pPlayer;
		//入口场景ID
		SceneID_t	PortSceneID		=	pPacket->GetSceneID();
		//申请人GUID
		GUID_t		ApplicantGuid	=	pPacket->GetPlayerGuid();

		WGCityError MsgError;

		USER* pUser = g_pOnlineUser->FindUser( ApplicantGuid ) ;
		if( pUser==NULL )
		{
			Log::SaveLog( WORLD_LOGFILE, "GWCityApplyNewCityHandler...User GUID=%X not find!", 
				ApplicantGuid ) ;

			return PACKET_EXE_CONTINUE ;
		}

		//这里要判定当前任务是否有权利建立城市,当前工会是否有资格申请城市
		GuildID_t guildID = pUser->GetGuildID();
		Guild* pGuild = g_pGuildManager->GetGuild( guildID );

		//if(!pGuild)
		//{
		//	Log::SaveLog( WORLD_LOGFILE, "GWCityApplyNewCityHandler...User Guild not find! guildID = %d", 
		//		guildID ) ;
		//	return PACKET_EXE_CONTINUE ;
		//}

		//合法
		//通知Server去load城市场景,返回城市场景号
		WGCityApplyNewCity MsgToServer;
		MsgToServer.SetSceneID(PortSceneID);
		MsgToServer.SetPlayerGuid(ApplicantGuid);
		pServerPlayer->SendPacket( &MsgToServer );

		Log::SaveLog( WORLD_LOGFILE, "GWCityApplyNewCityHandler...User GUID=%X Finished", 
			ApplicantGuid ) ;

		return PACKET_EXE_CONTINUE ;

	__LEAVE_FUNCTION

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

示例2: Execute


//.........这里部分代码省略.........
            pUser->AddRelation( Relation.GetTargetGUID(), &RUser );
            return PACKET_EXE_CONTINUE;
        }
        break;
    case REQ_NEWGOODFRIEND:
        { // 加入一个亲密好友
            pUser->AddGoodFriend( pRelationPacket->m_RelationGUID.GetTargetGUID() );
            return PACKET_EXE_CONTINUE;
        }
        break;
    case REQ_RELATIONONLINE:
        { // 获取密友的在线列表
            Msg.GetRelation()->m_Type = RET_ONLINELIST;
            RETURN_ONLINE_LIST* pSend = &(Msg.GetRelation()->m_RelationOnline);
            pSend->CleanUp();
            pUser->FillOnlineList(pSend);
        }
        break;
    case REQ_MODIFYMOOD:
        {
            pUser->SetMood( pRelationPacket->m_ModifyMood.GetMood() );
            return PACKET_EXE_CONTINUE;
        }
        break;
    case REQ_MODIFYSETTINGS:
        {
            pUser->SetSettings( pRelationPacket->m_Settings.GetSettings() );
            return PACKET_EXE_CONTINUE;
        }
        break;
    case REQ_NOTIFY_ADDTEMPFRIEND:
        {
            REQUEST_VIEW_PLAYER& Recv = pRelationPacket->m_ViewPlayer;

            if ( strlen(Recv.GetTargetName()) > 0 )
            {
                pTargetUser = g_pOnlineUser->FindUser( Recv.GetTargetName() );
            }

            if ( pTargetUser == NULL )
            { // 玩家可能不存在也可能不在线,由 Server 来判断
                Log::SaveLog( WORLD_LOGFILE, "GWRelationHandler...User GUID=%s not find!",
                    Recv.GetTargetName() );
                return PACKET_EXE_CONTINUE;
            }

            Msg.GetRelation()->m_Type = RET_NOTIFY_ADDTEMPFRIEND;
            REQUEST_VIEW_PLAYER* pSend = &(Msg.GetRelation()->m_PlayerName);
            pSend->CleanUp();
            pSend->SetTargetName( pUser->GetName() );
        }
        break;
    default :
        {
            Assert(FALSE);
            return PACKET_EXE_CONTINUE;
        }
    }

    if ( uErr > 0 )
    {
        Msg.GetRelation()->m_Type = uErr;
    }

    if ( pRelationData != NULL && pTargetUser != NULL )
    {
        pRelationData->SetGUID( pTargetUser->GetGUID() );
        pRelationData->SetName( pTargetUser->GetName() );
        pRelationData->SetLevel( pTargetUser->GetLevel() );
        pRelationData->SetMenPai( pTargetUser->GetMenpai() );
        pRelationData->SetPortrait( pTargetUser->GetPortrait() );
        pRelationData->SetGuildID( pTargetUser->GetGuildID() );
        pRelationData->SetGuildName( g_pGuildManager->GetGuildName(pTargetUser->GetGuildID()) );

        if ( pTargetUser->UserStatus() == US_NORMAL )
        { // 只有在线才发剩余信息
            pRelationData->SetOnlineFlag(1);
            pRelationData->SetMood( pTargetUser->GetMood() );
            pRelationData->SetTitle( pTargetUser->GetTitle() );
            pRelationData->SetSceneID( pTargetUser->GetSceneID() );

            if ( pTargetUser->GetTeamID() != INVALID_ID )
            {
                Team* pTeam = g_pTeamList->GetTeam( pTargetUser->GetTeamID() );
                if ( pTeam != NULL )
                {
                    pRelationData->SetTeamSize( pTeam->MemberCount() );
                }
            }
        }
    }

    pServerPlayer->SendPacket( &Msg );

    return PACKET_EXE_CONTINUE;

__LEAVE_FUNCTION

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


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