Skip to content

ClientReport

Internal

Not re-exported through require(Operator). This is not part of the public API and may move in a minor release. It is documented because understanding it matters when you are debugging, not because you should construct one. The internal path is ServerStorage.Operator.Server.ClientReport.

Validates the record notifications a client sends after running a client command, and writes the accepted ones into the Audit log marked source = "client".

The Transport wires this up; you would only touch it directly when assembling the pieces yourself.

This bounds the lie, it does not verify the report

A client command never reaches the server, so the server cannot observe what it did. The checks below reject a report unless it names a command the player was actually permitted to run, but they cannot confirm the player really ran it, and omission cannot be prevented at all.

See what you can and cannot trust.

Functions

ClientReport.build

luau
ClientReport.build(options: Options, player: Player, payload: any): (Entry?, string?)

Validates one payload. Returns an audit Entry ready to record, or nil and a reason.

Rejects unless every one of these holds:

CheckRejected when
shapethe payload is not a table, or path is not a list of non-empty strings
registeredpath does not resolve to a command
client-runthe command is not :runClient()
permittedcanRun(player, command) is false, or raises
statusstatus is not a known Dispatcher.Status
lengthtext exceeds Tokenizer.MaxInputLength
auditedthe command is :noAudit()

message and every args value are clamped rather than rejected, and args is capped in count. Identity, meaning jobId and executor, is taken from the caller, never the payload, and targets is never populated.

ClientReport.new

luau
ClientReport.new(options: ChannelOptions): Channel

Returns a channel whose handle(player, payload) rate-limits, validates and records. A dropped report is logged and discarded; it never affects the client, which has already run the command.

Types

Options

luau
type Options = {
	registry: Registry,
	canRun: (player: Player, command: Command) -> boolean,
	jobId: string,
}

ChannelOptions

luau
type ChannelOptions = {
	registry: Registry,
	canRun: (player: Player, command: Command) -> boolean,
	audit: Audit?,
	logger: Log.Logger?,
	isConnected: (player: Player) -> boolean,
	takeToken: (player: Player) -> boolean,
}

takeToken is the rate limiter; returning false drops the report. Reports use their own token bucket, separate from command dispatches, so client-command usage cannot starve real dispatches. Limits are in Transport.

Released under the MIT Licence.