summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-07 02:59:56 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-04-07 02:59:56 +0000
commit5c51ce020b0ade82162907afe93d9ca8319e5eeb (patch)
treed545f010a0d8fc3c892784d4145ffcd553f4df96
parent242d7abd31b519a9ed46433acdd534fd8548bf15 (diff)
downloadEssentials-5c51ce020b0ade82162907afe93d9ca8319e5eeb.tar
Essentials-5c51ce020b0ade82162907afe93d9ca8319e5eeb.tar.gz
Essentials-5c51ce020b0ade82162907afe93d9ca8319e5eeb.tar.lz
Essentials-5c51ce020b0ade82162907afe93d9ca8319e5eeb.tar.xz
Essentials-5c51ce020b0ade82162907afe93d9ca8319e5eeb.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.java92
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")