|
@@ -12,6 +12,7 @@ public class SteamIdentityProvider : IIdentityProvider
|
|
public IUser User { get; private set; }
|
|
public IUser User { get; private set; }
|
|
public bool IsLoggedIn { get; private set; }
|
|
public bool IsLoggedIn { get; private set; }
|
|
public Uri? EditProfileUrl { get; } = new Uri("https://store.steampowered.com/login/");
|
|
public Uri? EditProfileUrl { get; } = new Uri("https://store.steampowered.com/login/");
|
|
|
|
+
|
|
public bool IsValid
|
|
public bool IsValid
|
|
{
|
|
{
|
|
get
|
|
get
|
|
@@ -40,7 +41,10 @@ public class SteamIdentityProvider : IIdentityProvider
|
|
var ownedContent = GetOwnedDlcs();
|
|
var ownedContent = GetOwnedDlcs();
|
|
var user = new SteamUser()
|
|
var user = new SteamUser()
|
|
{
|
|
{
|
|
- Username = username, AvatarUrl = avatar, Id = id.m_SteamID, IsLoggedIn = true,
|
|
|
|
|
|
+ Username = username,
|
|
|
|
+ AvatarUrl = avatar,
|
|
|
|
+ Id = id.m_SteamID,
|
|
|
|
+ IsLoggedIn = true,
|
|
OwnedProducts = ownedContent,
|
|
OwnedProducts = ownedContent,
|
|
};
|
|
};
|
|
|
|
|
|
@@ -79,7 +83,8 @@ public class SteamIdentityProvider : IIdentityProvider
|
|
using SKBitmap bitmap = new SKBitmap((int)width, (int)height);
|
|
using SKBitmap bitmap = new SKBitmap((int)width, (int)height);
|
|
var allocated = GCHandle.Alloc(image, GCHandleType.Pinned);
|
|
var allocated = GCHandle.Alloc(image, GCHandleType.Pinned);
|
|
var info = new SKImageInfo((int)width, (int)height, SKColorType.Rgba8888, SKAlphaType.Premul);
|
|
var info = new SKImageInfo((int)width, (int)height, SKColorType.Rgba8888, SKAlphaType.Premul);
|
|
- bitmap.InstallPixels(info, allocated.AddrOfPinnedObject(), bitmap.RowBytes, delegate { allocated.Free(); }, null);
|
|
|
|
|
|
+ bitmap.InstallPixels(info, allocated.AddrOfPinnedObject(), bitmap.RowBytes,
|
|
|
|
+ delegate { allocated.Free(); }, null);
|
|
using FileStream stream = new FileStream(cache, FileMode.Create);
|
|
using FileStream stream = new FileStream(cache, FileMode.Create);
|
|
bitmap.Encode(SKEncodedImageFormat.Png, 100).SaveTo(stream);
|
|
bitmap.Encode(SKEncodedImageFormat.Png, 100).SaveTo(stream);
|
|
}
|
|
}
|
|
@@ -96,8 +101,11 @@ public class SteamIdentityProvider : IIdentityProvider
|
|
for (int i = 0; i < dlcCount; i++)
|
|
for (int i = 0; i < dlcCount; i++)
|
|
{
|
|
{
|
|
bool success = SteamApps.BGetDLCDataByIndex(i, out AppId_t appId, out bool available, out string name, 128);
|
|
bool success = SteamApps.BGetDLCDataByIndex(i, out AppId_t appId, out bool available, out string name, 128);
|
|
- if (success && available)
|
|
|
|
|
|
+ if (success)
|
|
{
|
|
{
|
|
|
|
+ bool owned = SteamApps.BIsDlcInstalled(appId);
|
|
|
|
+ if (!owned)
|
|
|
|
+ continue;
|
|
ownedDlcs.Add(new ProductData(appId.m_AppId.ToString(), name));
|
|
ownedDlcs.Add(new ProductData(appId.m_AppId.ToString(), name));
|
|
}
|
|
}
|
|
}
|
|
}
|