webSession object | webui.t[145]

Web UI Session object. This keeps track of miscellaneous items associated with the game session.

`transient webSession : object`

Superclass Tree (in declaration order)

`webSession`
`object`

Summary of Properties

`clientSessions collabKey everHadClient hkTime lastClientTime launcherGameID launcherUsername server sessionKey storageSID`

Summary of Methods

`addClient connectUI getCollabUrl getFullUrl housekeeping removeClient validateKey`

Properties

`clientSessions` | `webui.t[272]`

list of active client sessions (ClientSession objects)

`collabKey` | `webui.t[199]`

The collaborative session key. This is a secondary session key that allows additional users to connect to the session for collaborative play.

`everHadClient` | `webui.t[352]`

have we ever had a client connection?

`hkTime` | `webui.t[346]`

system time (ms ticks) of next scheduled housekeeping pass

`lastClientTime` | `webui.t[349]`

the last time we noticed that we had a client connected

`launcherGameID` | `webui.t[236]`

The launcher's game ID. This is the ID passed from the web server that launched the game, to let us know how the game is identified in the launcher database. This is typically an IFDB TUID string.

`launcherUsername` | `webui.t[243]`

The launcher's user name. This is passed from the web server that launched the game, to let us know the host user's screen name. We use this as the user's default screen name in multi-user games.

`server` | `webui.t[290]`

the HTTPServer object running our web session

`sessionKey` | `webui.t[192]`

The session key. This identifies the server as a whole, and is essentially an authentication mechanism that lets clients prove they got our address from an authorized source (rather than just stumbling across it via a port scan, say). Clients must hand this to us on each request, either via a URL query parameter or via a cookie. The normal setup (via WebResourceInit) is for the client to send us the key as a URL parameter on the initial request, at which point we'll pass it back as a set-cookie, removing the need for the client to include the key in subsequent URLs.

The key is just a random number that's long enough that an interloper couldn't hope to guess it. We generate this on the first evaluation, and it remains fixed at that point for as long as we're running.

`storageSID` | `webui.t[257]`

The primary storage server session ID, for the user who launched the server. If the user who launched the game logged in to a cloud storage server, this is the session ID that we use to transact business with the server on behalf of this logged-in user. This token identifies and authenticates the user, but it's ephemeral and it's only valid for the current game server session, so it's not quite like a password. This is the session for the launch user only; if other collaborative users join, they can get their own session IDs that will allow them to store files under their own private user folders on the server.

Methods

`addClient (s)` | `webui.t[275]`

add a client session

`connectUI (srv)` | `webui.t[160]`

Connect to the UI. By default, we ask the webMainWin object to establish a connection, and we save the server object internally for future reference.

`getCollabUrl ( )` | `webui.t[264]`

Get the collaborative player launch URL. This is a URL that the host can send to other players who wish to join the session as collaborative users.

`getFullUrl (resname)` | `webui.t[149]`

Get the full URL to the given resource.

`housekeeping ( )` | `webui.t[297]`

Run housekeeping tasks. The network event processor calls this periodically to let us perform background cleanup tasks. Returns the system tick time of the next housekeeping run.

`removeClient (s)` | `webui.t[283]`

remove a client session

`validateKey (req, query)` | `webui.t[204]`

Validate a session key sent from the client

Adv3Lite Library Reference Manual
Generated on 13/06/2025 from adv3Lite version 2.2.1