Beispiel #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();
        }
Beispiel #2
0
 public void Update(EndianStream stream)
 {
     stream.SeekTo(Offset);
     stream.WriteInt16((Int16)ChunkType);
     stream.SeekTo(stream.Position + 0x0A);
     stream.WriteInt32(TagIndex);
     stream.WriteFloat(SpawnCoords.X);
     stream.WriteFloat(SpawnCoords.Y);
     stream.WriteFloat(SpawnCoords.Z);
     stream.WriteFloat(SpawnCoords.Pitch);
     stream.WriteFloat(SpawnCoords.Yaw);
     stream.WriteFloat(SpawnCoords.Roll);
     stream.SeekTo(stream.Position + 0x16);
     stream.Skip(0x01);
     stream.WriteByte(Team);
     stream.WriteByte(SpareClips);
     stream.WriteByte(RespawnTime);
     stream.SeekTo(stream.Position + 0x12);
 }
Beispiel #3
0
 public void Update(EndianStream stream)
 {
     stream.SeekTo(Offset);
     stream.WriteInt32(Ident);
     stream.WriteByte(RunTimeMinimium);
     stream.WriteByte(RunTimeMaximium);
     stream.WriteByte(CountOnMap);
     stream.WriteByte(DesignTimeMaximium);
     stream.WriteFloat(Cost);
 }
Beispiel #4
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);
 }