We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The purpose is to simulate players logging in to the game, It was normal until it was updated: #5611
Through breakpoint debugging, I can get the account and password normally, but the new lambad callback doesn't work properly
Thank you in advance for your help! I wish you all the best!
Below is my code:
` bool FakeBot::FakePlayerLogin() { SessionMap const& Sessions = sWorld->GetAllSessions(); for (auto const& AccountMap : m_AllAccount) { uint32 AccountId = AccountMap.first; if (Sessions.find(AccountId) != Sessions.end()) continue;
if (m_BotAccount[AccountId].size() < AccountMax) { for (auto const& PlayerGuid : AccountMap.second) { ObjectGuid PGUID = ObjectGuid(HighGuid::Player, PlayerGuid); Player* FakeBot = ObjectAccessor::FindPlayer(PGUID); if (FakeBot && FakeBot->IsInWorld()) continue; auto const itr = m_BotPlayers.find(PlayerGuid); if (itr != m_BotPlayers.end()) continue; WorldSession* FakerSession = new WorldSession(AccountId, "", nullptr, SEC_PLAYER, 2, time(NULL), LOCALE_zhCN, 0, false, true, 0); if (!FakerSession) { delete FakerSession; continue; } FakerSession->SetplayerLoading(true); std::shared_ptr<LoginQueryHolder> holder = std::make_shared<LoginQueryHolder>(AccountId, PGUID); if (!holder->Initialize()) { FakerSession->SetplayerLoading(false); continue; } //The new version is handled, but he has some problems FakerSession->AddQueryHolderCallback(CharacterDatabase.DelayQueryHolder(holder)).AfterComplete([FakerSession](SQLQueryHolderBase const& holder) { FakerSession->HandlePlayerLoginFromDB(static_cast<LoginQueryHolder const&>(holder)); }); //Handling of old versions //LoginQueryHolder* holder = new LoginQueryHolder(AccountId, PGUID); //if (!holder->Initialize()) //{ // delete holder; // FakerSession->SetplayerLoading(false); // continue; //} //auto NowLoginCallback = CharacterDatabase.DelayQueryHolder((CharacterDatabaseQueryHolder const&)(Holder)); //CharacterDatabaseQueryHolder* ParamHolder; //NowLoginCallback.get(ParamHolder); //FakerSession->HandlePlayerLoginFromDB((LoginQueryHolder&)ParamHolder); Player* GameBot = FakerSession->GetPlayer(); if (!GameBot) { LOG_ERROR("Custom Tab","Fakeer << Guid: %u AccId: %u LoadError", PlayerGuid, AccountId); FakerSession->LogoutPlayer(false); delete FakerSession; continue; } return true; } } } return false;
}`
The text was updated successfully, but these errors were encountered:
the methods you need have not changed much
Sorry, something went wrong.
You're great. Can you tell me what to do?
Do not ignore the issue template. Reopen a new issue and follow the template.
No branches or pull requests
The purpose is to simulate players logging in to the game, It was normal until it was updated: #5611
Through breakpoint debugging, I can get the account and password normally, but the new lambad callback doesn't work properly
Thank you in advance for your help! I wish you all the best!
Below is my code:
`
bool FakeBot::FakePlayerLogin()
{
SessionMap const& Sessions = sWorld->GetAllSessions();
for (auto const& AccountMap : m_AllAccount)
{
uint32 AccountId = AccountMap.first;
if (Sessions.find(AccountId) != Sessions.end())
continue;
}`
The text was updated successfully, but these errors were encountered: