CompletePlayerConsumableFinalize: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document Lua functions planned for G1R:MP update 0.1.2
 
Clarify GothicRP consumable persistence ownership
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
= completePlayerConsumableFinalize =
= completePlayerConsumableFinalize =
<div style="background:#0b0b0b; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#f1f1f1; padding:0.85rem 1rem; margin:0.75rem 0 1rem;">
<div style="background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;">
<div style="color:#ff5a5a; font-weight:bold; letter-spacing:0.04em;">COMING IN UPDATE 0.1.2</div>
<div style="color:#111111; font-weight:bold; letter-spacing:0.04em;">AVAILABLE FROM UPDATE 0.1.2</div>
<div style="color:#f1f1f1; margin-top:0.25rem;">This function is documented in advance and is not yet available in the current public release.</div>
<div style="color:#111111; margin-top:0.25rem;">This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.</div>
</div>
</div>


Line 43: Line 43:
== Notes ==
== Notes ==
* Available only in server-side resource scripts.
* Available only in server-side resource scripts.
* This is an advanced transaction-completion function intended for the resource that owns the authoritative inventory workflow.
* This is an internal transaction-completion capability for the bundled <code>gothic_rp</code> persistence workflow, not a general gameplay function.
* The runtime accepts this call only when the calling resource is named exactly <code>gothic_rp</code>; every other resource receives <code>false</code>.
* The player, sequence, generation and commit key must all match the pending operation.
* The player, sequence, generation and commit key must all match the pending operation.
* Call it only after the final persistence result is known; it does not play an animation or apply a consumable effect by itself.
* Call it only after the final persistence result is known; it does not play an animation or apply a consumable effect by itself.

Latest revision as of 14:06, 8 September 2026

completePlayerConsumableFinalize

AVAILABLE FROM UPDATE 0.1.2
This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.

Completes or rejects the persistence-finalization stage of a pending authoritative consumable operation.

Syntax

bool completePlayerConsumableFinalize(int playerId, int sequence, int generation, string commitKey, bool committed)

Parameters

Name Type Required Description
playerId int yes The connected player identifier.
sequence int yes The positive consumable-use sequence received by the resource.
generation int yes The positive session generation supplied for this finalization request.
commitKey string yes The non-empty commit key supplied for the same pending operation; maximum 96 bytes.
committed bool yes True after final persistence succeeded, or false after it was rejected or rolled back.

Returns

Returns true only when the matching pending finalization is accepted; otherwise returns false.

Examples

Confirm a persisted consumable finalization:

local accepted = completePlayerConsumableFinalize(
    playerId, sequence, generation, commitKey, true
)
if not accepted then
    outputDebugString("Consumable finalization acknowledgement was rejected", 1)
end

Notes

  • Available only in server-side resource scripts.
  • This is an internal transaction-completion capability for the bundled gothic_rp persistence workflow, not a general gameplay function.
  • The runtime accepts this call only when the calling resource is named exactly gothic_rp; every other resource receives false.
  • The player, sequence, generation and commit key must all match the pending operation.
  • Call it only after the final persistence result is known; it does not play an animation or apply a consumable effect by itself.