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


C++ CGuild::getGradeCount方法代码示例

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


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

示例1: setGrade

//----------------------------------------------------------------------------
void CGuildMemberModule::setGrade( uint16 index,uint8 session, EGSPD::CGuildGrade::TGuildGrade grade)const
{
	MODULE_AST( _GuildMemberCore );
	CGuild * guild = EGS_PD_CAST<CGuild*>(_GuildMemberCore->getGuild());
	EGS_PD_AST( guild );
	CGuildCharProxy proxy;
	getProxy(proxy);
	proxy.cancelAFK();
		
	if ( guild->getMembersSession() != session )
	{
		proxy.sendSystemMessage( "GUILD_BAD_SESSION" );
		return;
	}
	if ( _GuildMemberCore->getMemberIndex() == index )
	{
		nlwarning("<GUILD>%s tries to change its grade",proxy.getId().toString().c_str());
		return;
	}
	CGuildMember * member = guild->getMemberByIndex( index );
	if ( member == NULL )
	{
		nlwarning("<GUILD>%s set invalid member idx %u as leader",proxy.getId().toString().c_str(),index );
		return;
	}
	EGSPD::CGuildGrade::TGuildGrade oldGrade = member->getGrade();
	if ( !canAffectGrade( oldGrade ) )
	{
		proxy.sendSystemMessage("GUILD_INSUFFICIENT_GRADE");
		return;
	}

	if ( !CGuildManager::getInstance()->isGMGuild( guild->getId() ) && guild->getGradeCount(grade) >= guild->getMaxGradeCount(grade) )
	{
		SM_STATIC_PARAMS_1( paramFull, STRING_MANAGER::string_id );
		paramFull[0].StringId = CEntityIdTranslator::getInstance()->getEntityNameStringId(member->getIngameEId());
		proxy.sendSystemMessage("GUILD_GRADE_FULL",paramFull);
		return;
	}
	
	member->setMemberGrade(grade);
	guild->incGradeCount( grade );
	guild->decGradeCount( oldGrade );
	
	// send system message
	SM_STATIC_PARAMS_3(params,STRING_MANAGER::player,STRING_MANAGER::player,STRING_MANAGER::string_id);
	params[0].setEIdAIAlias( proxy.getId(), CAIAliasTranslator::getInstance()->getAIAlias(proxy.getId()) );
	params[1].setEIdAIAlias( member->getIngameEId(), CAIAliasTranslator::getInstance()->getAIAlias(member->getIngameEId()) );
	params[2].StringId = guild->getNameId();
	
	// If the player is online, the module must be recreated. Do as the reference was destroyed
	CGuildMemberModule * module = NULL;
	if ( member->getReferencingModule(module) )
	{
		CGuildCharProxy targetProxy;
		module->getProxy(targetProxy);
		member->removeReferencingModule(module);
		module->onReferencedDestruction();
		IModule * moduleTarget = createModule(targetProxy,member);
		guild->setMemberClientDB( member );
		MODULE_AST(moduleTarget);
	}
}
开发者ID:Darkhunter,项目名称:Tranquillien-HCRP-Project-using-NeL,代码行数:64,代码来源:guild_member_module.cpp


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