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

💡 [FEAT] Highscore Page #79

Open
a-usr opened this issue Feb 8, 2024 · 6 comments
Open

💡 [FEAT] Highscore Page #79

a-usr opened this issue Feb 8, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@a-usr
Copy link
Contributor

a-usr commented Feb 8, 2024

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!

@a-usr a-usr added the enhancement New feature or request label Feb 8, 2024
@kraanzu
Copy link
Owner

kraanzu commented Feb 9, 2024

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

image

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:

image

image

@a-usr
Copy link
Contributor Author

a-usr commented Feb 9, 2024

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 see crown icon if you score more than your highscore

Yeah, good Idea!

@kraanzu
Copy link
Owner

kraanzu commented Feb 9, 2024

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 dooit-org/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

@a-usr
Copy link
Contributor Author

a-usr commented Feb 10, 2024

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:
image

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.

@kraanzu
Copy link
Owner

kraanzu commented Feb 10, 2024

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? :)

@a-usr
Copy link
Contributor Author

a-usr commented Feb 10, 2024

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

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

No branches or pull requests

2 participants