๐ก [FEAT] Highscore Page
a-usr opened this issue ยท 6 comments
Is your feature request related to a problem? ๐ข Please describe.
No
Describe the solution you'd like ๐ค
Basically a Tab that displays a Highscore for Words per Minute, and the Accuracy you had when you set the Highscore. That Highscore would of course have to be saved somewhere, so I propose just pickling the number and then saving it in binary in a file next to the config. This has the advantage of making tampering with the highscore more difficult.
Describe alternatives you've considered ๐ง
No response
Additional context ๐
Would be nice for the Unixporn community to have. And would thus increase popularity of your project. Also, on a side note, your project got starred by Elkowar, so congrats!
Hi @a-usr !
That Highscore would of course have to be saved somewhere
Yes all the info are being saved into ~/.local/share/smassh/smassh.json
or if you're not on linux, they are saved at:
python -c "import appdirs; print(appdirs.user_data_dir('smassh'))"
binary in a file next to the config. This has the advantage of making tampering with the highscore more difficult.
I don't think I can stop tampering even with a binary file but I'll check if it has any effect on the performance
Additional points:
You should see crown
icon if you score more than your highscore
I'm thinking about implementing a user dashboard just like we have in monkeytype but there's currently not a good support for graphs in the underlying TUI lib so I might have to come up with something myself.
I think I can at least currently implement these parts:
Hey @kraanzu !
Yes all the info are being saved into
~/.local/share/smassh/smassh.json
May I ask why specifically this directory? Why not ~/.config/smassh
?
I don't think I can stop tampering even with a binary file but I'll check if it has any effect on the performance
My point was to make it harder to fake a Highscore, as users without programming experience probably wouldn't go through the trouble of figuring out how to edit that specific binary file correctly. For most normal users, just mentioning the words "binary" and "edit" in one sentence is very scary
Additional points:
You should seecrown
icon if you score more than your highscore
Yeah, good Idea!
May I ask why specifically this directory? Why not ~/.config/smassh ?
I'm using this library to store config/data.
So there are 2 funcs that I'm using user_config_dir
and user_data_dir
This also aligns with XDG directory specification
I also wasn't aware of this and stored everything in the .config dir before haha. I learned about this from kraanzu/dooit#12 and #48
For most normal users, just mentioning the words "binary" and "edit" in one sentence is very scary
Yes, I understand. If I take this thing online then it can become a little bit more vulnerable
Yes, I understand. If I take this thing online then it can become a little bit more vulnerable
Feels like you replied to the pre-edit version of my comment. I actually mistook this screenshot for a global leaderboard:
That's why I assumed you wanted to create Webservices for this project.
Later I took another look at the image and realised I misinterpreted it. So I removed the part on my comment about possible difficulties with Webservices.
However, should you plan on implementing those, we can still talk about them.
should you plan on implementing those
This I'll implement after I'm satisfied with the local client. Make sure it has enough features and then I'll use something like appwrite to store the global results
also I think the XDG specs are clear now for you? :)
also I think the XDG specs are clear now for you? :)
Yes, after taking a look at #48 I realized that unlike what I thought the config and user data are stored separately from eachother on Linux. The root of this misconception was that I had only used smassh on windows, not on Linux. But thank you for your helpful explanation