- Use HTTPS URLs for game logos/achievement icons. Fixes #87.

- Fix DoDownloadLogo not catching exceptions for DownloadData.
This commit is contained in:
gibbed
2019-03-30 12:21:33 -05:00
parent 0958770784
commit 51ddcc0e37
3 changed files with 16 additions and 3 deletions

View File

@@ -22,6 +22,7 @@
using System;
using System.Diagnostics;
using System.Net;
using System.Windows.Forms;
namespace SAM.Game
@@ -84,6 +85,12 @@ namespace SAM.Game
return;
}
/* Disable server certificate validation.
* This is for media downloads (achievement icons).
* https://media.steamcommunity.com/ has certs issued to (various).e.akamai.net.
*/
ServicePointManager.ServerCertificateValidationCallback = (s, ce, ch, e) => true;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Manager(appId, client));

View File

@@ -227,15 +227,14 @@ namespace SAM.Picker
{
var info = (GameInfo)e.Argument;
var logoPath = string.Format(
"http://media.steamcommunity.com/steamcommunity/public/images/apps/{0}/{1}.jpg",
"https://media.steamcommunity.com/steamcommunity/public/images/apps/{0}/{1}.jpg",
info.Id,
info.Logo);
using (var downloader = new WebClient())
{
var data = downloader.DownloadData(new Uri(logoPath));
try
{
var data = downloader.DownloadData(new Uri(logoPath));
using (var stream = new MemoryStream(data, false))
{
var bitmap = new Bitmap(stream);

View File

@@ -21,6 +21,7 @@
*/
using System;
using System.Net;
using System.Windows.Forms;
namespace SAM.Picker
@@ -64,6 +65,12 @@ namespace SAM.Picker
return;
}
/* Disable server certificate validation.
* This is for media downloads (application logos).
* https://media.steamcommunity.com/ has certs issued to (various).e.akamai.net.
*/
ServicePointManager.ServerCertificateValidationCallback = (s, ce, ch, e) => true;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new GamePicker(client));