mirror of
https://github.com/terrymacdonald/DisplayMagician.git
synced 2024-08-30 18:32:20 +00:00
Updated develop changes to match
Updated the develop branch changes from v1.0.4 to the new string based GameIDs that we've moved to in order to support the Origin game ids.
This commit is contained in:
parent
f7d3a04f28
commit
0ec70e42c0
@ -230,7 +230,7 @@ namespace DisplayMagician.GameLibraries
|
|||||||
if (String.IsNullOrWhiteSpace(steamGameNameOrId))
|
if (String.IsNullOrWhiteSpace(steamGameNameOrId))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
logger.Debug($"SteamLibrary/RemoveSteamGame3: Removing Steam game with Name or UUID {steamGameNameOrUuid} from the Steam library");
|
logger.Debug($"SteamLibrary/RemoveSteamGame3: Removing Steam game with Name or UUID {steamGameNameOrId} from the Steam library");
|
||||||
|
|
||||||
int numRemoved;
|
int numRemoved;
|
||||||
Match match = Regex.Match(steamGameNameOrId, steamAppIdRegex, RegexOptions.IgnoreCase);
|
Match match = Regex.Match(steamGameNameOrId, steamAppIdRegex, RegexOptions.IgnoreCase);
|
||||||
@ -241,12 +241,12 @@ namespace DisplayMagician.GameLibraries
|
|||||||
|
|
||||||
if (numRemoved == 1)
|
if (numRemoved == 1)
|
||||||
{
|
{
|
||||||
logger.Debug($"SteamLibrary/RemoveSteamGame3: Removed Steam game with Name or UUID {steamGameNameOrUuid} ");
|
logger.Debug($"SteamLibrary/RemoveSteamGame3: Removed Steam game with Name or UUID {steamGameNameOrId} ");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (numRemoved == 0)
|
else if (numRemoved == 0)
|
||||||
{
|
{
|
||||||
logger.Debug($"SteamLibrary/RemoveSteamGame3: Didn't remove Steam game with Name or UUID {steamGameNameOrUuid} from the Steam Library");
|
logger.Debug($"SteamLibrary/RemoveSteamGame3: Didn't remove Steam game with Name or UUID {steamGameNameOrId} from the Steam Library");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -376,13 +376,13 @@ namespace DisplayMagician.GameLibraries
|
|||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Loop through the subKeys as they are the Steam Game IDs
|
// Loop through the subKeys as they are the Steam Game IDs
|
||||||
foreach (string steamGameKeyName in steamAppsKey.GetSubKeyNames())
|
foreach (string steamAppId in steamAppsKey.GetSubKeyNames())
|
||||||
{
|
{
|
||||||
logger.Trace($"SteamLibrary/LoadInstalledGames: Found SteamGameKeyName = {steamGameKeyName}");
|
logger.Trace($"SteamLibrary/LoadInstalledGames: Found SteamGameKeyName = {steamAppId}");
|
||||||
if (int.TryParse(steamGameKeyName, out int steamAppId))
|
if (!String.IsNullOrWhiteSpace(steamAppId))
|
||||||
{
|
{
|
||||||
logger.Trace($"SteamLibrary/LoadInstalledGames: SteamGameKeyName is an int, so trying to see if it is an installed app");
|
logger.Trace($"SteamLibrary/LoadInstalledGames: SteamGameKeyName is an int, so trying to see if it is an installed app");
|
||||||
string steamGameKeyFullName = $"{_registryAppsKey}\\{steamGameKeyName}";
|
string steamGameKeyFullName = $"{_registryAppsKey}\\{steamAppId}";
|
||||||
using (RegistryKey steamGameKey = Registry.CurrentUser.OpenSubKey(steamGameKeyFullName, RegistryKeyPermissionCheck.ReadSubTree))
|
using (RegistryKey steamGameKey = Registry.CurrentUser.OpenSubKey(steamGameKeyFullName, RegistryKeyPermissionCheck.ReadSubTree))
|
||||||
{
|
{
|
||||||
// If the Installed Value is set to 1, then the game is installed
|
// If the Installed Value is set to 1, then the game is installed
|
||||||
@ -578,8 +578,9 @@ namespace DisplayMagician.GameLibraries
|
|||||||
Match appidMatches = appidRegex.Match(steamLibraryAppManifestText);
|
Match appidMatches = appidRegex.Match(steamLibraryAppManifestText);
|
||||||
if (appidMatches.Success)
|
if (appidMatches.Success)
|
||||||
{
|
{
|
||||||
if (int.TryParse(appidMatches.Groups[1].Value, out int steamGameId))
|
if (!String.IsNullOrWhiteSpace(appidMatches.Groups[1].Value))
|
||||||
{
|
{
|
||||||
|
string steamGameId = appidMatches.Groups[1].Value;
|
||||||
logger.Trace($"SteamLibrary/LoadInstalledGames: Found Steam Game ID {steamGameId} within {steamLibraryAppManifestFilename} steam app manifest within steam library {steamLibraryPath}");
|
logger.Trace($"SteamLibrary/LoadInstalledGames: Found Steam Game ID {steamGameId} within {steamLibraryAppManifestFilename} steam app manifest within steam library {steamLibraryPath}");
|
||||||
// Check if this game is one that was installed
|
// Check if this game is one that was installed
|
||||||
if (steamAppInfo.ContainsKey(steamGameId))
|
if (steamAppInfo.ContainsKey(steamGameId))
|
||||||
|
@ -577,7 +577,7 @@ namespace DisplayMagician.GameLibraries
|
|||||||
logger.Trace($"UplayLibrary/LoadInstalledGames: uplayGameAppInfo.GameInstallDir = {uplayGameAppInfo.GameInstallDir }");
|
logger.Trace($"UplayLibrary/LoadInstalledGames: uplayGameAppInfo.GameInstallDir = {uplayGameAppInfo.GameInstallDir }");
|
||||||
uplayGameAppInfo.GameExe = Path.Combine(uplayGameAppInfo.GameInstallDir, gameFileName);
|
uplayGameAppInfo.GameExe = Path.Combine(uplayGameAppInfo.GameInstallDir, gameFileName);
|
||||||
logger.Trace($"UplayLibrary/LoadInstalledGames: uplayGameAppInfo.GameExe = {uplayGameAppInfo.GameExe }");
|
logger.Trace($"UplayLibrary/LoadInstalledGames: uplayGameAppInfo.GameExe = {uplayGameAppInfo.GameExe }");
|
||||||
uplayGameAppInfo.GameID = int.Parse(gameId);
|
uplayGameAppInfo.GameID = gameId;
|
||||||
logger.Trace($"UplayLibrary/LoadInstalledGames: uplayGameAppInfo.GameID = {uplayGameAppInfo.GameID }");
|
logger.Trace($"UplayLibrary/LoadInstalledGames: uplayGameAppInfo.GameID = {uplayGameAppInfo.GameID }");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2031,7 +2031,7 @@ namespace DisplayMagician
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We need to look up details about the game
|
// We need to look up details about the game
|
||||||
if (!SteamLibrary.ContainsSteamGameId(GameAppId))
|
if (!SteamLibrary.ContainsSteamGameById(GameAppId))
|
||||||
{
|
{
|
||||||
ShortcutError error = new ShortcutError();
|
ShortcutError error = new ShortcutError();
|
||||||
error.Name = "SteamGameNotInstalled";
|
error.Name = "SteamGameNotInstalled";
|
||||||
|
Loading…
Reference in New Issue
Block a user