diff options
Diffstat (limited to 'src/main/java/eu/olli/cowlection/data/SlothStalkingData.java')
-rw-r--r-- | src/main/java/eu/olli/cowlection/data/SlothStalkingData.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/main/java/eu/olli/cowlection/data/SlothStalkingData.java b/src/main/java/eu/olli/cowlection/data/SlothStalkingData.java new file mode 100644 index 0000000..6c6085e --- /dev/null +++ b/src/main/java/eu/olli/cowlection/data/SlothStalkingData.java @@ -0,0 +1,52 @@ +package eu.olli.cowlection.data; + +public class SlothStalkingData { + private String username; + private String rank; + private String rank_formatted; + // private boolean online; + private long last_login; + private long last_logout; + private String last_game; + + /** + * No-args constructor for GSON + */ + public SlothStalkingData() { + } + + public String getPlayerName() { + return username; + } + + public String getPlayerNameFormatted() { + return rank_formatted.replace('&', 'ยง') + " " + username; + } + + public long getLastLogin() { + return last_login; + } + + public long getLastLogout() { + return last_logout; + } + + public String getLastGame() { + return last_game; + } + + public boolean hasNeverJoinedHypixel() { + // example player that has never joined Hypixel (as of April 2020): Joe + return rank == null && last_login == 0; + } + + public boolean hasNeverLoggedOut() { + // example player that has no logout value (as of April 2020): Pig (in general accounts that haven't logged in for a few years) + return last_login != 0 && last_logout == 0; + } + + public boolean isHidingOnlineStatus() { + // example players: any higher ranked player (mods, admins, ...) + return last_login == 0 && last_logout == 0; + } +} |