Foxlider / FASTER

Full rebuild of Flax's tool for installing and updating Arma 3 server with built in features for managing Steam Workshop mods.
GNU General Public License v3.0
121 stars 34 forks source link

Fix incorrect Substring logic causing launcher file imports to fail #7

Closed wakeuphate closed 4 years ago

wakeuphate commented 4 years ago

I actually originally noticed this while fixing the buffer overflow issue you fixed in your previous release on the original FAST2 application. I hadn't even heard of FASTER until a few minutes ago, however here we are.

It looks like the same issue is happening in FASTER too; I'll just post what I posted over there as a pull request:

As per my other PR, feel free to tell me if I've steered wrong here; but testing locally this Substring fix seems to strip the final from the import link before it's passed on to SteamMod.AddSteamMod() which allows the file import to continue. Maybe the SteamAPI was changed at some point which broke the previous implementation, as it was stripping a majority of the IDs from the URLs.

I've tested this with my local exported HTML modset from the A3 client and all mods are pulled into the FAST2 Application just fine, though I'm aware there may be some edge cases I'm not thinking of.

Hopefully the fix works for you here too! I've checked it locally and it seems to import just fine on the feature/Update-1.7 branch and on master (but obviously fails on some of the mods due to the int overflow).

I also removed the Reverse() function as cleanup, since this is the only place it was used anyway.

Also I appreciate you making the new repo; I was unable to make a PR on the other one you have due to github's restrictions on making forks of forks, since I have FAST2 already forked I was unable to fork the other repo, so this one is perfect!

wakeuphate commented 4 years ago

You can actually ignore this; Turns out my file was randomly mangled and included a newline between the link and the data-type. Not really sure how that happened:

One Export:

<a href="http://steamcommunity.com/sharedfiles/filedetails/?id=893346105"
            data-type="Link">http://steamcommunity.com/sharedfiles/filedetails/?id=893346105</a>

Other Export:

<a href="http://steamcommunity.com/sharedfiles/filedetails/?id=893346105" data-type="Link">http://steamcommunity.com/sharedfiles/filedetails/?id=893346105</a>