Capabilities

DELIVER_GRANT

Apply item and skill grants with replay protection

Bridge contract

GrantResult applyGrant(String commandId, JsonObject payload);

Handle all failures as GrantResult; do not allow an exception to escape.

Supported grant payloads:

Item
{
  "type": "l2.grant_item",
  "schemaVersion": 1,
  "itemId": 57,
  "count": 1000
}
Skill
{
  "type": "l2.grant_skill",
  "schemaVersion": 1,
  "skillId": 1204,
  "skillLevel": 1
}

The target contains normalizedAccountName and characterId. Both reference implementations require the target character online and verify that the live character belongs to the supplied account.

Result contract

OutcomeDurableGateway action
APPLIEDYesComplete the command
ALREADY_APPLIEDYesComplete the replay without applying again
RETRYABLE_FAILURENoRetry; CHARACTER_OFFLINE is the standard offline result
PERMANENT_FAILUREYesStop retrying
RECONCILIATION_REQUIREDNoRequire an administrative decision

Required command journal

Before changing player state:

  1. Look up commandId.
  2. Return the stored result if the command is complete.
  3. Return RECONCILIATION_REQUIRED if an earlier attempt remains APPLYING.
  4. Insert the APPLYING marker.
  5. Apply the game mutation.
  6. Persist APPLIED.

The reference implementations create:

CREATE TABLE IF NOT EXISTS portal_command (
  command_id VARCHAR(36) NOT NULL PRIMARY KEY,
  status VARCHAR(24) NOT NULL,
  error_code VARCHAR(100) NULL,
  created_at BIGINT NOT NULL,
  applied_at BIGINT NULL
);

The game database user must be able to create this table and read, insert, and update its rows.

Verification

Connector check grants one Adena to the selected online character. Use a designated test character.

On this page