Feature: User stats system with its own view #303
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
GET
API endpoint for the statsTesting
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.