Example #1
0
        static void SplitFile()
        {
            IDStrings.Read(".id_db_idx_eu.db", ".id_db_str_eu.db");
            Strings.Read("paramstr_eu.db");
            UnicodeStrings.Read("paramunistr_eu.db");
            ColourStrings.Read("carcolor.sdb");

            var database = new ParamDB();

            database.ReadData("paramdb_eu.db");

            var raceDetails = new RaceDetailDB();

            raceDetails.ReadData("racedetail.db");

            var raceModes = new RaceModeDB();

            raceModes.ReadData("racemode.db");

            Directory.CreateDirectory("Data");
            Directory.SetCurrentDirectory("Data");
            database.DumpData();
            raceDetails.DumpData();
            raceModes.DumpData();

            Strings.Export("Strings");
            UnicodeStrings.Export("UnicodeStrings");
            ColourStrings.Export("ColourStrings");
            IDStrings.Export();
        }
Example #2
0
        public void Read(string indexFilename, string stringFilename)
        {
            stringTable.Read(stringFilename);

            using (FileStream file = new FileStream(indexFilename, FileMode.Open, FileAccess.Read))
            {
                byte[] magic = new byte[4];
                file.Read(magic);
                if (Encoding.ASCII.GetString(magic) != "IDDB")
                {
                    Console.WriteLine("Not an IDDB file.");
                    return;
                }

                uint idCount = file.ReadUInt();
                for (int i = 0; i < idCount; i++)
                {
                    ulong  id  = file.ReadULong();
                    ushort num = (ushort)file.ReadULong();
                    ids.Add(id, stringTable.Get(num));
                }
            }
        }