mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-12 07:59:48 +12:00
Finish Auctions? (finally??)
This commit is contained in:
parent
0f95462294
commit
69e7ef1baa
10 changed files with 235 additions and 69 deletions
|
@ -213,20 +213,24 @@
|
|||
"auction":{
|
||||
"auctions_running":"The following auctions are running:<BR>",
|
||||
"players_here":"^HPlayers Here: %USERNAMES%",
|
||||
"auction_horse_entry":"^I252^T8%USERNAME%'s %COLOR% %BREED% %GENDER% (%EXP%exp)^B3L%RANDOMID%^R1",
|
||||
"going_to":"^T8In %TIME%m going to %WINNINGPLAYER% for $%WINNINGBID%^R1^B72%AUCTIONRANDOMID%^B73%AUCTIONRANDOMID%^B74%AUCTIONRANDOMID%^B75%AUCTIONRANDOMID%^B76%RANDOMID%^B77%AUCTIONRANDOMID%^B78%AUCTIONRANDOMID%^R1",
|
||||
"not_sold":"^T8Auction Ended. Horse was not sold.",
|
||||
"auction_horse_entry":"^I252^T8%USERNAME%'s %COLOR% %BREED% %GENDER% (%EXP%exp)%LOOKBUTTON%^R1",
|
||||
"view_button":"^B3L%RANDOMID%",
|
||||
"going_to":"^T8In %TIME%m going to %WINNINGPLAYER% for $%WINNINGBID%^R1^B72%AUCTIONRANDOMID%^B73%AUCTIONRANDOMID%^B74%AUCTIONRANDOMID%^B75%AUCTIONRANDOMID%^B76%AUCTIONRANDOMID%^B77%AUCTIONRANDOMID%^B78%AUCTIONRANDOMID%^R1",
|
||||
"not_sold":"^T8Auction Ended. Horse was not sold.^R1",
|
||||
"sold_to":"^T8Auction Ended. %PLAYERNAME% won it for $%PRICE%^R1",
|
||||
"auction_horse":"^T0(2b max)^D41|AUCTION A HORSE^R1",
|
||||
|
||||
"one_horse_at_a_time":"Only one horse per player allowed up for auction at a time.",
|
||||
"list_horse":"^HIt costs you $1,000 to auction. If you wish to set a minimum bid for your horse, bid on it yourself. All auctions run for 8 minutes.<BR>Select from one of your horses to auction:^R1",
|
||||
"horse_list_entry":"^I252^T3%HORSENAME%%TACKEDORNO%^D42c%RANDOMID%|AUCTION^R1",
|
||||
"tacked":"[tacked!]",
|
||||
|
||||
"max_bid":"Max auction bidding is 2b.",
|
||||
"bid_raised":"Your bid raised $%AMOUNT% to $%NEWAMOUNT%.",
|
||||
"top_bid":" TOP BID",
|
||||
"existing_higher":" Existing Bid is Higher",
|
||||
|
||||
"no_other_transaction_allowed":"No other money transactions allowed while bidding on a Horse at auction.",
|
||||
"outbid_by":"You have been outbid by %USERNAME%. High bid is now $%AMOUNT%.",
|
||||
"cant_afford_bid":"You cannot afford that bid.",
|
||||
"cant_afford_listing":"You cannot afford the auction fee.",
|
||||
|
|
|
@ -6,10 +6,10 @@ namespace HISP.Game.Horse
|
|||
{
|
||||
public class HorseInstance
|
||||
{
|
||||
public HorseInstance(HorseInfo.Breed breed, int randomId = -1, string loadName=null, string loadDescription = "", int loadSpoiled=0, string loadCategory="KEEPER", int loadMagicUsed=0, int loadAutoSell=0, int leaseTimer=0, bool loadHidden=false)
|
||||
public HorseInstance(HorseInfo.Breed breed, int randomId = -1, string loadName=null, string loadDescription = "", int loadSpoiled=0, string loadCategory="KEEPER", int loadMagicUsed=0, int loadAutoSell=0, int leaseTimer=0, bool loadHidden=false, int loadOwner=0)
|
||||
{
|
||||
RandomId = RandomID.NextRandomId(randomId);
|
||||
Owner = 0;
|
||||
owner = loadOwner;
|
||||
if(loadName == null)
|
||||
{
|
||||
|
||||
|
@ -61,7 +61,19 @@ namespace HISP.Game.Horse
|
|||
}
|
||||
public int Leaser;
|
||||
public int RandomId;
|
||||
public int Owner;
|
||||
public int owner;
|
||||
public int Owner
|
||||
{
|
||||
get
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
set
|
||||
{
|
||||
owner = value;
|
||||
Database.SetHorseOwner(RandomId, owner);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Hidden
|
||||
{
|
||||
|
|
|
@ -30,6 +30,17 @@ namespace HISP.Game.Inventory
|
|||
Database.LoadHorseInventory(this, baseUser.Id);
|
||||
}
|
||||
|
||||
public void UnHide(int randomId)
|
||||
{
|
||||
foreach(HorseInstance inst in horsesList)
|
||||
{
|
||||
if (inst.RandomId == randomId)
|
||||
{
|
||||
inst.Hidden = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void AddHorse(HorseInstance horse, bool addToDb=true)
|
||||
{
|
||||
if (HorseList.Length + 1 > baseUser.MaxHorses)
|
||||
|
@ -41,8 +52,9 @@ namespace HISP.Game.Inventory
|
|||
horsesList.Add(horse);
|
||||
}
|
||||
|
||||
public void DeleteHorse(HorseInstance horse)
|
||||
public void DeleteHorse(HorseInstance horse, bool removeFromDb=true)
|
||||
{
|
||||
if(removeFromDb)
|
||||
Database.RemoveHorse(horse.RandomId);
|
||||
horsesList.Remove(horse);
|
||||
}
|
||||
|
|
|
@ -22,8 +22,10 @@ namespace HISP.Game
|
|||
public static string AuctionListHorse;
|
||||
|
||||
public static string AuctionHorseListEntryFormat;
|
||||
public static string AuctionHorseViewButton;
|
||||
public static string AuctionHorseIsTacked;
|
||||
|
||||
public static string AuctionBidMax;
|
||||
public static string AuctionBidRaisedFormat;
|
||||
public static string AuctionTopBid;
|
||||
public static string AuctionExistingBidHigher;
|
||||
|
@ -31,6 +33,7 @@ namespace HISP.Game
|
|||
public static string AuctionYouveBeenOutbidFormat;
|
||||
public static string AuctionCantAffordBid;
|
||||
public static string AuctionCantAffordAuctionFee;
|
||||
public static string AuctionOneHorsePerPlayer;
|
||||
|
||||
public static string AuctionYouBroughtAHorseFormat;
|
||||
public static string AuctionNoHorseBrought;
|
||||
|
@ -41,6 +44,8 @@ namespace HISP.Game
|
|||
public static string AuctionNotSold;
|
||||
public static string AuctionGoingToFormat;
|
||||
|
||||
public static string AuctionNoOtherTransactionAllowed;
|
||||
|
||||
// Warp Command
|
||||
public static string SuccessfullyWarpedToLocation;
|
||||
public static string SuccessfullyWarpedToPlayer;
|
||||
|
@ -894,7 +899,7 @@ namespace HISP.Game
|
|||
|
||||
public static string FormatAuctionSoldTo(string playerName, int money)
|
||||
{
|
||||
return AuctionSoldToFormat.Replace("%PLAYERNAME%", playerName).Replace("%MONEY%", money.ToString("N0", CultureInfo.InvariantCulture));
|
||||
return AuctionSoldToFormat.Replace("%PLAYERNAME%", playerName).Replace("%PRICE%", money.ToString("N0", CultureInfo.InvariantCulture));
|
||||
}
|
||||
public static string FormatAuctionGoingTo(int timeRemaining, string winningPlayer, int winningBid, int auctionRandomId)
|
||||
{
|
||||
|
@ -920,11 +925,15 @@ namespace HISP.Game
|
|||
{
|
||||
return AuctionHorseListEntryFormat.Replace("%HORSENAME%", horseName).Replace("%TACKEDORNO%", tacked ? Messages.AuctionHorseIsTacked : "").Replace("%RANDOMID%", randomId.ToString());
|
||||
}
|
||||
public static string FormatAuctionHorseEntry(string username, string color, string breedName, string gender, int experience, int horseRandomId)
|
||||
public static string FormatAuctionHorseEntry(string username, string color, string breedName, string gender, int experience, string lookButton)
|
||||
{
|
||||
return AuctionHorseEntryFormat.Replace("%USERNAME%", username).Replace("%COLOR%", color).Replace("%BREED%", breedName).Replace("%GENDER%", gender).Replace("%EXP%", experience.ToString("N0", CultureInfo.InvariantCulture)).Replace("%RANDOMID%", horseRandomId.ToString());
|
||||
return AuctionHorseEntryFormat.Replace("%USERNAME%", username).Replace("%COLOR%", color).Replace("%BREED%", breedName).Replace("%GENDER%", gender).Replace("%EXP%", experience.ToString("N0", CultureInfo.InvariantCulture)).Replace("%LOOKBUTTON%", lookButton);
|
||||
|
||||
}
|
||||
public static string FormatAuctionViewHorseButton(int randomId)
|
||||
{
|
||||
return AuctionHorseViewButton.Replace("%RANDOMID%", randomId.ToString());
|
||||
}
|
||||
public static string FormatAuctionPlayersHere(string usernames)
|
||||
{
|
||||
return AuctionPlayersHereFormat.Replace("%USERNAMES%", usernames);
|
||||
|
|
|
@ -1469,7 +1469,7 @@ namespace HISP.Game
|
|||
message += Messages.AuctionsRunning;
|
||||
foreach(Auction.AuctionEntry entry in auction.AuctionEntries.ToArray())
|
||||
{
|
||||
message += Messages.FormatAuctionHorseEntry(Database.GetUsername(entry.OwnerId), entry.Horse.Color, entry.Horse.Breed.Name, entry.Horse.Gender, entry.Horse.BasicStats.Experience, entry.Horse.RandomId);
|
||||
message += Messages.FormatAuctionHorseEntry(Database.GetUsername(entry.OwnerId), entry.Horse.Color, entry.Horse.Breed.Name, entry.Horse.Gender, entry.Horse.BasicStats.Experience, entry.Completed ? "" : Messages.FormatAuctionViewHorseButton(entry.Horse.RandomId));
|
||||
if (!entry.Completed)
|
||||
message += Messages.FormatAuctionGoingTo(entry.TimeRemaining, Database.GetUsername(entry.HighestBidder), entry.HighestBid, entry.RandomId);
|
||||
else
|
||||
|
|
|
@ -18,19 +18,44 @@ namespace HISP.Game.Services
|
|||
|
||||
public class AuctionBid
|
||||
{
|
||||
public const int MAX_BID = 2000000000;
|
||||
public User BidUser;
|
||||
public AuctionEntry AuctionItem;
|
||||
public int BidAmount;
|
||||
|
||||
|
||||
public void PlaceBid(int bidAmount)
|
||||
{
|
||||
string yourBidRaisedTo = Messages.FormatAuctionBidRaised(BidAmount, BidAmount + bidAmount);
|
||||
|
||||
if(BidAmount >= MAX_BID)
|
||||
{
|
||||
byte[] maxBidReached = PacketBuilder.CreateChat(Messages.AuctionBidMax, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
BidUser.LoggedinClient.SendPacket(maxBidReached);
|
||||
return;
|
||||
}
|
||||
|
||||
if (BidAmount + bidAmount > BidUser.Money && (AuctionItem.OwnerId != BidUser.Id))
|
||||
{
|
||||
|
||||
byte[] cantAffordBid = PacketBuilder.CreateChat(Messages.AuctionCantAffordBid, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
BidUser.LoggedinClient.SendPacket(cantAffordBid);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
BidAmount += bidAmount;
|
||||
if(BidAmount > MAX_BID) // no u
|
||||
{
|
||||
yourBidRaisedTo = Messages.FormatAuctionBidRaised(BidAmount, MAX_BID);
|
||||
BidAmount = MAX_BID;
|
||||
}
|
||||
|
||||
if (BidAmount > AuctionItem.HighestBid)
|
||||
{
|
||||
AuctionItem.HighestBid += BidAmount;
|
||||
if(AuctionItem.HighestBidder != BidUser.Id)
|
||||
int oldBid = AuctionItem.HighestBid;
|
||||
AuctionItem.HighestBid = BidAmount;
|
||||
if(AuctionItem.HighestBidder != BidUser.Id && oldBid > 0)
|
||||
{
|
||||
if (GameServer.IsUserOnline(AuctionItem.HighestBidder))
|
||||
{
|
||||
|
@ -42,7 +67,6 @@ namespace HISP.Game.Services
|
|||
|
||||
AuctionItem.HighestBidder = BidUser.Id;
|
||||
yourBidRaisedTo += Messages.AuctionTopBid;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -51,6 +75,7 @@ namespace HISP.Game.Services
|
|||
|
||||
byte[] bidPlacedMsg = PacketBuilder.CreateChat(yourBidRaisedTo, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
BidUser.LoggedinClient.SendPacket(bidPlacedMsg);
|
||||
|
||||
}
|
||||
}
|
||||
public class AuctionEntry
|
||||
|
@ -65,6 +90,7 @@ namespace HISP.Game.Services
|
|||
|
||||
public HorseInstance Horse;
|
||||
public int OwnerId;
|
||||
public List<AuctionBid> Bidders = new List<AuctionBid>();
|
||||
|
||||
public bool Completed
|
||||
{
|
||||
|
@ -77,26 +103,42 @@ namespace HISP.Game.Services
|
|||
done = value;
|
||||
if(done)
|
||||
{
|
||||
Horse.Owner = HighestBidder;
|
||||
Horse.Owner = highestBidder;
|
||||
Horse.Hidden = false;
|
||||
|
||||
if(OwnerId == highestBidder)
|
||||
{
|
||||
if(GameServer.IsUserOnline(OwnerId))
|
||||
{
|
||||
User auctionRunner = GameServer.GetUserById(highestBidder);
|
||||
auctionRunner.HorseInventory.UnHide(Horse.RandomId);
|
||||
byte[] notSold = PacketBuilder.CreateChat(Messages.AuctionNoHorseBrought, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
auctionRunner.LoggedinClient.SendPacket(notSold);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(GameServer.IsUserOnline(highestBidder))
|
||||
{
|
||||
User userWon = GameServer.GetUserById(highestBidder);
|
||||
byte[] wonAuction = PacketBuilder.CreateChat(Messages.FormatAuctionBroughtHorse(highestBid), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
userWon.LoggedinClient.SendPacket(wonAuction);
|
||||
userWon.Money -= highestBid;
|
||||
userWon.HorseInventory.AddHorse(Horse, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Database.SetPlayerMoney(Database.GetPlayerMoney(highestBidder) - highestBid, highestBidder);
|
||||
}
|
||||
|
||||
if(GameServer.IsUserOnline(OwnerId))
|
||||
{
|
||||
User userSold = GameServer.GetUserById(highestBidder);
|
||||
User userSold = GameServer.GetUserById(OwnerId);
|
||||
byte[] horseSold = PacketBuilder.CreateChat(Messages.FormatAuctionHorseSold(highestBid), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
userSold.LoggedinClient.SendPacket(horseSold);
|
||||
userSold.Money += highestBid;
|
||||
userSold.HorseInventory.DeleteHorse(Horse, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -104,6 +146,13 @@ namespace HISP.Game.Services
|
|||
}
|
||||
}
|
||||
Database.SetAuctionDone(RandomId, done);
|
||||
|
||||
foreach(AuctionBid bid in Bidders) // Cleanup some stuffs
|
||||
{
|
||||
if(bid.BidUser != null)
|
||||
bid.BidUser.Bids.Remove(bid);
|
||||
}
|
||||
Bidders.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -115,6 +164,7 @@ namespace HISP.Game.Services
|
|||
if (bid.AuctionItem.RandomId == this.RandomId)
|
||||
{
|
||||
bid.PlaceBid(bidAmount);
|
||||
auctionRoomPlacedIn.UpdateAuctionRoom();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -122,11 +172,17 @@ namespace HISP.Game.Services
|
|||
AuctionBid newBid = new AuctionBid();
|
||||
newBid.AuctionItem = this;
|
||||
newBid.BidUser = bidder;
|
||||
if (HighestBidder == bidder.Id)
|
||||
newBid.BidAmount = HighestBid;
|
||||
else
|
||||
newBid.BidAmount = 0;
|
||||
newBid.PlaceBid(bidAmount);
|
||||
bidder.Bids.Add(newBid);
|
||||
Bidders.Add(newBid);
|
||||
auctionRoomPlacedIn.UpdateAuctionRoom();
|
||||
}
|
||||
|
||||
public Auction auctionRoomPlacedIn;
|
||||
public int RandomId;
|
||||
private int timeRemaining;
|
||||
private bool done;
|
||||
|
@ -200,6 +256,7 @@ namespace HISP.Game.Services
|
|||
|
||||
public void AddEntry(AuctionEntry entry)
|
||||
{
|
||||
entry.auctionRoomPlacedIn = this;
|
||||
Database.AddAuctionRoom(entry, this.RoomId);
|
||||
AuctionEntries.Add(entry);
|
||||
|
||||
|
@ -232,6 +289,15 @@ namespace HISP.Game.Services
|
|||
throw new KeyNotFoundException("Auction Entry with RandomID: " + randomId + " NOT FOUND");
|
||||
}
|
||||
|
||||
public bool HasUserPlacedAuctionAllready(User user)
|
||||
{
|
||||
foreach(AuctionEntry entry in AuctionEntries)
|
||||
{
|
||||
if (entry.OwnerId == user.Id)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static Auction GetAuctionRoomById(int roomId)
|
||||
{
|
||||
foreach(Auction auction in AuctionRooms)
|
||||
|
|
|
@ -555,6 +555,29 @@ namespace HISP.Player
|
|||
LoggedinClient = baseClient;
|
||||
Inventory = new PlayerInventory(this);
|
||||
Quests = new PlayerQuests(this);
|
||||
|
||||
// Get auctions
|
||||
foreach(Auction auction in Auction.AuctionRooms)
|
||||
{
|
||||
foreach(Auction.AuctionEntry auctionEntry in auction.AuctionEntries)
|
||||
{
|
||||
if(auctionEntry.HighestBidder == this.Id)
|
||||
{
|
||||
Auction.AuctionBid bid = new Auction.AuctionBid();
|
||||
bid.BidUser = this;
|
||||
bid.BidAmount = auctionEntry.HighestBid;
|
||||
bid.AuctionItem = auctionEntry;
|
||||
|
||||
if(bid.BidAmount > 0)
|
||||
{
|
||||
Bids.Add(bid);
|
||||
auctionEntry.Bidders.Add(bid);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1481,9 +1481,10 @@ namespace HISP.Server
|
|||
int autosell = reader.GetInt32(29);
|
||||
int leaseTime = reader.GetInt32(2);
|
||||
bool hidden = reader.GetString(34) == "YES";
|
||||
int owner = reader.GetInt32(1);
|
||||
|
||||
HorseInstance inst = new HorseInstance(horseBreed, randomId, name, description, spoiled, category, magicUsed, autosell, leaseTime, hidden, owner);
|
||||
|
||||
HorseInstance inst = new HorseInstance(horseBreed, randomId, name, description, spoiled, category, magicUsed, autosell, leaseTime);
|
||||
inst.Owner = reader.GetInt32(1);
|
||||
inst.Leaser = reader.GetInt32(3);
|
||||
inst.Gender = reader.GetString(7);
|
||||
inst.Color = reader.GetString(8);
|
||||
|
@ -1568,6 +1569,7 @@ namespace HISP.Server
|
|||
auctionEntry.Horse = GetPlayerHorse(horseId);
|
||||
auctionEntry.OwnerId = reader.GetInt32(3);
|
||||
auctionEntry.Completed = reader.GetString(7) == "YES";
|
||||
auctionEntry.auctionRoomPlacedIn = auction;
|
||||
auction.AuctionEntries.Add(auctionEntry);
|
||||
|
||||
}
|
||||
|
@ -2402,6 +2404,21 @@ namespace HISP.Server
|
|||
}
|
||||
|
||||
|
||||
public static void SetHorseOwner(int randomId, int owner)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "UPDATE Horses SET ownerId=@owner WHERE randomId=@randomId";
|
||||
sqlCommand.Parameters.AddWithValue("@owner", owner);
|
||||
sqlCommand.Parameters.AddWithValue("@randomId", randomId);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetHorseHidden(int randomId, bool hidden)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
|
|
|
@ -829,15 +829,19 @@ namespace HISP.Server
|
|||
|
||||
Messages.AuctionListHorse = gameData.messages.meta.auction.list_horse;
|
||||
Messages.AuctionHorseListEntryFormat = gameData.messages.meta.auction.horse_list_entry;
|
||||
Messages.AuctionHorseViewButton = gameData.messages.meta.auction.view_button;
|
||||
Messages.AuctionHorseIsTacked = gameData.messages.meta.auction.tacked;
|
||||
|
||||
Messages.AuctionBidMax = gameData.messages.meta.auction.max_bid;
|
||||
Messages.AuctionBidRaisedFormat = gameData.messages.meta.auction.bid_raised;
|
||||
Messages.AuctionTopBid = gameData.messages.meta.auction.top_bid;
|
||||
Messages.AuctionExistingBidHigher = gameData.messages.meta.auction.existing_higher;
|
||||
|
||||
Messages.AuctionOneHorsePerPlayer = gameData.messages.meta.auction.one_horse_at_a_time;
|
||||
Messages.AuctionYouveBeenOutbidFormat = gameData.messages.meta.auction.outbid_by;
|
||||
Messages.AuctionCantAffordBid = gameData.messages.meta.auction.cant_afford_bid;
|
||||
Messages.AuctionCantAffordAuctionFee = gameData.messages.meta.auction.cant_afford_listing;
|
||||
Messages.AuctionNoOtherTransactionAllowed = gameData.messages.meta.auction.no_other_transaction_allowed;
|
||||
|
||||
Messages.AuctionYouBroughtAHorseFormat = gameData.messages.meta.auction.brought_horse;
|
||||
Messages.AuctionNoHorseBrought = gameData.messages.meta.auction.no_one_brought;
|
||||
|
|
|
@ -152,8 +152,7 @@ namespace HISP.Server
|
|||
entry.TimeRemaining--;
|
||||
if (entry.Completed)
|
||||
auction.DeleteEntry(entry);
|
||||
|
||||
if (entry.TimeRemaining <= 0)
|
||||
else if (entry.TimeRemaining <= 0)
|
||||
entry.Completed = true;
|
||||
|
||||
auction.UpdateAuctionRoom();
|
||||
|
@ -2582,7 +2581,12 @@ namespace HISP.Server
|
|||
return;
|
||||
}
|
||||
Auction auctionRoom = Auction.GetAuctionRoomById(int.Parse(tile.Code.Split('-')[1]));
|
||||
|
||||
if(auctionRoom.HasUserPlacedAuctionAllready(sender.LoggedinUser))
|
||||
{
|
||||
byte[] cantPlaceAuction = PacketBuilder.CreateChat(Messages.AuctionOneHorsePerPlayer, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.SendPacket(cantPlaceAuction);
|
||||
break;
|
||||
}
|
||||
if (sender.LoggedinUser.Money >= 1000)
|
||||
{
|
||||
sender.LoggedinUser.Money -= 1000;
|
||||
|
@ -4020,6 +4024,14 @@ namespace HISP.Server
|
|||
}
|
||||
}
|
||||
|
||||
if (sender.LoggedinUser.Bids.Count > 0)
|
||||
{
|
||||
byte[] cantBuyWhileAuctioning = PacketBuilder.CreateChat(Messages.AuctionNoOtherTransactionAllowed, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.SendPacket(cantBuyWhileAuctioning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (sender.LoggedinUser.Money >= cost)
|
||||
{
|
||||
string swfToLoad = Messages.BoatCutscene;
|
||||
|
@ -5401,6 +5413,13 @@ namespace HISP.Server
|
|||
if (shop != null)
|
||||
{
|
||||
int buyCost = shop.CalculateBuyCost(itemInfo) * count;
|
||||
if (sender.LoggedinUser.Bids.Count > 0)
|
||||
{
|
||||
byte[] cantBuyWhileAuctioning = PacketBuilder.CreateChat(Messages.AuctionNoOtherTransactionAllowed, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.SendPacket(cantBuyWhileAuctioning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (sender.LoggedinUser.Money < buyCost)
|
||||
{
|
||||
byte[] cantAffordMessage = PacketBuilder.CreateChat(Messages.CantAfford1, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
|
|
Loading…
Add table
Reference in a new issue