Skip to content

Commit 5ef9997

Browse files
committed
Core/Misc: Reduce differences between branches
1 parent bc7be2a commit 5ef9997

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+140
-162
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UPDATE `trinity_string` SET `content_default`='%s - owner: %s (%s account: %u) %s' WHERE `entry`=508;

src/server/database/Database/Implementation/CharacterDatabase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
5151
"cb.guid, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? "
5252
"LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid "
5353
"LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? AND c.deleteInfos_Name IS NULL ORDER BY c.guid", CONNECTION_ASYNC);
54-
PrepareStatement(CHAR_SEL_FREE_NAME, "SELECT guid, name, at_login FROM characters WHERE guid = ? AND account = ? AND NOT EXISTS (SELECT NULL FROM characters WHERE name = ?)", CONNECTION_ASYNC);
54+
PrepareStatement(CHAR_SEL_FREE_NAME, "SELECT name, at_login FROM characters WHERE guid = ? AND account = ? AND NOT EXISTS (SELECT NULL FROM characters WHERE name = ?)", CONNECTION_ASYNC);
5555
PrepareStatement(CHAR_SEL_CHAR_ZONE, "SELECT zone FROM characters WHERE guid = ?", CONNECTION_SYNCH);
5656
PrepareStatement(CHAR_SEL_CHARACTER_NAME_DATA, "SELECT race, class, gender, level, name FROM characters WHERE guid = ?", CONNECTION_SYNCH);
5757
PrepareStatement(CHAR_SEL_CHAR_POSITION_XYZ, "SELECT map, position_x, position_y, position_z FROM characters WHERE guid = ?", CONNECTION_SYNCH);
@@ -141,7 +141,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
141141
PrepareStatement(CHAR_UPD_MAIL_ITEM_RECEIVER, "UPDATE mail_items SET receiver = ? WHERE item_guid = ?", CONNECTION_ASYNC);
142142
PrepareStatement(CHAR_UPD_ITEM_OWNER, "UPDATE item_instance SET owner_guid = ? WHERE guid = ?", CONNECTION_ASYNC);
143143

144-
PrepareStatement(CHAR_SEL_ITEM_REFUNDS, "SELECT player_guid, paidMoney, paidExtendedCost FROM item_refund_instance WHERE item_guid = ? AND player_guid = ? LIMIT 1", CONNECTION_SYNCH);
144+
PrepareStatement(CHAR_SEL_ITEM_REFUNDS, "SELECT paidMoney, paidExtendedCost FROM item_refund_instance WHERE item_guid = ? AND player_guid = ? LIMIT 1", CONNECTION_SYNCH);
145145
PrepareStatement(CHAR_SEL_ITEM_BOP_TRADE, "SELECT allowedPlayers FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_SYNCH);
146146
PrepareStatement(CHAR_DEL_ITEM_BOP_TRADE, "DELETE FROM item_soulbound_trade_data WHERE itemGuid = ? LIMIT 1", CONNECTION_ASYNC);
147147
PrepareStatement(CHAR_INS_ITEM_BOP_TRADE, "INSERT INTO item_soulbound_trade_data VALUES (?, ?)", CONNECTION_ASYNC);

src/server/game/AI/SmartScripts/SmartScript.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
316316
mUseTextTimer = true;
317317
sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), talkTarget);
318318
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: {} {}, textGuid: {}",
319-
talker->GetName(), talker->GetGUID().ToString(), talkTarget ? talkTarget->GetGUID().ToString() : "0");
319+
talker->GetName(), talker->GetGUID().ToString(), talkTarget ? talkTarget->GetGUID().ToString() : "Empty");
320320
break;
321321
}
322322
case SMART_ACTION_SIMPLE_TALK:

src/server/game/Achievements/AchievementMgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
15271527
return;
15281528

