Raised This Month: $51 Target: $400
 12% 

Convert Server Files in Bz2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 11-10-2023 , 09:46   Convert Server Files in Bz2
Reply With Quote #1

I made a batch script to convert all your server files in a bz2 format since some FastDL's require that, hopefully this will be useful. (this should be in a .bat file, ex: script.bat)

**Don't forget to download 7-zip for this to work**

PHP Code:
@echo off
setlocal enabledelayedexpansion

REM Set the path to 7
-Zip executable
set 
"zipPath=C:\Program Files\7-Zip\7z.exe"

REM Set the path to the folder containing files to be converted
set 
"sourceFolder=C:\your\folder\with\files\cstrike"

REM Set the path to the folder where you want to save the compressed files
set 
"destinationFolder=C:\your\folder\saving\compressed\files"

REM Ensure the destination folder exists
if not exist "%destinationFolder%" mkdir "%destinationFolder%"

REM Define the list of file extensions to be ignored
set 
"ignoreExtensions=.cfg .bat .ico .txt .scr .log .css"

REM Compress files in the source folder and its subfolders into .bz2 format
for /"%sourceFolder%" %%i in (*) do (
    
set "relativePath=%%i"
    
set "relativePath=!relativePath:%sourceFolder%=!"

    
REM Get the file extension of the current file
    set 
"fileExtension=%%~xi"

    
REM Check if the file extension is in the list of ignored extensions
    
echo "!ignoreExtensions!" find "!fileExtension!" nul && (
        echo 
Ignoring"%%i"
    
) || (
        
"%zipPath%" -tbzip2 "%destinationFolder%!relativePath!.bz2" "%%i"
        
echo Compressed"%%i"
    
)
)

echo 
Compression completed.
pause 

Last edited by elmedin; 11-10-2023 at 10:02.
elmedin is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-11-2023 , 00:02   Re: Convert Server Files in Bz2
Reply With Quote #2

IIRC, fast download uses only uncompressed files for Half-Life-based (HLDS) games. I read that most Source-based games support this though but in that case this would only be applicable in the Source Servers (SRCDS) forum.
__________________
fysiks is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 11-11-2023 , 02:35   Re: Convert Server Files in Bz2
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
IIRC, fast download uses only uncompressed files for Half-Life-based (HLDS) games. I read that most Source-based games support this though but in that case this would only be applicable in the Source Servers (SRCDS) forum.
Actually a hosting service i am currently using requires bz2 compressed format for CS 1.6 files. I'm not sure if they're the only one.
elmedin is offline
DeteCT0R
Member
Join Date: Jun 2012
Location: My Home
Old 11-11-2023 , 03:54   Re: Convert Server Files in Bz2
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
IIRC, fast download uses only uncompressed files for Half-Life-based (HLDS) games. I read that most Source-based games support this though but in that case this would only be applicable in the Source Servers (SRCDS) forum.
Actually Half-Life-based games support gzip but no bz2. (I never tested gzip on any HL Based game because model and map size is not that big like in Source engine)
__________________
My steam:

Last edited by DeteCT0R; 11-11-2023 at 03:56.
DeteCT0R is offline
elmedin
Senior Member
Join Date: Nov 2013
Location: Bruh
Old 11-11-2023 , 04:11   Re: Convert Server Files in Bz2
Reply With Quote #5

Quote:
Originally Posted by DeteCT0R View Post
Actually Half-Life-based games support gzip but no bz2. (I never tested gzip on any HL Based game because model and map size is not that big like in Source engine)
Hmm probably you're right, the host admin just told me to bz2 compress them which was very weird because i never had to compress any cs 1.6 files ever. Gonna recheck this and if its true gonna delete this thread and put it for source if anyone wants to use this batch.
elmedin is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-11-2023 , 16:43   Re: Convert Server Files in Bz2
Reply With Quote #6

Quote:
Originally Posted by DeteCT0R View Post
Actually Half-Life-based games support gzip but no bz2. (I never tested gzip on any HL Based game because model and map size is not that big like in Source engine)
Do you have any documentation that you can point me to that mentions gzip support with HLDS games? This is the first time I've seen this stated. I know that HLDS does its own compression for direct/trickle download for some files (these are the .ztmp files and they reside right next to the original files are not not used at all if the files are available on fast download).
__________________
fysiks is offline
DeteCT0R
Member
Join Date: Jun 2012
Location: My Home
Old 11-12-2023 , 07:30   Re: Convert Server Files in Bz2
Reply With Quote #7

There is no documentation anywhere not even on wiki. Probably people didnt know because mapsize small and dont really need.
But i saw somewhere on github Alfred said this.
__________________
My steam:
DeteCT0R is offline
pokezao
Member
Join Date: Oct 2014
Old 11-12-2023 , 13:35   Re: Convert Server Files in Bz2
Reply With Quote #8

Here you have more information about that: https://github.com/R4to0/scstuff/wik...oad-in-GoldSrc
pokezao is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-12-2023 , 14:38   Re: Convert Server Files in Bz2
Reply With Quote #9

Nice, thanks for this info.
__________________
fysiks is offline
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 11-12-2023 , 15:21   Re: Convert Server Files in Bz2
Reply With Quote #10

Does it work?
__________________
amirwolf is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode