DBC StringTable menu

User Tag List

Results 1 to 3 of 3
  1. #1
    Monkeyx3's Avatar Member
    Reputation
    6
    Join Date
    Dec 2009
    Posts
    9
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    DBC StringTable

    I'm currently writing a small dbc lib using the .NET framework.
    Reading and writing works fine for dbcs like Item.dbc which doesn't contains any strings.

    But if I want to write a file like CharTitles.dbc I'll get some problems with strings.

    This is the Write method, which creates the file

    Code:
            
            public void Write(IEnumerable<IDBCEntry> entries, Dictionary<int, string> stringTable, int fieldsCount, int recordSize)
            {
                using (var writer = new BinaryWriter(new FileStream(this.DestinationPath, FileMode.OpenOrCreate), Encoding.UTF8))
                {
                    writer.Write(DBCWriter.DBCFileSignature);
                    writer.Write(entries.Count());
                    writer.Write(fieldsCount);
                    writer.Write(recordSize);
                    writer.Write(stringTable.Count());
    
                    foreach (var entry in entries)
                    {
                        entry.Write(writer, stringTable);
                    }
    
                    if (stringTable.Count() > 0)
                    {
                        foreach (var str in stringTable.Values)
                        {
                            writer.Write(str);
                        }
                    }
                    else
                    {
                        writer.Write((char)0x00);
                    }
    
    
                    writer.Flush();
                    writer.Close();
                }
            }
    The implementation of IDBCEntry contains a method called "Write". This method writes the row data into the stream like

    Code:
            public void Write(BinaryWriter writer, Dictionary<int, string> stringTable)
            {
                writer.Write(this.Id);
                writer.Write(this.ConditionId);
    ....
    If I open the new file now, the string columns just displaying the reference id to the string table.

    I guess this is because I write just an integer into this field but how can I write a reference to a string table row?

    Thanks in advance!

    DBC StringTable
  2. #2
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    This doesn't answer your question directly but I have to do a lot of DBC manipulation for my spell editor, e.g: https://github.com/stoneharry/Spell-...BC/SpellDBC.cs

  3. Thanks Ket, Monkeyx3 (2 members gave Thanks to stoneharry for this useful post)
  4. #3
    Monkeyx3's Avatar Member
    Reputation
    6
    Join Date
    Dec 2009
    Posts
    9
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks you! Your post really helped me.
    I wrote the position of the string as reference for the field but I have to write the position in the byte array.

Similar Threads

  1. need a CSV to DBC changer that actually works
    By Avianar47 in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 08-28-2006, 03:50 AM
  2. Can someone upload me dbc.mpq?
    By pandaman in forum World of Warcraft General
    Replies: 3
    Last Post: 08-25-2006, 09:05 PM
  3. DBC files
    By Tayo in forum WoW ME Questions and Requests
    Replies: 9
    Last Post: 08-24-2006, 05:48 AM
  4. .cvs to .dbc new one or help with DBCutil
    By Ednasil in forum Community Chat
    Replies: 0
    Last Post: 08-22-2006, 07:00 PM
  5. DBC files
    By Tayo in forum World of Warcraft Model Editing
    Replies: 3
    Last Post: 08-22-2006, 01:33 PM
All times are GMT -5. The time now is 09:08 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search