factorio-server-manager icon indicating copy to clipboard operation
factorio-server-manager copied to clipboard

mod settings editor

Open knoxfighter opened this issue 6 years ago • 10 comments

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 :)

knoxfighter avatar Feb 08 '19 21:02 knoxfighter

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?

sean-callahan avatar Feb 08 '19 22:02 sean-callahan

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 avatar Feb 09 '19 17:02 knoxfighter

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 avatar Mar 12 '19 18:03 knoxfighter

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

knoxfighter avatar Mar 13 '19 00:03 knoxfighter

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 avatar Jun 25 '19 23:06 knoxfighter

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 avatar Jul 29 '19 14:07 knoxfighter

@mroote can you please restart travis for this PR.

knoxfighter avatar Oct 10 '19 19:10 knoxfighter

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.

knoxfighter avatar Oct 11 '19 01:10 knoxfighter

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!!

knoxfighter avatar Jan 29 '20 14:01 knoxfighter

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?

DanielNagy avatar Feb 01 '20 03:02 DanielNagy