ServerSync

ServerSync

48.5k Downloads

[Feature Rq] Additional command line flags

thantik opened this issue · 6 comments

commented

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:

  1. Create new instance of Minecraft via MultiMC.
  2. Download ServerSync and place its jar in the newly created MultiMC minecraft folder.
  3. Edit instance, to place serversync startup into the pre-launch command.
  4. 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
  5. Edit said config file with text editor, replacing the default 127.0.0.1 with the server I want to use. Save and close.
  6. 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.

commented

Makes sense to allow server & port configuration on the cmdline.

commented

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

commented

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.

commented

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!

commented

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 😊

commented

Need to write some unit tests for the CLI and do some manual testing, shall close this ticket once that is done.

  • unit test the new CLI functionality
  • manual end to end test the CLI feature
  • update documentation with new CLI options
  • release new version on curseforge