Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ADDED: A guild member count cap, above a certain count clients within…

… the guild lock up, the added cap is the same as Blizzard had for 3.3.5a ( 500 members )
  • Loading branch information...
commit e2cd951742637310ae28a7f5f3a6b885b34b78cb 1 parent 6ba74cf
@dfighter1985 dfighter1985 authored
View
6 src/arcemu-world/Guild.h
@@ -23,7 +23,11 @@
class PlayerInfo;
-#define MAX_GUILD_RANKS 10
+enum{
+ MAX_GUILD_RANKS = 10,
+ MAX_GUILD_MEMBERS = 500
+};
+
enum PETITION_TURNIN_ERRORS
{
ERR_PETITION_OK,
View
19 src/arcemu-world/GuildHandler.cpp
@@ -90,6 +90,16 @@ void WorldSession::HandleInviteToGuild(WorldPacket & recv_data)
Guild::SendGuildCommandResult(this, GUILD_INVITE_S, "", GUILD_NOT_ALLIED);
return;
}
+
+ pGuild->getLock().Acquire();
+ uint32 memberCount = pGuild->GetNumMembers();
+ pGuild->getLock().Release();
+
+ if( memberCount >= MAX_GUILD_MEMBERS ){
+ SystemMessage( "Your guild is full." );
+ return;
+ }
+
Guild::SendGuildCommandResult(this, GUILD_INVITE_S, inviteeName.c_str(), GUILD_U_HAVE_INVITED);
//41
@@ -123,6 +133,15 @@ void WorldSession::HandleGuildAccept(WorldPacket & recv_data)
{
return;
}
+ pGuild->getLock().Acquire();
+ uint32 memberCount = pGuild->GetNumMembers();
+ pGuild->getLock().Release();
+
+ if( memberCount >= MAX_GUILD_MEMBERS ){
+ plyr->UnSetGuildInvitersGuid();
+ SystemMessage( "That guild is full." );
+ return;
+ }
pGuild->AddGuildMember(plyr->m_playerInfo, NULL);
}
View
9 src/arcemu-world/Level3.cpp
@@ -3692,6 +3692,15 @@ bool ChatHandler::HandleGuildJoinCommand(const char* args, WorldSession* m_sessi
if(pGuild)
{
+ pGuild->getLock().Acquire();
+ uint32 memberCount = pGuild->GetNumMembers();
+ pGuild->getLock().Release();
+
+ if( memberCount >= MAX_GUILD_MEMBERS ){
+ m_session->SystemMessage( "That guild is full." );
+ return true;
+ }
+
pGuild->AddGuildMember(ptarget->getPlayerInfo(), m_session, -2);
GreenSystemMessage(m_session, "You have joined the guild '%s'", pGuild->GetGuildName());
sGMLog.writefromsession(m_session, "Force joined guild '%s'", pGuild->GetGuildName());
Please sign in to comment.
Something went wrong with that request. Please try again.