Skip to content

@pumpkin-plugins/distant-horizons-support-pumpkin API / session/protocol / validate

Function: validate() ​

validate(state, peer, client, request, capacity?): { kind: number; reason: string; } | undefined

Defined in: packages/distant-horizons-support-pumpkin/src/session/protocol.ts:224

Checks a LOD request against the player's world, the negotiated configuration, the request range and the world border.

Parameters ​

state ​

SessionState

peer ​

Peer

client ​

Client

request ​

level ​

string

section ​

Section

timestamp? ​

number

tracker ​

number

type ​

"request"

capacity? ​

boolean = true

Also enforce the request rate and the server's pending-work limit, as for a new request.

Returns ​

{ kind: number; reason: string; } | undefined

The rejection reason and wire kind, or undefined when the request can be served.

pumpkin-plugins documentation