mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-11 17:10:21 -07:00
Add timePlayed to playerDetails
This commit is contained in:
parent
7b0ae33151
commit
0403b685a9
4 changed files with 25 additions and 3 deletions
Binary file not shown.
Binary file not shown.
|
|
@ -56,6 +56,11 @@ public class PlayerDetails {
|
||||||
*/
|
*/
|
||||||
private long lastLogin = -1;
|
private long lastLogin = -1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The account's last game login.
|
||||||
|
*/
|
||||||
|
private long timePlayed = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time the player is muted for.
|
* The time the player is muted for.
|
||||||
*/
|
*/
|
||||||
|
|
@ -387,6 +392,22 @@ public class PlayerDetails {
|
||||||
this.lastLogin = 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.
|
* Sets the mute time.
|
||||||
* @param muteTime the mute time.
|
* @param muteTime the mute time.
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ public final class PlayerSQLManager {
|
||||||
details.setRights(Rights.forId((int) table.getColumn("rights").getValue()));
|
details.setRights(Rights.forId((int) table.getColumn("rights").getValue()));
|
||||||
details.setDonatorType(DonatorType.forId((int) table.getColumn("donatorType").getValue()));
|
details.setDonatorType(DonatorType.forId((int) table.getColumn("donatorType").getValue()));
|
||||||
details.setLastLogin(System.currentTimeMillis());
|
details.setLastLogin(System.currentTimeMillis());
|
||||||
|
details.setTimePlayed((long) table.getColumn("timePlayed").getValue());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -113,7 +114,7 @@ public final class PlayerSQLManager {
|
||||||
table.getColumn("netWorth").updateValue(player.getMonitor().getNetworth());
|
table.getColumn("netWorth").updateValue(player.getMonitor().getNetworth());
|
||||||
table.getColumn("lastGameIp").updateValue(player.getDetails().getIpAddress());
|
table.getColumn("lastGameIp").updateValue(player.getDetails().getIpAddress());
|
||||||
table.getColumn("ironManMode").updateValue(player.getIronmanManager().getMode().name());
|
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("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("mac").updateValue(getAddressLog((String) table.getColumn("mac").getValue(), details.getInfo().getMac()));
|
||||||
table.getColumn("serial").updateValue(getAddressLog((String) table.getColumn("serial").getValue(), details.getInfo().getSerial()));
|
table.getColumn("serial").updateValue(getAddressLog((String) table.getColumn("serial").getValue(), details.getInfo().getSerial()));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue