diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-07 02:59:56 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-07 02:59:56 +0000 |
commit | 3908443717ba29ebcab3ff7e8f9971a1e2aad3b8 (patch) | |
tree | 30cb748029beed8083f5976440bc04ece9659e80 | |
parent | 46e6276c6373f42657ca6b76ae6dbdcbf58e2040 (diff) | |
download | Essentials-3908443717ba29ebcab3ff7e8f9971a1e2aad3b8.tar Essentials-3908443717ba29ebcab3ff7e8f9971a1e2aad3b8.tar.gz Essentials-3908443717ba29ebcab3ff7e8f9971a1e2aad3b8.tar.lz Essentials-3908443717ba29ebcab3ff7e8f9971a1e2aad3b8.tar.xz Essentials-3908443717ba29ebcab3ff7e8f9971a1e2aad3b8.zip |
[trunk] New base class for User for storing all data.
More data for future use.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1143 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/UserData.java | 92 |
1 files changed, 91 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/UserData.java b/Essentials/src/com/earth2me/essentials/UserData.java index 8342f9686..d7a6ff2e2 100644 --- a/Essentials/src/com/earth2me/essentials/UserData.java +++ b/Essentials/src/com/earth2me/essentials/UserData.java @@ -42,8 +42,11 @@ public abstract class UserData extends PlayerExtension implements IConf { ignoredPlayers = getIgnoredPlayers(); godmode = getGodModeEnabled(); muted = getMuted(); + muteTimeout = _getMuteTimeout(); jailed = getJailed(); - + jailTimeout = _getJailTimeout(); + lastLogin = _getLastLogin(); + lastLogout = _getLastLogout(); } public double getMoney() { @@ -239,6 +242,10 @@ public abstract class UserData extends PlayerExtension implements IConf { return config.getStringList("mail", new ArrayList<String>()); } + public List<String> getMails() { + return mails; + } + public void setMails(List<String> mails) { if (mails == null) { config.removeProperty("mail"); @@ -384,6 +391,22 @@ public abstract class UserData extends PlayerExtension implements IConf { return ret; } + private long muteTimeout; + + private long _getMuteTimeout() { + return config.getLong("timestamps.mute", 0); + } + + public long getMuteTimeout() { + return muteTimeout; + } + + public void setMuteTimeout(long time) { + muteTimeout = time; + config.setProperty("timestamps.mute", time); + config.save(); + } + private boolean jailed; private boolean getJailed() { @@ -406,6 +429,73 @@ public abstract class UserData extends PlayerExtension implements IConf { return ret; } + private long jailTimeout; + + private long _getJailTimeout() { + return config.getLong("timestamps.jail", 0); + } + + public long getJailTimeout() { + return jailTimeout; + } + + public void setJailTimeout(long time) { + jailTimeout = time; + config.setProperty("timestamps.jail", time); + config.save(); + } + + + public String getBanReason() { + return config.getString("ban.reason"); + } + + public void setBanReason(String reason) { + config.setProperty("ban.reason", reason); + config.save(); + } + + public long getBanTimeout() { + return config.getLong("ban.timeout", 0); + } + + public void setBanTimeout(long time) { + config.setProperty("ban.timeout", time); + config.save(); + } + + private long lastLogin; + + private long _getLastLogin() { + return config.getLong("timestamps.login", 0); + } + + public long getLastLogin() { + return lastLogin; + } + + public void setLastLogin(long time) { + lastLogin = time; + config.setProperty("timestamps.login", time); + config.save(); + } + + private long lastLogout; + + private long _getLastLogout() { + return config.getLong("timestamps.logout", 0); + } + + public long getLastLogout() { + return lastLogout; + } + + public void setLastLogout(long time) { + lastLogout = time; + config.setProperty("timestamps.logout", time); + config.save(); + } + private void updateConfig() { if (config.hasProperty("home") && !config.hasProperty("home.default")) { @SuppressWarnings("unchecked") |