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

The final fix to list hub and musiclists #152

Conversation

UnDeviato
Copy link
Contributor

No description provided.

Copy link
Owner

@Crystalwarrior Crystalwarrior left a comment

Choose a reason for hiding this comment

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

please remove write_read/ folder check everywhere, only check for read_only/ folders to consider it a read-only hub/musiclist/etc.

server/area.py Outdated
if os.path.isfile(f"storage/musiclists/read_only/{self.music_ref}.yaml"):
self.load_music(f"storage/musiclists/read_only/{self.music_ref}.yaml")
else:
self.load_music(f"storage/musiclists/write_read/{self.music_ref}.yaml")
Copy link
Owner

Choose a reason for hiding this comment

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

remove write_read/, if it's not in a read_only/ folder then it's a read and write.

Otherwise this will just break all servers currently using KFO

@@ -112,7 +112,10 @@ def ooc_cmd_save_hub(client, arg):
raise ArgumentError("Filename must be at least 3 symbols long!")
try:
if args[0] != "":
path = "storage/hubs"
if len(args) > 2 and args[2].lower() == "read_only":
Copy link
Owner

@Crystalwarrior Crystalwarrior Jul 15, 2024

Choose a reason for hiding this comment

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

/save_hub args[0] args[1] args[2], args[2] doesn't exist.
this should be len(args) > 1 and args[1].lower(), please check all instances of this

Suggested change
if len(args) > 2 and args[2].lower() == "read_only":
if len(args) > 1 and args[1].lower() == "read_only":

@@ -122,14 +125,14 @@ def ooc_cmd_save_hub(client, arg):
"Server storage full! Please contact the server host to resolve this issue."
)
try:
if os.path.isfile(f"storage/hubs/read_only/{derelative(args[0])}.yaml"):
raise ArgumentError(f"Hub {args[0]} already exists and it is read-only!")
if os.path.isfile(f"storage/hubs/{derelative(args[0])}.yaml") and len(args) > 2 and args[2].lower() == "read_only":
Copy link
Owner

Choose a reason for hiding this comment

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

/save_hub args[0] args[1] args[2], args[2] doesn't exist.
this should be len(args) > 1 and args[1].lower(), please check all instances of this

@@ -428,18 +434,18 @@ def ooc_cmd_musiclist_save(client, arg):
return

if len(args) > 2 and args[2].lower() == "read_only":
Copy link
Owner

Choose a reason for hiding this comment

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

/save_hub args[0] args[1] args[2], args[2] doesn't exist.
this should be len(args) > 1 and args[1].lower(), please check all instances of this

@Crystalwarrior
Copy link
Owner

this being allowed is also problematic, it should look out for read_only/ in the string and block saving if found
image

@Crystalwarrior Crystalwarrior merged commit 0664609 into Crystalwarrior:master Jul 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants