mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
Core/Guild: avoid data integrity problems wrapping delete+insert statements in a transaction
This commit is contained in:
@@ -146,7 +146,8 @@ public:
|
||||
return false;
|
||||
|
||||
// player's guild membership checked in AddMember before add
|
||||
return targetGuild->AddMember(targetGuid);
|
||||
SQLTransaction trans(nullptr);
|
||||
return targetGuild->AddMember(trans, targetGuid);
|
||||
}
|
||||
|
||||
static bool HandleGuildUninviteCommand(ChatHandler* handler, char const* args)
|
||||
@@ -164,7 +165,8 @@ public:
|
||||
if (!targetGuild)
|
||||
return false;
|
||||
|
||||
targetGuild->DeleteMember(targetGuid, false, true, true);
|
||||
SQLTransaction trans(nullptr);
|
||||
targetGuild->DeleteMember(trans, targetGuid, false, true, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -191,7 +193,8 @@ public:
|
||||
return false;
|
||||
|
||||
uint8 newRank = uint8(atoi(rankStr));
|
||||
return targetGuild->ChangeMemberRank(targetGuid, newRank);
|
||||
SQLTransaction trans(nullptr);
|
||||
return targetGuild->ChangeMemberRank(trans, targetGuid, newRank);
|
||||
}
|
||||
|
||||
static bool HandleGuildRenameCommand(ChatHandler* handler, char const* _args)
|
||||
|
||||
Reference in New Issue
Block a user