Merge branch 'essmaster' into essrelease

This commit is contained in:
KHobbits 2011-09-27 02:01:52 +01:00
commit 3dc29be083
4 changed files with 20 additions and 10 deletions

View file

@ -108,7 +108,8 @@ public class EssentialsPlayerListener extends PlayerListener
}
Location afk = user.getAfkPosition();
if (afk == null || !event.getTo().getWorld().equals(afk.getWorld()) || afk.distanceSquared(event.getTo()) > 9) {
if (afk == null || !event.getTo().getWorld().equals(afk.getWorld()) || afk.distanceSquared(event.getTo()) > 9)
{
user.updateActivity(true);
}
@ -314,14 +315,13 @@ public class EssentialsPlayerListener extends PlayerListener
user.setNPC(false);
final long currentTime = System.currentTimeMillis();
user.checkBanTimeout(currentTime);
boolean banExpired = user.checkBanTimeout(currentTime);
user.checkMuteTimeout(currentTime);
user.checkJailTimeout(currentTime);
if (user.isBanned() || event.getResult() == Result.KICK_BANNED)
if (banExpired == false && (user.isBanned() || event.getResult() == Result.KICK_BANNED))
{
final String banReason = user.getBanReason();
LOGGER.log(Level.INFO, "Banned for '" + banReason + "'");
event.disallow(Result.KICK_BANNED, banReason != null && !banReason.isEmpty() && !banReason.equalsIgnoreCase("ban") ? banReason : Util.i18n("defaultBanReason"));
return;
}

View file

@ -381,7 +381,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
this.hidden = hidden;
}
public void checkJailTimeout(final long currentTime)
//Returns true if status expired during this check
public boolean checkJailTimeout(final long currentTime)
{
if (getJailTimeout() > 0 && getJailTimeout() < currentTime && isJailed())
{
@ -396,26 +397,34 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
catch (Exception ex)
{
}
return true;
}
return false;
}
public void checkMuteTimeout(final long currentTime)
//Returns true if status expired during this check
public boolean checkMuteTimeout(final long currentTime)
{
if (getMuteTimeout() > 0 && getMuteTimeout() < currentTime && isMuted())
{
setMuteTimeout(0);
sendMessage(Util.i18n("canTalkAgain"));
setMuted(false);
return true;
}
return false;
}
public void checkBanTimeout(final long currentTime)
//Returns true if status expired during this check
public boolean checkBanTimeout(final long currentTime)
{
if (getBanTimeout() > 0 && getBanTimeout() < currentTime && isBanned())
{
setBanTimeout(0);
setBanned(false);
return true;
}
return false;
}
public void updateActivity(final boolean broadcast)

View file

@ -21,4 +21,5 @@ v 1.1:
- Removed superperms update on plugins unloading. Unneeded and created undesired lag on shutdown.
- Added a BukkitPermsUpdateTask to only update superperms once on a load/reload.
- Fix for GM not checking inheritance for known superperms nodes.
- Optimized getAllPlayersPermissions and fixed pushing unknown perms to superperms.
- Optimized getAllPlayersPermissions and fixed pushing unknown perms to superperms.
v 1.2:

View file

@ -1,5 +1,5 @@
name: GroupManager
version: "1.1 (Phoenix)"
version: "1.2 (Phoenix)"
main: org.anjocaido.groupmanager.GroupManager
website: http://www.anjocaido.info/
description: Provides on-the-fly system for permissions system created by Nijikokun. But all in memory, and with flat-file saving schedule.