Ejemplo n.º 1
0
        /// <summary>
        /// Constructs an instance of UpdateManager requiring a tweaker settings class and a UI renderer class.
        /// </summary>
        /// <param name="settings"></param>
        /// <param name="output"></param>
        public UpdateManager(ITweakerSettings settings, ITrigger output)
        {
            this.Settings = settings;
            this.Output   = output;

            // At the moment, the downloader is tightly coupled against this class.
            // In the future, downloader can be decoupled away in the very case where we have PSO2 private server running a patch server.
            this.Downloader = new SegaDownloader(output);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the value of the game client version.
 /// </summary>
 public static string GetGameVersion(this ITweakerSettings settings)
 {
     lock (GameVersionFileLock)
     {
         var path = settings.GetGameVersionFilePath();
         if (!File.Exists(path))
         {
             return(null);
         }
         return(File.ReadAllText(path));
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Sets the value of the game client version.
 /// </summary>
 /// <param name="settings"></param>
 /// <param name="version"></param>
 public static void SetGameVersion(this ITweakerSettings settings, string version)
 {
     lock (GameVersionFileLock)
     {
         var path = settings.GetGameVersionFilePath();
         var dir  = Path.GetDirectoryName(path);
         if (!Directory.Exists(dir))
         {
             Directory.CreateDirectory(dir);
         }
         File.WriteAllText(path, version);
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs an instance of FanPatcher using given Tweaker settings and output triggers.
 /// </summary>
 /// <param name="settings"></param>
 /// <param name="triggers"></param>
 public FanPatcher(ITweakerSettings settings, ITrigger triggers)
 {
     this.Settings = settings;
     this.Triggers = triggers;
 }
Ejemplo n.º 5
0
#pragma warning restore RECS0154 // Parameter is never used

        /// <summary>
        /// Gets the path of the game version file.
        /// </summary>
        public static string GetGameVersionFilePath(this ITweakerSettings settings)
        {
            return(Path.Combine(settings.GetUserFolderPath(), "version.ver"));
        }
Ejemplo n.º 6
0
#pragma warning disable RECS0154 // Parameter is never used
        /// <summary>
        /// Gets the value of the PSO2 user profile folder.
        /// </summary>
        public static string GetUserFolderPath(this ITweakerSettings settings)
        {
            var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            return(Path.Combine(documents, @"SEGA\PHANTASYSTARONLINE2"));
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Gets the game file directory where the game asset files usually located in.
 /// </summary>
 public static string LicenseDirectory(this ITweakerSettings settings)
 {
     return(Path.Combine(settings.GameDirectory, @"data\license"));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Gets the game file directory where the game asset files usually located in.
 /// </summary>
 public static string DataWin32Directory(this ITweakerSettings settings)
 {
     return(Path.Combine(settings.GameDirectory, @"data\win32"));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Gets the known, usual Tweaker backup directory.
 /// </summary>
 public static string BackupDirectory(this ITweakerSettings settings)
 {
     return(Path.Combine(settings.DataWin32Directory(), "backup"));
 }