public ResourceInfo GetArchiveEntryByArchiveName(string filePath)
 {
     var archiveCache = new ArchiveCache(UnitsyncWritableFolder);
     var ret = archiveCache.Archives.FirstOrDefault(x => x.ArchiveName == Path.GetFileName(filePath));
     if (ret == null)
     {
         ReInit();
         archiveCache = new ArchiveCache(UnitsyncWritableFolder);
         return archiveCache.Archives.FirstOrDefault(x => x.ArchiveName == Path.GetFileName(filePath));
     }
     return ret;
 }
 public ResourceInfo GetArchiveEntryByInternalName(string name)
 {
     var archiveCache = new ArchiveCache(UnitsyncWritableFolder);
     var ret = archiveCache.Archives.FirstOrDefault(x => x.Name == name);
     if (ret == null)
     {
         ReInit();
         archiveCache = new ArchiveCache(UnitsyncWritableFolder);
         return archiveCache.Archives.FirstOrDefault(x => x.Name == name);
     }
     return ret;
 }
示例#3
0
 public ResourceInfo GetResourceFromFileName(string filePath) {
     var archiveCache = new ArchiveCache(UnitsyncWritableFolder);
     var ae = archiveCache.Archives.FirstOrDefault(x => x.ArchiveName == Path.GetFileName(filePath));
     if (ae == null) return null;
     try
     {
         return GetMap(ae);
     }
     catch (Exception ex)
     {
         Trace.TraceWarning("Not a map: {0}" ,ex);
     }
     try
     {
         return GetMod(ae);
     }
     catch (Exception ex)
     {
         Trace.TraceWarning("Not a mod: {0}", ex);
     }
     return ae;
 }