Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Let's do this shit, go chris brown on the return key");
            Console.ReadLine();

            string mapInfoFolder = @"C:\Users\Alex\Documents\My Received Files\info\info\";

            DirectoryInfo di = new DirectoryInfo(mapInfoFolder);
            FileInfo[] rgFiles = di.GetFiles("*.mapinfo");
            foreach (FileInfo fi in rgFiles)
            {
                string fileName = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(fi.Name.ToLower());

                EndianStream stream = new EndianStream(new FileStream(fi.FullName, FileMode.OpenOrCreate), Endian.BigEndian);
                stream.SeekTo(0x3C);
                Int32 mapID = stream.ReadInt32();

                string jsonDB = File.ReadAllText(@"C:/Users/Alex/Desktop/" + fi.Name.Replace(fi.Extension, "") + "_json.h3tagdb");
                jsonDB = jsonDB.Replace("\"MapID\":0", "\"MapID\":" + mapID.ToString());
                File.WriteAllText(@"C:/Users/Alex/Desktop/" + fi.Name.Replace(fi.Extension, "") + "_json.h3tagdb", jsonDB);

                Console.WriteLine("Grabbed ID of {0}", fi.Name.Replace(fi.Extension, ""));
            }

            Console.WriteLine("All done");
            Console.ReadLine();
        }
Esempio n. 2
0
 public TagEntry(EndianStream stream, Tag mapTags)
 {
     PlacedItems = new List<ItemPlacementChunk>();
     Offset = stream.Position;
     Ident = stream.ReadInt32();
     Tag = mapTags.SearchTags(Ident);
     RunTimeMinimium = stream.ReadByte();
     RunTimeMaximium = stream.ReadByte();
     CountOnMap = stream.ReadByte();
     DesignTimeMaximium = stream.ReadByte();
     Cost = stream.ReadFloat();
 }
Esempio n. 3
0
 public ItemPlacementChunk(EndianStream stream)
 {
     Offset = stream.Position;
     ChunkType = (ItemChunkType)stream.ReadInt16();
     stream.SeekTo(stream.Position + 0x0A);
     TagIndex = stream.ReadInt32();
     SpawnCoords = new ItemSpawnCoords()
     {
         X = stream.ReadFloat(),
         Y = stream.ReadFloat(),
         Z = stream.ReadFloat(),
         Yaw = stream.ReadFloat(),
         Pitch = stream.ReadFloat(),
         Roll = stream.ReadFloat()
     };
     stream.SeekTo(stream.Position + 0x16);
     stream.ReadByte();
     Team = stream.ReadByte();
     SpareClips = stream.ReadByte();
     RespawnTime = stream.ReadByte();
     stream.SeekTo(stream.Position + 0x12);
 }