Class LoginEvent
java.lang.Object
net.storm.sdk.script.blocking_events.BlockingEvent
net.storm.sdk.script.blocking_events.LoginEvent
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 ClassesModifier and TypeClassDescriptionstatic enumEnumeration of possible login server responses.static interfaceConstants representing various login screen states. -
Constructor Summary
ConstructorsConstructorDescriptionLoginEvent(BlockingEventManager blockingEventManager) Constructs a new LoginEvent with default condition (always true). -
Method Summary
-
Constructor Details
-
LoginEvent
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:
validatein classBlockingEvent- Returns:
trueif login handling should occur,falseotherwise
-
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:
loopin classBlockingEvent- 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
-