GetPackageRoots() public method

List of Package Roots
public GetPackageRoots ( ) : List
return List
コード例 #1
0
ファイル: Databackup.cs プロジェクト: polserver/poltools
 /// <summary>
 ///     Build the fileSpecs_ List of files to add to the archive.
 /// </summary>		
 /// <returns>
 ///     true if it was able to fully build the list.
 /// </returns>
 bool BuildFileList()
 {
     if (bool.Parse(Settings.Global.DataBackup["BackupData"]))
     {
         // Ok, they want to backup the Data Directory. Let's Scan this
         // directory to get all the files and move on.
         foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\data"))
         {
             fileSpecs_.Add(filename);
         }
     }
     if (bool.Parse(Settings.Global.DataBackup["BackupScripts"]))
     {
         // Ok, they want to backup all the Scripts. Let's Scan this
         // directory to get all the files and move on. Let's remember, we also
         // need to check everything within each Package Root. OH MY!
         fileSpecs_.Add(Settings.Global.Properties["POLPath"]+@"\pol.cfg");
         fileSpecs_.Add(Settings.Global.Properties["POLPath"] + @"\uoconvert.cfg");
         foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\config"))
         {
             fileSpecs_.Add(filename);
         }
         foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\regions"))
         {
             fileSpecs_.Add(filename);
         }
         foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\scripts"))
         {
             fileSpecs_.Add(filename);
         }
         // Now we read the PackageRoot Entries from Ecompile.Cfg in order to get
         // all the user's "pkg" directories. OH YAY!
         EConfig MyConfig = new EConfig();
         MyConfig.LoadConfig(Settings.Global.Properties["ECompileCfgPath"]);
         foreach (string pathname in MyConfig.GetPackageRoots())
         {
             foreach (string filename in FileSystemUtil.GetAllFileNames(pathname))
             {
                 fileSpecs_.Add(filename);
             }
         }
     }
     if (bool.Parse(Settings.Global.DataBackup["BackupRealms"]))
     {
         foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\realm"))
         {
             fileSpecs_.Add(filename);
         }
     }
     if (bool.Parse(Settings.Global.DataBackup["BackupLogs"]))
     {
         foreach (string filename in FileSystemUtil.GetAllFileNames(Settings.Global.Properties["POLPath"] + @"\log"))
         {
             fileSpecs_.Add(filename);
         }
     }
     return (fileSpecs_.Count > 0);
 }