Skip to content

Commit

Permalink
Add more options to factorio.json (#320)
Browse files Browse the repository at this point in the history
* [factorio] Install command now takes in  account custom save location

* Add startup-options and use-latest
  • Loading branch information
TheFrenchTechMan authored Feb 7, 2025
1 parent f16226b commit d97be85
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions factorio/factorio.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,24 @@
"display": "Save File to Use",
"internal": false
},
"use-latest": {
"desc": "Should the server always start the latest saved game?",
"display": "",
"internal": false,
"required": true,
"value": "",
"type": "option",
"options": [
{
"value": "--start-server",
"display": "No"
},
{
"value": "--start-server-load-latest",
"display": "Yes"
}
]
},
"ip": {
"value": "0.0.0.0",
"required": true,
Expand All @@ -48,6 +66,13 @@
"desc": "Server Settings File Location",
"display": "Server Settings JSON",
"internal": false
},
"startup-options": {
"value": "",
"required": false,
"desc": "Additional startup options (reference at https://wiki.factorio.com/Command_line_parameters)",
"display": "Options separated by a space",
"internal": false
}
},
"install": [
Expand All @@ -58,12 +83,12 @@
"mkdir factorio",
"tar --no-same-owner -xvf factorio.tar.xz",
"cp factorio/data/server-settings.example.json factorio/data/server-settings.json",
"./factorio/bin/x64/factorio --create saves/default.zip"
"./factorio/bin/x64/factorio --create ${save}"
]
}
],
"run": {
"command": "./factorio/bin/x64/factorio --port ${port} --bind ${ip} --start-server ${save} --server-settings ${server-settings}",
"command": "./factorio/bin/x64/factorio --port ${port} --bind ${ip} ${use-latest} ${save} --server-settings ${server-settings} ${startup-options}",
"stop": "/quit"
},
"environment": {
Expand Down

0 comments on commit d97be85

Please sign in to comment.