Beispiel #1
0
 void CreateConfigsDir()
 {
     if (ConfigsDir == null)
     {
         ConfigsDir = WurmDir.CreateSubdirectory("configs");
     }
 }
Beispiel #2
0
 void CreatePacksDir()
 {
     if (PacksDir == null)
     {
         PacksDir = WurmDir.CreateSubdirectory("packs");
     }
 }
Beispiel #3
0
 void CreatePlayersDir()
 {
     if (PlayersDir == null)
     {
         PlayersDir = WurmDir.CreateSubdirectory("players");
     }
 }
Beispiel #4
0
        /// <summary>
        /// Copies / overwrites contents of wurm directory from source directory.
        /// </summary>
        /// <param name="sourceDirFullPath"></param>
        /// <returns></returns>
        public WurmClientMock PopulateFromDir(string sourceDirFullPath)
        {
            dir.AmmendFromSourceDirectory(sourceDirFullPath, "wurm");
            if (targetPlatform != Platform.Windows)
            {
                // replace all CRLF with LF, to simulate Linux log files
                var allLogFiles =
                    WurmDir.EnumerateDirectories("players")
                    .SelectMany(di => di.GetDirectories())
                    .Select(di => di.GetDirectories("logs").SingleOrDefault())
                    .Where(di => di != null)
                    .SelectMany(di => di.GetFiles());

                foreach (var fi in allLogFiles)
                {
                    var content = File.ReadAllText(fi.FullName);
                    content = content.Replace("\r\n", "\n");
                    File.WriteAllText(fi.FullName, content);
                }
            }
            return(this);
        }