OnWorldItemDropCommitted

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 20:00, 19 October 2026 by QCherry (talk | contribs) (Document upcoming 0.1.9 custom native keys, shared doors, server Lua callbacks and persistence; not a release)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

onWorldItemDropCommitted

Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated server and clients.

Server-side event, handled on root. All resources running at commit. Deferred notification after the pending drop was committed and its world object published. No extra inventory deduction or completion call is needed. Fields are numbers except canonical item string; timestamp is server monotonic milliseconds captured when the drop was created.

Callback

addEventHandler("onWorldItemDropCommitted", root, function(objectId, playerId, item, quantity, serverTimeMs)
    -- Add server-side handling here; see the Custom keys guide.
end)

Contract

Door id is resource-local; playerId is a numeric server player ID; item is the canonical item string. Only parameters shown in this event's signature are passed. eventOrigin is "server"; sourceResource is a table with name="server". No addEvent declaration is needed. This name cannot be opted into remote calls or forged by Lua triggerEvent.

See callback delivery and limits. Notifications are not cancellable hooks or durable transaction logs; readiness reports do not grant entitlement. See drop/pickup persistence before changing inventory in a handler.