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

mod settings editor #131

Open
wants to merge 29 commits into
base: develop
Choose a base branch
from

Conversation

knoxfighter
Copy link
Member

I want to add the posibility to modify the mod-settings, like requested in #121.
Currently reading and writing the mod-settings.dat is implemented.

@mroote @sean-callahan My question is: should i make only the mod-settings.dat|json modifable, or should i also parse all mods, to get the allowed values and the default values.

Reading all mods is a heavy overhead, cause i need to extract all lua-files from the mods and execute the lua-code with a lua vm/compiler.

I opened this PR to get more information and to show the status, it is not near to be finished :)

@sean-callahan
Copy link
Contributor

Executing the mod's Lua files will definitely be too expensive. Perhaps an interface similar to the server setting page will work? Just empty text inputs that encode to the mod-setting.dat format. If there's an error with the input it should be reported in the console when the server starts, right?

@knoxfighter
Copy link
Member Author

knoxfighter commented Feb 9, 2019

Perhaps an interface similar to the server setting page will work?

Thats exactly, what i had in mind.

If there's an error with the input it should be reported in the console when the server starts, right?

If a wrong value (empty, out-of-scope) is set, the value is just reseted to its default value. That behaviour, doesnt tell the user, if something and what is wrong. In the frontend, the values are changed for no reason, when you restart the server.

@knoxfighter
Copy link
Member Author

I implemented it mostly like the general settings page. It is possible to read and write configs and configs will be reset, when invalid.
Three different types of configs are possible (string, number and bool).
It is not possible to add or remove configs!

I also wrote information on top, so users do not get confused, when things are changing by themselfs.

So, this feature is finished.

@knoxfighter knoxfighter changed the title mod settings [WIP] mod settings editor Mar 12, 2019
@knoxfighter
Copy link
Member Author

The tests failed randomly, i dont find any problem at all. @mroote can you please run the tests again.

@knoxfighter
Copy link
Member Author

ok, i have no idea, why this fails. Sometimes its only one, sometimes multiple ones, sometimes on linux only, sometimes on windows only... I think this is a bug in travis :(

@knoxfighter
Copy link
Member Author

I'm not sure, if i should merge this. In my opinion, this is just an error with travis-ci, cause its only on windows and not reproducable. I would say, lets just merge it.
What do you say? @mroote

@knoxfighter
Copy link
Member Author

@mroote can you please restart travis for this PR.

@knoxfighter
Copy link
Member Author

ok, i have absolutly no idea, how this error happens sometimes. It makes no sense, it only happens sometimes and i cant reproduce it, on my local machines...
I think, this is an error from travis :(
In my opinion: If you test it locally @mroote, and review the code, we can merge it and ignore the error or disable those tests.

# Conflicts:
#	.travis.yml
#	README.md
#	gopkglist
#	src/mods_handler.go
@knoxfighter
Copy link
Member Author

Here, the travis tests are successful, but the tests on my repo are failing ... https://travis-ci.com/knoxfighter/factorio-server-manager/jobs/281517922

I dont understand this at all!!

@DanielNagy
Copy link

My Thoughts to this.. Let the Game create the mod-settings file, rather than parsing the enabled mods list yourself.. At least opening an existing mod-settings file, you are pulling the current values into the GUI.. Downside would be that a new mod setting may not appear unless you start / stop the server with the new mod installed/enabled?

@jannaahs jannaahs added this to the 1.0 milestone Jan 8, 2021
@knoxfighter knoxfighter removed this from the 1.0 milestone Jan 11, 2021
@knoxfighter knoxfighter closed this Mar 9, 2021
@knoxfighter knoxfighter deleted the branch OpenFactorioServerManager:develop March 9, 2021 20:38
@knoxfighter knoxfighter reopened this Mar 9, 2021
@knoxfighter knoxfighter added this to the 0.12 milestone Jun 18, 2022
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.

None yet

4 participants