OnPlayerItemStatsReport

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 13:28, 20 October 2026 by QCherry (talk | contribs) (Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

onPlayerItemStatsReport

AVAILABLE FROM UPDATE 0.1.9
Available from 0.1.9. See the scope and validation notes below.

Reports a client's application status for an item profile revision. Diagnostic only; not gameplay or permission authority.

Availability

This event is available in server-side scripts.

Callback signature

function(playerId, item, revision, ok, reason)

Parameters

Name Type Description
playerId number Authenticated reporting connection's player ID.
item string Canonical item type key.
revision string Reported decimal revision; preserve as a string.
ok boolean Whether the client reported successful application/preflight.
reason string Machine-readable diagnostic reason; see below.

Examples

addEventHandler("onPlayerItemStatsReport", root,
    function(playerId, item, revision, ok, reason)
        outputDebugString("Item profile: " .. item .. " rev=" .. revision
            .. " player=" .. tostring(playerId) .. " ok=" .. tostring(ok)
            .. " reason=" .. reason)
    end)

Notes

  • Available from G1R:MP 0.1.9. This documents the implemented API and its current limits. See Item type stats for scope and remaining in-game validation.
  • Register on root. Reports are batched/rate-limited; stale revisions and duplicate states can be ignored. Do not wait for exactly one callback per setter call.
  • native-fields-applied: checked native fields were written. server-authoritative-only: no native definition write was needed.
  • native-rune-cost-ready: the local rune-cost adapter passed its read-only preflight. This does NOT mean that an actual paid/free spell cast succeeded.
  • item-definition-not-loaded, native-layout-unavailable and native-apply-failed indicate failure to apply the native part.
  • Never trust ok as proof of honest execution and never grant items, money, permissions or damage from it. Read the server profile and test actual gameplay.