-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
Refactor mtaserver.conf.template #3857
base: master
Are you sure you want to change the base?
Refactor mtaserver.conf.template #3857
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Hmm, check out what I did. |
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.
It looks good, although I recommend inserting a comment at the beginning of the template file to let the user know that they shouldn't change it
Please resolve conflicts, @Fernando-A-Rocha |
@Dutchman101 Merge conflict resolved. I will apply Nico's suggestion now. |
@Nico8340 All good now? |
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.
LGTM
Future WorkI believe that later we should refactor the config system removing the need to have 2 separate files local.conf and editor.conf (as well as editor_acl.xml) for the configuration of Host-Game and Map-Editor servers. It's bad practice that we are duplicating all config values to those files, while in reality all that is happening is some values changing when these servers are started (like startup resources and server name etc). This could be hardcoded in C++, and for Host-Game, the values of the last used preferred settings can be cached to core client config. I volunteer to do this refactoring if you guys agree. ->feedback, @Dutchman101 |
Context
The
mtaserver.conf.template
file is a copy of mtaserver.conf without the<module>
and<resource>
nodes, that devs have been maintaining manually. Default config already comes in mtaserver.conf. Without this PR, the script looks for mtaserver.conf.template, and if it finds it, it will scan for missing config nodes in the existing mtaserver.conf config, and then after it's done with the changes, it deletes the .template file. So it's only ever used once. The problem is that real MTA servers never get their hands on the .template file, so it is never used. Mtaserver.conf.template file is not shipped with the server via the installer or zip provided by mtasa.com. Devs compiling MTA:SA also don't need this template ever, because the default config is already in the mtaserver.conf file... Also, the note in the beginning of the mtaserver.conf.template file is false<!-- This file is compiled into the server binary.
This file is never compiled in the server binary, it gets deleted after use. So, it has zero practical use.What I changed
install_data.lua
to automatically duplicatemtaserver.conf
=>mtaserver.conf.template
compose_files.lua
to do thismtaserver.conf.template
to be included by the Installer (nightly.nsi)mtaserver.conf.template
after runningWhy?
mtaserver.conf.template
.