Class User

java.lang.Object
group24.escaperoom.data.User

public class User extends Object
  • Field Details

    • username

      protected String username
    • player_id

      protected UUID player_id
    • access_key

      protected UUID access_key
    • record

      protected PlayerRecord record
  • Method Details

    • getRecord

      public static PlayerRecord getRecord()
    • getCredentials

      public static User.Credentials getCredentials()
    • AttemptLogin

      public static CompletableFuture<Networking.StatusCode> AttemptLogin(String username, String password)
      Using the Networking APIs, log the user in. Operates in-place, so the user calling this function will be logged in if successful. Requires: - username - password Updates on success: - sets username - sets player_id - sets access_key Returns StatusCode for success/fail handling: - StatusCode.OK: success - anything else: error
    • logOut

      public static void logOut()
    • createAccount

      public static CompletableFuture<Networking.StatusCode> createAccount(String username, String password)
      Using the Networking APIs, create a new user and log them in. If a user with the name already exists, this function will fail Operates in-place, so the user calling this function will be logged in if successful. Requires: - username - password Updates on success: - clears password - sets player_id - sets access_key Returns StatusCode for success/fail handling: - StatusCode.OK: success - anything else: error
    • hasAccount

      public static CompletableFuture<Networking.StatusCode> hasAccount(String username)
      Using the Networking APIs, check if a user exists by checking their username. Requires: - username Returns StatusCode for success/fail handling: - StatusCode.OK: success - anything else: error
    • isLoggedIn

      public static boolean isLoggedIn()
      Check if the user is logged in.