If "autoLeaveAfterDaysOfInactivity" is set to 0.0 or a negative number, it's now effectively disabled

Renamed "disablePVPBetweenNeutralFaction" to "disablePVPBetweenNeutralFactions" because the grammar nazi in me calls for it
a couple of minor optimizations
finally, include gson.jar in the lib folder
This commit is contained in:
Brettflan 2011-07-29 05:12:14 -05:00
parent e36e1419e9
commit e3cb829e6b
4 changed files with 9 additions and 5 deletions

BIN
lib/gson.jar Normal file

Binary file not shown.

View File

@ -71,7 +71,7 @@ public class Conf {
public static double homesTeleportAllowedEnemyDistance = 32;
public static boolean homesTeleportIgnoreEnemiesIfInOwnTerritory = true;
public static boolean disablePVPBetweenNeutralFaction = false;
public static boolean disablePVPBetweenNeutralFactions = false;
public static boolean disablePVPForFactionlessPlayers = false;
public static int noPVPDamageToOthersForXSecondsAfterLogin = 3;

View File

@ -673,6 +673,10 @@ public class FPlayer {
}
public static void autoLeaveOnInactivityRoutine() {
if (Conf.autoLeaveAfterDaysOfInactivity <= 0.0) {
return;
}
long now = System.currentTimeMillis();
double toleranceMillis = Conf.autoLeaveAfterDaysOfInactivity * 24 * 60 * 60 * 1000;

View File

@ -189,13 +189,13 @@ public class FactionsEntityListener extends EntityListener {
Relation relation = defender.getRelation(attacker);
// You can not hurt neutral factions
if (relation.isNeutral() && Conf.disablePVPBetweenNeutralFaction) {
attacker.sendMessage("You can't hurt neutral factions");
return false;
if (Conf.disablePVPBetweenNeutralFactions && relation.isNeutral()) {
attacker.sendMessage("You can't hurt neutral factions");
return false;
}
// Players without faction may be hurt anywhere
if (defender.getFaction().isNone()) {
if (!defender.hasFaction()) {
return true;
}