diff options
| author | Shauren <shauren.trinity@gmail.com> | 2019-07-27 10:52:33 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2019-07-27 10:52:33 +0200 |
| commit | f6e2b8cdc1c8a3dd291947f67566b41dac116622 (patch) | |
| tree | 22a01cb91b2d47827ae73b48fcace3926587a341 /src/server/game/Calendar | |
| parent | e8e89f58fb800014f53341f12505f60ee2b5fb6f (diff) | |
Core/DBLayer: Prevent committing transactions started on a different database
Diffstat (limited to 'src/server/game/Calendar')
| -rw-r--r-- | src/server/game/Calendar/CalendarMgr.cpp | 12 | ||||
| -rw-r--r-- | src/server/game/Calendar/CalendarMgr.h | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/server/game/Calendar/CalendarMgr.cpp b/src/server/game/Calendar/CalendarMgr.cpp index d55bb226beb..c0487937986 100644 --- a/src/server/game/Calendar/CalendarMgr.cpp +++ b/src/server/game/Calendar/CalendarMgr.cpp @@ -137,11 +137,11 @@ void CalendarMgr::AddEvent(CalendarEvent* calendarEvent, CalendarSendEventType s void CalendarMgr::AddInvite(CalendarEvent* calendarEvent, CalendarInvite* invite) { - SQLTransaction dummy; + CharacterDatabaseTransaction dummy; AddInvite(calendarEvent, invite, dummy); } -void CalendarMgr::AddInvite(CalendarEvent* calendarEvent, CalendarInvite* invite, SQLTransaction& trans) +void CalendarMgr::AddInvite(CalendarEvent* calendarEvent, CalendarInvite* invite, CharacterDatabaseTransaction& trans) { if (!calendarEvent->IsGuildAnnouncement() && calendarEvent->GetOwnerGUID() != invite->GetInviteeGUID()) SendCalendarEventInvite(*invite); @@ -168,7 +168,7 @@ void CalendarMgr::RemoveEvent(uint64 eventId, ObjectGuid remover) SendCalendarEventRemovedAlert(*calendarEvent); - SQLTransaction trans = CharacterDatabase.BeginTransaction(); + CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction(); CharacterDatabasePreparedStatement* stmt; MailDraft mail(calendarEvent->BuildCalendarMailSubject(remover), calendarEvent->BuildCalendarMailBody()); @@ -214,7 +214,7 @@ void CalendarMgr::RemoveInvite(uint64 inviteId, uint64 eventId, ObjectGuid /*rem if (itr == _invites[eventId].end()) return; - SQLTransaction trans = CharacterDatabase.BeginTransaction(); + CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction(); CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CALENDAR_INVITE); stmt->setUInt64(0, (*itr)->GetInviteId()); trans->Append(stmt); @@ -251,11 +251,11 @@ void CalendarMgr::UpdateEvent(CalendarEvent* calendarEvent) void CalendarMgr::UpdateInvite(CalendarInvite* invite) { - SQLTransaction dummy; + CharacterDatabaseTransaction dummy; UpdateInvite(invite, dummy); } -void CalendarMgr::UpdateInvite(CalendarInvite* invite, SQLTransaction& trans) +void CalendarMgr::UpdateInvite(CalendarInvite* invite, CharacterDatabaseTransaction& trans) { CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_CALENDAR_INVITE); stmt->setUInt64(0, invite->GetInviteId()); diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h index aa7f1afbed4..fa67c8b2261 100644 --- a/src/server/game/Calendar/CalendarMgr.h +++ b/src/server/game/Calendar/CalendarMgr.h @@ -313,10 +313,10 @@ class TC_GAME_API CalendarMgr void UpdateEvent(CalendarEvent* calendarEvent); void AddInvite(CalendarEvent* calendarEvent, CalendarInvite* invite); - void AddInvite(CalendarEvent* calendarEvent, CalendarInvite* invite, SQLTransaction& trans); + void AddInvite(CalendarEvent* calendarEvent, CalendarInvite* invite, CharacterDatabaseTransaction& trans); void RemoveInvite(uint64 inviteId, uint64 eventId, ObjectGuid remover); void UpdateInvite(CalendarInvite* invite); - void UpdateInvite(CalendarInvite* invite, SQLTransaction& trans); + void UpdateInvite(CalendarInvite* invite, CharacterDatabaseTransaction& trans); void RemoveAllPlayerEventsAndInvites(ObjectGuid guid); void RemovePlayerGuildEventsAndSignups(ObjectGuid guid, ObjectGuid::LowType guildId); |
