aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/AuctionHouseHandler.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-05-07 18:47:36 +0200
committerShauren <shauren.trinity@gmail.com>2013-05-07 18:47:36 +0200
commit27ceee92fbfdb0021b9e6e852d5097b7195e9e11 (patch)
tree3bcfd5d5c21b3633bf984a1a818fba67a382269d /src/server/game/Handlers/AuctionHouseHandler.cpp
parent45bae8d4b74d772215cb22c7bb27732f55c5d9fd (diff)
Core/AuctionHouse: Fixed field type mismatches when saving auction to database (db fields are unsigned int) and prevent posting auctions with bids or buyouts over gold cap
Closes #9762
Diffstat (limited to 'src/server/game/Handlers/AuctionHouseHandler.cpp')
-rw-r--r--src/server/game/Handlers/AuctionHouseHandler.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp
index 47ad7ffa568..abeee3e1a9e 100644
--- a/src/server/game/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Handlers/AuctionHouseHandler.cpp
@@ -127,6 +127,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
if (itemsCount > MAX_AUCTION_ITEMS)
{
SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR);
+ recvData.rfinish();
return;
}
@@ -135,8 +136,11 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
recvData >> itemGUIDs[i];
recvData >> count[i];
- if (!itemGUIDs[i] || !count[i] || count[i] > 1000 )
+ if (!itemGUIDs[i] || !count[i] || count[i] > 1000)
+ {
+ recvData.rfinish();
return;
+ }
}
recvData >> bid;
@@ -146,6 +150,14 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
if (!bid || !etime)
return;
+ if (bid > MAX_MONEY_AMOUNT || buyout > MAX_MONEY_AMOUNT)
+ {
+ sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Player %s (GUID %u) attempted to sell item with higher price than max gold amount.", _player->GetName().c_str(), _player->GetGUIDLow());
+ SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR);
+ return;
+ }
+
+
Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER);
if (!creature)
{