Core/Server: fix duplicated inserts into tutorials table for newly created characters
Port From (https://github.com/TrinityCore/TrinityCore/commit/26fe9496191225c8300ac57c07e9380193ec2c54)
This commit is contained in:
@@ -315,7 +315,6 @@ namespace Framework.Database
|
|||||||
|
|
||||||
// Tutorials
|
// Tutorials
|
||||||
PrepareStatement(CharStatements.SEL_TUTORIALS, "SELECT tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7 FROM account_tutorial WHERE accountId = ?");
|
PrepareStatement(CharStatements.SEL_TUTORIALS, "SELECT tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7 FROM account_tutorial WHERE accountId = ?");
|
||||||
PrepareStatement(CharStatements.SEL_HAS_TUTORIALS, "SELECT 1 FROM account_tutorial WHERE accountId = ?");
|
|
||||||
PrepareStatement(CharStatements.INS_TUTORIALS, "INSERT INTO account_tutorial(tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7, accountId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
PrepareStatement(CharStatements.INS_TUTORIALS, "INSERT INTO account_tutorial(tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7, accountId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
PrepareStatement(CharStatements.UPD_TUTORIALS, "UPDATE account_tutorial SET tut0 = ?, tut1 = ?, tut2 = ?, tut3 = ?, tut4 = ?, tut5 = ?, tut6 = ?, tut7 = ? WHERE accountId = ?");
|
PrepareStatement(CharStatements.UPD_TUTORIALS, "UPDATE account_tutorial SET tut0 = ?, tut1 = ?, tut2 = ?, tut3 = ?, tut4 = ?, tut5 = ?, tut6 = ?, tut7 = ? WHERE accountId = ?");
|
||||||
PrepareStatement(CharStatements.DEL_TUTORIALS, "DELETE FROM account_tutorial WHERE accountId = ?");
|
PrepareStatement(CharStatements.DEL_TUTORIALS, "DELETE FROM account_tutorial WHERE accountId = ?");
|
||||||
@@ -967,7 +966,6 @@ namespace Framework.Database
|
|||||||
DEL_PLAYER_ACCOUNT_DATA,
|
DEL_PLAYER_ACCOUNT_DATA,
|
||||||
|
|
||||||
SEL_TUTORIALS,
|
SEL_TUTORIALS,
|
||||||
SEL_HAS_TUTORIALS,
|
|
||||||
INS_TUTORIALS,
|
INS_TUTORIALS,
|
||||||
UPD_TUTORIALS,
|
UPD_TUTORIALS,
|
||||||
DEL_TUTORIALS,
|
DEL_TUTORIALS,
|
||||||
|
|||||||
@@ -449,6 +449,10 @@ namespace Game
|
|||||||
stmt.AddValue(SharedConst.MaxAccountTutorialValues, GetAccountId());
|
stmt.AddValue(SharedConst.MaxAccountTutorialValues, GetAccountId());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
|
// now has, set flag so next save uses update query
|
||||||
|
if (!hasTutorialsInDB)
|
||||||
|
tutorialsChanged |= TutorialsFlag.LoadedFromDB;
|
||||||
|
|
||||||
tutorialsChanged &= ~TutorialsFlag.Changed;
|
tutorialsChanged &= ~TutorialsFlag.Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user