-
Notifications
You must be signed in to change notification settings - Fork 44
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
Config simplification #84
Conversation
motd = ["Welcome to the server!", "Have a great time!", "Adventure awaits!"] # Message of the day | ||
max_players = 100 # Maximum number of players | ||
network_tick_rate = 20 # Network updates per second per user | ||
world = "World" # The name of the world to load |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't the previous value for this world = "world"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but it doesn't really matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but it doesn't really matter
Yeah I guess it's not used yet still think it should be the same as it was before though
Simplifying the config system
Description
The config system was overly complicated and contained a lot of clutter that made it difficult to decipher. This PR changes the config init system from a complex OnceLock system to a much more streamlined lazy_static system. The change from runtime init to a "life before main" system is minor since the config would be one of the first things set up anyway. The only major issue would be not being able to use tracing since that won't have been initialized yet.
The other change implemented was changing how the favicon is fetched, switching it from a runtime loading to simply using lazy_static to bake the favicon directly into the binary.
Motivation and Context
This PR makes the config much easier to work with and debug. It was discussed with members in the discord server.
How has this been tested?
It has been tested manually since unit tests of this nature would be largely incompatible with CI
Types of changes
Checklist: