For each multiplayer match, we store a record of the results. Then a user can look back through previous matches. We’re just using the storage system for this, in go:
nk.StorageWrite(ctx, []*runtime.StorageWrite{
{
Collection: "matches",
Key: matchId,
Value: string(payload),
PermissionRead: 0,
PermissionWrite: 0,
UserID: userId,
},
})
Then when we want to show match history, we use:
records, nextCursor, err := nk.StorageList(ctx, "", userId, "matches", 10, cursor)
However, while we’d like to show the most recent 10 matches, this shows the first 10. Looking through the server runtime code in core_storage.go
, it looks like there is no way to reverse the order of the cursors and the list queries.
This seems like a straightforward use case, so I thought I’d ask here if we’re missing something simple. If not, would the Heroic Labs team be open to a PR?