Esempio n. 1
0
 private static GameLocationInfo GetGameLocation(String[] args)
 {
     try
     {
         GameLocationInfo result;
         if (args == null || args.Length == 0)
         {
             if (File.Exists(GameLocationInfo.LauncherName))
             {
                 result = new GameLocationInfo(Environment.CurrentDirectory);
                 result.Validate();
             }
             else
             {
                 result = GameLocationSteamRegistryProvider.TryLoad();
             }
         }
         else
         {
             result = new GameLocationInfo(args[0]);
             result.Validate();
         }
         return(result);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Failed to get a game location.");
         Console.WriteLine("---------------------------");
         Console.WriteLine(ex);
         Console.WriteLine("---------------------------");
         return(null);
     }
 }
Esempio n. 2
0
 private static GameLocationInfo GetGameLocation(String[] args)
 {
     try
     {
         GameLocationInfo result;
         if (args.IsNullOrEmpty())
         {
             if (File.Exists(GameLocationInfo.LauncherName))
             {
                 result = new GameLocationInfo(Environment.CurrentDirectory);
                 result.Validate();
             }
             else
             {
                 result = GameLocationSteamRegistryProvider.TryLoad();
             }
         }
         else
         {
             result = new GameLocationInfo(args[0]);
             result.Validate();
         }
         return(result);
     }
     catch (Exception ex)
     {
         Log.Error(ex, "Failed to get a game location.");
         Console.WriteLine($"Failed to get a game location. See [{Log.LogFileName}] for details.");
         return(null);
     }
 }