Raised This Month: $ Target: $400
 0% 

Bzip2 Compression on the fly ! (fastdownload/sv_downloadurl)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 08-29-2009 , 20:03   Bzip2 Compression on the fly ! (fastdownload/sv_downloadurl)
Reply With Quote #1





I always found it annoying, having to compress files everytime I upload a new map/texture/sound to my server manually. That's why I started thinking about if it would be possible to compress files on the fly while the client is downloading it.

And yes, it's possible

I've spent some hours writing a PHP script and filed it out allot.

Requirements:
  • Apache2 webserver running on the server machine where the gameserver is
  • Apache2 mod_rewrite
  • PHP 5
Features:
  • On the fly bzip2 compression of any files (you can specify the allowed file extensions in config.inc.php)
  • File caching (so already compressed files don't have to be compressed again)
  • Simultanous file sending to clients (clients don't have to wait for the first client to be finished)
  • Multiple server support
  • Specify allowed file extensions
Installation
  1. Simply unzip and upload the attached directory to your webserver directory.
  2. Edit config.inc.php to match your needs
  3. Set chmod of cache to 0770 (rwxrwx---)
  4. Change the sv_downloadurl of your gameserver(s):
Example: sv_downloadurl www.your-domain-or-ip.tld/bzip2_onthefly/configname

Put this line into your cfg/server.cfg file.

Enjoy

Note: Doesn't work for TF2 (and other orangebox games ?) atm.
Attached Files
File Type: zip bzip2_onthefly.zip (2.1 KB, 781 views)
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

Last edited by berni; 09-13-2009 at 05:00.
berni is offline
 



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 22:55.


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