本文整理汇总了C++中GuildMember::getRank方法的典型用法代码示例。如果您正苦于以下问题:C++ GuildMember::getRank方法的具体用法?C++ GuildMember::getRank怎么用?C++ GuildMember::getRank使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GuildMember
的用法示例。
在下文中一共展示了GuildMember::getRank方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
//----------------------------------------------------------------------
//
// GSModifyGuildMemberHandler::execute()
//
//----------------------------------------------------------------------
void GSModifyGuildMemberHandler::execute (GSModifyGuildMember* pPacket, Player* pPlayer )
throw(ProtocolException , Error )
{
__BEGIN_TRY __BEGIN_DEBUG_EX
#ifdef __SHARED_SERVER__
//cout << "GSModifyGuildMember received" << endl;
Assert(pPacket != NULL);
// 길드를 가져온다.
Guild* pGuild = g_pGuildManager->getGuild(pPacket->getGuildID());
//try { Assert(pGuild != NULL); } catch (Throwable& ) { return; }
if (pGuild==NULL) return;
// 길드의 멤버인지 확인한다.
GuildMember* pGuildMember = pGuild->getMember(pPacket->getName());
//try { Assert(pGuildMember != NULL); } catch (Throwable& ) { return; }
if (pGuildMember==NULL) return;
// 보낸사람이 길드 마스터인지 확인한다. (길드 마스터를 바꿀때는 예외 )
if (pGuild->getMaster() != pPacket->getSender()
&& pPacket->getGuildMemberRank() != GuildMember::GUILDMEMBER_RANK_MASTER )
return;
if (pGuildMember->getRank() == GuildMember::GUILDMEMBER_RANK_WAIT &&
pPacket->getGuildMemberRank() == GuildMember::GUILDMEMBER_RANK_NORMAL )
{
///////////////////////////////////////////////////////////////////////////////////////
// 길드 멤버 가입을 승인한 경우, DB에 Slayer, Vampire, Ousters 테이블의 GuildID 를 바꾼다.
///////////////////////////////////////////////////////////////////////////////////////
Statement* pStmt = NULL;
BEGIN_DB
{
pStmt = g_pDatabaseManager->getConnection("DARKEDEN" )->createStatement();
if (pGuild->getRace() == Guild::GUILD_RACE_SLAYER )
{
pStmt->executeQuery("UPDATE Slayer SET GuildID = %d WHERE Name = '%s'", pGuild->getID(), pGuildMember->getName().c_str());
pStmt->executeQuery("INSERT INTO Messages (Receiver, Message ) VALUES ('%s', '%s' )", pGuildMember->getName().c_str(), g_pStringPool->c_str(STRID_TEAM_JOIN_ACCEPT ));
}
else if (pGuild->getRace() == Guild::GUILD_RACE_VAMPIRE )
{
pStmt->executeQuery("UPDATE Vampire SET GuildID = %d WHERE Name = '%s'", pGuild->getID(), pGuildMember->getName().c_str());
pStmt->executeQuery("INSERT INTO Messages (Receiver, Message ) VALUES ('%s', '%s' )", pGuildMember->getName().c_str(), g_pStringPool->c_str(STRID_CLAN_JOIN_ACCEPT ));
}
else if (pGuild->getRace() == Guild::GUILD_RACE_OUSTERS )
{
pStmt->executeQuery("UPDATE Ousters SET GuildID = %d WHERE Name = '%s'", pGuild->getID(), pGuildMember->getName().c_str());
pStmt->executeQuery("INSERT INTO Messages (Receiver, Message ) VALUES ('%s', '%s' )", pGuildMember->getName().c_str(), g_pStringPool->c_str(STRID_CLAN_JOIN_ACCEPT ));
}
SAFE_DELETE(pStmt);
}
END_DB(pStmt)
// Guild Member 정보를 변경한다.
pGuild->modifyMemberRank(pGuildMember->getName(), pPacket->getGuildMemberRank());
}
示例2: execute
void CGSelectGuildMemberHandler::execute (CGSelectGuildMember* pPacket , Player* pPlayer)
throw(Error)
{
__BEGIN_TRY __BEGIN_DEBUG_EX
#ifdef __GAME_SERVER__
Assert(pPacket != NULL);
Assert(pPlayer != NULL);
SYSTEM_ASSERT(SYSTEM_GUILD);
GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pPlayer);
Assert(pGamePlayer != NULL);
PlayerCreature* pPlayerCreature = dynamic_cast<PlayerCreature*>(pGamePlayer->getCreature());
Assert(pPlayerCreature != NULL);
// 선택한 길드를 가져온다.
Guild* pGuild = g_pGuildManager->getGuild(pPlayerCreature->getGuildID());
//try { Assert(pGuild != NULL); } catch (Throwable& ) { return; }
if (pGuild==NULL) return;
// 선택한 길드 멤버를 가져온다.
GuildMember* pGuildMember = pGuild->getMember(pPacket->getName());
//try { Assert(pGuildMember != NULL); } catch (Throwable& ) { return; }
if (pGuildMember==NULL) return;
GCShowGuildMemberInfo gcShowGuildMemberInfo;
gcShowGuildMemberInfo.setGuildID(pGuildMember->getGuildID());
gcShowGuildMemberInfo.setName(pGuildMember->getName());
gcShowGuildMemberInfo.setGuildMemberRank(pGuildMember->getRank());
gcShowGuildMemberInfo.setGuildMemberIntro(pGuildMember->getIntro());
pPlayer->sendPacket(&gcShowGuildMemberInfo);
#endif // __GAME_SERVER__
__END_DEBUG_EX __END_CATCH
}
示例3: execute
void CGModifyGuildMemberHandler::execute (CGModifyGuildMember* pPacket , Player* pPlayer)
throw(Error)
{
__BEGIN_TRY __BEGIN_DEBUG_EX
#ifdef __GAME_SERVER__
//cout << "CGModifyGuildMember received." << endl;
Assert(pPacket != NULL);
Assert(pPlayer != NULL);
SYSTEM_ASSERT(SYSTEM_GUILD);
GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pPlayer);
Assert(pGamePlayer != NULL);
Creature* pCreature = pGamePlayer->getCreature();
Assert(pCreature != NULL);
PlayerCreature* pPlayerCreature = dynamic_cast<PlayerCreature*>(pCreature);
Assert(pPlayerCreature != NULL);
// 길드를 가져온다.
Guild* pGuild = g_pGuildManager->getGuild(pPlayerCreature->getGuildID());
//try { Assert(pGuild != NULL); } catch (Throwable& t ) { return; }
if (pGuild==NULL) return;
// 길드 멤버 정보를 가져온다.
GuildMember* pGuildMember = pGuild->getMember(pPlayerCreature->getName());
//try { Assert(pGuild != NULL); } catch (Throwable& t ) { return; }
if (pGuildMember==NULL) return;
//cout << "get guild" << endl;
if (pPacket->getGuildMemberRank() == GuildMember::GUILDMEMBER_RANK_DENY )
{
////////////////////////////////////////////////////////
// 길드 멤버를 추방한다.
////////////////////////////////////////////////////////
// 마스터가 아니면 추방할 수 없다.
if (pGuildMember->getRank() != GuildMember::GUILDMEMBER_RANK_MASTER )
return;
if (g_pGuildManager->hasActiveWar(pGuild->getID() ) )
{
GCSystemMessage msg;
msg.setMessage(g_pStringPool->getString(STRID_CANNOT_KICK_DURING_WAR ));
pPlayer->sendPacket(&msg);
return;
}
GSExpelGuildMember gsExpelGuildMember;
gsExpelGuildMember.setGuildID(pGuild->getID());
gsExpelGuildMember.setName(pPacket->getName());
gsExpelGuildMember.setSender(pPlayerCreature->getName());
//cout << "send GSExpelGuildMember" << endl;
g_pSharedServerManager->sendPacket(&gsExpelGuildMember);
}
else
{
if (pGuild->getActiveMemberCount() >= MAX_GUILDMEMBER_ACTIVE_COUNT )
{
GCSystemMessage msg;
msg.setMessage(g_pStringPool->getString(STRID_CANNOT_ACCEPT_MORE_JOIN ));
pPlayer->sendPacket(&msg);
return;
}
///////////////////////////////////////////////////////
// 길드 가입을 승인한다.
///////////////////////////////////////////////////////
// 마스터나 서브마스터 이어야 한다.
if (pGuildMember->getRank() != GuildMember::GUILDMEMBER_RANK_MASTER
&& pGuildMember->getRank() != GuildMember::GUILDMEMBER_RANK_SUBMASTER )
return;
if (g_pGuildManager->hasActiveWar(pGuild->getID() ) )
{
GCSystemMessage msg;
msg.setMessage(g_pStringPool->getString(STRID_CANNOT_ACCEPT_DURING_WAR ));
pPlayer->sendPacket(&msg);
return;
}
GSModifyGuildMember gsModifyGuildMember;
gsModifyGuildMember.setGuildID(pGuild->getID());
gsModifyGuildMember.setName(pPacket->getName());
gsModifyGuildMember.setGuildMemberRank(pPacket->getGuildMemberRank());
gsModifyGuildMember.setSender(pPlayerCreature->getName());
//cout << "send GSModifyGuildMember" << endl;
g_pSharedServerManager->sendPacket(&gsModifyGuildMember);
}
//.........这里部分代码省略.........
示例4: execute
//----------------------------------------------------------------------
//
// SGModifyGuildOKHandler::execute()
//
//----------------------------------------------------------------------
void SGModifyGuildOKHandler::execute (SGModifyGuildOK* pPacket )
throw(ProtocolException , Error )
{
__BEGIN_TRY __BEGIN_DEBUG_EX
#ifdef __GAME_SERVER__
Guild* pGuild = g_pGuildManager->getGuild(pPacket->getGuildID());
Assert(pGuild != NULL);
if (pGuild->getState() == Guild::GUILD_STATE_WAIT && pPacket->getGuildState() == Guild::GUILD_STATE_ACTIVE )
{
/////////////////////////////////////////////////////////////
// 존 추가
/////////////////////////////////////////////////////////////
/* if (pGuild->getServerGroupID() == g_pConfig->getPropertyInt("ServerID" ) )
{
// 이 게임 서버에 길드 아지트를 만든다.
//////////////
// Zone Info
//////////////
ZoneInfo* pZoneInfo = new ZoneInfo();
pZoneInfo->setZoneID(pGuild->getZoneID());
pZoneInfo->setZoneGroupID(2);
pZoneInfo->setZoneType("NPC_SHOP");
pZoneInfo->setZoneLevel(0);
pZoneInfo->setZoneAccessMode("PUBLIC");
pZoneInfo->setZoneOwnerID("");
pZoneInfo->setPayPlay("");
if (pGuild->getRace() == Guild::GUILD_RACE_SLAYER )
{
pZoneInfo->setSMPFilename("team_hdqrs.smp");
pZoneInfo->setSSIFilename("team_hdqrs.ssi");
string Name = "team - " + pGuild->getName();
pZoneInfo->setFullName(Name);
pZoneInfo->setShortName(Name);
}
else if (pGuild->getRace() == Guild::GUILD_RACE_VAMPIRE )
{
pZoneInfo->setSMPFilename("clan_hdqrs.smp");
pZoneInfo->setSSIFilename("clan_hdqrs.ssi");
string Name = "clan - " + pGuild->getName();
pZoneInfo->setFullName(Name);
pZoneInfo->setShortName(Name);
}
g_pZoneInfoManager->addZoneInfo(pZoneInfo);
/////////
// Zone
/////////
Zone* pZone = new Zone(pGuild->getZoneID());
Assert(pZone != NULL);
ZoneGroup* pZoneGroup = g_pZoneGroupManager->getZoneGroup(2);
Assert(pZoneGroup != NULL);
pZone->setZoneGroup(pZoneGroup);
pZoneGroup->addZone(pZone);
pZone->init();
}
*/
// 정식 길드로 변경
pGuild->setState(Guild::GUILD_STATE_ACTIVE);
HashMapGuildMember& Members = pGuild->getMembers();
HashMapGuildMemberItor itr = Members.begin();
for (; itr != Members.end(); itr++ )
{
GuildMember* pGuildMember = itr->second;
// 멤버가 접속해 있다면
__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);
PlayerCreature* pPlayerCreature = dynamic_cast<PlayerCreature*>(pCreature);
Assert(pPlayerCreature != NULL);
// 길드 아이디를 바꿔준다.
pPlayerCreature->setGuildID(pGuild->getID());
// 클라이언트에 길드 아이디가 바꼈음을 알려준다.
GCModifyGuildMemberInfo gcModifyGuildMemberInfo;
gcModifyGuildMemberInfo.setGuildID(pGuild->getID());
gcModifyGuildMemberInfo.setGuildName(pGuild->getName());
gcModifyGuildMemberInfo.setGuildMemberRank(pGuildMember->getRank());
pPlayer->sendPacket(&gcModifyGuildMemberInfo);
//.........这里部分代码省略.........
示例5: execute
//.........这里部分代码省略.........
Zone* pZone = pCreature->getZone();
Assert(pZone != NULL);
pZone->broadcastPacket(pCreature->getX(), pCreature->getY(), &gcOtherModifyInfo, pCreature);
}
__LEAVE_CRITICAL_SECTION((*g_pPCFinder))
// Guild Member 객체를 삭제한다.
SAFE_DELETE(pGuildMember);
}
// 길드 멤버 맵을 삭제한다.
Members.clear();
// 길드 매니저에서 길드를 삭제한다.
g_pGuildManager->deleteGuild(pGuild->getID());
// 길드 객체를 삭제한다.
SAFE_DELETE(pGuild);
}
else if (pGuild->getState() == Guild::GUILD_STATE_WAIT )
{
HashMapGuildMember& Members = pGuild->getMembers();
HashMapGuildMemberItor itr = Members.begin();
Statement* pStmt = NULL;
Result* pResult = NULL;
BEGIN_DB
{
pStmt = g_pDatabaseManager->getConnection("DARKEDEN" )->createStatement();
for (; itr != Members.end(); itr++ )
{
GuildMember* pGuildMember = itr->second;
// 접속해 있으면
__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);
PlayerCreature* pPlayerCreature = dynamic_cast<PlayerCreature*>(pCreature);
Assert(pPlayerCreature != NULL);
// 등록비를 환불한다.
Gold_t Gold = pPlayerCreature->getGold();
if (pGuildMember->getRank() == GuildMember::GUILDMEMBER_RANK_MASTER )
{
Gold = min((uint64_t)(Gold + RETURN_SLAYER_MASTER_GOLD), (uint64_t)2000000000);
}
else if (pGuildMember->getRank() == GuildMember::GUILDMEMBER_RANK_SUBMASTER )
{
Gold = min((uint64_t)(Gold + RETURN_SLAYER_SUBMASTER_GOLD), (uint64_t)2000000000);
}
pPlayerCreature->setGoldEx(Gold);
GCModifyInformation gcModifyInformation;
gcModifyInformation.addLongData(MODIFY_GOLD, Gold);
pPlayer->sendPacket(&gcModifyInformation);
// 메시지를 보낸다.
pResult = pStmt->executeQuery("SELECT Message FROM Messages WHERE Receiver = '%s'", pCreature->getName().c_str());
while (pResult->next() )
{
GCSystemMessage message;
message.setMessage(pResult->getString(1));
pPlayer->sendPacket(&message);
}
pStmt->executeQuery("DELETE FROM Messages WHERE Receiver = '%s'", pCreature->getName().c_str());
}
__LEAVE_CRITICAL_SECTION((*g_pPCFinder))
// 길드 멤버 객체를 삭제한다.
SAFE_DELETE(pGuildMember);
}
// 길드 멤버 해쉬 맵을 지운다.
Members.clear();
// 길드 매니저에서 길드를 삭제한다.
g_pGuildManager->deleteGuild(pGuild->getID());
GuildUnionManager::Instance().removeMasterGuild(pGuild->getID());
// 길드 객체를 삭제한다.
SAFE_DELETE(pGuild);
SAFE_DELETE(pStmt);
}
END_DB(pStmt)
}
示例6: 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" ) ) // 이 게임 서버에서 추가한 길드원인가?
{
//.........这里部分代码省略.........