Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scoreboards enabled after release are not used by the library if local scoreboards exist #1

Open
rubybrowncoat opened this issue Nov 18, 2023 · 7 comments

Comments

@rubybrowncoat
Copy link

rubybrowncoat commented Nov 18, 2023

I think this check keeps the game locked into local scoreboards even once they eventually exist (for the catalog game):
https://github.com/GammaGames/pdScoreboards/blob/83401d38f65bc8b9070f9d58fb3fd992006dd5ec/pdScoreboards.lua#L172-L176

@GammaGames
Copy link
Collaborator

🤔 Thank you for reporting this, I'll take a look when I get the chance! I remember some discussion around tweaking how the official scoreboards worked a bit ago so it might be related to that.

@rubybrowncoat
Copy link
Author

rubybrowncoat commented Nov 26, 2023

The issue here seems to be specifically with that check, and not with the official APIs, in the sense that:
scoreboards is read from the datastore scoreboards_file so if at any point in time the initialize function failed the official getScoreboards call for whatever reason and _init_scoreboards is called, the scoreboards_file gets created so that first component of the check is ~= nil, and since _init_scoreboards always sets scoreboards.not_authorized as true and _saves it that second component, if the scoreboards_file exists, is also always true.

This means that if _init_scoreboards is ever called then on any following initialize it will always be called, and from that point local scoreboards are active regardless.

@GammaGames
Copy link
Collaborator

Good catch!! I'll try to get a fix in within the next few days

@GammaGames
Copy link
Collaborator

I opted to remove the attempt at caching authorization: #2

@rubybrowncoat
Copy link
Author

That's pretty much what I did in my copy to bypass the issue. 👍

@GammaGames
Copy link
Collaborator

Thanks for the feedback, I merged it. And congrats on the catalog launch! 🎉

@ebeneliason
Copy link

I realize this is an old thread, but since it's still open despite the fix and my inquiry is related I'll revive it. If these are better suited as separate issues let me know.

  1. I think a lot of the value in having this convenient wrapper would be specifically to enable seamless migration to global scoreboards if/when they become available. That would require the locally cached high scores to get communicated to Panic's scoreboard servers. Does this happen magically already because the format used by this lib matches the scoreboard APIs own offline caching format? (does it?) Or could/should something be added to the API to report at least the highest local score to the global boards when they successfully load the first time? Actually — does this library interfere with that offline caching of the official APIs?

  2. For some games there could be value in exposing both local and global leaderboards. As far as I can tell, the official scoreboard APIs don't provide any way to fetch all of a user's own high scores — just their highest on any given board (unless they happen to hold multiple top ten scores). Would you consider extending this library so as to provide local high score functionality in addition to the global functionality (if available)? I suppose you'd need an optional flag to getScores (or a getLocalScores function), and probably a way to check whether global high scores are available or not.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants