Various fixes + addedTimerUtil
This commit is contained in:
@@ -32,9 +32,9 @@ public class HideoutCallbacks : OnUpdate
|
||||
/// <summary>
|
||||
/// Handle HideoutUpgrade event
|
||||
/// </summary>
|
||||
public ItemEventRouterResponse Upgrade(PmcData pmcData, HideoutUpgradeRequestData info, string sessionID, ItemEventRouterResponse output)
|
||||
public ItemEventRouterResponse Upgrade(PmcData pmcData, HideoutUpgradeRequestData request, string sessionID, ItemEventRouterResponse output)
|
||||
{
|
||||
_hideoutController.StartUpgrade(pmcData, info, sessionID, output);
|
||||
_hideoutController.StartUpgrade(pmcData, request, sessionID, output);
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -42,9 +42,9 @@ public class HideoutCallbacks : OnUpdate
|
||||
/// <summary>
|
||||
/// Handle HideoutUpgradeComplete event
|
||||
/// </summary>
|
||||
public ItemEventRouterResponse UpgradeComplete(PmcData pmcData, HideoutUpgradeCompleteRequestData info, string sessionID, ItemEventRouterResponse output)
|
||||
public ItemEventRouterResponse UpgradeComplete(PmcData pmcData, HideoutUpgradeCompleteRequestData request, string sessionID, ItemEventRouterResponse output)
|
||||
{
|
||||
_hideoutController.UpgradeComplete(pmcData, info, sessionID, output);
|
||||
_hideoutController.UpgradeComplete(pmcData, request, sessionID, output);
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -52,49 +52,49 @@ public class HideoutCallbacks : OnUpdate
|
||||
/// <summary>
|
||||
/// Handle HideoutPutItemsInAreaSlots
|
||||
/// </summary>
|
||||
public ItemEventRouterResponse PutItemsInAreaSlots(PmcData pmcData, HideoutPutItemInRequestData info, string sessionID)
|
||||
public ItemEventRouterResponse PutItemsInAreaSlots(PmcData pmcData, HideoutPutItemInRequestData request, string sessionID)
|
||||
{
|
||||
return _hideoutController.PutItemsInAreaSlots(pmcData, info, sessionID);
|
||||
return _hideoutController.PutItemsInAreaSlots(pmcData, request, sessionID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle HideoutTakeItemsFromAreaSlots event
|
||||
/// </summary>
|
||||
public ItemEventRouterResponse TakeItemsFromAreaSlots(PmcData pmcData, HideoutTakeItemOutRequestData info, string sessionID)
|
||||
public ItemEventRouterResponse TakeItemsFromAreaSlots(PmcData pmcData, HideoutTakeItemOutRequestData request, string sessionID)
|
||||
{
|
||||
return _hideoutController.TakeItemsFromAreaSlots(pmcData, info, sessionID);
|
||||
return _hideoutController.TakeItemsFromAreaSlots(pmcData, request, sessionID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle HideoutToggleArea event
|
||||
/// </summary>
|
||||
public ItemEventRouterResponse ToggleArea(PmcData pmcData, HideoutToggleAreaRequestData info, string sessionID)
|
||||
public ItemEventRouterResponse ToggleArea(PmcData pmcData, HideoutToggleAreaRequestData request, string sessionID)
|
||||
{
|
||||
return _hideoutController.ToggleArea(pmcData, info, sessionID);
|
||||
return _hideoutController.ToggleArea(pmcData, request, sessionID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle HideoutSingleProductionStart event
|
||||
/// </summary>
|
||||
public ItemEventRouterResponse SingleProductionStart(PmcData pmcData, HideoutSingleProductionStartRequestData info, string sessionID)
|
||||
public ItemEventRouterResponse SingleProductionStart(PmcData pmcData, HideoutSingleProductionStartRequestData request, string sessionID)
|
||||
{
|
||||
return _hideoutController.SingleProductionStart(pmcData, info, sessionID);
|
||||
return _hideoutController.SingleProductionStart(pmcData, request, sessionID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle HideoutScavCaseProductionStart event
|
||||
/// </summary>
|
||||
public ItemEventRouterResponse ScavCaseProductionStart(PmcData pmcData, HideoutScavCaseStartRequestData info, string sessionID)
|
||||
public ItemEventRouterResponse ScavCaseProductionStart(PmcData pmcData, HideoutScavCaseStartRequestData request, string sessionID)
|
||||
{
|
||||
return _hideoutController.ScavCaseProductionStart(pmcData, info, sessionID);
|
||||
return _hideoutController.ScavCaseProductionStart(pmcData, request, sessionID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle HideoutContinuousProductionStart
|
||||
/// </summary>
|
||||
public ItemEventRouterResponse ContinuousProductionStart(PmcData pmcData, HideoutContinuousProductionStartRequestData info, string sessionID)
|
||||
public ItemEventRouterResponse ContinuousProductionStart(PmcData pmcData, HideoutContinuousProductionStartRequestData request, string sessionID)
|
||||
{
|
||||
return _hideoutController.ContinuousProductionStart(pmcData, info, sessionID);
|
||||
return _hideoutController.ContinuousProductionStart(pmcData, request, sessionID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -662,9 +662,9 @@ public class ProfileHelper
|
||||
}
|
||||
|
||||
var customisationTemplateDb = _databaseService.GetTemplates().Customization;
|
||||
var matchingCustomisation = customisationTemplateDb[reward.Target];
|
||||
var matchingCustomisation = customisationTemplateDb.GetValueOrDefault(reward.Target, null);
|
||||
|
||||
if (matchingCustomisation != null)
|
||||
if (matchingCustomisation is null)
|
||||
{
|
||||
var rewardToStore = new CustomisationStorage
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Core.Models.Eft.Common.Tables;
|
||||
using Core.Models.Eft.Common.Tables;
|
||||
using Core.Models.Eft.Hideout;
|
||||
|
||||
namespace Core.Models.Eft.Common;
|
||||
@@ -1294,13 +1294,13 @@ public class Mastering
|
||||
public class Customization
|
||||
{
|
||||
[JsonPropertyName("SavageHead")]
|
||||
public Dictionary<string, Dictionary<string, object>>? Head { get; set; }
|
||||
public Dictionary<string, Dictionary<string, WildHead>>? Head { get; set; }
|
||||
|
||||
[JsonPropertyName("SavageBody")]
|
||||
public Dictionary<string, Dictionary<string, object>>? Body { get; set; }
|
||||
public Dictionary<string, Dictionary<string, WildBody>>? Body { get; set; }
|
||||
|
||||
[JsonPropertyName("SavageFeet")]
|
||||
public Dictionary<string, Dictionary<string, object>>? Feet { get; set; }
|
||||
public Dictionary<string, Dictionary<string, WildFeet>>? Feet { get; set; }
|
||||
|
||||
[JsonPropertyName("CustomizationVoice")]
|
||||
public List<CustomizationVoice>? VoiceOptions { get; set; }
|
||||
@@ -1309,6 +1309,41 @@ public class Customization
|
||||
public BodyParts? BodyParts { get; set; }
|
||||
}
|
||||
|
||||
public class WildHead
|
||||
{
|
||||
[JsonPropertyName("head")]
|
||||
public string Head { get; set; }
|
||||
|
||||
[JsonPropertyName("isNotRandom")]
|
||||
public string IsNotRandom { get; set; }
|
||||
|
||||
[JsonPropertyName("NotRandom")]
|
||||
public string NotRandom { get; set; }
|
||||
}
|
||||
|
||||
public class WildBody
|
||||
{
|
||||
[JsonPropertyName("body")]
|
||||
public string Body { get; set; }
|
||||
|
||||
[JsonPropertyName("hands")]
|
||||
public string Hands { get; set; }
|
||||
|
||||
[JsonPropertyName("isNotRandom")]
|
||||
public string IsNotRandom { get; set; }
|
||||
}
|
||||
public class WildFeet
|
||||
{
|
||||
[JsonPropertyName("head")]
|
||||
public string Head { get; set; }
|
||||
|
||||
[JsonPropertyName("isNotRandom")]
|
||||
public string IsNotRandom { get; set; }
|
||||
|
||||
[JsonPropertyName("NotRandom")]
|
||||
public string NotRandom { get; set; }
|
||||
}
|
||||
|
||||
public class CustomizationVoice
|
||||
{
|
||||
[JsonPropertyName("voice")]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using Core.Models.Common;
|
||||
using Core.Models.Eft.Common;
|
||||
|
||||
@@ -131,7 +131,10 @@ public class LocationConfig : BaseConfig
|
||||
/// </summary>
|
||||
[JsonPropertyName("reserveRaiderSpawnChanceOverrides")]
|
||||
public ReserveRaiderSpawnChanceOverrides ReserveRaiderSpawnChanceOverrides { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Containers to remove all children from when generating static/loose loot
|
||||
/// </summary>
|
||||
[JsonPropertyName("tplsToStripChildItemsFrom")]
|
||||
public List<string> TplsToStripChildItemsFrom { get; set; }
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Diagnostics;
|
||||
using Core.Annotations;
|
||||
|
||||
namespace Core.Utils
|
||||
{
|
||||
[Injectable]
|
||||
public class TimerUtil
|
||||
{
|
||||
private readonly Stopwatch _stopwatch;
|
||||
|
||||
public TimerUtil()
|
||||
{
|
||||
_stopwatch = new Stopwatch();
|
||||
_stopwatch.Start();
|
||||
}
|
||||
|
||||
public int Stop(string unit = "sec")
|
||||
{
|
||||
_stopwatch.Stop();
|
||||
var timePassed = _stopwatch.Elapsed;
|
||||
|
||||
return unit switch
|
||||
{
|
||||
"ns" => timePassed.Nanoseconds,
|
||||
"ms" => timePassed.Milliseconds,
|
||||
_ => timePassed.Seconds
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user