Class TimeDAO
java.lang.Object
net.flectone.pulse.data.database.dao.TimeDAO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondatabase()Gets the database instance associated with this DAO.getAllPlayTimes(int limit, int offset) Gets all playtime records with player names.getByPlayer(@NonNull FPlayer fPlayer) Gets playtime record for a player.intGets total number of playtime records.voidUpdates total playtime with AFK.voidRecords a player's join If the player already exists, increments their session count; otherwise inserts a new playtime record.voidRecords a player's quit and updates total playtime.voidsaveSession(@NonNull PlayTime playTime) Records a player's session If the player already exists, increments their session count; otherwise inserts a new playtime record.sqlClass()Gets the SQL interface class for this DAO.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BaseDAO
getSQL, inTransaction, useCustomTransaction, useHandle, useTransaction, withHandle
-
Constructor Details
-
TimeDAO
-
-
Method Details
-
database
-
sqlClass
-
saveJoin
Records a player's join If the player already exists, increments their session count; otherwise inserts a new playtime record.- Parameters:
fPlayer- the player who joined
-
saveSession
Records a player's session If the player already exists, increments their session count; otherwise inserts a new playtime record.- Parameters:
playTime- the playtime data to save
-
saveAfk
Updates total playtime with AFK. If the player is entering AFK, adds elapsed time to total and invert last seen. If the player is returning from AFK, updates the last seen timestamp.- Parameters:
fPlayer- the player whose AFK status is being updatedafk- true if the player is going AFK, false if returning
-
saveQuit
-
getByPlayer
-
getTotalCount
public int getTotalCount()Gets total number of playtime records.- Returns:
- total count
-
getAllPlayTimes
-