Package dev.twilite.game.facade
Class Connection
java.lang.Object
dev.twilite.game.facade.Connection
Utilities for manipulating the native client's login and network connection state.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumProxy protocols supported by the native socket hook. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidjagexLogin(String sessionId, String characterId, String displayName) Starts a Jagex-account token login for a specific character.static voidlegacyLogin(String username, String password, String otp) Starts a legacy username/password login.static voidRemoves the active process-local proxy configuration.static voidsetProxy(Connection.ProxyType type, String host, int port) Routes future native game socket connections through a proxy without authentication.static voidsetProxy(Connection.ProxyType type, String host, int port, String username, String password) Routes future native game socket connections through a proxy.
-
Constructor Details
-
Connection
public Connection()
-
-
Method Details
-
legacyLogin
Starts a legacy username/password login.If
otpis supplied, it is treated as a TOTP secret and converted into the current six-digit authenticator token before the login is started. Calling this also clears the active Jagex session and character identifiers so stale token-login state is not reused.- Parameters:
username- legacy account usernamepassword- legacy account passwordotp- optional TOTP secret, ornull/blank when no authenticator is needed
-
jagexLogin
Starts a Jagex-account token login for a specific character.This clears the legacy username/password fields, writes the Jagex session environment values used by the native client, and asks the client to begin game-token login.
- Parameters:
sessionId- Jagex session identifier/token valuecharacterId- target character identifierdisplayName- optional character display name
-
setProxy
Routes future native game socket connections through a proxy without authentication.- Parameters:
type- proxy protocolhost- proxy host or IP addressport- proxy port, from 1 to 65535
-
setProxy
public static void setProxy(Connection.ProxyType type, String host, int port, String username, String password) Routes future native game socket connections through a proxy.Invalid values reset the proxy instead. Existing sockets are not reconnected; this only affects later native
connect/WSAConnectcalls.- Parameters:
type- proxy protocolhost- proxy host or IP addressport- proxy port, from 1 to 65535username- optional proxy usernamepassword- optional proxy password
-
resetProxy
public static void resetProxy()Removes the active process-local proxy configuration.
-