Skip to main content
This topic demonstrates how to call the Real-Time Activity (RTA) service by using the following flat C code examples.

Registering a handler to get statistic change events from the RTA service

You define your statistics and configure them for RTA in Partner Center. For more information, see the following:
If you’re an event-based statistics developer, contact your developer account manager (DAM) for information about portal configuration of event-based statistics in Partner Center. For more information, see Configure XBOX Live stats and stat rules in Partner Center).
Within your title, you need to configure the statistics that you want RTA to track. Title handlers are invoked whenever one of the configured statistics changes as shown in the following code example.

Flat C

Unregistering from the RTA service

When updates are no longer needed for a particular statistic (or a set of statistics), your title should simply stop tracking that statistic. If statistics updates are no longer needed altogether, removing all registered handlers automatically removes the related RTA subscriptions as shown in the following code example.

Flat C

If a client uses RTA for multiplayer sessions, and is disconnected for thirty seconds, the Multiplayer Session Directory (MPSD) detects that the RTA session is closed, and removes the player from the session. XSAPI then automatically reestablishes the RTA connection. However, it’s the title’s responsibility to rewrite its MPSD sessions after the RTA subscription has been reestablished.

See also

XblStatisticChangeEventArgs XblUserStatisticsAddStatisticChangedHandler XblUserStatisticsRemoveStatisticChangedHandler
Last modified on August 20, 2026