Add Configuration Support for Bazaar Auction Times

This commit is contained in:
AconiteGodOfSWG
2021-01-13 02:37:27 -05:00
parent 121c001fc8
commit ad57ec13b4
3 changed files with 35 additions and 14 deletions
@@ -1426,6 +1426,9 @@ void AuctionMarket::AddImmediateAuction(const AddImmediateAuctionMessage &messag
// force the expire timer to be 30 days after the auction timer has finished
// The expire timer should be large to allow for time to sit in the stockroom before it is deleted.
int expireTimer = auctionTimer + (ConfigCommodityServer::getMinutesVendorItemTimer() * 60);
// bazaar timers
int bazaarAuctionTimer = (ConfigCommodityServer::getMinutesBazaarAuctionTimer() * 60) + time(0);
int bazaarItemTimer = bazaarAuctionTimer + (ConfigCommodityServer::getMinutesBazaarItemTimer() * 60);
if (message.GetFlags() & AUCTION_VENDOR_TRANSFER)
{
@@ -1481,11 +1484,11 @@ void AuctionMarket::AddImmediateAuction(const AddImmediateAuctionMessage &messag
return;
}
}
// If this is not a player vendor, then use the values sent in from the message
// If this is not a player vendor, use bazaar settings for auction and expiration time
else
{
auctionTimer = message.GetAuctionTimer();
expireTimer = message.GetExpireTimer();
auctionTimer = bazaarAuctionTimer;
expireTimer = bazaarItemTimer;
}
// cannot use "relist" on an item bought as a vendor offer;
@@ -1638,11 +1641,11 @@ void AuctionMarket::AddImmediateAuction(const AddImmediateAuctionMessage &messag
return;
}
// If this is not a player vendor, then use the values sent in from the message
// If this is not a player vendor, use bazaar settings for auction and expiration time
if( !auctionLocation.IsVendorMarket() )
{
auctionTimer = message.GetAuctionTimer();
expireTimer = message.GetExpireTimer();
auctionTimer = bazaarAuctionTimer;
expireTimer = bazaarItemTimer;
}
static Unicode::String const emptyUnicodeString;
@@ -54,13 +54,15 @@ void ConfigCommodityServer::install(void)
KEY_INT (centralServerPort, 44456);
KEY_STRING (centralServerAddress, "localhost");
KEY_INT (sleepTimePerFrameMs, 1);
KEY_INT (minutesActiveToUnaccessed, 7 * 24 * 60);
KEY_INT (minutesEmptyToEndangered, 7 * 24 * 60);
KEY_INT (minutesUnaccessedToEndangered, 7 * 24 * 60);
KEY_INT (minutesEndangeredToRemoved, 7 * 24 * 60);
KEY_INT (minutesVendorAuctionTimer, 30 * 24 * 60);
KEY_INT (minutesVendorItemTimer, 30 * 24 * 60);
KEY_INT (minutesActiveToUnaccessed, 10080); // 7 days
KEY_INT (minutesEmptyToEndangered, 10080);
KEY_INT (minutesUnaccessedToEndangered, 10080);
KEY_INT (minutesEndangeredToRemoved, 10080);
KEY_INT (minutesVendorAuctionTimer, 43200); // 30 days
KEY_INT (minutesVendorItemTimer, 43200);
KEY_INT (maxAuctionsPerPage, 100);
KEY_INT (minutesBazaarAuctionTimer, 10080);
KEY_INT (minutesBazaarItemTimer, 10080);
}
//-----------------------------------------------------------------------
@@ -43,9 +43,11 @@ class ConfigCommodityServer
int minutesEmptyToEndangered;
int minutesUnaccessedToEndangered;
int minutesEndangeredToRemoved;
int minutesVendorAuctionTimer;
int minutesVendorItemTimer;
int minutesVendorAuctionTimer; // max time an item is listed on a vendor
int minutesVendorItemTimer; // max time a vendor item is held in stockroom after it expires for pickup by the seller (auction time + item time)
int maxAuctionsPerPage;
int minutesBazaarAuctionTimer; // max time an item is listed on bazaar
int minutesBazaarItemTimer; // max time a bazaar item is held by system after it expires for pickup by the seller (auction time + item time)
};
static uint16 getCMServerServiceBindPort ();
@@ -78,6 +80,8 @@ class ConfigCommodityServer
static int getMinutesVendorAuctionTimer ();
static int getMinutesVendorItemTimer ();
static int getMaxAuctionsPerPage ();
static int getMinutesBazaarAuctionTimer ();
static int getMinutesBazaarItemTimer ();
static void install ();
static void remove ();
@@ -296,4 +300,16 @@ inline int ConfigCommodityServer::getMaxAuctionsPerPage()
return data->maxAuctionsPerPage;
}
//-----------------------------------------------------------------------
inline int ConfigCommodityServer::getMinutesBazaarAuctionTimer() {
return data->minutesBazaarAuctionTimer;
}
//-----------------------------------------------------------------------
inline int ConfigCommodityServer::getMinutesBazaarItemTimer() {
return data->minutesBazaarItemTimer;
}
#endif // _ConfigCommodityServer_H