Raised This Month: $32 Target: $400
 8% 

HTTP Resources Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-13-2012 , 15:26   HTTP Resources Manager
Reply With Quote #1

PLEASE DON'T USE IT FOR NOW, I NEED TO REWRITE IT.



HTTP Resources Manager
∞ v1.0, released November 13th, 2012


In short summary, the main purpose of this module is to allow sending files from an HTTP server to the clients when they connect to a game server.
It has the same goal as you would precaching generic files from an AMX Mod X plugin or from a mapname.res file.
Except through the module has some advantages !

How the module can be useful for me ? Here some situations you can consider :
  • Reducing the number of wav sounds precached from plugins/modules to avoid to go over the 512 items limit.
    We are talking about sounds not emitted (played on a specific client).
    If you want to use a lot of such sounds, the module is for you ;


  • Avoiding the limit of 1280 items you can send on the client. Such list contains all the default resources
    of the current game, map and any custom resources. It's a limit you encounter less often than
    the limit of 512 items per resources type, but depending the map, game and the plugins/mods installed
    it could be easily hit. For example, in CZ, de_dust2 and without plugins, the count is already to 970 ;


  • Using several download urls. It might useful if your HTTP server is limited in number of connections,
    is full, or any kind of limitation, and you would need several HTTP servers. As note, the first version
    of this module doesn't support yet urls per resources type or group ;


  • Preparing your server to some event which requires to download a lot of new resources. For example,
    you've prepared a mod to be activated at some date, you may want to make your players downloading progressively
    such new resources over few days. to avoid your HTTP server exploding or be limited in speed because too
    much players are trying to download at once ;


  • And more... probably ! ;p

Contents :


FEATURES
∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙

As note, the module title includes "manager" because we can manage the urls to use and resources to send per client.
But for now, it's a first and simple version, more features will come to complete the list.

Here a list of current features :
  • Can send an unlimited number of files to the client
    Tried only to send 2000+ files, but if a limit exists, it should be the client memory.


  • Support multiple sv_downloadurl entries
    At the moment, if several entries are provided,
    It will rotate the urls at each client's connection.


  • Resources/urls are configured through a config file and can be defined per map or per map prefix
    Support an unlimited number of entries.
    Can provide a directory only and module will retrieve all the files containing inside.


  • Include a fix to get around the download issue where you can't download from HTTP server anymore
    After a disconnection, if you try to download something, it will get the files from the game server instead.
    And unless you restart the game to clear the memory, it could not be fixed.
    Until now with a plugin/module through a magic reconnection !


  • Support all the HL1 mods.
    Not really a feature but it looks good to put there ;p.
    Not surprising though since we are talking about engine and it's the same for all games.

CREDITS
∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙
  • Joropito : for his CHooker library and general coding help ;
  • Bos93 and mazdan : for their plugins which fix the download issue

HOW IT WORKS ?
∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙

Some people may not really understand what is this limit of 1280 and such.
I will try to explain globally the context.

An image is better than words. I've simplified and it's basically what happens :
Spoiler

More technically, SV_SendResources consists of 3 engine messages :
  • SVC_RESOURCEREQUEST
    To control whether the list on the client is up-to-date, based on server spawn count, in case server has restarted and a new list must be requested again.


  • SVC_RESOURCELOCATION
    It's there you provide the download url the client will use to download from HTTP server, if available.


  • SVC_RESOURCELIST
    Big message containing the list of all resources.
What does the module, is basically to hook SV_SendResources and rewritting the whole function.
This way, we can control what download url, and we add any custom resources after sending what contains the list.


CONFIGURATION
∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙

The configuration allows the use of custom resources and urls in a file per map and per map prefix.
All configuration files go there : addons/http_resources_manager/configs/.
  1. How to name the configuration files :

    • @default.res : It's an unique file name for all maps, a fallback if no per map or per prefix files are found.
    • mapname.res : It will match the exact map name.
    • prefix-prefixmap.res : It will match any maps starting with prefixmap_.

    Example with de_dust : de_dust.res and prefix-de.res.

    The module will check the configuration files this order : prefix-prefixmap.resmapname.res@default.res.
    It means this order will act as fallback for resources and urls : checking config files until getting something.


  2. To edit the configuration files :

    The format is, for now, very simple. Here an example :
    Config format

    The rules :
    • Any urls must be preceded by downloadurl ;
    • One line per url or resource :
    • Max url length is 128 characters ! Any urls length superior to that will be truncated :
    • Max resource path length is 63 characters ! Any resources length superior to that will be ignored :
    • You can provide a directory but it's not recursive (meaning, any others folders inside are ignored) ;
    • Don't put quotes or anything, do like the example.

COMMAND
∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙

For troubleshooting, a command exits to help this way, showing useful informations : rm
Usage : [rm] <command>

Commands :
  • version
    Display some informations about the module and where to get a support. I.e :
    example


  • status
    Display module status.
    Useful for people where the module doesn't work and they can't check the server logs. I.e :

    example


  • config
    Display configuration status.
    Useful to see how the configuration files have been parsed and seeing any message error. I.e :

    example

