fix(Core/WorldSession): change how to storing data in account_tutorial (#1563)

* Core/Misc Created handler for character creation

* fix(Core/DB): Error message when the password is longer than 16 char when creating an account

* Update rev_1551539925032805900.sql

* Update AccountMgr.cpp

* fix(Core/DB): account_tutorial now storing data

* clean
This commit is contained in:
Ercules76
2019-03-14 21:43:50 +01:00
committed by Viste(Кирилл)
parent 2e65c0afb7
commit 2d1e459197

View File

@@ -804,15 +804,12 @@ void WorldSession::SaveTutorialsData(SQLTransaction &trans)
if (!m_TutorialsChanged)
return;
bool hasTutorials = false;
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
if (m_Tutorials[i] != 0)
{
hasTutorials = true;
break;
}
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_HAS_TUTORIALS);
stmt->setUInt32(0, GetAccountId());
bool hasTutorials = bool(CharacterDatabase.Query(stmt));
stmt = CharacterDatabase.GetPreparedStatement(hasTutorials ? CHAR_UPD_TUTORIALS : CHAR_INS_TUTORIALS);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(hasTutorials ? CHAR_UPD_TUTORIALS : CHAR_INS_TUTORIALS);
for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i)
stmt->setUInt32(i, m_Tutorials[i]);
stmt->setUInt32(MAX_ACCOUNT_TUTORIAL_VALUES, GetAccountId());