mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Trinity SQLTransaction
Ungroups Trinity from AzerothCore when necessary Replaces SQLTransaction by CharacterDatabaseTransaction
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user