New setting factionMemberLimit (default 0, no limit), which will prevent players from joining any faction that has reached this membership limit.

This commit is contained in:
Brettflan 2012-02-24 06:30:18 -06:00
parent 967870a582
commit c1f5475d0c
2 changed files with 14 additions and 5 deletions

View File

@ -40,6 +40,9 @@ public class Conf
public static boolean newFactionsDefaultOpen = false; public static boolean newFactionsDefaultOpen = false;
// when faction membership hits this limit, players will no longer be able to join using /f join; default is 0, no limit
public static int factionMemberLimit = 0;
// what faction ID to start new players in when they first join the server; default is 0, "no faction" // what faction ID to start new players in when they first join the server; default is 0, "no faction"
public static String newPlayerStartingFactionID = "0"; public static String newPlayerStartingFactionID = "0";

View File

@ -42,6 +42,12 @@ public class CmdJoin extends FCommand
return; return;
} }
if (Conf.factionMemberLimit > 0 && faction.getFPlayers().size() >= Conf.factionMemberLimit)
{
msg("<b>The faction %s is at the limit of %d members, so you cannot currently join.", faction.getTag(fme));
return;
}
if (fme.hasFaction()) if (fme.hasFaction())
{ {
msg("<b>You must leave your current faction first."); msg("<b>You must leave your current faction first.");