[Release]Http Download Helper

d3nd3
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

[Release]Http Download Helper

Post by d3nd3 »

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. :wink:

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.
User avatar
Evil4N Netherlands
Reactions: 14
Posts: 4056
Joined: 23 Nov 2011, 14:56
Location: Netherlands

Re: [Release]Http Download Helper

Post by Evil4N »

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!
d3nd3
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release]Http Download Helper

Post by d3nd3 »

Evil4N wrote: 15 Apr 2023, 15:16 I totally agree with Dende. No idea what he said but whatever.
Hello , uf Eagle :tongue:
User avatar
Trekker Canada
Reactions: 5
Posts: 234
Joined: 22 Jan 2014, 22:58

Re: [Release]Http Download Helper

Post by Trekker »

feedback from anyone?

testing this.
User avatar
Evil4N Netherlands
Reactions: 14
Posts: 4056
Joined: 23 Nov 2011, 14:56
Location: Netherlands

Re: [Release]Http Download Helper

Post by Evil4N »

d3nd3 wrote: 15 Apr 2023, 18:39
Evil4N wrote: 15 Apr 2023, 15:16 I totally agree with Dende. No idea what he said but whatever.
Hello , uf Eagle :tongue:
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 :tongue:
You think I'm not online. But I'm always here. Scrolling. Judging.

]TÐW[Evil4N!
User avatar
Acadie Canada
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [Release]Http Download Helper

Post by Acadie »

Trekker wrote: 18 Apr 2023, 20:34 feedback from anyone?

testing this.
Currently require Powershell 5 or above to unzip.
User avatar
Trekker Canada
Reactions: 5
Posts: 234
Joined: 22 Jan 2014, 22:58

Re: [Release]Http Download Helper

Post by Trekker »

Trying on Windows 10

Had no problems with 7-Zip

PowerShell version: 5.1.19041.2673
CheaterSkeeter Great Britain
Reactions: 0
Posts: 409
Joined: 04 Dec 2011, 12:07

Re: [Release]Http Download Helper

Post by CheaterSkeeter »

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)
d3nd3
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release]Http Download Helper

Post by d3nd3 »

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.
CheaterSkeeter Great Britain
Reactions: 0
Posts: 409
Joined: 04 Dec 2011, 12:07

Re: [Release]Http Download Helper

Post by CheaterSkeeter »

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!
d3nd3
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release]Http Download Helper

Post by d3nd3 »

The idea is improved now because the http listener window is not visible , starts hidden and auto-closes when SoF.exe is closed.
User avatar
Trekker Canada
Reactions: 5
Posts: 234
Joined: 22 Jan 2014, 22:58

Re: [Release]Http Download Helper

Post by Trekker »

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?!
HTTP Launcher.jpg
You do not have the required permissions to view the files attached to this post.
d3nd3
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release]Http Download Helper

Post by d3nd3 »

Thanks for the feedback, its honest and will make a difference!
d3nd3
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release]Http Download Helper

Post by d3nd3 »

We are now out of beta, already. Woo
User avatar
Trekker Canada
Reactions: 5
Posts: 234
Joined: 22 Jan 2014, 22:58

Re: [Release]Http Download Helper

Post by Trekker »

For me, SoF_HTTP.cmd flashes a window but does not launch SoF :confused:
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.
User avatar
Acadie Canada
Reactions: 15
Posts: 718
Joined: 23 Nov 2011, 16:42
Location: Canada

Re: [Release]Http Download Helper

Post by Acadie »

Trekker wrote: 04 May 2023, 19:17 Player will not see anything unless she/ he is in console which is good.
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.
Trekker wrote: 05 May 2023, 03:15 For me, SoF_HTTP.cmd flashes a window but does not launch SoF :confused:
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 :wacko:
powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File http_listener.ps1 "disappear"
d3nd3
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release]Http Download Helper

Post by d3nd3 »

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.
User avatar
Trekker Canada
Reactions: 5
Posts: 234
Joined: 22 Jan 2014, 22:58

Re: [Release]Http Download Helper

Post by Trekker »

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.
User avatar
Trekker Canada
Reactions: 5
Posts: 234
Joined: 22 Jan 2014, 22:58

Re: [Release]Http Download Helper

Post by Trekker »

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".
Spoiler:
d3nd3
Reactions: 8
Posts: 168
Joined: 02 Dec 2011, 17:23

Re: [Release]Http Download Helper

Post by d3nd3 »

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: Claudebot and 0 guests