Furtherfix ragfair modlimits (#724)
* Further fix to mod limit debug log * Small improvements on FlagOfferForRemoval to correctly fix logging instead of FromSeconds using the unixtimestamp --------- Co-authored-by: acidphantasm <acidphantasm@acidphantasm.com>
This commit is contained in:
@@ -1025,18 +1025,24 @@ public class RagfairController(
|
||||
}
|
||||
|
||||
// Only reduce time to end if time remaining is greater than what we would set it to
|
||||
var differenceInSeconds = playerOffer.EndTime - timeUtil.GetTimeStamp();
|
||||
if (differenceInSeconds > RagfairConfig.Sell.ExpireSeconds)
|
||||
var now = timeUtil.GetTimeStamp();
|
||||
var configExpireSeconds = RagfairConfig.Sell.ExpireSeconds;
|
||||
|
||||
var differenceInSeconds = playerOffer.EndTime - now;
|
||||
if (differenceInSeconds > configExpireSeconds)
|
||||
{
|
||||
// `expireSeconds` Default is 71 seconds
|
||||
var newEndTime = RagfairConfig.Sell.ExpireSeconds + timeUtil.GetTimeStamp();
|
||||
// TODO: RagfairConfig.Sell.ExpireSeconds should not exist as it should use
|
||||
// Globals.Configuration.RagFair.OfferDurationTimeInHourAfterRemove (the value actually used by client)
|
||||
var newEndTime = configExpireSeconds + now;
|
||||
playerOffer.EndTime = (long?)Math.Round((double)newEndTime);
|
||||
differenceInSeconds = configExpireSeconds;
|
||||
}
|
||||
|
||||
if (logger.IsLogEnabled(LogLevel.Debug))
|
||||
if (logger.IsLogEnabled(LogLevel.Debug) && differenceInSeconds is { } remaining)
|
||||
{
|
||||
logger.Debug(
|
||||
$"Flagged player: {sessionId} offer: {offerId} for expiry in: {TimeSpan.FromSeconds(playerOffer.EndTime.Value).ToString()}"
|
||||
$"Flagged player: {sessionId} offer: {offerId} for expiry in: {TimeSpan.FromSeconds(remaining).ToString()}"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user