Class PlayerAuthentication

java.lang.Object
com.hypixel.hytale.server.core.auth.PlayerAuthentication

public class PlayerAuthentication extends Object
  • Field Details

    • MAX_REFERRAL_DATA_SIZE

      public static final int MAX_REFERRAL_DATA_SIZE
      Maximum allowed size for referral data in bytes.
      See Also:
  • Constructor Details

    • PlayerAuthentication

      public PlayerAuthentication()
    • PlayerAuthentication

      public PlayerAuthentication(@Nonnull UUID uuid, @Nonnull String username)
  • Method Details

    • getUsername

      @Nonnull public String getUsername()
    • getUuid

      @Nonnull public UUID getUuid()
    • setUsername

      public void setUsername(@Nonnull String username)
    • setUuid

      public void setUuid(@Nonnull UUID uuid)
    • getReferralData

      @Nullable public byte[] getReferralData()
      Gets the referral data sent with a SetUsername packet during server transfer, if any.
      Returns:
      the referral data, or null if not a referral connection
    • setReferralData

      public void setReferralData(@Nullable byte[] referralData)
      Sets the referral data for this authentication.
      Parameters:
      referralData - the referral data to store
      Throws:
      IllegalArgumentException - if referralData exceeds maximum size
    • getReferralSource

      @Nullable public HostAddress getReferralSource()
      Gets the source server that referred this player (for abuse detection).
      Returns:
      the source server address, or null if not a referral
    • setReferralSource

      public void setReferralSource(@Nullable HostAddress referralSource)
      Sets the referral source server for this authentication.
      Parameters:
      referralSource - the source server address
    • getSkin

      @Nullable public PlayerSkin getSkin()
    • setSkin

      public void setSkin(@Nullable PlayerSkin skin)