本文整理汇总了C++中CGuild::incGradeCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CGuild::incGradeCount方法的具体用法?C++ CGuild::incGradeCount怎么用?C++ CGuild::incGradeCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGuild
的用法示例。
在下文中一共展示了CGuild::incGradeCount方法的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);
}
}