Exemple #1
0
 public static void Iterate(List <ulong> files, Dictionary <ulong, Record> map, CASCHandler handler)
 {
     foreach (ulong key in files)
     {
         if (!map.ContainsKey(key))
         {
             continue;
         }
         using (Stream stream = Util.OpenFile(map[key], handler)) {
             if (stream == null)
             {
                 continue;
             }
             try {
                 OWString str = new OWString(stream);
                 if (str.Value == null || str.Value.Length == 0)
                 {
                     continue;
                 }
                 Console.Out.WriteLine("{0:X12}.{1:X3}: {2}", GUID.LongKey(key), GUID.Type(key), str.Value);
             } catch {
                 Console.Out.WriteLine("Error with file {0:X12}.{1:X3}", GUID.LongKey(key), GUID.Type(key));
             }
         }
     }
 }
Exemple #2
0
        internal static string GetOWString(ulong guid, CASCHandler handler, Dictionary <ulong, Record> map)
        {
            if (guid == 0 || !map.ContainsKey(guid))
            {
                return(null);
            }
            Stream   str = Util.OpenFile(map[guid], handler);
            OWString ows = new OWString(str);

            return(ows);
        }
Exemple #3
0
        public static string GetString(ulong key, Dictionary <ulong, Record> map, CASCHandler handler)
        {
            if (!map.ContainsKey(key))
            {
                return(null);
            }

            Stream   str = OpenFile(map[key], handler);
            OWString ows = new OWString(str);

            return(ows.Value);
        }
Exemple #4
0
 public static string GetString(ulong guid)
 {
     if (guid == 0)
     {
         return(null);            // don't even try
     }
     if (!Files.ContainsKey(guid))
     {
         return(null);
     }
     using (Stream stream = OpenFile(Files[guid])) {
         if (stream == null)
         {
             return(null);
         }
         OWString owString = new OWString(stream);
         return(owString);
     }
 }