Skip to content

Implement manual pin awarding and pin tests - #918

Merged
jvyden merged 12 commits into
LittleBigRefresh:mainfrom
Toastbrot236:manual-pins
Aug 4, 2025
Merged

Implement manual pin awarding and pin tests#918
jvyden merged 12 commits into
LittleBigRefresh:mainfrom
Toastbrot236:manual-pins

Conversation

@Toastbrot236

Copy link
Copy Markdown
Contributor

This PR:

  • Adds database methods for awarding single PinProgressRelations to users, aswell as ManuallyAwardedPins, which is an enum tracking the progressTypes of all pins (right now not all pins) which the game does not unlock itself and instead expects the server to award manually
  • Implements awarding all 4 leaderboard-related pins aswell as 2 out of 3 website-related pins from ManuallyAwardedPins to users if they complete their objectives, as an example for the above
  • Adds tests for the above
  • Slightly adjusts pin progress syncing for 2 certain manually-awarded pins whose progress works differently from all other pins
  • Adds a test for the above aswell

This would've closed both #395 and #690, however the pin awarded for hearting a user on the website is not implemented yet since there is no way to heart users using the API yet, and the rating pins are not implemented yet either because I didn't really want this PR to become too large.

Also my naming skills aren't very great.

@jvyden
jvyden self-requested a review August 3, 2025 20:05
Comment on lines +16 to +20
FrozenSet<long> specialTreatmentPins =
[
(long)ManuallyAwardedPins.TopXOfAnyStoryLevelWithOver50Scores,
(long)ManuallyAwardedPins.TopXOfAnyCommunityLevelWithOver50Scores,
];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know it's a bit slow to freeze a list. This should be done statically at the class level.

For naming I think progressDescPins, or to be verbose, pinsWithDescendingProgress

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

descendingProgressPins maybe? Is verbose but a little shorter.

Comment on lines +112 to +113
database.IncrementUserPinProgress((long)ManuallyAwardedPins.SignIntoWebsite, 1, user, false);
database.IncrementUserPinProgress((long)ManuallyAwardedPins.SignIntoWebsite, 1, user, true);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bleh, this sucks. Maybe that last param should be nullable, where null means update for both beta, not-beta?

/// <summary>
/// The progress types of pins which have to be awarded manually by the server.
/// </summary>
public enum ManuallyAwardedPins : long

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServerPins maybe?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that might make it sound like these are our own custom pins or something, but other than that I like that name.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you keep the XMLDoc, should be fine

@Toastbrot236
Toastbrot236 requested a review from jvyden August 4, 2025 09:51
@jvyden
jvyden merged commit 7f6d22b into LittleBigRefresh:main Aug 4, 2025
4 of 5 checks passed
@Toastbrot236
Toastbrot236 deleted the manual-pins branch August 5, 2025 18:12
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

Successfully merging this pull request may close these issues.

2 participants