![ServerSync](https://media.forgecdn.net/avatars/thumbnails/254/696/256/256/637199290945083080.png)
[Feature Rq] Additional command line flags
thantik opened this issue · 6 comments
Serversync Version: latest/all
Minecraft Version: Yes.
Issue:
I'm currently using your MultiMC setup for ServerSync and something always bothers me -- you are never allowed to specify which server you want to use via the command line arguments. So this results in me setting up MultiMC for my family, and each time - I must follow these steps:
- Create new instance of Minecraft via MultiMC.
- Download ServerSync and place its jar in the newly created MultiMC minecraft folder.
- Edit instance, to place serversync startup into the pre-launch command.
- Either manually run serversync.jar or fire up minecraft multimc instance, so that serversync.jar is run and creates a ./config/serversync/serversync-client.cfg file
- Edit said config file with text editor, replacing the default 127.0.0.1 with the server I want to use. Save and close.
- Re-run MultiMC Minecraft instance, this time allowing serversync to update appropriately.
If I could simply put in a server name at the end of (for example)
$INST_JAVA -jar serversync-3.5.1.jar progress-only myserverhere.com
This would allow me to skip steps 4, 5 when setting up Forge clients by simply adding the server to sync with via command. Ideally, port number could be specified as well. If port unspecified, use default or config-specified.
Added the ability to configure port & address via the CLI, available in version 3.6.0+
https://github.com/superzanti/ServerSync/releases
Output of the help text:
Usage: ServerSync [-hoqsV] [-a=<serverAddress>] [-p=<serverPort>]
A utility for synchronizing a server<->client style game.
-a, --address=<serverAddress>
The address of the server you wish to connect to.
-h, --help Show this help message and exit.
-o, --progress, progress-only
Only show progress indication. Ignored if '-s',
'--server' is specified.
-p, --port=<serverPort> The port the server is running on.
-q, silent, --quiet Remove all GUI interaction. Ignored if '-s',
'--server' is specified.
-s, server, --server Run the program in server mode.
-V, --version Print version information and exit.
Example usage for MultiMC:
$INST_JAVA -jar serversync-3.6.0.jar -o -a foobar.com -p 28456
Probably makes sense to allow configuration of the file ignore list as well via the CLI, shall do that later as a different ticket though.
I'm concerned that the ignore list on the CLI wouldn't make sense, or would be difficult to implement in a way that would be concise.
I didn't think you'd implement this so fast, so - thank you a ton for that!
You can pass multiple arguments to a CLI flag. I would probably just implement it something like so:
serversync.jar --ignore **/foobar mods/coolio.jar **/*.ignore
Could also use some kind of delimiter to separate a string list of items, usually a comma.
The part that is more interesting is parsing it in the code afterwards 😊