Just wanted to share my syncing code for client and server using WinRAR and windows Batch. Maybe somebody wanted to do something similiar and can make use of this

pastebin.com/Q2UDt7QD
pastebin.com

Posted May 28, 2013, 1:39 PM UTC

812
Don_Andy•

You can probably skip extracting forge and merging it into the minecraft_server.jar. As far as I'm aware you can just rename the Forge zip file into a jar, put it in the same folder as the minecraft_server.jar and then run the Forge jar instead of the server jar.

That makes it a lot easier to update/downgrade Forge.

3
badhardOP•

I read that too, but doesnt work for me for some reason and in the end, it would just to the same ;-)

since both are archives you have to extract one and add it to another one. There is no way around that :)

1
Don_Andy•

Hm, that's alright, it works either way. I just like having a clean jar, in case of updates/changes, which is why I also love MultiMC.

I've been running servers with it ever since the feature was implemented into Forge, but if it doesn't work for you, it doesn't work.

Good job on the script in either case!

2
badhardOP•

oh just wanted to add:

  • its for local server-files
  • it syncs forge
  • configs
  • mods
  • coremods

based on what your server already has so you dont copy over client side mods like inventory tweaks etc.

Its searched is based on

  • ModName x.x.x.x.extension

so basically it splits into 2 strings using first space

2
SofusTheGreat•

Why do you have :endX when there's practically no need for them?

2
badhardOP•

its for debugging purpose so I can jump to them and terminate early or overgo one section with GOTO

1
DoctorCube•

Man this is something that needs to be in the launcher by default. Point it at a server and copy configs.

2
badhardOP•

well if you use the FTB launcher, the server files and client files should be the same. But it is very usefull if you do your own pack or for testing purposes.

2
febcad•

Any chance of a version for 7zip, since that is free (and yields better and faster compression for me)?

Also you can have excactly identical folders by using symbolic links (mklink /j /d Target Source) on windows vista/7 (i know you don't want this, but added this anyway).

1
badhardOP•

I dont use 7zip but since I just use 2 Winrar commands and its just extracting and compressing I am pretty sure you can do something similiar

ok I just looked it up, you just have to replace winrar with 7zip. Every switch I use is the same in 7zip

And yes I know, but since you want to test your client first (since it can break something and you dont want to destroy your server :)) I dont want linked folders and since you cannot have all mods you use on your client on your server too (for example InvTweaks) this is basically the safer route.

1
Raizunne•

Any chance you show us how to use it? or where to place it? Its a very nice tool and will surely be helpful to lots of people, as myself :D. Thanks in advance.

1
badhardOP•

Its a so called Batch File in Windows (files ending with *.bat)

Its like a small script which can be run and emulate as you would type in the commands in your shell (CMD under run program)

You can place it whereever you want, but just have to specify the locations of your local server and your client. the first few lines declare everything.

  • set forge=instMods/forge.zip I use MultiMC so my Forgefile is located at instmods (where all JAR mods are installed) forge just searched for files with forge in it so I dont have to specify which version (* is used as a placeholder and can mean "this can be anything")
  • set jar=minecraft_server.jar how your server jar is written
  • set RootClient=D:/Games/Multi MC/instances/[1.5.2] Feed the Beast/minecraft root folder of your client
  • set RootServer=D:/Data/Dropbox/Computer/Spiele/Minecraft/Server root folder of your server
  • set ConfigClient=%RootClient%/config config folder client
  • set ConfigServer=%RootServer%/config config folder server
  • set CoreClient=%RootClient%/coremods core folder client
  • set CoreServer=%RootServer%/coremods core folder server
  • set ModClient=%RootClient%/mods mod folder client
  • set ModServer=%RootServer%/mods mod folder server

If you are using MultiMC and standard Minecraft Server you would only need to change these 2 lines

  • set RootClient=D:/Games/Multi MC/instances/[1.5.2] Feed the Beast/minecraft
  • set RootServer=D:/Data/Dropbox/Computer/Spiele/Minecraft/Server

since it depends where on your system it is located.

1