Jump to content

Automatic sv_downloadurl provisioning


KingJ

Recommended Posts

Using TCAdmin, is there any way to automatically put the contents on a web server and add the correct sv_downloadurl parameter in their server.cfg?

 

Currently, we setup a download url on request for users on an IIS website, giving them a subdirectory of their server ID.

 

If there is any way to automatically add their subdirectory to IIS, or any other webserver that could be run on an alternative port and set the parameter in the server.cfg i'd like to know - it would save us a lot of time.

 

I know you can simply give users some separate webspace to act as a sv_downloadurl but then they have to upload all content twice and does not account for any map packs or mods the users install via TCAdmin, this is why direct access is preferred.

 

Thanks.

Link to comment
Share on other sites

What I think you mean is that tcadmin automatically create a virtual host for folders like : maps, materials, ... and that they can access to these folders with an adresse like : customer.yourcompany.com/downloadurl/ and then they can use that adresse for a download url ?

 

I don't think that Tcadmin do that. Maybe in next version? But I don't know... Have to install IIS on each server then make an A redirection for each domain. Hard to make a script for that.

Link to comment
Share on other sites

I'll have a look into that, there must be some way to script the adding of virtual directories. However, I still have to manually add in the correct URL into their server.cfg - unless this can be scripted too?

 

How did you do it previously Dan? As you do it on request now I guess you had some form of automated system previously?

 

Edit: Looking around there is a handy script that MS provide with IIS called iisvdir.vbs which lets you add/delete vdirs from IIS from command line. I could almost certainly integrate this with the Install/Uninstall script options. I'll have a play around with it and let you know how it goes.

Link to comment
Share on other sites

Okay, i've come up with the following script for install:

 

iisvdir /create "Download Redirects" "%serverip%:%serverport%" "%userfilespath%"

 

and for uninstall:

 

iisvdir /delete "Download Redirects"/"%serverip%:%serverport%"

 

The install script will need to be altered slightly for each game, as %userfilespath% points to the root directory rather than the cstrike folder for example (Edit: Just found that I can set the %userfilespath% to the correct path in the game config, why it isn't at cstrike already I don't know). Other than that, it's all working! :) Thanks for the tip off about the install/uninstall scripts - didn't think of that.

 

However, I don't see an option to run the install script on an existing server. I do have existing servers that i'd like to run this on. The only way I can think of running the script (from TCAdmin, I could run it externally...) is to move the server to another and back again (Time/Data consuming) or reinstall the server (upon which all data is lost). Are there any other options for running the install script from TCAdmin?

 

 

Also, here is a bit of SQL you can run to add this install/uninstall script to all Source and GoldSRC servers:

 


UPDATE tc_games SET INSTALL_SCRIPT = 'iisvdir /create "Download Redirects" "%serverip%:%serverport%" "%userfilespath%"' WHERE `RELATIVE_EXECUTABLE` LIKE '%SRCDS%' OR `RELATIVE_EXECUTABLE` LIKE '%HLDS%'

 

UPDATE tc_games SET UNINSTALL_SCRIPT = 'iisvdir /delete "Download Redirects"/"%serverip%:%serverport%"' WHERE `RELATIVE_EXECUTABLE` LIKE '%SRCDS%' OR `RELATIVE_EXECUTABLE` LIKE '%HLDS%'

 

You will have to correctly set the user files path yourself however. At least you can easily set this bit!

Link to comment
Share on other sites

What path does %gameserverroot% return? sv_downloadurl requires the root of the given URL to be the inside of the mod folder (i.e the contents of cstrike, tf etc), not the contents of the folder containing srcds.exe

 

I've set all the user file paths to the appropriate mod directory, and now the setup of sv_downloadurl in IIS is working fine. All I need to know now is a way to execute the setup script from within TCAdmin after a server has been installed.

Link to comment
Share on other sites

%gameserverroot% - C:\UserFiles\username\T1238238923892\

 

%userfilespath% - C:\UserFiles\username\

 

If you want it to point to the cstrike folder, then just use -> %gameserverroot%cstrike\

 

When it prints out it should be C:\UserFiles\username\T1238238923892\cstrike\

Link to comment
Share on other sites

%gameserverroot% - C:\UserFiles\username\T1238238923892\

 

%userfilespath% - C:\UserFiles\username\

 

If you want it to point to the cstrike folder, then just use -> %gameserverroot%cstrike\

 

When it prints out it should be C:\UserFiles\username\T1238238923892\cstrike\

 

That's not what i'm seeing.

 

For me, %userfilespath% produces the root path (e.g C:\Servers\username\T1238238923892) combined with the "Relative User Files Directory" defined in the game config. So I a user is located in C:\Servers\username\T1238238923892 and the game is cstrike, %userfilespath% is C:\Servers\username\T1238238923892\cstrike, which is the correct directory for the sv_urldownload base.

Link to comment
Share on other sites

  • 6 months later...

Hey.

 

I wonder what can block creating VD? Any ideas? Im using iisvdir.vbs /create "sitename" "foldername" "pointpath" or iisvdir /create "sitename" "foldername" "pointpath"

 

I typed that in comand line and nothing has happened.

Link to comment
Share on other sites

iisvdir /create "Download Redirects" "87.98.131.182:27015" "C:\UserFiles\ADMIN\GameServers\TC21584618180557782530483\cstrike"

 

Connecting to server ...Done.

Could not find website Download Redirects

Type IIsVDir /create /? for help.

Link to comment
Share on other sites

iisvdir /create "Download Redirects" "87.98.131.182:27015" "C:\UserFiles\ADMIN\GameServers\TC21584618180557782530483\cstrike"

 

Connecting to server ...Done.

Could not find website Download Redirects

Type IIsVDir /create /? for help.

 

You need to have a Website in IIS called "Download Redirects", see the attachment for details.

downloadredirects.JPG.e7b2b0d1c4e5d8988e878c9b7d8505a6.JPG

Link to comment
Share on other sites

As you may know by default file's extensions such as .bsp or .cfg cant be downloaded from web site. You have to set that type of files in MIME Types menu: go to IIS menu, Properties of your website, than HHTP Headers and MIME Types than click New and set file extension.

 

On my web site i have reading permission and i advise you not to set Directory Browsing box so users cant browse web site.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Who's Online   0 Members, 0 Anonymous, 6 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use