created helpers

This commit is contained in:
CWX
2025-01-08 21:09:31 +00:00
parent 00ee82b5a0
commit f425074be2
49 changed files with 775 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class AssortHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class BotDifficultyHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class BotGeneratorHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class BotHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class BotWeaponGeneratorHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class ContainerHelper
{
}
@@ -0,0 +1,6 @@
namespace Core.Helpers.Dialogue;
public class AbstractDialogChatBot
{
}
@@ -0,0 +1,6 @@
namespace Core.Helpers.Dialog.Commando;
public class ChatCommand
{
}
@@ -0,0 +1,6 @@
namespace Core.Helpers.Dialog.Commando;
public class SptCommandoCommands
{
}
@@ -0,0 +1,6 @@
namespace Core.Helpers.Dialog.Commando.SptCommands.GiveCommand;
public class GiveSptCommand
{
}
@@ -0,0 +1,6 @@
namespace Core.Helpers.Dialog.Commando.SptCommands.GiveCommand;
public class SavedCommand
{
}
@@ -0,0 +1,6 @@
namespace Core.Helpers.Dialog.Commando.SptCommands.ProfileCommand;
public class ProfileSptCommand
{
}
@@ -0,0 +1,6 @@
namespace Core.Helpers.Dialog.Commando.SptCommands;
public class SptCommand
{
}
@@ -0,0 +1,6 @@
namespace Core.Helpers.Dialog.Commando.SptCommands.TraderCommand;
public class TraderSptCommand
{
}
@@ -0,0 +1,6 @@
namespace Core.Helpers.Dialogue;
public class CommandoDialogChatBot
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers.Dialogue;
public class DialogueChatBot
{
}
@@ -0,0 +1,6 @@
namespace Core.Helpers.Dialogue;
public class SptDialogueChatBot
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class DialogueHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class DurabilityLimitsHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class GameEventHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class HandbookHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class HealthHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class HideoutHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class HttpServerHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class InRaidHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class InventoryHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class ItemHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class NotificationSendHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class NotifierHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class PaymentHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class PresetHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class ProbabilityHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class ProfileHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class QuestConditionHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class QuestHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class RagfairHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class RagfairOfferHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class RagfairSellHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class RagfairServerHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class RagfairSortHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class RepairHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class RepeatableQuestHelper
{
}
+6
View File
@@ -0,0 +1,6 @@
namespace Core.Helpers;
public class SecureContainerHelper
{
}
+82
View File
@@ -0,0 +1,82 @@
using Core.Models.Eft.Common;
using Core.Models.Eft.Common.Tables;
using Core.Models.Eft.ItemEvent;
using Core.Models.Eft.Trade;
namespace Core.Helpers;
public class TradeHelper
{
public TradeHelper()
{
}
/// <summary>
/// Buy item from flea or trader
/// </summary>
/// <param name="pmcData">Player profile</param>
/// <param name="buyRequestData">data from client</param>
/// <param name="sessionID">Session id</param>
/// <param name="foundInRaid">Should item be found in raid</param>
/// <param name="output">Item event router response</param>
public void buyItem(
PmcData pmcData,
ProcessBuyTradeRequestData buyRequestData,
string sessionID,
bool foundInRaid,
ItemEventRouterResponse output
)
{
throw new NotImplementedException();
}
/// <summary>
/// Sell item to trader
/// </summary>
/// <param name="profileWithItemsToSell">Profile to remove items from</param>
/// <param name="profileToReceiveMoney">Profile to accept the money for selling item</param>
/// <param name="sellRequest">Request data</param>
/// <param name="sessionID">Session id</param>
/// <param name="output">Item event router response</param>
public void sellItem(
PmcData profileWithItemsToSell,
PmcData profileToReceiveMoney,
ProcessSellTradeRequestData sellRequest,
string sessionID,
ItemEventRouterResponse output
)
{
throw new NotImplementedException();
}
protected void incrementCirculateSoldToTraderCounter(
PmcData profileWithItemsToSell,
PmcData profileToReceiveMoney,
ProcessSellTradeRequestData sellRequest
)
{
throw new NotImplementedException();
}
/// <summary>
/// Traders allow a limited number of purchases per refresh cycle (default 60 mins)
/// </summary>
/// <param name="sessionId">Session id</param>
/// <param name="pmcData">Profile making the purchase</param>
/// <param name="traderId">Trader assort is purchased from</param>
/// <param name="assortBeingPurchased">the item from trader being bought</param>
/// <param name="assortId">Id of assort being purchased</param>
/// <param name="count">How many of the item are being bought</param>
protected void checkPurchaseIsWithinTraderItemLimit(
string sessionId,
PmcData pmcData,
string traderId,
Item assortBeingPurchased,
string assortId,
int count
)
{
throw new NotImplementedException();
}
}
+82
View File
@@ -0,0 +1,82 @@
using Core.Models.Eft.Common.Tables;
namespace Core.Helpers;
public class TraderAssortHelper
{
public TraderAssortHelper()
{
}
/// <summary>
/// Get a traders assorts
/// Can be used for returning ragfair / fence assorts
/// Filter out assorts not unlocked due to level OR quest completion
/// </summary>
/// <param name="sessionId">session id</param>
/// <param name="traderId">traders id</param>
/// <param name="showLockedAssorts">Should assorts player hasn't unlocked be returned - default false</param>
/// <returns>a traders' assorts</returns>
public TraderAssort GetAssort(string sessionId, string traderId, bool showLockedAssorts = false)
{
throw new NotImplementedException();
}
/// <summary>
/// Given the blacklist provided, remove root items from assort
/// </summary>
/// <param name="assortToFilter">Trader assort to modify</param>
/// <param name="itemsTplsToRemove">Item TPLs the assort should not have</param>
protected void RemoveItemsFromAssort(TraderAssort assortToFilter, List<string> itemsTplsToRemove)
{
throw new NotImplementedException();
}
/// <summary>
/// Reset every traders root item `BuyRestrictionCurrent` property to 0
/// </summary>
/// <param name="assortItems">Items to adjust</param>
protected void ResetBuyRestrictionCurrentValue(List<Item> assortItems)
{
throw new NotImplementedException();
}
/// <summary>
/// Create a dict of all assort id = quest id mappings used to work out what items should be shown to player based on the quests they've started/completed/failed
/// </summary>
protected void HydrateMergedQuestAssorts()
{
throw new NotImplementedException();
}
/// <summary>
/// Reset a traders assorts and move nextResupply value to future
/// Flag trader as needing a flea offer reset to be picked up by flea update() function
/// </summary>
/// <param name="trader">trader details to alter</param>
public void ResetExpiredTrader(Trader trader)
{
throw new NotImplementedException();
}
/// <summary>
/// Does the supplied trader need its assorts refreshed
/// </summary>
/// <param name="traderID">Trader to check</param>
/// <returns>true they need refreshing</returns>
public bool TraderAssortsHaveExpired(string traderID)
{
throw new NotImplementedException();
}
/// <summary>
/// Get an array of pristine trader items prior to any alteration by player (as they were on server start)
/// </summary>
/// <param name="traderId">trader id</param>
/// <returns>array of Items</returns>
protected List<Item> GetPristineTraderAssorts(string traderId)
{
throw new NotImplementedException();
}
}
+254
View File
@@ -0,0 +1,254 @@
using Core.Models.Eft.Common;
using Core.Models.Eft.Common.Tables;
using Core.Models.Eft.Profile;
using Core.Models.Enums;
using Core.Models.Spt.Config;
namespace Core.Helpers;
public class TraderHelper
{
private TraderConfig _traderConfig;
private Dictionary<string, int>? _highestTraderPriceItems;
public TraderHelper()
{
}
/// <summary>
/// Get a trader base object, update profile to reflect players current standing in profile
/// when trader not found in profile
/// </summary>
/// <param name="traderID">Traders Id to get</param>
/// <param name="sessionID">Players id</param>
/// <returns>Trader base</returns>
public TraderBase GetTrader(string traderID, string sessionID)
{
throw new NotImplementedException();
}
/// <summary>
/// Get all assort data for a particular trader
/// </summary>
/// <param name="traderId">Trader to get assorts for</param>
/// <returns>TraderAssort</returns>
public TraderAssort GetTraderAssortsByTraderId(string traderId)
{
throw new NotImplementedException();
}
/// <summary>
/// Retrieve the Item from a traders assort data by its id
/// </summary>
/// <param name="traderId">Trader to get assorts for</param>
/// <param name="assortId">Id of assort to find</param>
/// <returns>Item object</returns>
public Item GetTraderAssortItemByAssortId(string traderId, string assortId)
{
throw new NotImplementedException();
}
/// <summary>
/// Reset a profiles trader data back to its initial state as seen by a level 1 player
/// Does NOT take into account different profile levels
/// </summary>
/// <param name="sessionID">session id of player</param>
/// <param name="traderID">trader id to reset</param>
public void ResetTrader(string sessionID, string traderID)
{
throw new NotImplementedException();
}
/// <summary>
/// Get the starting standing of a trader based on the current profiles type (e.g. EoD, Standard etc)
/// </summary>
/// <param name="traderId">Trader id to get standing for</param>
/// <param name="rawProfileTemplate">Raw profile from profiles.json to look up standing from</param>
/// <returns>Standing value</returns>
protected double GetStartingStanding(string traderId, ProfileTraderTemplate rawProfileTemplate)
{
throw new NotImplementedException();
}
/// <summary>
/// Add a list of suit ids to a profiles suit list, no duplicates
/// </summary>
/// <param name="fullProfile">Profile to add to</param>
/// <param name="suitIds">Suit Ids to add</param>
protected void AddSuitsToProfile(SptProfile fullProfile, List<string> suitIds)
{
throw new NotImplementedException();
}
/// <summary>
/// Alter a traders unlocked status
/// </summary>
/// <param name="traderId">Trader to alter</param>
/// <param name="status">New status to use</param>
/// <param name="sessionId">Session id of player</param>
public void SetTraderUnlockedState(string traderId, bool status, string sessionId)
{
throw new NotImplementedException();
}
/// <summary>
/// Add standing to a trader and level them up if exp goes over level threshold
/// </summary>
/// <param name="sessionId">Session id of player</param>
/// <param name="traderId">Traders id to add standing to</param>
/// <param name="standingToAdd">Standing value to add to trader</param>
public void AddStandingToTrader(string sessionId, string traderId, double standingToAdd)
{
throw new NotImplementedException();
}
/// <summary>
/// Add standing to current standing and clamp value if it goes too low
/// </summary>
/// <param name="currentStanding">current trader standing</param>
/// <param name="standingToAdd">standing to add to trader standing</param>
/// <returns>current standing + added standing (clamped if needed)</returns>
protected double AddStandingValuesTogether(double currentStanding, double standingToAdd)
{
throw new NotImplementedException();
}
/// <summary>
/// Iterate over a profile's traders and ensure they have the correct loyalty level for the player.
/// </summary>
/// <param name="sessionId">Profile to check.</param>
public void ValidateTraderStandingsAndPlayerLevelForProfile(string sessionId)
{
throw new NotImplementedException();
}
/// <summary>
/// Calculate trader's level based on experience amount and increments level if over threshold.
/// Also validates and updates player level if not correct based on XP value.
/// </summary>
/// <param name="traderID">Trader to check standing of.</param>
/// <param name="pmcData">Profile to update trader in.</param>
public void LevelUp(string traderID, PmcData pmcData)
{
throw new NotImplementedException();
}
/// <summary>
/// Get the next update timestamp for a trader.
/// </summary>
/// <param name="traderID">Trader to look up update value for.</param>
/// <returns>Future timestamp.</returns>
public long GetNextUpdateTimestamp(string traderID)
{
throw new NotImplementedException();
}
/// <summary>
/// Get the reset time between trader assort refreshes in seconds.
/// </summary>
/// <param name="traderId">Trader to look up.</param>
/// <returns>Time in seconds.</returns>
public long? GetTraderUpdateSeconds(string traderId)
{
throw new NotImplementedException();
}
public TraderLoyaltyLevel GetLoyaltyLevel(string traderID, PmcData pmcData)
{
throw new NotImplementedException();
}
/// <summary>
/// Store the purchase of an assort from a trader in the player profile
/// </summary>
/// <param name="sessionID">Session id</param>
/// <param name="newPurchaseDetails">New item assort id + count</param>
public void AddTraderPurchasesToPlayerProfile(
string sessionID,
object newPurchaseDetails, // TODO: TYPE FUCKEY { items: { itemId: string; count: number }[]; traderId: string }
Item itemPurchased)
{
throw new NotImplementedException();
}
/// <summary>
/// EoD and Unheard get a 20% bonus to personal trader limit purchases
/// </summary>
/// <param name="buyRestrictionMax">Existing value from trader item</param>
/// <param name="gameVersion">Profiles game version</param>
/// <returns>buyRestrictionMax value</returns>
public double GetAccountTypeAdjustedTraderPurchaseLimit(double buyRestrictionMax, string gameVersion)
{
throw new NotImplementedException();
}
/// <summary>
/// Get the highest rouble price for an item from traders
/// UNUSED
/// </summary>
/// <param name="tpl">Item to look up highest price for</param>
/// <returns>highest rouble cost for item</returns>
public double GetHighestTraderPriceRouble(string tpl)
{
throw new NotImplementedException();
}
/// <summary>
/// Get the highest price item can be sold to trader for (roubles)
/// </summary>
/// <param name="tpl">Item to look up best trader sell-to price</param>
/// <returns>Rouble price</returns>
public double GetHighestSellToTraderPrice(string tpl)
{
throw new NotImplementedException();
}
/// <summary>
/// Get a trader enum key by its value
/// </summary>
/// <param name="traderId">Traders id</param>
/// <returns>Traders key</returns>
public Trader GetTraderById(string traderId)
{
throw new NotImplementedException();
}
/// <summary>
/// Validates that the provided traderEnumValue exists in the Traders enum. If the value is valid, it returns the
/// same enum value, effectively serving as a trader ID; otherwise, it logs an error and returns an empty string.
/// This method provides a runtime check to prevent undefined behavior when using the enum as a dictionary key.
///
/// For example, instead of this:
/// const traderId = Traders[Traders.PRAPOR];
///
/// You can use safely use this:
/// const traderId = this.traderHelper.getValidTraderIdByEnumValue(Traders.PRAPOR);
///
/// </summary>
/// <param name="traderEnumValue">The trader enum value to validate</param>
/// <returns>The validated trader enum value as a string, or an empty string if invalid</returns>
public string GetValidTraderIdByEnumValue(object traderEnumValue) // TODO: param was Traders
{
throw new NotImplementedException();
}
/// <summary>
/// Does the 'Traders' enum has a value that matches the passed in parameter
/// </summary>
/// <param name="key">Value to check for</param>
/// <returns>True, values exists in Traders enum as a value</returns>
public bool TraderEnumHasKey(string key)
{
throw new NotImplementedException();
}
/// <summary>
/// Accepts a trader id
/// </summary>
/// <param name="traderId">Trader id</param>
/// <returns>True if Traders enum has the param as a value</returns>
public bool TraderEnumHasValue(string traderId)
{
throw new NotImplementedException();
}
}
+9
View File
@@ -0,0 +1,9 @@
namespace Core.Helpers;
public class UtilityHelper
{
public List<T> ArrayIntersect<T>(List<T> a, List<T> b)
{
throw new NotImplementedException();
}
}
+34
View File
@@ -0,0 +1,34 @@
namespace Core.Helpers;
public class WeatherHelper
{
public WeatherHelper()
{
}
/// <summary>
/// Get the current in-raid time - does not include an accurate date, only time
/// </summary>
/// <param name="currentDate">(new Date())</param>
/// <returns>Date object of current in-raid time</returns>
public DateTime GetInRaidTime(double? timestamp = null)
{
throw new NotImplementedException();
}
/// <summary>
/// Is the current raid at nighttime
/// </summary>
/// <param name="timeVariant">PASS OR CURR (from raid settings)</param>
/// <returns>True when nighttime</returns>
public bool IsNightTime(DateTime timeVariant)
{
throw new NotImplementedException();
}
public bool IsHourAtNightTime(int currentHour)
{
throw new NotImplementedException();
}
}
+56
View File
@@ -0,0 +1,56 @@
namespace Core.Helpers;
public class WeightedRandomHelper
{
public WeightedRandomHelper()
{
}
/// <summary>
/// Choos an item from the passed in array based on the weightings of each
/// </summary>
/// <param name="itemArray">Items and weights to use</param>
/// <returns>Chosen item from array</returns>
public T GetWeightedValue<T>(Dictionary<string, object> itemArray)
{
throw new NotImplementedException();
}
/// <summary>
/// Picks the random item based on its weight.
/// The items with higher weight will be picked more often (with a higher probability).
///
/// For example:
/// - items = ['banana', 'orange', 'apple']
/// - weights = [0, 0.2, 0.8]
/// - weightedRandom(items, weights) in 80% of cases will return 'apple', in 20% of cases will return
/// 'orange' and it will never return 'banana' (because probability of picking the banana is 0%)
///
/// </summary>
/// <param name="items">List of items</param>
/// <param name="weights">List of weights</param>
/// <returns>Dictionary with item and index</returns>
public Dictionary<string, object> WeightedRandom(List<object> items, List<double> weights)
{
throw new NotImplementedException();
}
/// <summary>
/// Find the greated common divisor of all weights and use it on the passed in dictionary
/// </summary>
/// <param name="weightedDict">Values to reduce</param>
public void ReduceWeightValues(Dictionary<string, double> weightedDict)
{
throw new NotImplementedException();
}
protected double CommonDivisor(List<double> numbers)
{
throw new NotImplementedException();
}
protected double Gcd(double a, double b)
{
throw new NotImplementedException();
}
}