本文整理汇总了C++中Guild::GetMemberSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Guild::GetMemberSize方法的具体用法?C++ Guild::GetMemberSize怎么用?C++ Guild::GetMemberSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Guild
的用法示例。
在下文中一共展示了Guild::GetMemberSize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleGuildDisbandOpcode
void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/)
{
DEBUG_LOG("WORLD: Received opcode CMSG_GUILD_DISBAND");
Guild* guild = sGuildMgr.GetGuildById(GetPlayer()->GetGuildId());
if (!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
return;
}
if (GetPlayer()->GetObjectGuid() != guild->GetLeaderGuid())
{
SendGuildCommandResult(GUILD_INVITE_S, "", ERR_GUILD_PERMISSIONS);
return;
}
// do not delete guilds that level are higher than undeletable
if (guild->GetMemberSize() == 1 && guild->GetLevel() >= sWorld.getConfig(CONGIG_UINT32_GUILD_UNDELETABLE_LEVEL))
{
SendGuildCommandResult(GUILD_INVITE_S, "", ERR_GUILD_UNDELETABLE_DUE_TO_LEVEL);
return;
}
guild->Disband();
delete guild;
DEBUG_LOG("WORLD: Guild Successfully Disbanded");
}
示例2: HandleGuildLeaveOpcode
void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
{
sLog.outDebug("WORLD: Received CMSG_GUILD_LEAVE");
Guild *guild = sObjectMgr.GetGuildById(_player->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
return;
}
if(_player->GetGUID() == guild->GetLeader() && guild->GetMemberSize() > 1)
{
SendGuildCommandResult(GUILD_QUIT_S, "", ERR_GUILD_LEADER_LEAVE);
return;
}
if(_player->GetGUID() == guild->GetLeader())
{
guild->Disband();
return;
}
guild->DelMember(_player->GetGUID());
// Put record into guild log
guild->LogGuildEvent(GUILD_EVENT_LOG_LEAVE_GUILD, _player->GetGUIDLow(), 0, 0);
guild->BroadcastEvent(GE_LEFT, _player->GetGUID(), 1, _player->GetName(), "", "");
SendGuildCommandResult(GUILD_QUIT_S, guild->GetName(), ERR_PLAYER_NO_MORE_IN_GUILD);
}
示例3: HandleGuildLeaveOpcode
void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
{
DEBUG_LOG("WORLD: Received opcode CMSG_GUILD_LEAVE");
Guild* guild = sGuildMgr.GetGuildById(_player->GetGuildId());
if (!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
return;
}
if (_player->GetObjectGuid() == guild->GetLeaderGuid() && guild->GetMemberSize() > 1)
{
SendGuildCommandResult(GUILD_QUIT_S, "", ERR_GUILD_LEADER_LEAVE);
return;
}
// do not delete guilds that level are higher than undeletable
if (guild->GetMemberSize() == 1 && guild->GetLevel() >= sWorld.getConfig(CONGIG_UINT32_GUILD_UNDELETABLE_LEVEL))
{
SendGuildCommandResult(GUILD_INVITE_S, "", ERR_GUILD_UNDELETABLE_DUE_TO_LEVEL);
return;
}
sCalendarMgr.RemoveGuildCalendar(_player->GetObjectGuid(), guild->GetId());
if (_player->GetObjectGuid() == guild->GetLeaderGuid())
{
guild->Disband();
delete guild;
return;
}
SendGuildCommandResult(GUILD_QUIT_S, guild->GetName(), ERR_PLAYER_NO_MORE_IN_GUILD);
if (guild->DelMember(_player->GetObjectGuid()))
{
guild->Disband();
delete guild;
return;
}
// Put record into guild log
guild->LogGuildEvent(GUILD_EVENT_LOG_LEAVE_GUILD, _player->GetObjectGuid());
guild->BroadcastEvent(GE_LEFT, _player->GetObjectGuid(), _player->GetName());
}
示例4: HandleGuildInfoOpcode
void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/)
{
DEBUG_LOG("WORLD: Received opcode CMSG_GUILD_INFO");
Guild* guild = sGuildMgr.GetGuildById(GetPlayer()->GetGuildId());
if (!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
return;
}
WorldPacket data(SMSG_GUILD_INFO, (guild->GetName().size() + 4 + 4 + 4));
data << guild->GetName();
data << uint32(secsToTimeBitFields(guild->GetCreatedDate())); // 3.x (prev. day + month + year)
data << uint32(guild->GetMemberSize()); // amount of chars
data << uint32(guild->GetAccountsNumber()); // amount of accounts
SendPacket(&data);
}
示例5: HandleGuildLeaveOpcode
void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
{
std::string plName;
Guild *guild;
//sLog.outDebug("WORLD: Received CMSG_GUILD_LEAVE");
guild = objmgr.GetGuildById(_player->GetGuildId());
if(!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", GUILD_PLAYER_NOT_IN_GUILD);
return;
}
if(_player->GetGUID() == guild->GetLeader() && guild->GetMemberSize() > 1)
{
SendGuildCommandResult(GUILD_QUIT_S, "", GUILD_LEADER_LEAVE);
return;
}
if(_player->GetGUID() == guild->GetLeader())
{
guild->Disband();
return;
}
plName = _player->GetName();
guild->DelMember(_player->GetGUID());
// Put record into guildlog
guild->LogGuildEvent(GUILD_EVENT_LOG_LEAVE_GUILD, _player->GetGUIDLow(), 0, 0);
WorldPacket data(SMSG_GUILD_EVENT, (2+10)); // guess size
data << (uint8)GE_LEFT;
data << (uint8)1; // strings count
data << plName;
guild->BroadcastPacket(&data);
//sLog.outDebug("WORLD: Sent (SMSG_GUILD_EVENT)");
SendGuildCommandResult(GUILD_QUIT_S, guild->GetName(), GUILD_PLAYER_NO_MORE_IN_GUILD);
}
示例6: HandleGuildLeaveOpcode
void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/)
{
DEBUG_LOG("WORLD: Received opcode CMSG_GUILD_LEAVE");
Guild* guild = sGuildMgr.GetGuildById(_player->GetGuildId());
if (!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
return;
}
if (_player->GetObjectGuid() == guild->GetLeaderGuid() && guild->GetMemberSize() > 1)
{
SendGuildCommandResult(GUILD_QUIT_S, "", ERR_GUILD_LEADER_LEAVE);
return;
}
if (_player->GetObjectGuid() == guild->GetLeaderGuid())
{
guild->Disband();
delete guild;
return;
}
SendGuildCommandResult(GUILD_QUIT_S, guild->GetName(), ERR_PLAYER_NO_MORE_IN_GUILD);
if (guild->DelMember(_player->GetObjectGuid()))
{
guild->Disband();
delete guild;
return;
}
// Put record into guild log
guild->LogGuildEvent(GUILD_EVENT_LOG_LEAVE_GUILD, _player->GetObjectGuid());
guild->BroadcastEvent(GE_LEFT, _player->GetObjectGuid(), _player->GetName());
}
示例7: HandleGuildRemoveOpcode
void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket)
{
DEBUG_LOG("WORLD: Received opcode CMSG_GUILD_REMOVE");
std::string plName;
ObjectGuid targetGuid;
recvPacket.ReadGuidMask<6, 5, 4, 0, 1, 3, 7, 2>(targetGuid);
recvPacket.ReadGuidBytes<2, 6, 5, 7, 1, 4, 3, 0>(targetGuid);
Guild* guild = sGuildMgr.GetGuildById(GetPlayer()->GetGuildId());
if (!guild)
{
SendGuildCommandResult(GUILD_CREATE_S, "", ERR_GUILD_PLAYER_NOT_IN_GUILD);
return;
}
if (!guild->HasRankRight(GetPlayer()->GetRank(), GR_RIGHT_REMOVE))
{
SendGuildCommandResult(GUILD_INVITE_S, "", ERR_GUILD_PERMISSIONS);
return;
}
if (!sObjectMgr.GetPlayerNameByGUID(targetGuid, plName))
return;
MemberSlot* slot = guild->GetMemberSlot(targetGuid);
if (!slot)
{
SendGuildCommandResult(GUILD_INVITE_S, plName, ERR_GUILD_PLAYER_NOT_IN_GUILD_S);
return;
}
if (slot->RankId == GR_GUILDMASTER)
{
SendGuildCommandResult(GUILD_QUIT_S, "", ERR_GUILD_LEADER_LEAVE);
return;
}
// do not allow to kick player with same or higher rights
if (GetPlayer()->GetRank() >= slot->RankId)
{
SendGuildCommandResult(GUILD_QUIT_S, plName, ERR_GUILD_RANK_TOO_HIGH_S);
return;
}
// do not delete guilds that level are higher than undeletable
if (guild->GetMemberSize() == 1 && guild->GetLevel() >= sWorld.getConfig(CONGIG_UINT32_GUILD_UNDELETABLE_LEVEL))
{
SendGuildCommandResult(GUILD_INVITE_S, "", ERR_GUILD_UNDELETABLE_DUE_TO_LEVEL);
return;
}
// possible last member removed, do cleanup, and no need events
if (guild->DelMember(slot->guid))
{
guild->Disband();
delete guild;
return;
}
// Put record into guild log
guild->LogGuildEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, GetPlayer()->GetObjectGuid(), slot->guid);
guild->BroadcastEvent(GE_REMOVED, plName.c_str(), _player->GetName());
}