Save characters.lastLogoutTime in database (#353)
This commit is contained in:
@@ -9710,6 +9710,14 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
|||||||
|
|
||||||
public void logOff() {
|
public void logOff() {
|
||||||
this.loggedIn = false;
|
this.loggedIn = false;
|
||||||
|
|
||||||
|
try (Connection con = DatabaseConnection.getConnection(); PreparedStatement ps = con.prepareStatement("UPDATE characters SET lastLogoutTime=? WHERE id=?")) {
|
||||||
|
ps.setTimestamp(1, new Timestamp(System.currentTimeMillis()));
|
||||||
|
ps.setInt(2, getId());
|
||||||
|
ps.executeUpdate();
|
||||||
|
} catch (SQLException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLoggedin() {
|
public boolean isLoggedin() {
|
||||||
|
|||||||
Reference in New Issue
Block a user