Open icemansparks opened 2 months ago
Ok seems like I have found the cause for this issue and it is probably not that common.
TL;DR:
Custom SQL was used on server setup to add pre-existing player accounts to the account and character database.
But in acore_playerbots.playerbots_random_bots
the value for "bot" is fixed on server stup and rfrncs bot charactr guids which ar in this case real characters instead.
Long version:
As far as I can tell, it is decided if a character is a bot / part of a bot account by looking up the value in acore_playerbots.playerbots_random_bots
The table is pre-populated with all the bots that have been created on first initialisation when starting up the server.
The problem in my case now seems to be, that the character IDs are used in this table in the "bot" column to link the character guid to the bot entry. Since the values for the guids of the bots seem to be pre-populated (couldn't find the exact sql file yet), character guid values start at 1, just like the created character entries.
This is the breaking point for my setup as i added character and account entries for already existing user accounts with a custom SQL in the server sql directory (as supposed to).
These will be created before all modules, resulting in my character database having real user (player) characters inside them (guid 1-30 in this case).
The playerbot character creation now just starts with the next available guid (all good so far) but the association in acore_playerbots.playerbots_random_bots
still references fixed guids from the character table (in this case 1-30 are assigned to playerbot accoutns and are therefore identified as such.
Reassigning the bot number to the "free bot character guid" solved the problem as it seems. The following screenshot shows the table after adjusting the first 30 guid values.
Proposed solution (idea):
the entries in acore_playerbots.playerbots_random_bots
should be based on the bot account character guid values that actually have been created instead of using pre-defined values.
I like the detail here, but I'm wondering how exactly to reproduce this, is it something I could reproduce by creating characters (in the normal way) before using/enabling the bot?
Now EITHER:
OR: (what I did)
acore_characters
DB (specifically characters table) and acore_auth
DB (everything more or less)\azerothcore-wotlk\data\sql\custom\db_characters
Ok, I tried to understand how bots and bot accounts are created... if I got it right, it is done in
void RandomPlayerbotFactory::CreateRandomBots()
?
Account and bot creation follows the same kind of "for loop":
for (uint32 accountNumber = 0; accountNumber < sPlayerbotAIConfig->randomBotAccountCount; ++accountNumber)
This, as far as I understand, always starts with accountId = 0
and counts up until the max bot accounts configured in the config sPlayerbotAIConfig->randomBotAccountCount
.
This does not take into account any existing "player-made accounts" that are present before module initialization and will always lead to a false assignment of bots to accounts in acore_playerbots.playerbots_random_bots
since the assignment starts with accountId = 1
rather than the first bot account.
Example of the accounts table:
I think a suitable solution could be to find all bot accounts based on the botAccountPrefix
, get their AccountIDs, and add them to an array, then instead of an automatic increase for-loop, iterate over all bot accounts from the array and the characters associated with those accounts?
Unfortunately i cannot implement it myself :)
Describe the bug After staring up the Server and loggin into a character on a non admin account, the characters from the friendlist and guild are shown to be loggin in and immediately loggin out.
Settings from config:
No error messages are shown in the server console, though. The recurring message of "30 New bots" appears in the server console window instead.
Commit hash 264c533d1fd020234eb1c05005343d86fcca7a39
To Reproduce Steps to reproduce the behavior:
Expected behavior With the options to deny bots from guild and disabled auto login, the alt characters of the player and other players accounts should not login at all automatically.
Desktop (please complete the following information):