Save characters.lastLogoutTime in database (#353)

This commit is contained in:
MedicOP
2019-01-21 22:17:36 +01:00
committed by Ronan Lana
parent 224f5c677b
commit e5e0dc9332

View File

@@ -9710,6 +9710,14 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
public void logOff() {
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() {