Skip to content

Commit 40540eb

Browse files
authored
Expose IUser#getLastActivityTime to API (#6101)
1 parent 46ba679 commit 40540eb

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

Essentials/src/main/java/com/earth2me/essentials/IUser.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,17 @@ default boolean hasOutstandingTeleportRequest() {
177177

178178
String getFormattedJailTime();
179179

180+
/**
181+
* Returns last activity time.
182+
* <p>
183+
* It is used internally to determine if user's afk status should be set to
184+
* true because of ACTIVITY {@link AfkStatusChangeEvent.Cause}, or the player
185+
* should be kicked for being afk too long.
186+
*
187+
* @return Last activity time (Epoch Milliseconds)
188+
*/
189+
long getLastActivityTime();
190+
180191
@Deprecated
181192
List<String> getMails();
182193

Essentials/src/main/java/com/earth2me/essentials/User.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,11 @@ public boolean checkMuteTimeout(final long currentTime) {
775775
return false;
776776
}
777777

778+
@Override
779+
public long getLastActivityTime() {
780+
return this.lastActivity;
781+
}
782+
778783
@Deprecated
779784
public void updateActivity(final boolean broadcast) {
780785
updateActivity(broadcast, AfkStatusChangeEvent.Cause.UNKNOWN);

0 commit comments

Comments
 (0)