UpdateAchievementsAsync usage unclear

I am confused about the existence of UpdateAchievementsAsync. from the signature, it accepts a session, indicating to me that this method is to be called by the user’s client. This is also what i understood from the sample code in GitHub - heroiclabs/reconstructing-fun.

My though it that this method is only ever to be called by the server (or from an external server using s2s) and is only allowed to be used by the client for the most trivial game implementation. What am I missing ?

@jell-o-fishi It really depends on the type of game project you work on. The Hiro game framework is designed to be compatible with a huge variety of different game genres and device target platforms (console, browser, mobile, and desktop).

Due to the flexibility we’ve tried to keep in mind use cases like when the simulation of the gameplay happens client-side (match3, merge, solo mid-core RPG, etc, etc). In which case you’d need for the client to submit progress on the achievement(s) because it is the only source of authority for what progress has been made. (For example, destroy 5 enemy units)

When your game design is fully authoritative (i.e. Unity/Unreal headless instances on a Fleet manager) you can of course simply submit progress server side. In which case we provide functions to allow you to execute the logic directly on the server:

systems.GetAchievementsSystem().UpdateAchievements(...)

You can also disable the achievements function from use with the client for your type of game:

err := hiro.UnregisterRpc(initializer, hiro.RpcId_RPC_ID_ACHIEVEMENTS_UPDATE)

Hope this helps.