Client
.NET/Unity C++/Unreal/Cocos2d-x JavaScript/Cocos2d-js Godot 3 Godot 4 Java/Android Defold cURL REST Swift Dart/Flutter
Server
TypeScript Go Lua
Progression Read more about the Progression system in Hiro here .
Functions
# Get
# Get all, or an optionally-filtered set of progressions for the given user.
1
2
3
4
5
6
7
userId := "userId"
lastKnownProgressions := map [ string ] * hiro . Progression {}
progressions , deltas , err := systems . GetProgressionSystem (). Get ( ctx , logger , nk , userId , lastKnownProgressions )
if err != nil {
return err
}
Purchase
# Permanently unlock a specified progression, if that progression supports this operation.
1
2
3
4
5
6
7
userId := "userId"
progressionId := "progressionId"
progressions , err := systems . GetProgressionSystem (). Purchase ( ctx , logger , nk , userId , progressionId )
if err != nil {
return err
}
Update
# Update a specified progression, if that progression supports this operation.
1
2
3
4
5
6
7
8
userId := "userId"
progressionId := "progressionId"
counts := map [ string ] int64 { "rank" : 2 , "xp" : 5 }
progressions , err := systems . GetProgressionSystem (). Update ( ctx , logger , nk , userId , progressionId , counts )
if err != nil {
return err
}
Reset
# Reset one or more progressions to clear their progress. Only applies to progression counts and unlock costs.
1
2
3
4
5
6
7
userId := "userId"
progressionIds := [] string { "progressionId_001" , "progressionId_002" }
progressions , err := systems . GetProgressionSystem (). Reset ( ctx , logger , nk , userId , progressionIds )
if err != nil {
return err
}