Skip to content

Pending ​

A connection awaiting the auth resource's decision. Only the resource named by [auth] resource in server.toml receives one, in player_auth. It is not a player yet, and no other resource knows about it. Once it is accepted, rejected, timed out or disconnected, every method returns nil, err.

Pending:id ​

The player id the connection receives once accepted; its player_connect handle has the same id.

Returns id integer

Pending:name ​

Returns name string|nil, err string|nil

Pending:ip ​

Returns ip string|nil, err string|nil

Pending:credential ​

The opaque id of the credential the client's launcher proved to this server: the same for the same computer on this server, different on every other server. nil when the connection presented none (a client without a launcher). It identifies a device, not an account; no other part of the API exposes it.

Returns credential string|nil, err string|nil

Pending:accept ​

Admits the connection; player_connect then fires for every resource.

Returns ok boolean|nil, err string|nil

Pending:reject ​

Rejects the connection with reason (up to 64 bytes, shown to the player). No resource is notified of a player.

Parameters

  • reason (optional) string

Returns ok boolean|nil, err string|nil

Pending:open_view ​

Opens a view of this resource (the login screen) on the waiting client. Takes the same spec and callbacks as dlmp.open_view; view:player() is nil until the connection is accepted. Until then, its page may also fetch the auth sites of [[auth.providers]] in server.toml, and nothing else outside its origin.

Parameters

  • spec table — {entry, input?, actions?}
  • callbacks (optional) table — {on_ready?, on_action?, on_close?}

Returns view View|nil, err string|nil

Pending:web_auth ​

Returns a one-time ticket for the auth site provider of [[auth.providers]], with the site's origin: {ticket, origin}. Send both to the login page. The page posts the ticket with the name and password to the site, which replies with a signed token (a JWT), and passes the token to darqlinemp.submitAuth. The core verifies the token and calls on_identity(provider, subject): the site vouches that subject signed in, so map (provider, subject) to your account and accept. Any token consumes the ticket: a rejected token calls on_identity(nil, reason) (invalid, audience, ticket, expired), and a new ticket is required. A new ticket replaces the previous one and its callback. The resource never sees the token or the password.

Parameters

  • provider string
  • on_identity fun(provider: string|nil, subject_or_reason: string)

Returns grant {ticket: string, origin: string}|nil, err string|nil

Documentation licensed under CC BY 4.0. DarqlineMP is not affiliated with Rockstar Games or Take-Two Interactive. Grand Theft Auto is a trademark of Take-Two Interactive Software, Inc.