OnPlayerDiscordPresenceStatus

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

onPlayerDiscordPresenceStatus

Available from 0.1.9. Use matching updated clients and server.

Server-side diagnostic event, delivered to the resource currently owning a player's active Discord Rich Presence profile. No addEvent declaration is needed.

Signature

addEventHandler("onPlayerDiscordPresenceStatus", root, function(playerId, status)
    outputDebugString("Discord player " .. tostring(playerId) .. ": " .. status)
end)

playerId is the numeric game player ID; status is a string. Delivery occurs on diagnostic changes to the current owner, deferred by the server, not synchronously inside set/update.

See all status values. After clear there is no owner and no former-owner cleanup callback. Not every possible status is guaranteed to be emitted. The getter also returns disconnected for invalid/offline players; use onPlayerQuit for quit handling.

Advisory client diagnostics, never authorization. Applied means local Discord RPC acknowledgement, not proof of identity, guild membership, roles, public display or valid gameplay. Do not grant rewards/permissions based on it. No Discord account ID, token, username or friends list is passed. getPlayerDiscordPresenceStatus can read the last status; it may lag a clear until the next client report.