Azerothcore-wotlk: [Global Storage] - Arena teams and Guild membership bugged

Created on 22 Jun 2020  路  9Comments  路  Source: azerothcore/azerothcore-wotlk

SMALL DESCRIPTION:

Some players are getting this weird bug were they can't see their own arena team and even guild. The game lets them join again to the arena team but with 0 progression, and for the non bugged members of the arena team, the bugged one who rejoined shows duplicated, one with the correct ammount of arenas played, and the other with 0 progression.

For now we've been dealing with this by restarting the server. On server restart the bugged players gets their team and guild access back, but this is far from an optimal solution.

I've only noticed than all the players with this bug get mentioned on the server log, whith something like this:

`2020-06-22 14:36:48 Player Xxxxxx [GUID: 123456] was not found in the global storage, but it was found in the database.

2020-06-22 14:36:49 Player Xxxxxx [GUID: 123456] was not found in the global storage, but it was found in the database.`

The lines before are never followed by "Player %s [GUID: %u] added to the global storage.", which I think may be a clue for this bug. It's like for some reason the player information is getting lost on this "global storage", and when trying to reload the info from database, it gets loaded but missing the arena and guild of the player.

I'm sorry for not being able to reproduce the issue. If anyone knows how global storage works, or what could disrupt this system, I'll be glad to start some testing to give more info, but for now this is all I have.

BRANCH(ES):

master

AC HASH/COMMIT:

34077115a5de7d640517caf8136f8648f8f195e3

OPERATING SYSTEM:

Ubuntu 18.04

MODULES:

mod-anticheat-master
mod-boss-announcer
mod-eluna-lua-engine-master
mod-emblem-transfer
mod-premium
mod-reward-played-time-master
mod-transmog-master

OTHER CUSTOMIZATIONS:

I've lowered conflarate delay to 0 on https://github.com/azerothcore/azerothcore-wotlk/blob/master/src/server/game/Entities/Unit/Unit.cpp#L3928

CORE Confirmed Priority - High

Most helpful comment

After making a deal with the devil, a way to reproduce this issue came to me. Please check the pull request above for more information, and thanks in advance for testing and maybe even suggesting a better way to address this issue.

All 9 comments

Arena team member add buged !!??

Confirmed. I've seen this happening in some AC-based servers.

I'm sorry for not being able to reproduce the issue.

However I don't know how to reproduce this either.

Confirmed, I had this problem too ^^

Hello everyone and so long, I was analyzing the report:

First of all, on my local server I have no way to test the error.

Secondly, I am sure since the core or AC (C ++ code) had to be adjusted for the Cross BG module, I believe that those adjustments are causing problems, because prior to that change that problem did not occur or happened.

PostData: Regardless of whether the module is not installed !

Greetings to all !

I'm using

SO: Arch Linux

Those "fixes" were intended to fix a wrong way to handle queue, not specifically related to Cross BG.

The BG system created new Battlegrounds even though there were room in those already existing ones.

Those PRs are not related with the guild creation/guid, so how can you be sure about it?

Also, if I remember correctly, this bug was there before the recent changes to the BG queue.

Confirm this bug present maybe 1 year ago. I never can find what cause for reproduce error, but is present in actual commits.

I also have this bug, and 2 other guys have it @malow @icenet . My core is like 4 months old.

I didn't notice the console error which is a nice hint. I'll investigate since nobody even tried to check the code -_-'

So here is the code in question:

        sLog->outString("Player %s [GUID: %u] was not found in the global storage, but it was found in the database.", name.c_str(), guid);

        sWorld->AddGlobalPlayerData(
            fields[0].GetUInt32(), /*guid*/
            fields[1].GetUInt32(), /*accountId*/
            fields[2].GetString(), /*name*/
            fields[3].GetUInt8(),  /*gender*/
            fields[4].GetUInt8(),  /*race*/
            fields[5].GetUInt8(),  /*class*/
            fields[6].GetUInt8(),  /*level*/
            0,                     /*mail count*/
            0                      /*guild id*/
        );

        itr = _globalPlayerDataStore.find(guid);
        if (itr != _globalPlayerDataStore.end())
        {
            sLog->outString("Player %s [GUID: %u] added to the global storage.", name.c_str(), guid);
            return &itr->second;
        }

We can see several issues:

1) First of all, in my console, it never displayed this Player %s [GUID: %u] added to the global storage., does it mean it was never added to the global storage therefore creating the bug?? seems like an issue.

2) Secondly, this part loads the player data:

        sWorld->AddGlobalPlayerData(
            fields[0].GetUInt32(), /*guid*/
            fields[1].GetUInt32(), /*accountId*/
            fields[2].GetString(), /*name*/
            fields[3].GetUInt8(),  /*gender*/
            fields[4].GetUInt8(),  /*race*/
            fields[5].GetUInt8(),  /*class*/
            fields[6].GetUInt8(),  /*level*/
            0,                     /*mail count*/
            0                      /*guild id*/
        );

but mail count and guild id are set to 0, it could be the cause of the issue.

To get the mailcount, in another part of the code, there is this:

        // count mails
        uint16 mailCount = 0;
        std::map<uint32, uint16>::const_iterator itr = _mailCountMap.find(guidLow);
        if (itr != _mailCountMap.end())
            mailCount = itr->second;

Now when I look at the query used for "fields", it's this PrepareStatement(CHAR_SEL_DATA_BY_GUID, "SELECT guid, account, name, gender, race, class, level FROM characters WHERE deleteDate IS NULL AND guid = ?", CONNECTION_BOTH); which obviously doesn't return the mailcount nor the guild id. This SQL query is only used in that code, so we can safely edit it in my opinion.
Maybe something like:

PrepareStatement(CHAR_SEL_DATA_BY_GUID, "SELECT guid, account, name, gender, race, class, level, guildid FROM characters AS ch LEFT JOIN guild_member AS gum  ON ch.guid = gum.guid WHERE ch.deleteDate IS NULL AND ch.guid = ?", CONNECTION_BOTH);

Therefore we would select the guild id like this:

        sWorld->AddGlobalPlayerData(
            fields[0].GetUInt32(), /*guid*/
            fields[1].GetUInt32(), /*accountId*/
            fields[2].GetString(), /*name*/
            fields[3].GetUInt8(),  /*gender*/
            fields[4].GetUInt8(),  /*race*/
            fields[5].GetUInt8(),  /*class*/
            fields[6].GetUInt8(),  /*level*/
            0,                     /*mail count*/
            fields[7].GetUInt32() /* id*/
        );

or better, with named fields (as currently it's pure shit) but I don't know how to do that in cpp (maybe fields['guildid'])

then see what happens? at least I tried

Note that this issue is repeated everywhere the function sWorld->AddGlobalPlayerData() is called so it is probably a bigger issue.

3) Finally, why do this line only affect few players "Player %s [GUID: %u] was not found in the global storage, but it was found in the database." ?? what causes the player to not be found in the global storage ? did he ALT+F4 ingame? Did he got a crash? or something more pernicious (and more logical) happened?

After making a deal with the devil, a way to reproduce this issue came to me. Please check the pull request above for more information, and thanks in advance for testing and maybe even suggesting a better way to address this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lineagedr picture lineagedr  路  3Comments

aradep picture aradep  路  3Comments

Franklampardst picture Franklampardst  路  3Comments

wetbrownsauce picture wetbrownsauce  路  3Comments

wowissues picture wowissues  路  3Comments