gekware / minecraft-server-hibernation

Autostart and stop minecraft-server when players join/leave
GNU General Public License v3.0
387 stars 38 forks source link

Implement #219: Flags for ServPort and ServPortQuery #220

Closed A-wels closed 1 year ago

A-wels commented 1 year ago

Implements #219 Added flags to msh-config.json. Default is set to -1, which reads the settings from server.properties. When set to a port, msh uses these ports.

gekigek99 commented 1 year ago

I was actually thinking of not adding servport and servportquery in config.

So that msh always tries to get it from server msconfig...

And for the rare cases in which it's needed to specify them one can use the start parameters.

What do you think?

A-wels commented 1 year ago

Ok, just so I am sure that I correctly understood this correctly: It should be possible to start msh with start parameters (e.g. ./msh --ServPort 25550) When no parameters are given, the port is read from server.properties.

Is this correct?

gekigek99 commented 1 year ago

Yes exactly!

Just to not overpopulate the config file with settings that 99% of users will never need.

What do you think?

A-wels commented 1 year ago

This does sound like a good idea. I will change this accordingly.

A-wels commented 1 year ago

... I just notices that the arguments are automatically written into the msh-config.json file. I will need to fix this as well

Edit: I am not sure on how to exclude variables from the config file, since I am not very fluent in go.

gekigek99 commented 1 year ago

... I just notices that the arguments are automatically written into the msh-config.json file. I will need to fix this as well

fixed, you just forgot to remove the 2 parameters from the model config.

Good job, thanks for the help!