15291529
TC_LOG_INFO("achievement", "AchievementMgr::CompletedAchievement({}). Player: {} {}",
1530-
achievement->ID, m_player->GetName(), m_player->GetGUID().ToString());
1530+
achievement->ID, m_player->GetGUID().ToString(), m_player->GetName());
15311531

15321532
SendAchievementEarned(achievement);
15331533
CompletedAchievementData& ca = m_completedAchievements[achievement->ID];

src/server/game/AuctionHouse/AuctionHouseMgr.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,10 @@ void AuctionHouseMgr::LoadAuctions()
416416
TC_LOG_INFO("server.loading", ">> Loaded {} auctions with {} bidders in {} ms", countAuctions, countBidders, GetMSTimeDiffToNow(oldMSTime));
417417
}
418418

419-
void AuctionHouseMgr::AddAItem(Item* it)
419+
void AuctionHouseMgr::AddAItem(Item* item)
420420
{
421-
ASSERT(it);
422-
ASSERT(mAitems.find(it->GetGUID().GetCounter()) == mAitems.end());
423-
mAitems[it->GetGUID().GetCounter()] = it;
421+
ASSERT(item);
422+
ASSERT_WITH_SIDE_EFFECTS(mAitems.emplace(item->GetGUID().GetCounter(), item).second);
424423
}
425424

426425
bool AuctionHouseMgr::RemoveAItem(ObjectGuid::LowType id, bool deleteItem /*= false*/, CharacterDatabaseTransaction* trans /*= nullptr*/)
@@ -645,7 +644,7 @@ void AuctionHouseObject::Update()
645644
continue;
646645

647646
///- Either cancel the auction if there was no bidder
648-
if (auction->bidder == 0 && auction->bid == 0)
647+
if (!auction->bidder && auction->bid == 0)
649648
{
650649
sAuctionMgr->SendAuctionExpiredMail(auction, trans);
651650
sScriptMgr->OnAuctionExpire(this, auction);

src/server/game/AuctionHouse/AuctionHouseMgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class TC_GAME_API AuctionHouseMgr
199199
void LoadAuctionItems();
200200
void LoadAuctions();
201201

202-
void AddAItem(Item* it);
202+
void AddAItem(Item* item);
203203
bool RemoveAItem(ObjectGuid::LowType id, bool deleteItem = false, CharacterDatabaseTransaction* trans = nullptr);
204204
bool PendingAuctionAdd(Player* player, AuctionEntry* aEntry);
205205
uint32 PendingAuctionCount(Player const* player) const;

src/server/game/Battlefield/Battlefield.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint)
913913

914914
TC_LOG_DEBUG("bg.battlefield", "Creating capture point {}", capturePoint->GetEntry());
915915

916-
m_capturePointGUID = ObjectGuid(HighGuid::GameObject, capturePoint->GetEntry(), capturePoint->GetGUID().GetCounter());
916+
m_capturePointGUID = capturePoint->GetGUID();
917917

918918
// check info existence
919919
GameObjectTemplate const* goinfo = capturePoint->GetGOInfo();

src/server/game/Chat/Hyperlinks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ namespace Trinity::Hyperlinks
134134
{
135135
if (Optional<uint64> res = Trinity::StringTo<uint64>(data, 16))
136136
{
137-
val.Set(*res);
137+
val.SetRawValue(*res);
138138
return true;
139139
}
140140
else

src/server/game/Entities/Item/Item.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ Item::Item()
260260
mb_in_trade = false;
261261
m_lastPlayedTimeUpdate = GameTime::GetGameTime();
262262

263-
m_refundRecipient = 0;
264263
m_paidMoney = 0;
265264
m_paidExtendedCost = 0;
266265
}
@@ -327,7 +326,6 @@ void Item::SaveToDB(CharacterDatabaseTransaction trans)
327326
if (!isInTransaction)
328327
trans = CharacterDatabase.BeginTransaction();
329328

