I don’t have any experience with TrinityCore (or any other core), but I wanted to learn how to use it. So I installed a local server and learned how to do some basic things (create an NPC, modify weapon stats, etc). And I was wondering if the following actions were possible using only .sql queries (without having to compile again or using other methods):
Change the name of the character in real time
Change the name of a command (e.g. pinfo to playerinfo). [I changed the name in world.command, mysql.command, and auth.rbac_permissions, but I still have to use .pinfo in order for it to work. If I type ‘.playerinfo’ I get the message “That command does not exist”.
Create a macro and put it in the third button of a character. The macro should contain “/say Hello, world”. [In characters.character_action there are some options to see what an user has in each button, however I wasn’t able to put a macro with that table. Also, I have no idea how I would write “/say Hello, world” inside the macro. In characters.account_data, under the column data there are some hexadecimal values, when I coverted them to ASCII that field contained information about the macros that the user has (name, image, and content), however I couldn’t do anything with it).
Server won’t respond right away when you change something on the database side. Something has to reload the data used by the server in-memory. For example, if you change some RBAC permissions, then you need to perform “.reload rbac” command, though, there have been cases where people need to relog fully into their account for the new changes to take effect.
There should be a command .character rename to flag a character for rename, however, if character is renamed through database query, then the said account would likely need to relog to see the change, because server has the old name loaded in the memory until account relogs.
The only way to change a command’s name or its function is editing TC’s source code and recompiling it. RBAC permissions in the database use rbac enum ids defined in the source code, usually per command (e.g. rbac::RBAC_PERM_COMMAND_CHARACTER). If I remember correctly, then world.command only holds descriptive/help information about the command. So ultimately, you can’t change command’s name with just an SQL query, you will need to do it through source-code (under server/scripts/Commands).
I won’t be able to say much about 3rd question, though. Not very familiar with account_data table and client-server macro interaction. Hope the other two answers help.
Thank you, your answers were very helpful. I still have some troubles to change the name of the character if the player is online. If I change the name, the database will change the name again to the old name and will ignore my query changing the name once the player disconnects. How can I “force” the database to keep the new name?