本文整理汇总了C++中GuildMember::setRank方法的典型用法代码示例。如果您正苦于以下问题:C++ GuildMember::setRank方法的具体用法?C++ GuildMember::setRank怎么用?C++ GuildMember::setRank使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuildMember
的用法示例。
在下文中一共展示了GuildMember::setRank方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
//----------------------------------------------------------------------
//
// SGAddGuildMemberOKHandler::execute()
//
//----------------------------------------------------------------------
void SGAddGuildMemberOKHandler::execute (SGAddGuildMemberOK* pPacket )
throw(ProtocolException , Error )
{
__BEGIN_TRY __BEGIN_DEBUG_EX
#ifdef __GAME_SERVER__
// 길드 멤버 object 를 만든다.
GuildMember* pGuildMember = new GuildMember();
pGuildMember->setGuildID(pPacket->getGuildID());
pGuildMember->setName(pPacket->getName());
pGuildMember->setRank(pPacket->getGuildMemberRank());
// 길드에 추가한다.
Guild* pGuild = g_pGuildManager->getGuild(pGuildMember->getGuildID());
pGuild->addMember(pGuildMember);
// 멤버에게 메세지를 보낸다.
__ENTER_CRITICAL_SECTION((*g_pPCFinder))
Creature* pCreature = g_pPCFinder->getCreature_LOCKED(pGuildMember->getName());
if (pCreature != NULL && pCreature->isPC() )
{
Player* pPlayer = pCreature->getPlayer();
Assert(pPlayer != NULL);
if (pGuildMember->getRank() == GuildMember::GUILDMEMBER_RANK_MASTER ||
pGuildMember->getRank() == GuildMember::GUILDMEMBER_RANK_SUBMASTER ) // 길드마스터나 서브마스터일 경우
{
PlayerCreature* pPlayerCreature = dynamic_cast<PlayerCreature*>(pCreature);
Assert(pPlayerCreature != NULL);
Gold_t Fee;
if (pGuildMember->getRank() == GuildMember::GUILDMEMBER_RANK_MASTER )
Fee = REQUIRE_SLAYER_MASTER_GOLD;
else if (pGuildMember->getRank() == GuildMember::GUILDMEMBER_RANK_SUBMASTER )
Fee = REQUIRE_SLAYER_SUBMASTER_GOLD;
else
Fee = 0;
Gold_t CurMoney = pPlayerCreature->getGold();
if (CurMoney < Fee )
{
// 큰일났군
CurMoney = 0;
}
else
CurMoney -= Fee;
pPlayerCreature->setGoldEx(CurMoney);
if (Fee != 0 )
{
GCModifyInformation gcModifyInformation;
gcModifyInformation.addLongData(MODIFY_GOLD, CurMoney);
// 바뀐정보를 클라이언트에 보내준다.
pPlayer->sendPacket(&gcModifyInformation);
}
// 길드 가입 메시지를 보여준다.
GCSystemMessage gcSystemMessage;
if (pGuild->getRace() == Guild::GUILD_RACE_SLAYER )
gcSystemMessage.setMessage(g_pStringPool->getString(STRID_TEAM_JOIN_ACCEPTED ));
else if (pGuild->getRace() == Guild::GUILD_RACE_VAMPIRE )
gcSystemMessage.setMessage(g_pStringPool->getString(STRID_CLAN_JOIN_ACCEPTED ));
else if (pGuild->getRace() == Guild::GUILD_RACE_OUSTERS )
gcSystemMessage.setMessage(g_pStringPool->getString(STRID_CLAN_JOIN_ACCEPTED ));
pPlayer->sendPacket(&gcSystemMessage);
}
else if (pGuildMember->getRank() == GuildMember::GUILDMEMBER_RANK_WAIT )
{
// 길드 가입 신청 메시지를 보낸다.
GCSystemMessage gcSystemMessage;
if (pGuild->getRace() == Guild::GUILD_RACE_SLAYER )
gcSystemMessage.setMessage(g_pStringPool->getString(STRID_TEAM_JOIN_TRY ));
else if (pGuild->getRace() == Guild::GUILD_RACE_VAMPIRE )
gcSystemMessage.setMessage(g_pStringPool->getString(STRID_CLAN_JOIN_TRY ));
else if (pGuild->getRace() == Guild::GUILD_RACE_OUSTERS )
gcSystemMessage.setMessage(g_pStringPool->getString(STRID_CLAN_JOIN_TRY ));
pPlayer->sendPacket(&gcSystemMessage);
}
}
else
{
// 접속이 안되어 있다.
// 마스터나 서브마스터일 경우
// DB 에서 돈을 까도록 한다.
if ((pGuildMember->getRank() == GuildMember::GUILDMEMBER_RANK_MASTER ||
pGuildMember->getRank() == GuildMember::GUILDMEMBER_RANK_SUBMASTER ) // 길드마스터나 서브마스터일 경우
&& pPacket->getServerGroupID() == g_pConfig->getPropertyInt("ServerID" ) ) // 이 게임 서버에서 추가한 길드원인가?
{
//.........这里部分代码省略.........