mirror of
https://github.com/JDM170/SteamAchievementManager
synced 2025-12-10 05:37:18 +07:00
- Use HTTPS URLs for game logos/achievement icons. Fixes #87.
- Fix DoDownloadLogo not catching exceptions for DownloadData.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user