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

Moved highscores from worldpath to modstorage #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Coding-Hare
Copy link

worldpath is deprecated move it to modstorage instead.

worldpath is deprecated move it to modstorage instead.
Comment on lines +67 to +69
if count >= 5 then
write_file(xp_redo.highscore)
end
Copy link
Member

@S-S-X S-S-X Jan 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

count doesn't do anything useful after first write, you probably meant to reset it here to write every 5 minutes?

Suggested change
if count >= 5 then
write_file(xp_redo.highscore)
end
if count >= 5 then
write_file(xp_redo.highscore)
count = 0
end

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ups emberassing that I forgot this but yeah I meant that

@S-S-X
Copy link
Member

S-S-X commented Jan 5, 2023

luacheck:

    highscore.lua:4:37: line contains trailing whitespace
    highscore.lua:9:1: line contains only whitespace
    highscore.lua:17:33: line contains trailing whitespace
    highscore.lua:19:9: line contains trailing whitespace

@S-S-X
Copy link
Member

S-S-X commented Jan 6, 2023

I guess some ppl might be using highscore.txt directly, possibly publishing it to some web service or something like that.

IMO things like this shouldn't affect mod storage decisions. For stability API (or possibly globals) + separate mod should be used instead but thought that I'll mention it if someone reading this finds this causing trouble with their methods.

@BuckarooBanzay BuckarooBanzay added the enhancement New feature or request label Jan 8, 2023
@wsor4035
Copy link

@Coding-Hare any plans to continue this?

@fluxionary
Copy link
Member

worldpath is deprecated

i'm generally very much in favor of using mod storage over custom data files (w/ exceptions for e.g. the data has a complicated structure). but is the worldpath deprecated? the docs currently describe minetest.get_worldpath() as "Useful for storing custom data", and i don't see any mention of it being deprecated anywhere. this would have drastic implications for mods like sban and verbana which have their own sqlite database backends.

I guess some ppl might be using highscore.txt directly, possibly publishing it to some web service or something like that.

your-land currently does that, but sucking the data out of mod storage isn't meaningfully harder than reading a flat file.

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

Successfully merging this pull request may close these issues.

None yet

5 participants