Fixed disband exploit

This commit is contained in:
ProSavage 2018-12-23 18:20:54 -06:00
parent 266c598b76
commit 7be48b5942
7 changed files with 15 additions and 7 deletions

View File

@ -3,11 +3,12 @@
<groupId>com.massivecraft</groupId> <groupId>com.massivecraft</groupId>
<artifactId>Factions</artifactId> <artifactId>Factions</artifactId>
<versioning> <versioning>
<release>1.6.9.5-U0.2.1-RC-1.5-BETA-2</release> <release>1.6.9.5-U0.2.1-RC-1.5-STABLE</release>
<versions> <versions>
<version>1.6.9.5-U0.2.1-RC-1.5-BETA</version> <version>1.6.9.5-U0.2.1-RC-1.5-BETA</version>
<version>1.6.9.5-U0.2.1-RC-1.5-BETA-2</version> <version>1.6.9.5-U0.2.1-RC-1.5-BETA-2</version>
<version>1.6.9.5-U0.2.1-RC-1.5-STABLE</version>
</versions> </versions>
<lastUpdated>20181221214408</lastUpdated> <lastUpdated>20181222234636</lastUpdated>
</versioning> </versioning>
</metadata> </metadata>

View File

@ -1 +1 @@
e9ce0bdae55853de86510ddacb671877 53a6a6cb7d4b4409eeaa35c1fababa7c

View File

@ -1 +1 @@
694467945b9eeace46a9acb0cfd0fddc9c87fad8 6322473e3dc1d937e8d27f82b10f12ac42f8fbb4

View File

@ -4,7 +4,7 @@
<groupId>com.massivecraft</groupId> <groupId>com.massivecraft</groupId>
<artifactId>Factions</artifactId> <artifactId>Factions</artifactId>
<version>1.6.9.5-U0.2.1-RC-1.5-BETA-2</version> <version>1.6.9.5-U0.2.1-RC-1.5-STABLE</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>SavageFactions</name> <name>SavageFactions</name>

View File

@ -273,6 +273,8 @@ public interface Faction extends EconomyParticipator {
FPlayer getFPlayerAdmin(); FPlayer getFPlayerAdmin();
FPlayer getFPlayerLeader();
ArrayList<FPlayer> getFPlayersWhereRole(Role role); ArrayList<FPlayer> getFPlayersWhereRole(Role role);
ArrayList<Player> getOnlinePlayers(); ArrayList<Player> getOnlinePlayers();

View File

@ -47,7 +47,7 @@ public class CmdDisband extends FCommand {
if (!fme.isAdminBypassing()) { if (!fme.isAdminBypassing()) {
Access access = faction.getAccess(fme, PermissableAction.DISBAND); Access access = faction.getAccess(fme, PermissableAction.DISBAND);
if (fme.getRole() != Role.LEADER && access != Access.ALLOW) { if (fme.getRole() != Role.LEADER && faction.getFPlayerLeader() != fme && access != Access.ALLOW) {
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "disband " + faction.getTag()); fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "disband " + faction.getTag());
return; return;
} }

View File

@ -917,6 +917,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
return ret; return ret;
} }
public FPlayer getFPlayerAdmin() { public FPlayer getFPlayerAdmin() {
if (!this.isNormal()) { if (!this.isNormal()) {
return null; return null;
@ -930,6 +931,10 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
return null; return null;
} }
public FPlayer getFPlayerLeader() {
return getFPlayerAdmin();
}
public ArrayList<FPlayer> getFPlayersWhereRole(Role role) { public ArrayList<FPlayer> getFPlayersWhereRole(Role role) {
ArrayList<FPlayer> ret = new ArrayList<>(); ArrayList<FPlayer> ret = new ArrayList<>();
if (!this.isNormal()) { if (!this.isNormal()) {