Skip to content

Add playerView option to plugin API #671

@delucis

Description

@delucis

Currently games can define a playerView to exclude secret state from the G that is returned to clients.

As mentioned in #668, plugins should also be able to hide secret state on the client, for example using a playerView option:

const plugin = {
  playerView: ({ G, ctx, game, data, playerID }) => data without secrets,
}

We would then have to call the plugins’ playerView for each update sent to clients.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions