Trinity SQLTransaction

Ungroups Trinity from AzerothCore when necessary
Replaces SQLTransaction by CharacterDatabaseTransaction
This commit is contained in:
RedSkull-666
2020-03-31 19:29:24 +02:00
parent 042629ea61
commit c58135b161
4 changed files with 14 additions and 6 deletions

View File

@@ -2094,7 +2094,9 @@ namespace LuaGlobalFunctions
draft.SetMoney(money);
#endif
#if defined TRINITY || AZEROTHCORE
#if defined TRINITY
CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
#elif defined AZEROTHCORE
SQLTransaction trans = CharacterDatabase.BeginTransaction();
#endif
uint8 addedItems = 0;

View File

@@ -254,7 +254,7 @@ namespace LuaGuild
uint8 rankId = Eluna::CHECKVAL<uint8>(L, 3, GUILD_RANK_NONE);
#ifdef TRINITY
SQLTransaction trans(nullptr);
CharacterDatabaseTransaction trans(nullptr);
guild->AddMember(trans, player->GET_GUID(), rankId);
#else
guild->AddMember(player->GET_GUID(), rankId);
@@ -273,7 +273,10 @@ namespace LuaGuild
Player* player = Eluna::CHECKOBJ<Player>(L, 2);
bool isDisbanding = Eluna::CHECKVAL<bool>(L, 3, false);
#if defined TRINITY || AZEROTHCORE
#if defined TRINITY
CharacterDatabaseTransaction trans(nullptr);
guild->DeleteMember(trans, player->GET_GUID(), isDisbanding);
#elif defined AZEROTHCORE
SQLTransaction trans(nullptr);
guild->DeleteMember(trans, player->GET_GUID(), isDisbanding);
#else
@@ -294,7 +297,7 @@ namespace LuaGuild
uint8 newRank = Eluna::CHECKVAL<uint8>(L, 3);
#ifdef TRINITY
SQLTransaction trans(nullptr);
CharacterDatabaseTransaction trans(nullptr);
guild->ChangeMemberRank(trans, player->GET_GUID(), newRank);
#else
guild->ChangeMemberRank(player->GET_GUID(), newRank);

View File

@@ -740,7 +740,10 @@ namespace LuaItem
*/
int SaveToDB(lua_State* /*L*/, Item* item)
{
#if defined TRINITY || AZEROTHCORE
#if defined TRINITY
CharacterDatabaseTransaction trans = CharacterDatabaseTransaction(nullptr);
item->SaveToDB(trans);
#elif defined AZEROTHCORE
SQLTransaction trans = SQLTransaction(NULL);
item->SaveToDB(trans);
#else

View File

@@ -2913,7 +2913,7 @@ namespace LuaPlayer
if (sWorld->getBoolConfig(CONFIG_QUEST_ENABLE_QUEST_TRACKER)) // check if Quest Tracker is enabled
{
// prepare Quest Tracker datas
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_GM_COMPLETE);
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_QUEST_TRACK_GM_COMPLETE);
stmt->setUInt32(0, quest->GetQuestId());
stmt->setUInt32(1, player->GetGUID().GetCounter());