trickerer / Trinity-Bots

NPCBots for TrinityCore and AzerothCore 3.3.5
https://github.com/trickerer/TrinityCore-3.3.5-with-NPCBots/
464 stars 151 forks source link

[TC] [Question] [Core] Applying SQL files is still leaving issues when running the WorldServer binary (missing fields) #851

Closed PREngineer closed 1 month ago

PREngineer commented 1 month ago

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

Description

I am building the repository that has the NPCBots built into Trinity Core (https://github.com/trickerer/TrinityCore-3.3.5-with-NPCBots/) following the instructions.

I've gotten to the Step 6 (Apply SQL files) but the instructions are very confusing and I am getting errors.

I'm assuming that this requires me to install the TrinityCore DB first from their official releases, since the included files are "updates." The first thing that I do is to put the file (TDB_full_world_335.24041_2024_04_10.sql) in the bin folder and run the worldserver. The worldserver gives me errors about tables that don't exist.

1

Then, I try to apply the world and character SQL files, and I see no errors.

sudo mysql

USE world
SOURCE /home/trinity/TrinityCore-3.3.5-with-NPCBots/sql/Bots/1_world_bot_appearance.sql
SOURCE /home/trinity/TrinityCore-3.3.5-with-NPCBots/sql/Bots/2_world_bot_extras.sql
SOURCE /home/trinity/TrinityCore-3.3.5-with-NPCBots/sql/Bots/3_world_bots.sql
SOURCE /home/trinity/TrinityCore-3.3.5-with-NPCBots/sql/Bots/4_world_generate_bot_equips.sql
SOURCE /home/trinity/TrinityCore-3.3.5-with-NPCBots/sql/Bots/5_world_botgiver.sql

USE characters
SOURCE /home/trinity/TrinityCore-3.3.5-with-NPCBots/sql/Bots/characters_bots.sql

exit

Then, I apply the updates to the 3 databases without any errors.

sudo mysql

USE auth
SOURCE /home/trinity/TrinityCore-3.3.5-with-NPCBots/sql/Bots/ALL_auth.sql

USE characters
SOURCE /home/trinity/TrinityCore-3.3.5-with-NPCBots/sql/Bots/ALL_characters.sql

USE world
SOURCE /home/trinity/TrinityCore-3.3.5-with-NPCBots/sql/Bots/ALL_world.sql

exit

When I try to start the WorldServer again, to validate that everything is correct. I am still getting errors.

2

Aren't these fields supposed to be added to the tables as part of the updates?

I think that this section of the README needs re-writing for more clarity. What am I missing? What is the proper order of execution?

Appreciate your help.

TrinityCore or AzerothCore

TrinityCore

Core rev. hash/commit

TrinityCore rev. 302cf0264b7b 2024-07-17 08:50:59 +0700 (npcbots_3.3.5 branch) (Unix, RelWithDebInfo, Static) (worldserver-daemon)

Operating system

Ubuntu 24

trickerer commented 1 month ago

These errors indicate wrong execution order, in particular that characters_bots.sql file contents were executed after all the updates, essentially you got the raw table without updates. What you got wrong is that you don't need to execute any of already existing files when you use bash scripts to merge them, only those three freshly created ones (ALL_xyz.sql). No worries though, all bot SQLs are re-executable. Just use those 3 files again. If you still get errors you'll have to check ALL_characters.sql file contents to see if it in fact starts with

--
SET FOREIGN_KEY CHECKS=0;

DROP TABLE IF EXISTS `characters_npcbot`;
...
PREngineer commented 1 month ago

Thanks a lot, kind sir! Now it works. I must have ran the individual files in step 6 after the ALL_*. Thank you for your awesome work!