using Core.Annotations; using Core.Helpers; using Core.Models.Eft.Common; using Core.Models.Eft.Common.Tables; using Core.Models.Eft.ItemEvent; using Core.Models.Eft.Ragfair; using Core.Models.Eft.Trade; using Core.Models.Enums; using Core.Models.Spt.Config; using Core.Routers; using Core.Servers; using Core.Services; using Core.Utils; using ILogger = Core.Models.Utils.ILogger; namespace Core.Controllers; [Injectable] public class TradeController { private readonly ILogger _logger; private readonly DatabaseService _databaseService; private readonly EventOutputHolder _eventOutputHolder; private readonly TradeHelper _tradeHelper; private readonly TimeUtil _timeUtil; private readonly HashUtil _hashUtil; private readonly ItemHelper _itemHelper; private readonly ProfileHelper _profileHelper; private readonly RagfairOfferHelper _ragfairOfferHelper; private readonly TraderHelper _traderHelper; // private readonly RagfairServer _ragfairServer; private readonly HttpResponseUtil _httpResponseUtil; private readonly LocalisationService _localisationService; private readonly RagfairPriceService _ragfairPriceService; // private readonly MailSendService _mailSendService; private readonly ConfigServer _configServer; private readonly RagfairConfig _ragfairConfig; private readonly TraderConfig _traderConfig; public TradeController ( ILogger logger, DatabaseService databaseService, EventOutputHolder eventOutputHolder, TradeHelper tradeHelper, TimeUtil timeUtil, HashUtil hashUtil, ItemHelper itemHelper, ProfileHelper profileHelper, RagfairOfferHelper ragfairOfferHelper, TraderHelper traderHelper, HttpResponseUtil httpResponseUtil, LocalisationService localisationService, RagfairPriceService ragfairPriceService, ConfigServer configServer ) { _logger = logger; _databaseService = databaseService; _eventOutputHolder = eventOutputHolder; _tradeHelper = tradeHelper; _timeUtil = timeUtil; _hashUtil = hashUtil; _itemHelper = itemHelper; _profileHelper = profileHelper; _ragfairOfferHelper = ragfairOfferHelper; _traderHelper = traderHelper; _httpResponseUtil = httpResponseUtil; _localisationService = localisationService; _ragfairPriceService = ragfairPriceService; _configServer = configServer; _ragfairConfig = _configServer.GetConfig(); _traderConfig = _configServer.GetConfig(); } /// /// Handle TradingConfirm event /// /// /// /// /// public ItemEventRouterResponse ConfirmTrading( PmcData pmcData, ProcessBaseTradeRequestData request, string sessionId) { throw new NotImplementedException(); } /// /// Handle RagFairBuyOffer event /// /// /// /// /// public ItemEventRouterResponse ConfirmRagfairTrading( PmcData pmcData, ProcessRagfairTradeRequestData request, string sessionId) { throw new NotImplementedException(); } /// /// Buy an item off the flea sold by a trader /// /// Session id /// Player profile /// Offer being purchased /// request data from client /// Output to send back to client private void BuyTraderItemFromRagfair( string sessionId, PmcData pmcData, RagfairOffer fleaOffer, OfferRequest offerRequest, ItemEventRouterResponse output) { throw new NotImplementedException(); } /// /// Buy an item off the flea sold by a PMC /// /// Session id /// Player profile /// Offer being purchased /// request data from client /// Output to send back to client private void BuyPmcItemFromRagfair( string sessionId, PmcData pmcData, RagfairOffer fleaOffer, OfferRequest offerRequest, ItemEventRouterResponse output) { throw new NotImplementedException(); } /// /// Is the provided offerid and ownerid from a player made offer /// /// id of the offer /// Owner id /// true if offer was made by a player private bool IsPlayerOffer( string offerId, string offerOwnerId) { throw new NotImplementedException(); } /// /// Does Player have necessary trader loyalty to purchase flea offer /// /// Flea offer being bought /// Player profile /// True if player can buy offer private bool PlayerLacksTraderLoyaltyLevelToBuyOffer( RagfairOffer fleaOffer, PmcData pmcData) { throw new NotImplementedException(); } /// /// Handle SellAllFromSavage event /// /// /// /// /// public ItemEventRouterResponse SellScavItemsToFence( PmcData pmcData, SellScavItemsToFenceRequestData request, string sessionId) { throw new NotImplementedException(); } /// /// Send the specified rouble total to player as mail /// /// Session id /// amount of roubles to send /// Trader to sell items to private void MailMoneyToPlayer( string sessionId, int roublesToSend, string trader) { throw new NotImplementedException(); } /// /// Looks up an items children and gets total handbook price for them /// /// parent item that has children we want to sum price of /// All items (parent + children) /// Prices of items from handbook /// Trader being sold to, to perform buy category check against /// Rouble price private int GetPriceOfItemAndChildren( string parentItemId, List items, Dictionary handbookPrices, TraderBase traderDetails) { throw new NotImplementedException(); } }