GENERAL NOTES
∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙
  • Tested alone, not sure if all will work properly with several players ;
  • The module uses function from engine and a signature was needed for windows. It's based on the latest version. Don't bother me if some are not found on your non-steam server.

TO-DO/IDEAS LIST
∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙
  • Associating an url to resource type or a groupe of resources ;
  • Make recursive the search in a directory ;
  • Need to test if we can send several SVC_ messages so we could do something with the non-custom resources ;
  • Per-country custom urls (Joropito's idea)
  • Vip custom urls (Joropito's idea)
  • Add a command to output the list
  • Maybe add a check that a provided url exists, could be useful for troubleshooting
  • Maybe doing the same for custom resources, not sure for both.
  • ... give me your ideas!

CHANGE LOG
∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙

v1.0 - November 13th, 2012
Initial release.

INSTALLATION
∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙

It's a metamod module. It's something you install like AMX Mod X, for example.
  1. If not done already, install metamod ;
  2. Download http_resources_manager-files.zip and extract the content in your addons/ directory ;
  3. Open addons/metamod/plugins.ini file, add the following line and save :
    If windows server : win32 addons/http_resources_manager/dlls/http_resources_manager_mm.dll
    If linux server : linux addons/http_resources_manager/dlls/http_resources_manager_mm_i386.so
  4. If your server is behind a router, you can explicit the internet IP by adding the following cvar in your server.cfg : ip "x.x.x.x".
    You must provide it otherwise your players won't be able to connect to your server ;
  5. Configure as you wish ;
  6. Restart your server ;
  7. Check if all is good using the server commands : rm status and rm config.

INSTALLATION FILES
∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙∙ ∙

http_resources_manager-sources.zip : contains the project source code.
http_resources_manager-files.zip : contains the binaries file.


PLEASE DON'T USE IT FOR NOW, I NEED TO REWRITE IT.
Attached Files
File Type: zip http_resources_manager-sources.zip (35.2 KB, 1422 views)
File Type: zip http_resources_manager-files.zip (37.8 KB, 2011 views)
__________________

Last edited by Arkshine; 11-18-2014 at 06:17.
Arkshine is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-13-2012 , 15:26   Re: HTTP Resources Manager
Reply With Quote #2

Reserved.
__________________
Arkshine is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-13-2012 , 15:27   Re: HTTP Resources Manager
Reply With Quote #3

Phew! Finally made it. It took me some times. .
I may forgot some informations, but I guess it's enough for now.

Hope the module won't crash for you guys !
__________________

Last edited by Arkshine; 11-13-2012 at 15:33.
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 11-13-2012 , 15:33   Re: HTTP Resources Manager
Reply With Quote #4

I don't think this could work....

Anyone willing to test?
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-13-2012 , 15:34   Re: HTTP Resources Manager
Reply With Quote #5

Make sure you wear some protection, your computer may explode. This module offers no guarantee. Sorry.
__________________

Last edited by Arkshine; 11-13-2012 at 15:35.
Arkshine is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 11-13-2012 , 15:38   Re: HTTP Resources Manager
Reply With Quote #6

Nice and great job! Thank you for releasing Arkshine !! I'm going for some tests, thank you again.

Spoiler

Last edited by dFF; 11-13-2012 at 15:38.
dFF is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-13-2012 , 15:41   Re: HTTP Resources Manager
Reply With Quote #7

No, it's a directory. ;) Module will retrieve files automatically inside it.

Read my post !!
__________________

Last edited by Arkshine; 11-13-2012 at 15:41.
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 11-13-2012 , 15:53   Re: HTTP Resources Manager
Reply With Quote #8

Ok, let's go with features or improvements

- Some tests with anti-retry plugins should be done. Having some forward tolet plugins know about that situation could be usefull.

- Per-client country url management (custom urls for a country list, maybe with custom files per-country)

- Vip urls? (let vip users use very fast web downloads)

- Url load balancing (with weight)
Example:

url 30 http://xxx.xxx.xxx.xxx/cstrike
url 70 http://yyy.yyy.yyy.yy.yyy/cstrike


Then, 30% of users will go to xxx url, 70% of users to yyy.
This is useful when you pay for bandwidth on web hostings

__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Bos93
Veteran Member
Join Date: Jul 2010
Old 11-13-2012 , 15:55   Re: HTTP Resources Manager
Reply With Quote #9

Quote:
Originally Posted by Arkshine View Post
Make sure you wear some protection, your computer may explode. This module offers no guarantee. Sorry.


WOW! Arkshine,thank you very much!!!

I really needed it.
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Bos93
Veteran Member
Join Date: Jul 2010
Old 11-13-2012 , 15:58   Re: HTTP Resources Manager
Reply With Quote #10

# models/shogun

maybe # models/shogun.mdl?
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
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 12:08.


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