[lbreakouthd] Flatpak version does not save high scores
Good-looking and addictive OpenSource games
Brought to you by:
kulkanie
I have only Flatpak version for my distro, and it fails to use high score table:
Loading hiscores /app/var/lbreakouthd.hscr
...blah blah blah...
ERROR: hiscores.cpp:133: save(): Could not open hiscores file /app/var/lbreakouthd.hscr
So every run the table is initialized as if never played before.
That is a bug with the flatpak package, you will need to report this to the respective maintainer (which is not me). The file lbreakouthd.hscr must be created with permission 666. This seems to be missing in the flatpak package.
As a workaround you can start a console and run
sudo touch /app/var/lbreakouthd.hscr
sudo chmod 666 /app/var/lbreakouthd.hscr
That should do the trick.
Great game, love playing it! Would be great if this did the same thing as ltris and lbreakout2 do, for example, and saved the hscr file to a user config dir. Ltris/Lbreakout2 both save their high-scores to
$HOME/.lgames/. In addition to avoiding a world-writable file in/var, with potential security issues, this would benefit multi-user systems where one user's high-scores do not get upstaged by another's. Just a thought.Many thanks for the great suite of games in the first place.
Something like the following patch does the trick for me:
hi, i'm happy you like the games and that's interesting, because ALL lgames including ltris and lbreakout2 store the high scores in $localstatedir. (intentionally btw, i like the idea of shared global highscores and think the security risk is low). but if you run, e.g., configure with --prefix=/home/myuser/ you can have a single-user installation with your own private highscores. so you must have some modified copies? anyways, to keep it consistent and as it's configurable i'll leave lbreakouthd's highscores location as it is.
Thanks for the feedback.
As regards to ltris, I meant that it implements something like this (
chart.c):so if it cannot save to global statedir, it falls back to saving it inside a user's home dir. Perhaps lbreakouthd could do with such a backup plan as well.
I think for Linux distros packaging your games (I help out with packaging on openSUSE), users typically expect to install RPMs/DEBs from the package manager for convenience, which installs to
prefix=/usr(generally speaking). In these cases, having a fall back option to save to the user's config dir may be useful, esp. if the distro balks at the idea of installing world-writable files to root.my bad, I only checked chart_load_from_path and not chart_load. so yeah I see the point and added it for consistency. lbreakouthd will now fallback as well.