• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Server How to Compress Maps for Download Redirect the Easy Way

Colonel Panic

Grizzled Veteran
Jul 5, 2009
313
5
I wrote up this little script which simplifies matters, especially if you have custom meshes and textures to go with your maps. Every time you run it, it will overwrite the previous files compressed by this script unless you move them, though I don't expect this should ever be a problem, be forewarned anyway.

paste the following into a text file and name it CompressMaps.bat and put it in your kf server system folder.
Code:
ucc compress ..\maps\*.rom
ucc compress ..\staticmeshes\*.usx
ucc compress ..\textures\*.utx

mkdir ..\maps\compressed\
echo a|move ..\maps\*.uz2 ..\maps\compressed\
echo a|move ..\staticmeshes\*.uz2 ..\maps\compressed\
echo a|move ..\textures\*.uz2 ..\maps\compressed\
whenever you add new maps now, just run the script, and then do a bulk upload of everything in the new maps\compressed\ directory to your download server (recommend using the option to skip already existing files when uploading, to save time and bandwidth)
 
Last edited:
When adding
Code:
echo a|move ..\compress\*.uz2 ..\compress\compressed\
to my pre made script i get the error "a duplicate file name exists or the file cannot be found" so it isn't moving the files.

Any ideas?

Edit: ok figured out that it was looking in the dir above so changed to
Code:
echo a|move ..\KF Compression Tool v2\compress\*.uz2 ..\KF Compression Tool v2\compress\compressed\
and now i get the error: "the syntax of the command is incorrect" - spaces in the name?

Edit2: sorted thanks (was spaces), nice little feature to add to my compression tool :)

Download it here if anyone is interested...
 
Last edited:
Upvote 0
Yeah, you need to enclose in quotes if you're specifying a path that contains spaces.

the ..\ indicates up one directory though, so if you're running it from INSIDE the "KF Compression Tool" folder as your post suggests, you can omit the ..\ and also the current directory... i.e., it would be just
Code:
echo a|move compress\*.uz2 compress\compressed\
though if I were doing it with an app like that, I would just have it move the compressed files automagically from the respective KF folders into an arbitrary consolidated location. You can then have the script open the destination using
Code:
explorer "<filepath>"
my script was just meant to be a really simple way to combine the compression arguments for multiple folders into one, then consolidate the results.
 
Upvote 0
Why do you echo a?

When you execute move to a previously used directory, it will open a prompt, asking if you want to overwrite any files of the same name. The options are (y)es, (n)o or (a)ll. By piping an a (via echo a |) to the command when executing, it fills the prompt with the a in the buffer and confirms an overwrite all. It's necessary to keep the script from being interrupted if the script is run multiple times and the directory it is dumping to is not emptied each time.
 
Upvote 0
When you execute move to a previously used directory, it will open a prompt, asking if you want to overwrite any files of the same name. The options are (y)es, (n)o or (a)ll. By piping an a (via echo a |) to the command when executing, it fills the prompt with the a in the buffer and confirms an overwrite all. It's necessary to keep the script from being interrupted if the script is run multiple times and the directory it is dumping to is not emptied each time.

Oh... that was a batch script... /me assumed it was Linux with a move alias from mv by only looking at the Code section, and feels like he walked in the girls' bathroom, walking out now.

Second question, by actually reading the thread this time, do I simply upload every file in maps\compressed to my fast downloads server? I do not have to put them in subdirectories like the Source Engine:

server\
server\maps
server\staticmeshes
server\textures

? And obviously in the RedOrchestra.ini I give the URL of the server for RedirectToURL, but is it the same for ProxyServerHost?

Code:
[IpDrv.HTTPDownload]
RedirectToURL=
ProxyServerHost=
ProxyServerPort=3128
UseCompression=True
 
Last edited:
Upvote 0