Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor mtaserver.conf.template #3857

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

Merged
Dutchman101 merged 28 commits into multitheftauto:master from Fernando-A-Rocha:conf-template
Aug 17, 2025

Conversation

@Fernando-A-Rocha
Copy link
Contributor

@Fernando-A-Rocha Fernando-A-Rocha commented Nov 14, 2024
edited
Loading

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 files via the installer or zip provided by mtasa.com.
  • This file is only present in the source code, which devs compiling mtasa manually will result in this file being moved to the build server
  • Devs compiling mtasa 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 even gets deleted after use by the script.

So, mtaserver.conf.template has had zero practical use over the last years.

What I changed

  • Deleted mtaserver.conf.template from files
  • Edited buildaction install_data.lua to automatically duplicate mtaserver.conf => mtaserver.conf.template
  • Also updated compose_files.lua to do this
  • Added mtaserver.conf.template to be included by the Installer (nightly.nsi)
  • Refactored AddMissingSettings():
    • Will not delete mtaserver.conf.template after running
    • Removed hungarian notation
    • Made the function not add missing resource/module nodes

Why?

  • We no longer need to duplicate every new/changed config setting to mtaserver.conf.template.
  • By shipping mtaserver.conf.template with the installer (overwrites existing mtaserver.conf.template of the server), servers owners will receive updates to that file, so their server will receive new settings added by newer server builds, which will then be automatically inserted in the server's mtaserver.conf

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

@Fernando-A-Rocha Fernando-A-Rocha changed the title (削除) Remove mtaserver.conf.template (削除ここまで) (追記) Refactor mtaserver.conf.template (追記ここまで) Nov 15, 2024
Copy link
Contributor Author

Fernando-A-Rocha commented Nov 15, 2024
edited
Loading

Why not use the template file if you already have existing logic for it? I think it's unnecessary to embed the entire config in the code and use it for every reinstallation, instead this should be done from one file, which is this template file

Hmm, check out what I did.

Copy link
Member

@Nico8340 Nico8340 left a 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

Fernando-A-Rocha reacted with thumbs up emoji
Copy link
Member

Dutchman101 commented Nov 21, 2024
edited
Loading

Please resolve conflicts, @Fernando-A-Rocha

Didn't this appear for you?
Untitled

Fernando-A-Rocha reacted with thumbs up emoji

Copy link
Contributor Author

Fernando-A-Rocha commented Nov 22, 2024
edited
Loading

@Dutchman101 Merge conflict resolved. I will apply Nico's suggestion now.

Copy link
Contributor Author

@Nico8340 All good now?

Copy link
Member

@Nico8340 Nico8340 left a comment

Choose a reason for hiding this comment

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

LGTM

Fernando-A-Rocha reacted with heart emoji
Copy link
Contributor Author

Ready

Copy link
Contributor Author

@ project maintainers

merge conflict fixed again. this is ready. any opinions?

Copy link
Contributor Author

Ready

Copy link
Contributor Author

Feedback?

Copy link
Member

Thanks, you followed through with everything and were concise about what and why.

@Dutchman101 Dutchman101 merged commit bc431d8 into multitheftauto:master Aug 17, 2025
MTABot pushed a commit that referenced this pull request Aug 17, 2025
@botder botder added this to the 1.7.1 milestone Aug 17, 2025
Copy link
Member

Dutchman101 commented Aug 21, 2025
edited
Loading

I'm sorry but this PR will have to be temporarily reverted.. it broke build because of a buildserver-local NSIS script issue that i tried to resolve there but was unable to. It will be re-introduced later by @botder if/when he gets to it, he knows his way around the buildscript better than me and i left him notes.

Reverted in 5c3b988

@Fernando-A-Rocha

Dutchman101 added a commit that referenced this pull request Aug 21, 2025
This reverts commit bc431d8.
Temporary, will be reintroduced later. Refer to new comment on PR #3857 for details
MTABot pushed a commit that referenced this pull request Aug 21, 2025
5c3b988 Revert "Refactor mtaserver.conf.template (#3857)" This reverts commit bc431d8.
b4bfd3e Visual Studio Update
1307ddd Update client en_US pot
botder pushed a commit that referenced this pull request Aug 31, 2025
Refer to PR #3857 for details on what this change entails.
MTABot pushed a commit that referenced this pull request Aug 31, 2025
7bd161d Refactor mtaserver.conf.template (#3857)
186ffa8 Update client en_US pot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@FileEX FileEX FileEX approved these changes

@Nico8340 Nico8340 Awaiting requested review from Nico8340

@tederis tederis Awaiting requested review from tederis

Assignees

No one assigned

Labels

enhancement New feature or request refactor

Projects

None yet

Milestone

1.7.1

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /