ServerSync

ServerSync

48.5k Downloads

How can I sync a single file between client and server?

Lwayage opened this issue ยท 3 comments

commented

Serversync Version: 3.6.0.0

Minecraft Version: 1.12.2

Issue:

hello! I get stuck when I use ServerSync, I can't sync a single file between client and server. For excample, I want sync a server file: "CustomSkinLoader/CustomSkinLoader.json" to the same path in client, but I don't want to sync the whole folder "CustomSkinLoader". What should I do ?

I try to put the "CustomSkinLoader/CustomSkinLoader.json" into CONFIG_INCLUDE_LIST or DIRECTORY_INCLUDE_LIST, it doesn't work.

I find a way to do this at present: add "CustomSkinLoader" into DIRECTORY_INCLUDE_LIST of serversync-server.cfg, then edit serversync-client.cfg, add all subfolders and other files of CustomSkinLoader in FILE_IGNORE_LIST, it work. But it's tedious, and I can't edit user's serversync-client.cfg in server terminal

I'm ever so grateful if you can solve my problem.

commented

The tool was not really designed for transferring single files.

The preview versions have limited support for redirecting files, you could potentially set up a directory with only the file you want to sync and then configure a redirect pattern to put it somewhere else on the client.
https://github.com/rheimus/ServerSync/releases

The functionality is of course not thoroughly tested so there are probably bugs present.

Example server config:

{
  "general": {
    "push_client_mods": false,
    "sync_mode": 2
  },
  "connection": {
    "port": 38067
  },
  "rules": {
    "directory_include_list": [
      "stuff_to_serve"
    ],
    "file_ignore_list": [ ],
    "redirect_files": [
       {"pattern": stuff_to_serve/CustomSkinLoader.json, "redirectTo": "CustomSkinLoader"}
    ]
  },
  "misc": {
    "locale": "en_US"
  }
}
commented

I intend to split directory management and file inclusion in the future which will allow for individual file sync if desired.

commented

Closing this to be covered by #215