Appearance
sdk.session
Credential-free session recovery. The native layer invokes Tibia's official retained-credential reconnect slot. This module adds an opt-in retry policy; it never accepts account, password, authenticator, session-key, character, or packet parameters.
lua
local M = require("sdk.session")state
function · state(): GameSessionStatus?, ErrorMessage?
Return a sanitized snapshot of the official login/game-session state.
Returns
| Type | Summary |
|---|---|
GameSessionStatus|nil | state |
string|nil | err |
status
alias · status(): GameSessionStatus?, ErrorMessage?
Same as state.
Alias
Same as state.
Returns
| Type | Summary |
|---|---|
GameSessionStatus?, ErrorMessage? | — |
reconnect
function · reconnect(): Result?, string?
Queue the official retained-credential reconnect action. Success means accepted/queued locally; wait for WorldEntered or in_world.
Returns
| Type | Summary |
|---|---|
boolean|nil | ok |
string|nil | status_or_error |
start
function · start(options)
Enable opt-in automatic recovery after this process has observed a real in-world session. Calling start at the login screen never auto-logs in.
Parameters
| Name | Type | Summary |
|---|---|---|
options? | AutoReconnectOptions | — |
Returns
| Type | Summary |
|---|---|
boolean|nil | ok |
string|nil | err |
stop
function · stop(): boolean
Disable automatic reconnect and release its tick subscription.
Returns
| Type | Summary |
|---|---|
boolean | — |
resume
function · resume(): Result?, ErrorMessage?
Acknowledge the current LoginError and permit another bounded attempt.
Returns
| Type | Summary |
|---|---|
boolean|nil | ok |
string|nil | err |
auto_state
function · auto_state(): AutoReconnectStatus
Return policy diagnostics without any native pointers or account material.
Returns
| Type | Summary |
|---|---|
AutoReconnectStatus | — |
enable_auto_reconnect
alias · enable_auto_reconnect(options?: AutoReconnectOptions): Result?, ErrorMessage?
Same as start.
Alias
Same as start.
Parameters
| Name | Type | Summary |
|---|---|---|
options | AutoReconnectOptions | — |
Returns
| Type | Summary |
|---|---|
Result?, ErrorMessage? | — |
disable_auto_reconnect
alias · disable_auto_reconnect(): boolean
Same as stop.
Alias
Same as stop.
Returns
| Type | Summary |
|---|---|
boolean | — |