Some dead code elimination

This commit is contained in:
Olof Larsson
2011-10-24 03:02:25 +02:00
parent 46161f61db
commit 074be07510
10 changed files with 40 additions and 296 deletions

View File

@@ -25,9 +25,9 @@ public class Faction extends Entity implements EconomyParticipator
// FIELD: invites
// Where string is a lowercase player name
private Set<String> invites;
public void invite(FPlayer fplayer) { this.invites.add(fplayer.getName().toLowerCase()); }
public void deinvite(FPlayer fplayer) { this.invites.remove(fplayer.getName().toLowerCase()); }
public boolean isInvited(FPlayer fplayer) { return this.invites.contains(fplayer.getName().toLowerCase()); }
public void invite(FPlayer fplayer) { this.invites.add(fplayer.getId().toLowerCase()); }
public void deinvite(FPlayer fplayer) { this.invites.remove(fplayer.getId().toLowerCase()); }
public boolean isInvited(FPlayer fplayer) { return this.invites.contains(fplayer.getId().toLowerCase()); }
// FIELD: open
private boolean open;
@@ -84,9 +84,6 @@ public class Faction extends Entity implements EconomyParticipator
this.home = null;
}
// FIELD: lastPlayerLoggedOffTime
private transient long lastPlayerLoggedOffTime;
// FIELD: account (fake field)
// Bank functions
public double money;
@@ -161,9 +158,6 @@ public class Faction extends Entity implements EconomyParticipator
this.open = Conf.newFactionsDefaultOpen;
this.tag = "???";
this.description = "Default faction description :(";
this.lastPlayerLoggedOffTime = 0;
//this.peaceful = false;
//this.peacefulExplosionsEnabled = false;
this.money = 0.0;
this.flagOverrides = new LinkedHashMap<FFlag, Boolean>();
this.permOverrides = new LinkedHashMap<FPerm, Set<Rel>>();
@@ -242,6 +236,7 @@ public class Faction extends Entity implements EconomyParticipator
}
}
// TODO: Implement a has enough feature.
//----------------------------------------------//
// Power
//----------------------------------------------//
@@ -390,34 +385,6 @@ public class Faction extends Entity implements EconomyParticipator
return ret;
}
// slightly faster check than getOnlinePlayers() if you just want to see if there are any players online
public boolean hasPlayersOnline()
{
// only real factions can have players online, not safe zone / war zone
//if (this.isPlayerFreeType()) return false;
for (Player player: P.p.getServer().getOnlinePlayers())
{
FPlayer fplayer = FPlayers.i.get(player);
if (fplayer.getFaction() == this)
{
return true;
}
}
// even if all players are technically logged off, maybe someone was on recently enough to not consider them officially offline yet
if (Conf.considerFactionsReallyOfflineAfterXMinutes > 0 && System.currentTimeMillis() < lastPlayerLoggedOffTime + (Conf.considerFactionsReallyOfflineAfterXMinutes * 60000))
{
return true;
}
return false;
}
public void memberLoggedOff()
{
lastPlayerLoggedOffTime = System.currentTimeMillis();
}
//----------------------------------------------//
// Messages
//----------------------------------------------//