Thread: http download of custom content

Results 1 to 13 of 13
  1. #1
    Nami Swaaan! <3 Lento's Avatar
    Join Date
    Apr 2002
    Location
    Grand Line
    Posts
    973

    http download of custom content

    Someone posted this on the hlds mailinglist, might be interesting for a few admins out there...

    ---

    Half-Life Fast HTTP Asset Downloading Instructions
    V1.02 January 22, 2004


    SUMMARY
    -------

    Half-Life now supports the download of custom content (maps,
    skins, sounds, and so on) from a HTTP server (ie: webserver)
    when connecting, instead of downloading directly from the
    game server itself.

    HTTP downloading has three major benefits:

    1) There is no impact on the game server when downloading
    custom content, as a completely separate HTTP content server
    does the transfer

    2) Players will download custom content at their maximum
    transfer rate, resulting in *much* faster downloads

    3) Players who are downloading custom content do not take up a
    player slot on the server while they wait



    WHAT PLAYERS CONNECTING TO A SERVER WITH CUSTOM CONTENT WILL SEE
    ----------------------------------------------------------------

    When a player connects to a server utilizing custom content, one
    of two things will occur:

    1) If the server is not configured for HTTP download, the game
    server will use the normal "trickle" download mechanism

    2) If the server is configured for HTTP downloading, the player
    will see an enhanced download dialog, and much faster downloads.
    While this content is downloading, they are not connected to the
    game server. Once the download finishes, they are automatically
    reconnected to the game server, and ready to play.


    CONFIGURING YOUR SERVER TO USE FAST HTTP ASSET DOWNLOADING
    ----------------------------------------------------------

    1) Make a list of all the custom files (bsp, wav, mdl, etc)
    used on your server

    2) Put these files on a HTTP server (ie: webserver), keeping
    the folder layout intact

    3) OPTIONAL: To display a "banner image" to players that
    download content, place a 340x56 pixel image in the
    file <custom content directory>/gfx/banner.gif

    4) Set the sv_downloadurl cvar to
    "http://yourserver/custom_content_directory/"


    Example:

    Your server uses the non-standard map "de_generic", which
    requires the following files:

    C:\Program Files\Steam\SteamCache\your@email.address\
    Counter-Strike\cstrike\maps\de_generic.map
    C:\Program Files\Steam\SteamCache\your@email.address\
    Counter-Strike\cstrike\de_generic.wad
    C:\Program Files\Steam\SteamCache\your@email.address\
    Counter-Strike\cstrike\sound\ambience\de_generic_a.wav
    C:\Program Files\Steam\SteamCache\your@email.address\
    Counter-Strike\cstrike\sound\ambience\de_generic_b.wav
    C:\Program Files\Steam\SteamCache\your@email.address\
    Counter-Strike\cstrike\sound\ambience\de_generic_c.wav


    You have web space (perhaps through your ISP) with the URL
    "http://www.turtlerockstudios.com/~matt" that you will use to
    host your custom content.

    To do this, you copy the files needed for "de_generic" to your
    webspace, placing them in a folder called "my_cstrike" in your webspace
    top-level directory, keeping their directory layout intact.

    You now have the following files in your webspace:

    http://www.turtlerockstudios.com/~ma...de_generic.map

    http://www.turtlerockstudios.com/~ma...de_generic.wad

    http://www.turtlerockstudios.com/~ma...bience/de_gene
    ric_a.wav

    http://www.turtlerockstudios.com/~ma...bience/de_gene
    ric_b.wav

    http://www.turtlerockstudios.com/~ma...bience/de_gene
    ric_c.wav

    You now set the "sv_downloadurl" cvar on your game server to
    "http://www.turtlerockstudios.com/~matt/my_cstrike/". Now,
    players who connect to your server will automatically download the map
    "de_generic" and its required files from your webspace when they connect

    (unless they already have it, of course).

    TECHNICAL DETAILS
    -----------------

    * The maximum length of the sv_downloadurl is 127 characters

    * A username and password can be specified for the HTTP server
    by embedding them in the sv_downloadurl like so:

    http://username:password@www.somewhere.com/

    ( Note - recent IE patches make disable this functionality )

    * If a connecting player has an existing file of the same name,
    it will not be overwritten. The download file will be skipped.

    * Certain game-crtical and/or dangerous files cannot be
    downloaded (ie: *.exe, *.vbs, etc)

  2. #2
    absolute cherry
    Join Date
    Aug 2003
    Location
    Sweden
    Posts
    2,124
    thats great!

  3. #3
    Tenbatsu Enjiru Sabatashi
    Join Date
    Jan 2004
    Posts
    128
    Woah O_O *gets extra web server ready
    69.93.79.3:27015 SvenCoUzi.com SC 3.0 Fun Server!
    www.SvenCoUzi.com

  4. #4
    Mixmaster
    Join Date
    Aug 2001
    Location
    Milton Keynes
    Posts
    714
    Nice Heads Up Lento!!!

    Im locking this to stop trash being posted so its easy to read and making it sticky.

    Thanks!
    For all your soulfull house needs, go to--->>DJMrMagics Web Site

  5. #5
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,466

    Re: http download of custom content

    Reopening this thread because I'm curious if this information is still up to date. (I don't know anything about running servers)

  6. #6
    Not in the circlejerk S. H. Lynx's Avatar
    Join Date
    Sep 2009
    Location
    Santiago, Chile
    Posts
    186

    Re: http download of custom content

    Quote Originally Posted by Nih View Post
    Reopening this thread because I'm curious if this information is still up to date. (I don't know anything about running servers)
    sv_downloadurl still works if that's what you're asking.

    There's a small bug in SC that shows all files as "completed" but in fact they're downloading. (you can't see the download progress)

    Servidor Hispano de Sven Co-op

    Current HN: Luces en Babel / Babylon (Steam) - I no longer use S. H. Lynx on my work.
    SteamID

  7. #7
    incognico nico's Avatar
    Join Date
    Aug 2015
    Posts
    441

    Re: http download of custom content

    Quote Originally Posted by Nih View Post
    I'm curious if this information is still up to date.
    sv_downloadurl is, the banner image is not.

    Also the method of (actually) copying files in the fastdl folder is a bit outdated and we have svencoop_addon, most people who host a sven server also have a web server installed and just serve svencoop_addon.

    My first 2 protips at http://forums.svencoop.com/showthrea...l=1#post513418 basically cover this.

  8. #8
    Registered User tridz's Avatar
    Join Date
    Jan 2016
    Location
    Istanbul,Turkey
    Posts
    63

    Re: http download of custom content

    Is it possible to zip the maps like in source games. If it is possible can someone give me a name for the program to do the zipping?

  9. #9
    incognico nico's Avatar
    Join Date
    Aug 2015
    Posts
    441

    Re: http download of custom content

    Quote Originally Posted by tridz View Post
    Is it possible to zip the maps like in source games. If it is possible can someone give me a name for the program to do the zipping?
    No it is not.

    But what you can try is if http compression with defalte or gzip in your webserver on the *.wad *.wav *.bsp *.txt and *.cfg files - you need to extensively test this though.

    I wanted to check some day if and what Accept-Encoding the Valve HTTP client sends. Maybe a dev can quickly grep the sources or tell from knowlegde if this will work or not.

  10. #10
    Registered User
    Join Date
    Mar 2016
    Posts
    15

    Re: http download of custom content

    it seems not working for all map files ? i am using it and its working but sometimes the game downloading mdl and wav files normally without http url

  11. #11
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [uk]
    Posts
    8,486

    Re: http download of custom content

    That'll likely be because a map RES file is missing resources.
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  12. #12
    Green eyed cat @n!t@'s Avatar
    Join Date
    Jan 2009
    Location
    Anitalink.com
    Posts
    150

    Re: http download of custom content

    Quote Originally Posted by Lento View Post
    3) OPTIONAL: To display a "banner image" to players that
    download content, place a 340x56 pixel image in the
    file <custom content directory>/gfx/banner.gif
    Removed from the current hl & sc version *cry*
    Anitalink.com
    Жизнь порой несправедлива... но любовь придаёт этой несправедливости смысл...
    Life is unfair from time to time... But love gives a sense to this injustice...

  13. #13
    incognico nico's Avatar
    Join Date
    Aug 2015
    Posts
    441

    Re: http download of custom content

    Quote Originally Posted by nico View Post
    No it is not.

    But what you can try is if http compression with defalte or gzip in your webserver on the *.wad *.wav *.bsp *.txt and *.cfg files - you need to extensively test this though.

    I wanted to check some day if and what Accept-Encoding the Valve HTTP client sends. Maybe a dev can quickly grep the sources or tell from knowlegde if this will work or not.
    Clarification, a bit later (lol): SC supports gzip HTTP transfer compression. If you tell your fastdl webserver to compress the mime types "text/* audio/* image/* application/octet-stream" this should compress all custom content (application/octet-stream is used for files with unkown mime types like wad/bsp/mdl assuming you have not added any custom filetype/mime associations). Also use a reasonable minimum filesize (like only compress files >4KiB). mod_deflate for lighttpd or apache can do this (on the fly compression). But note that compression uses CPU power, especially when the webserver is running on the same host as the gameserver (think 20 players on mapchange to a new map with loads of content). Compression level also matters. Traffic-wise with such a configuration it is about the same as fastdl on Source games, just that gzip instead of bzip2 is used.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •