mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-24 05:35:51 +12:00
Add more auction checks
This commit is contained in:
parent
f35456385d
commit
35a1d00dd3
8 changed files with 689 additions and 4 deletions
|
@ -26,6 +26,13 @@ namespace HISP.Game.Services
|
|||
|
||||
public void PlaceBid(int bidAmount)
|
||||
{
|
||||
if(BidUser.HorseInventory.HorseList.Length >= BidUser.MaxHorses)
|
||||
{
|
||||
byte[] tooManyHorses = PacketBuilder.CreateChat(Messages.AuctionYouHaveTooManyHorses, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
BidUser.LoggedinClient.SendPacket(tooManyHorses);
|
||||
return;
|
||||
}
|
||||
|
||||
string yourBidRaisedTo = Messages.FormatAuctionBidRaised(BidAmount, BidAmount + bidAmount);
|
||||
|
||||
if(BidAmount >= MAX_BID)
|
||||
|
@ -35,6 +42,7 @@ namespace HISP.Game.Services
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
if (BidAmount + bidAmount > BidUser.Money && (AuctionItem.OwnerId != BidUser.Id))
|
||||
{
|
||||
|
||||
|
@ -53,6 +61,20 @@ namespace HISP.Game.Services
|
|||
|
||||
if (BidAmount > AuctionItem.HighestBid)
|
||||
{
|
||||
|
||||
foreach(Auction room in AuctionRooms)
|
||||
{
|
||||
foreach(Auction.AuctionEntry entry in room.AuctionEntries)
|
||||
{
|
||||
if(entry.RandomId != AuctionItem.RandomId)
|
||||
{
|
||||
byte[] cantWinTooMuch = PacketBuilder.CreateChat(Messages.AuctionOnlyOneWinningBidAllowed, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
BidUser.LoggedinClient.SendPacket(cantWinTooMuch);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int oldBid = AuctionItem.HighestBid;
|
||||
AuctionItem.HighestBid = BidAmount;
|
||||
if(AuctionItem.HighestBidder != BidUser.Id && oldBid > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue