Partager via


Writing an event to power an event-based achievement

This topic shows example code of how to write an in-game event.

When the event is fired, the event-based stats on the service are updated according to the stat rules that you've defined in Partner Center. Those stats, in turn, power event-based achievements.

Flat C API

HRESULT hr = XblEventsWriteInGameEvent(
    xboxLiveContext,
    "PuzzleSolved",
    R"({"DifficultyLevelId":100, "GameplayModeId":"Adventure"})",
    R"({"LocationX":1,"LocationY":1})"
);

For more information, see XblEventsWriteInGameEvent.