Class LoginEvent

java.lang.Object
net.storm.sdk.script.blocking_events.BlockingEvent
net.storm.sdk.script.blocking_events.LoginEvent

public class LoginEvent extends BlockingEvent
A blocking event that handles automatic login to the game.

This event manages the entire login process including:

  • Entering username and password credentials
  • Handling two-factor authentication (TOTP)
  • Processing various login server responses
  • OAuth2 login support
  • World selection and hopping

The event will automatically retry failed login attempts up to a maximum of 5 times before stopping.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enumeration of possible login server responses.
    static interface 
    Constants representing various login screen states.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LoginEvent(BlockingEventManager blockingEventManager)
    Constructs a new LoginEvent with default condition (always true).
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Performs the actual login based on the current login state.
    int
    Executes the login logic.
    boolean
    Validates whether the login event should be active.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LoginEvent

      public LoginEvent(BlockingEventManager blockingEventManager)
      Constructs a new LoginEvent with default condition (always true).
      Parameters:
      blockingEventManager - the manager that owns this event
  • Method Details

    • validate

      public boolean validate()
      Validates whether the login event should be active.

      The event is valid when the player is not logged in, not currently hopping worlds, and has either a game account configured or OAuth credentials set.

      Specified by:
      validate in class BlockingEvent
      Returns:
      true if login handling should occur, false otherwise
    • loop

      public int loop()
      Executes the login logic.

      Handles world list loading, login message processing, and delegates to the appropriate login method based on the current state.

      Specified by:
      loop in class BlockingEvent
      Returns:
      sleep duration in milliseconds, or negative value on failure
    • login

      public int login()
      Performs the actual login based on the current login state.

      Handles various login states including authenticator, disabled accounts, membership requirements, invalid credentials, and OAuth2.

      Returns:
      sleep duration in milliseconds, or negative value on failure