diff --git a/CompiledServer/production/RS-2009/org/crandor/game/node/entity/player/info/PlayerDetails.class b/CompiledServer/production/RS-2009/org/crandor/game/node/entity/player/info/PlayerDetails.class index 83cf56620..ba559d635 100644 Binary files a/CompiledServer/production/RS-2009/org/crandor/game/node/entity/player/info/PlayerDetails.class and b/CompiledServer/production/RS-2009/org/crandor/game/node/entity/player/info/PlayerDetails.class differ diff --git a/CompiledServer/production/RS-2009/org/crandor/game/node/entity/player/info/portal/PlayerSQLManager.class b/CompiledServer/production/RS-2009/org/crandor/game/node/entity/player/info/portal/PlayerSQLManager.class index d31dbdf96..51db9abe6 100644 Binary files a/CompiledServer/production/RS-2009/org/crandor/game/node/entity/player/info/portal/PlayerSQLManager.class and b/CompiledServer/production/RS-2009/org/crandor/game/node/entity/player/info/portal/PlayerSQLManager.class differ diff --git a/Server/src/org/crandor/game/node/entity/player/info/PlayerDetails.java b/Server/src/org/crandor/game/node/entity/player/info/PlayerDetails.java index 2041b3cf6..b01eb1cc9 100644 --- a/Server/src/org/crandor/game/node/entity/player/info/PlayerDetails.java +++ b/Server/src/org/crandor/game/node/entity/player/info/PlayerDetails.java @@ -50,11 +50,16 @@ public class PlayerDetails { * The unique id of the account. */ private int uid; - + /** * The account's last game login. */ private long lastLogin = -1; + + /** + * The account's last game login. + */ + private long timePlayed = 0; /** * The time the player is muted for. @@ -370,7 +375,7 @@ public class PlayerDetails { public void setIcon(Icon icon) { this.icon = icon; } - + /** * Gets the lastLogin. * @return the lastLogin. @@ -386,6 +391,22 @@ public class PlayerDetails { public void setLastLogin(long lastLogin) { this.lastLogin = lastLogin; } + + /** + * Gets the timePlayed. + * @return the timePlayed. + */ + public long getTimePlayed() { + return timePlayed; + } + + /** + * Sets the timePlayed. + * @param timePlayed the timePlayed to set + */ + public void setTimePlayed(long timePlayed) { + this.timePlayed = timePlayed; + } /** * Sets the mute time. diff --git a/Server/src/org/crandor/game/node/entity/player/info/portal/PlayerSQLManager.java b/Server/src/org/crandor/game/node/entity/player/info/portal/PlayerSQLManager.java index d96bcb230..ce4b24abb 100644 --- a/Server/src/org/crandor/game/node/entity/player/info/portal/PlayerSQLManager.java +++ b/Server/src/org/crandor/game/node/entity/player/info/portal/PlayerSQLManager.java @@ -87,6 +87,7 @@ public final class PlayerSQLManager { details.setRights(Rights.forId((int) table.getColumn("rights").getValue())); details.setDonatorType(DonatorType.forId((int) table.getColumn("donatorType").getValue())); details.setLastLogin(System.currentTimeMillis()); + details.setTimePlayed((long) table.getColumn("timePlayed").getValue()); return true; } @@ -113,7 +114,7 @@ public final class PlayerSQLManager { table.getColumn("netWorth").updateValue(player.getMonitor().getNetworth()); table.getColumn("lastGameIp").updateValue(player.getDetails().getIpAddress()); table.getColumn("ironManMode").updateValue(player.getIronmanManager().getMode().name()); - table.getColumn("timePlayed").updateValue((long) table.getColumn("timePlayed").getValue() + (System.currentTimeMillis() - player.getDetails().getLastLogin())); + table.getColumn("timePlayed").updateValue(player.getDetails().getTimePlayed() + (System.currentTimeMillis() - player.getDetails().getLastLogin())); table.getColumn("ip").updateValue(getAddressLog((String) table.getColumn("ip").getValue(), details.getInfo().getIp())); table.getColumn("mac").updateValue(getAddressLog((String) table.getColumn("mac").getValue(), details.getInfo().getMac())); table.getColumn("serial").updateValue(getAddressLog((String) table.getColumn("serial").getValue(), details.getInfo().getSerial()));