330-
ObjectGuid::LowType guid = GetGUID().GetCounter();
331329
switch (uState)
332330
{
333331
case ITEM_NEW:
@@ -362,29 +360,29 @@ void Item::SaveToDB(CharacterDatabaseTransaction trans)
362360
stmt->setUInt16(++index, GetUInt32Value(ITEM_FIELD_DURABILITY));
363361
stmt->setUInt32(++index, GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME));
364362
stmt->setString(++index, m_text);
365-
stmt->setUInt32(++index, guid);
363+
stmt->setUInt32(++index, GetGUID().GetCounter());
366364

367365
trans->Append(stmt);
368366

369367
if ((uState == ITEM_CHANGED) && IsWrapped())
370368
{
371369
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GIFT_OWNER);
372370
stmt->setUInt32(0, GetOwnerGUID().GetCounter());
373-
stmt->setUInt32(1, guid);
371+
stmt->setUInt32(1, GetGUID().GetCounter());
374372
trans->Append(stmt);
375373
}
376374
break;
377375
}
378376
case ITEM_REMOVED:
379377
{
380378
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE);
381-
stmt->setUInt32(0, guid);
379+
stmt->setUInt32(0, GetGUID().GetCounter());
382380
trans->Append(stmt);
383381

384382
if (IsWrapped())
385383
{
386384
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT);
387-
stmt->setUInt32(0, guid);
385+
stmt->setUInt32(0, GetGUID().GetCounter());
388386
trans->Append(stmt);
389387
}
390388

@@ -1139,7 +1137,7 @@ void Item::SaveRefundDataToDB()
11391137

11401138
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEM_REFUND_INSTANCE);
11411139
stmt->setUInt32(0, GetGUID().GetCounter());
1142-
stmt->setUInt32(1, GetRefundRecipient());
1140+
stmt->setUInt32(1, GetRefundRecipient().GetCounter());
11431141
stmt->setUInt32(2, GetPaidMoney());
11441142
stmt->setUInt16(3, uint16(GetPaidExtendedCost()));
11451143
trans->Append(stmt);
@@ -1168,7 +1166,7 @@ void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, Character
11681166
if (changestate)
11691167
SetState(ITEM_CHANGED, owner);
11701168

1171-
SetRefundRecipient(0);
1169+
SetRefundRecipient(ObjectGuid::Empty);
11721170
SetPaidMoney(0);
11731171
SetPaidExtendedCost(0);
11741172
DeleteRefundDataFromDB(trans);

src/server/game/Entities/Item/Item.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ class TC_GAME_API Item : public Object
183183

184184
// Item Refund system
185185
void SetNotRefundable(Player* owner, bool changestate = true, CharacterDatabaseTransaction* trans = nullptr);
186-
void SetRefundRecipient(ObjectGuid::LowType pGuidLow) { m_refundRecipient = pGuidLow; }
186+
void SetRefundRecipient(ObjectGuid const& guid) { m_refundRecipient = guid; }
187187
void SetPaidMoney(uint32 money) { m_paidMoney = money; }
188188
void SetPaidExtendedCost(uint32 iece) { m_paidExtendedCost = iece; }
189189

190-
uint32 GetRefundRecipient() const { return m_refundRecipient; }
190+
ObjectGuid const& GetRefundRecipient() const { return m_refundRecipient; }
191191
uint32 GetPaidMoney() const { return m_paidMoney; }
192192
uint32 GetPaidExtendedCost() const { return m_paidExtendedCost; }
193193

@@ -216,7 +216,7 @@ class TC_GAME_API Item : public Object
216216
int16 uQueuePos;
217217
bool mb_in_trade; // true if item is currently in trade-window
218218
time_t m_lastPlayedTimeUpdate;
219-
ObjectGuid::LowType m_refundRecipient;
219+
ObjectGuid m_refundRecipient;
220220
uint32 m_paidMoney;
221221
uint32 m_paidExtendedCost;
222222
GuidSet allowedGUIDs;

0 commit comments

Comments
 (0)