[Release]Http Download Helper
Posts: 168
Joined: 02 Dec 2011, 17:23
Joined: 02 Dec 2011, 17:23
[Release]Http Download Helper
https://github.com/d3nd3/sof-win-http-helper
Its similar to the python one that was released by cheaterskeeter. It accesses the same sof1maps repository. But its not python based and might be less confusing to understand how it works (more open-source). I am going to use this one for windows, so I thought I'd share.
For the curious minded : it uses the sp_cl_info_map command repeatedly during connect to get the mapname as early as possible. Then it saves the mapname to a small file at sofplus/data/http_tmp, this file is read by a windows batch/cmd script which then calls curl.exe (which is provided) or can be downloaded from official curl website and extracted. The file that is downloaded is a zip file, so its then extracted also by the batch/cmd script, then deleted. If the mapname.bsp already exists in your directories it doesn't download. (sofplus handles that with sp_sc_file_find).
Latest version:
Its similar to the python one that was released by cheaterskeeter. It accesses the same sof1maps repository. But its not python based and might be less confusing to understand how it works (more open-source). I am going to use this one for windows, so I thought I'd share.
For the curious minded : it uses the sp_cl_info_map command repeatedly during connect to get the mapname as early as possible. Then it saves the mapname to a small file at sofplus/data/http_tmp, this file is read by a windows batch/cmd script which then calls curl.exe (which is provided) or can be downloaded from official curl website and extracted. The file that is downloaded is a zip file, so its then extracted also by the batch/cmd script, then deleted. If the mapname.bsp already exists in your directories it doesn't download. (sofplus handles that with sp_sc_file_find).
Latest version:
You do not have the required permissions to view the files attached to this post.
Last edited by d3nd3 on 12 Dec 2023, 05:50, edited 5 times in total.
Posts: 4056
Joined: 23 Nov 2011, 14:56
Joined: 23 Nov 2011, 14:56
Location: Netherlands
Re: [Release]Http Download Helper
I totally agree with Dende. No idea what he said but whatever.
You think I'm not online. But I'm always here. Scrolling. Judging.
]TÐW[Evil4N!
]TÐW[Evil4N!
Posts: 168
Joined: 02 Dec 2011, 17:23
Joined: 02 Dec 2011, 17:23
Posts: 234
Joined: 22 Jan 2014, 22:58
Joined: 22 Jan 2014, 22:58
Posts: 4056
Joined: 23 Nov 2011, 14:56
Joined: 23 Nov 2011, 14:56
Location: Netherlands
Re: [Release]Http Download Helper
lol... would the sof community believe us that you, me and ShocK used to be in the same clan back in the jolt/cpl days ? How the allegiances has changed since then
You think I'm not online. But I'm always here. Scrolling. Judging.
]TÐW[Evil4N!
]TÐW[Evil4N!
Posts: 718
Joined: 23 Nov 2011, 16:42
Joined: 23 Nov 2011, 16:42
Location: Canada
Posts: 234
Joined: 22 Jan 2014, 22:58
Joined: 22 Jan 2014, 22:58
Re: [Release]Http Download Helper
Trying on Windows 10
Had no problems with 7-Zip
PowerShell version: 5.1.19041.2673
Had no problems with 7-Zip
PowerShell version: 5.1.19041.2673
Posts: 409
Joined: 04 Dec 2011, 12:07
Joined: 04 Dec 2011, 12:07
Re: [Release]Http Download Helper
Nice work dende! once the script is changed to use a lower version of powershell (its only needed to extract a file (quick fix) or use 7z.exe as trekker says) + also replace curl.exe with powershell, it should be the standard http download method. and the other one to be deprecated.
Acadie is the maintainer of the sof1maps repository keeping everything up to date and working, thank you. when we have a version that gets individual files on demand, it should be added to a CE-lite version (with no broken map paks. nothing)
Acadie is the maintainer of the sof1maps repository keeping everything up to date and working, thank you. when we have a version that gets individual files on demand, it should be added to a CE-lite version (with no broken map paks. nothing)
Posts: 168
Joined: 02 Dec 2011, 17:23
Joined: 02 Dec 2011, 17:23
Re: [Release]Http Download Helper
Its updated to use powershell only now and not require curl. I'm not sure about supporting lower powershell versions. Thats something I am not looking into right now. There are too few users to consider for that.
Posts: 409
Joined: 04 Dec 2011, 12:07
Joined: 04 Dec 2011, 12:07
Re: [Release]Http Download Helper
you need to make it work for @Acadie, out of the box (this one person is a large % of the user base, and just so happens to be the person who will be maintaining the repo, so making sure it works for them is a top priority) - we require Acadies seal of approval!
Posts: 168
Joined: 02 Dec 2011, 17:23
Joined: 02 Dec 2011, 17:23
Re: [Release]Http Download Helper
The idea is improved now because the http listener window is not visible , starts hidden and auto-closes when SoF.exe is closed.
Posts: 234
Joined: 22 Jan 2014, 22:58
Joined: 22 Jan 2014, 22:58
Re: [Release]Http Download Helper
Works great.
Creates the necessary folders if not present and downloads maps in seconds.
Player will not see anything unless she/ he is in console which is good.
I moved all map packs from the Base folder, also moved/ renamed Maps, sound and textures folders.
No problems hopping servers getting huge custom maps in seconds.
Extracting the compressed file produces strange results, I even downloaded and installed the latest WinZip.
Both WinZip and 7-Zip fail to "extract to" and "extract here"; It acts as if "extract to sof-win-http-helper-master" was selected using Right-Click.
In my case it created the folder "sof-win-http-helper-master" in "sof\".
At least once, this folder was repeated as a sub-folder.
Tested from my Download folder as well as putting the compressed file in SoF\.
I just copy pasted manually till I find out what is going on (suspecting my system and/ or something I am doing as I tweaked the heck out of this Windows 10 installation)
The Launcher shortcut has to be executed from within the SoF Folder for me to work, creating a shortcut to the shortcut on the Desktop, flashes a window and sits idle!
My SoF is installed to: "C:\Users\MCNE\Soldier of Fortune"
After closing SoF, Http Download Helper terminates.
Readme file could be improved. Find it a bit confusing.
What is this with,
Start in: D:\sof1?!
Creates the necessary folders if not present and downloads maps in seconds.
Player will not see anything unless she/ he is in console which is good.
I moved all map packs from the Base folder, also moved/ renamed Maps, sound and textures folders.
No problems hopping servers getting huge custom maps in seconds.
Extracting the compressed file produces strange results, I even downloaded and installed the latest WinZip.
Both WinZip and 7-Zip fail to "extract to" and "extract here"; It acts as if "extract to sof-win-http-helper-master" was selected using Right-Click.
In my case it created the folder "sof-win-http-helper-master" in "sof\".
At least once, this folder was repeated as a sub-folder.
Tested from my Download folder as well as putting the compressed file in SoF\.
I just copy pasted manually till I find out what is going on (suspecting my system and/ or something I am doing as I tweaked the heck out of this Windows 10 installation)
The Launcher shortcut has to be executed from within the SoF Folder for me to work, creating a shortcut to the shortcut on the Desktop, flashes a window and sits idle!
My SoF is installed to: "C:\Users\MCNE\Soldier of Fortune"
After closing SoF, Http Download Helper terminates.
Readme file could be improved. Find it a bit confusing.
What is this with,
Start in: D:\sof1?!
You do not have the required permissions to view the files attached to this post.
Posts: 168
Joined: 02 Dec 2011, 17:23
Joined: 02 Dec 2011, 17:23
Posts: 168
Joined: 02 Dec 2011, 17:23
Joined: 02 Dec 2011, 17:23
Posts: 234
Joined: 22 Jan 2014, 22:58
Joined: 22 Jan 2014, 22:58
Re: [Release]Http Download Helper
For me, SoF_HTTP.cmd flashes a window but does not launch SoF
Tried with a shortcut on Desktop and from sof\.
Note: My Windows 10 does not have any "SoF fixes" installed, since I didn't experience any issues installing and/ or running SoF.
Still using the older one.
Tried with a shortcut on Desktop and from sof\.
Note: My Windows 10 does not have any "SoF fixes" installed, since I didn't experience any issues installing and/ or running SoF.
Still using the older one.
Posts: 718
Joined: 23 Nov 2011, 16:42
Joined: 23 Nov 2011, 16:42
Location: Canada
Re: [Release]Http Download Helper
I edited the http2.func to have a "silent mode" option (along having few polished code but I still require deeper testing) by creating a boolean cvar (I named it http2_silent). I'm still uncertain whether I'd prefer using a config file as default value, or mimic the CVAR_ARCHIVE flag.
It worked with this line in SoF_HTTP.cmd but that's just me blind guessing so I can't tell if it's good or not, eh
powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File http_listener.ps1 "disappear"
Posts: 168
Joined: 02 Dec 2011, 17:23
Joined: 02 Dec 2011, 17:23
Re: [Release]Http Download Helper
Made v1.1 with:
Only ever console print upon one event, when a download is requested to github.
Changed script path api, might fix chins problem.
Btw, Acadie, the script can be launched directly with the .ps1 or the .cmd and it will be hidden because it relaunches its self with the hidden flag, thats what the pseudo argument "disappear" is used for. To detect second launch for self-hiding.
Only ever console print upon one event, when a download is requested to github.
Changed script path api, might fix chins problem.
Btw, Acadie, the script can be launched directly with the .ps1 or the .cmd and it will be hidden because it relaunches its self with the hidden flag, thats what the pseudo argument "disappear" is used for. To detect second launch for self-hiding.
Posts: 234
Joined: 22 Jan 2014, 22:58
Joined: 22 Jan 2014, 22:58
Re: [Release]Http Download Helper
Same behavior for me.
Still using the version with "SoF HTTP Launcher" which works great for me.
Not sure if compression was done using "Relative Pathnames" or not, seems it was compressed using "Full Pathnames"
For me still extracts to "sof-win-http-helper-master" folder, so can not simply extract to sof\
If it works for everyone else, I'd be happy using the one that works for me.
I too can work around what I am reporting, I have a working shortcut on Desktop as well but that is not the purpose of this thread I thought since not all users would be able to make it work on their system by editing.
Rooting for one version for all.
Thanks for all the efforts, I am sure it can be made to work for all specially if more players give it a try and report back their findings.
Still using the version with "SoF HTTP Launcher" which works great for me.
Not sure if compression was done using "Relative Pathnames" or not, seems it was compressed using "Full Pathnames"
For me still extracts to "sof-win-http-helper-master" folder, so can not simply extract to sof\
If it works for everyone else, I'd be happy using the one that works for me.
I too can work around what I am reporting, I have a working shortcut on Desktop as well but that is not the purpose of this thread I thought since not all users would be able to make it work on their system by editing.
Rooting for one version for all.
Thanks for all the efforts, I am sure it can be made to work for all specially if more players give it a try and report back their findings.
Posts: 234
Joined: 22 Jan 2014, 22:58
Joined: 22 Jan 2014, 22:58
Re: [Release]Http Download Helper
Request:
Add line/ s informing player when map is not on github.
May be even requesting player to upload the missing map or something.
Currently it just says, "Resunming maps/ ..." which might be misleading to some players thinking they are "fast downloading".
Add line/ s informing player when map is not on github.
May be even requesting player to upload the missing map or something.
Currently it just says, "Resunming maps/ ..." which might be misleading to some players thinking they are "fast downloading".
Spoiler:
Posts: 168
Joined: 02 Dec 2011, 17:23
Joined: 02 Dec 2011, 17:23
Re: [Release]Http Download Helper
The latest releases do not have the folder problem you mention, make sure you take the https://github.com/d3nd3/sof-win-http-h ... helper.zip link, not the source code.
Who is online
Users browsing this forum: No registered users and 0 guests