Skip to content
R edited this page Dec 27, 2021 · 15 revisions

These instructions apply to v4+, config files moved to root from 4.0 onwards, i.e. the same level as serversync.(jar|exe)

serversync-server.json

Including files in the sync

Add a file or a glob pattern to the include list of the files object.

{
  "rules": {
    "files": {
      include: ["mods/**"]
    }
  }
}

Common patterns:

  • mods/** - Everything in mods
  • config/** - Everything in config
  • stuff/**/include-me/** - Everything at any level of the stuff folder that is also inside a folder named include-me

Serving client only mods (optional)

Client only mods are things like optifine or NEAT that do not need to be loaded server side.

Specific support for this concept: Client mods

Alternative way to achieve the same thing: Redirecting files

Managing directories

Including files is great but you probably want to clean up old versions or random mods that already exist in the destination so that a client can actually connect to your server, do this with directory rules.

{
  "rules": {
    "directories": [
      { "path": "mods", "mode": "mirror" },
      { "path": "config", "mode": "push" }
    ]
  }
}

This configures the mods folder to be in mirror mode, which will tell the client to clean up any files that don't exist in the server folder. e.g.

server client resolved
mods/🐟 mods/🐟 mods/🐟
mods/πŸš— mods/πŸš—
mods/🍊

mods/🍊 would be deleted as it does not exist on the server

mods/πŸš— would be transferred as it does not exist on the client

mods/🐟 would be tested to see if it is the same file as the server.