YoYoGames / GMEXT-Steamworks

Repository for GameMaker's Steamworks Extension
Other
65 stars 12 forks source link

Add function steam_get_leaderboard_entry_count #29

Closed Dibbenator closed 8 months ago

Dibbenator commented 1 year ago

Function steam_get_leaderboard_entry_count added for User Stats Added to demo room to show that & how function works

nkrapivin commented 1 year ago

Sorry for asking but how is that different from ds_list_size inside the async leaderboard event?

Dibbenator commented 1 year ago

I want to know the total number of entries in the leaderboard at the server (which might be 1000's in a large game), not just the number of entries returned in the message from the server, as I am plotting a histogram from the data.

Though I was wondering afterwards what is meant by the return; num_entries: The number of returned entries

I interpreted this as just the number of entries that had been returned in the current message from the documentation. Afterwards I wondered if it is the number of entries in the leaderboard? (but haven't checked)

Dibbenator commented 1 year ago

At least from the Steamworks API, I interpret also from that that num_entries is the number of entries returned in the message, judging by the functions;

https://partner.steamgames.com/doc/api/ISteamUserStats#GetLeaderboardEntryCount Returns: int The number of entries in the leaderboard. Returns 0 if the leaderboard handle is invalid.

https://partner.steamgames.com/doc/api/ISteamUserStats#LeaderboardScoresDownloaded_t returns: m_cEntryCount | int | The number of entries downloaded.

But for LeaderboardScoreUploaded_t, there is a return num_entries in the Gamemaker Steamworks API, but not in Steam's own API, so I guess that's what I would look at next to see what is in it

Dibbenator commented 1 year ago

I double checked it now; num_entries is as I thought only the number of entries returned in the data packet, so not the total number of entries in the leaderboard.

And it is the Gamemaker Steamworks API documentation that is incorrect for LeaderboardScoreUploaded_t, in that what is returned in the async_load message doesn't include num_entries at all.

Hence I think there is no other way to get the total number of entries in the leaderboard other than with this function I added steam_get_leaderboard_entry_count

DiasFranciscoA commented 1 year ago

There are some conflicts with your PR (please resolve them by rebasing your branch). Also leave here some notes of some caveats with the function I can see that the user needs to meet some pre-requisites for this function to work properly (other function calls). This is important so our documentation team can properly document this in the future.

DiasFranciscoA commented 8 months ago

This feature was already implemented in last release will close this PR