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

Feature: User stats system with its own view #303

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

iitsg
Copy link

@iitsg iitsg commented Nov 19, 2024

Description

As some users have wished for this feature for quite some time, myself included (even though I am pretty new to Shobu), I thought that I might as well add it. And by chance, you have already been tracking duels for around a year, which makes migration of old stats available.

Changes

  • Added stats to the user model
  • Added migration scripts for easy migration, built on the existing system
  • Added an extra GET API endpoint for the stats
  • Added an extra view for the stats, built into the header
  • Some minor refactoring (can be reverted if desired)

Testing

I've tested migration of old accounts, setting up new accounts, stats tracking after a match (>60s), and the stats view itself. I've also tested disconnections, which are tracked as a loss for the disconnected player and a win for the other player. In my testing, nothing broke and it shouldn't really, as it's built on top of the existing match tracking foundation. But just because it "WoRkS oN mY mAcHiNe" doesn't mean it will on your production server. Well, software development things we have to live with, right?

Notes

It's my first contribution here, and I don't have that much Go experience, but I hope you like the code quality. Feedback is appreciated.

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.

1 participant