azerothcore-wotlk icon indicating copy to clipboard operation
azerothcore-wotlk copied to clipboard

Feature: automatic DB export to DBC on server startup

Open MellianStudios opened this issue 2 years ago • 4 comments

Describe your feature request or suggestion in detail

Hello so this is intended mainly for modders. On discord there was discussion about exporting data from DB to dbc files automatically and it seemed like very good feature so here we are. Goal of this is to streamline and simplify process of changing dbc files in development process. Intended use is to have client and server on same machine and symlink [client_location]/Data/patch-4.MPQ (that is folder not mpq file) to [path_to_core]/build/Data. With this setup after you change dbc data in DB you just have to restart client and server nothing else. (and delete cache)

I think it should be part of world not auth server so flow of world server is like this

  1. opening database pool auth
  2. opening database pool characters
  3. opening database pool world
  4. updating auth database
  5. updating characters database
  6. updating world database
  7. loading world information
  8. dbc files load

I checked it only in console not in code so im not actually 100% sure that this is possible to do

In world config there should be added 2 settings (naming and exact wording is debatable i dont think mine is perfect)

#
#    AllowExportDBCFromDB
#        Description: Exports all table with matching names to dbc files inside /azerothcore/build/Data
#                            WARNING: This is intended for advanced users and modders. It is strongly recommended to NOT turn this on if #                            you are new to AzerothCore as this can potentially break your server requiring you to redownload dbc files and #                            recompile core.
#        Default:       0 - (Disabled)
#                           1 - (Enable)

AllowExportDBCFromDB = 0

#
#    ExportDBDFromDB
#        Description: Credentials for custom database containing tables of dbc data. If left blank characters and world databases will #                            be used. It is recommended to use custom database.
#        Example:     "hostname;port;username;password;database"
#                            ".;somenumber;username;password;database" - (Use named pipes on Windows
#                                                                                                          "enable-named-pipe" to [mysqld]
#                                                                                                          section my.ini)
#                           ".;/path/to/unix_socket;username;password;database" - (use Unix sockets on
#                                                                                                                    Unix/Linux)
#        Default:      ""

ExportDBDFromDB = ""

If this is enabled it should be ran before step 8 which is loading dbc files.

  1. It should either use characters and world DB or connect to custom one specified.
  2. Load all tables which names are matching any dbc filename. It have to care only about table columns which names are matching dbc if there are any additional custom columns ignore them.
  3. Export all data into /azerothcore/build/Data folder (replace existing)

If you think it would be better to add 3rd option to specify path to location where to expot dbc files you can do it but i think that highly defeats purpose of this

Ideally modules should be able to hook into this process and change those tables before they get exported but i dont know if it is even possible since i dont know if modules are loaded after or before dbc files during startup. If anyone has any idea how to achieve this it would be nice

Describe a possible solution to your feature or suggestion in detail

No response

Additional context

No response

MellianStudios avatar Sep 01 '22 23:09 MellianStudios

There’s something I don’t understand here:

The server uses DBC files (exported from MPQ) The client uses MPQ files. The server already has database tables that read from DBC files and can be used to override the DBC values. The client has no use for DBC files.

Nyeriah avatar Sep 01 '22 23:09 Nyeriah

I think his basic premise is wrapped around the idea that a Folder named like a MPQ file that contains DBC files will be treated by the Client as if it was a MPQ file. Thus You dont need MPQ files you just need MPQ folders that contain the same dbc files as the server uses

DavuKnight avatar Sep 01 '22 23:09 DavuKnight

@Nyeriah

today i actually found thanks to @heyitsbench that if you name folder like mpq patch and put dbc files in it client will process it anyway

MellianStudios avatar Sep 01 '22 23:09 MellianStudios

Asked in the World-Mod Slack and got pointed at https://github.com/stoneharry/DBC-Editing-Workflow case anyone stumbles on this later. Its not an exact fit but looks to be close

DavuKnight avatar Sep 02 '22 15:09 DavuKnight

Will close this. Dont see the point

Kitzunu avatar Oct 22 '23 01:10 Kitzunu