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

Move bios.lua to the rom folder #1974

Open
Kan18 opened this issue Sep 14, 2024 · 3 comments
Open

Move bios.lua to the rom folder #1974

Kan18 opened this issue Sep 14, 2024 · 3 comments
Labels
enhancement An extension of a feature or a new feature.

Comments

@Kan18
Copy link

Kan18 commented Sep 14, 2024

Currently, unlike all the other lua files involved in computer startup, bios.lua is inaccessible from an in-game computer, and needs to be downloaded from the CC:T GitHub or a similar source. This is problematic for users trying to figure out how a function defined in bios.lua works (print, read, etc.), or programs which need to access bios.lua's source code (sandbox programs or debuggers). Such programs need to implement code to download the correct version of bios.lua from GitHub, which could also be incorrect if the server is running a custom datapack.

Moving bios.lua to the rom folder would simplify these use-cases. It could probably be moved to rom/bios.lua, since there's already a precedent of lua files being stored directly in the rom folder (rom/startup.lua).

(Due to datapack compatibility, this might have to be changed with a major Minecraft version?
Or CC:T could load the lua/bios.lua resource if it exists, otherwise load lua/rom/bios.lua)

@Kan18 Kan18 added the enhancement An extension of a feature or a new feature. label Sep 14, 2024
@zyxkad
Copy link
Contributor

zyxkad commented Sep 14, 2024

btw you can just simply decompress the mod, and bios.lua is under the resources folder

@Wojbie
Copy link
Contributor

Wojbie commented Sep 14, 2024

2 things that come to my mind is fact that:

  1. This would allow user to see if server they are playing modified bios.lua or not. I am not sure if this is something really needed but it would be neat thing to provide for users.
  2. This could be implemented without needing to make any breaking changes by just making file system api that handles rom just display bios.lua file in rom/bios.lua while file itself stays where it always was in source code.

On other hand i am not exactly sure if this is something that is truly needed and i do know that some CC servers kept stuff in bios.lua that they didn't want to be openly visible to all users like API tokens (Yes this stuff was still visible to those who know how to use debug lib but you see my point)

@Kan18
Copy link
Author

Kan18 commented Sep 14, 2024

Retaining the compatibility measure of loading bios.lua first then rom/bios.lua could allow secrets to continue to be stored. However, this measure would mean rom/bios.lua wouldn't reflect the actual code being loaded, unless the rom mount redirected rom/bios.lua to bios.lua as you suggest, which would make secret storage impossible. But providing the closest possible version of the bios.lua code rather than the exact server-modified version running might be good enough for many use-cases, like sandbox creation or in-game code viewing.
It would be more reliable for servers to just write a separate mod to store API tokens, but unfortunately, many server owners do not want to write mods.

btw you can just simply decompress the mod, and bios.lua is under the resources folder

For clarification, I am referring to the use-case of accessing bios.lua from an in-game computer. Downloading and decompressing the jar would be substantially more difficult than downloading from GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An extension of a feature or a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants