Skip to content

@pumpkin-plugins/distant-horizons-support-pumpkin API / session/state / SessionState

Class: SessionState ​

Defined in: packages/distant-horizons-support-pumpkin/src/session/state.ts:70

Client sessions, request queues and counters shared by the session modules, with the bookkeeping that keeps them consistent. Each Sessions owns one instance.

Methods ​

clearRevisionIfUnused() ​

clearRevisionIfUnused(key): void

Defined in: packages/distant-horizons-support-pumpkin/src/session/state.ts:132

Forgets a section's change revision once no request or refresh still tracks it.

Parameters ​

key ​

string

Returns ​

void


drop() ​

drop(request): void

Defined in: packages/distant-horizons-support-pumpkin/src/session/state.ts:126

Removes a finished, rejected or cancelled request from the queue.

Parameters ​

request ​

Request

Returns ​

void


endSession() ​

endSession(name): void

Defined in: packages/distant-horizons-support-pumpkin/src/session/state.ts:99

Ends a player's DH protocol session and drops its requests and queued responses.

Parameters ​

name ​

string

Returns ​

void


removeClient() ​

removeClient(name): void

Defined in: packages/distant-horizons-support-pumpkin/src/session/state.ts:121

Forgets a player's session, pending requests and background refreshes, without logging.

Parameters ​

name ​

string

Returns ​

void


withSessionPeer() ​

withSessionPeer(peers, name, use): void

Defined in: packages/distant-horizons-support-pumpkin/src/session/state.ts:111

Runs work for one session player, ending only that session when the player is gone or the work fails.

Parameters ​

peers ​

Peers

name ​

string

use ​

(peer) => void

Returns ​

void

pumpkin-plugins documentation