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:
{
"type": "l2.grant_item",
"schemaVersion": 1,
"itemId": 57,
"count": 1000
}{
"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
| Outcome | Durable | Gateway action |
|---|---|---|
APPLIED | Yes | Complete the command |
ALREADY_APPLIED | Yes | Complete the replay without applying again |
RETRYABLE_FAILURE | No | Retry; CHARACTER_OFFLINE is the standard offline result |
PERMANENT_FAILURE | Yes | Stop retrying |
RECONCILIATION_REQUIRED | No | Require an administrative decision |
Required command journal
Before changing player state:
- Look up
commandId. - Return the stored result if the command is complete.
- Return
RECONCILIATION_REQUIREDif an earlier attempt remainsAPPLYING. - Insert the
APPLYINGmarker. - Apply the game mutation.
- 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.