Cleanup of warnings
This commit is contained in:
@@ -24,7 +24,7 @@ public class ClientLogCallbacks(
|
|||||||
/// Handle /singleplayer/log
|
/// Handle /singleplayer/log
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public ValueTask<string> ClientLog(string url, ClientLogRequest request, MongoId sessionID)
|
public ValueTask<string> ClientLog(string url, ClientLogRequest request, MongoId sessionId)
|
||||||
{
|
{
|
||||||
if (request.Message == "-1")
|
if (request.Message == "-1")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ public class GameController(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Two day post-profile creation
|
// Two day post-profile creation
|
||||||
if (currentTimeStamp > timeStampProfileCreated + oneDaySeconds * 2)
|
if (currentTimeStamp > timeStampProfileCreated + (oneDaySeconds * 2))
|
||||||
{
|
{
|
||||||
giftService.SendPraporStartingGift(pmcProfile.SessionId.Value, 2);
|
giftService.SendPraporStartingGift(pmcProfile.SessionId.Value, 2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -846,7 +846,7 @@ public class HideoutController(
|
|||||||
|
|
||||||
// Build an array of the tools that need to be returned to the player
|
// Build an array of the tools that need to be returned to the player
|
||||||
List<List<Item>> toolsToSendToPlayer = [];
|
List<List<Item>> toolsToSendToPlayer = [];
|
||||||
pmcData.Hideout.Production.TryGetValue(prodId.Value, out Production hideoutProduction);
|
pmcData.Hideout.Production.TryGetValue(prodId.Value, out var hideoutProduction);
|
||||||
if (hideoutProduction.SptRequiredTools?.Count > 0)
|
if (hideoutProduction.SptRequiredTools?.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var tool in hideoutProduction.SptRequiredTools)
|
foreach (var tool in hideoutProduction.SptRequiredTools)
|
||||||
|
|||||||
@@ -509,6 +509,7 @@ public class BotWeaponGenerator(
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add ammo to the secure container.
|
/// Add ammo to the secure container.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="botId">Id of bot we're adding ammo to</param>
|
||||||
/// <param name="stackCount">How many stacks of ammo to add.</param>
|
/// <param name="stackCount">How many stacks of ammo to add.</param>
|
||||||
/// <param name="ammoTpl">Ammo type to add.</param>
|
/// <param name="ammoTpl">Ammo type to add.</param>
|
||||||
/// <param name="stackSize">Size of the ammo stack to add.</param>
|
/// <param name="stackSize">Size of the ammo stack to add.</param>
|
||||||
@@ -711,10 +712,8 @@ public class BotWeaponGenerator(
|
|||||||
|
|
||||||
// Try to get cartridges from slots array first, if none found, try Cartridges array
|
// Try to get cartridges from slots array first, if none found, try Cartridges array
|
||||||
var cartridges =
|
var cartridges =
|
||||||
magazineTemplate.Value.Properties.Slots.FirstOrDefault()?.Properties?.Filters.FirstOrDefault()?.Filter ?? magazineTemplate
|
magazineTemplate.Value.Properties.Slots.FirstOrDefault()?.Properties?.Filters.FirstOrDefault()?.Filter
|
||||||
.Value.Properties.Cartridges.FirstOrDefault()
|
?? magazineTemplate.Value.Properties.Cartridges.FirstOrDefault()?.Properties?.Filters.FirstOrDefault()?.Filter;
|
||||||
?.Properties?.Filters.FirstOrDefault()
|
|
||||||
?.Filter;
|
|
||||||
|
|
||||||
return cartridges ?? [];
|
return cartridges ?? [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ public record RepeatableQuest : Quest
|
|||||||
[JsonPropertyName("sptRepatableGroupName")]
|
[JsonPropertyName("sptRepatableGroupName")]
|
||||||
public string? SptRepatableGroupName { get; set; }
|
public string? SptRepatableGroupName { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("acceptanceAndFinishingSource")]
|
|
||||||
public string? AcceptanceAndFinishingSource { get; set; }
|
|
||||||
|
|
||||||
[JsonPropertyName("questStatus")]
|
[JsonPropertyName("questStatus")]
|
||||||
public RepeatableQuestStatus? QuestStatus { get; set; }
|
public RepeatableQuestStatus? QuestStatus { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,9 +121,9 @@ public class BotEquipmentFilterService(
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="botEquipmentRole">equipment role to return</param>
|
/// <param name="botEquipmentRole">equipment role to return</param>
|
||||||
/// <returns>EquipmentFilters object</returns>
|
/// <returns>EquipmentFilters object</returns>
|
||||||
public EquipmentFilters GetBotEquipmentSettings(string botEquipmentRole)
|
public EquipmentFilters? GetBotEquipmentSettings(string botEquipmentRole)
|
||||||
{
|
{
|
||||||
return BotEquipmentConfig[botEquipmentRole];
|
return BotEquipmentConfig.GetValueOrDefault(botEquipmentRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -415,7 +415,7 @@ public class BotEquipmentFilterService(
|
|||||||
foreach (var itemToEditKvP in poolAdjustmentKvP.Value)
|
foreach (var itemToEditKvP in poolAdjustmentKvP.Value)
|
||||||
// Only make change if item exists as we're editing, not adding
|
// Only make change if item exists as we're editing, not adding
|
||||||
{
|
{
|
||||||
if (locationToUpdate.GetValueOrDefault(itemToEditKvP.Key) != null || locationToUpdate[itemToEditKvP.Key] == 0)
|
if (locationToUpdate.ContainsKey(itemToEditKvP.Key) || locationToUpdate[itemToEditKvP.Key] == 0)
|
||||||
{
|
{
|
||||||
locationToUpdate[itemToEditKvP.Key] = itemToEditKvP.Value;
|
locationToUpdate[itemToEditKvP.Key] = itemToEditKvP.Value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using System.Diagnostics;
|
|
||||||
using SPTarkov.Common.Extensions;
|
using SPTarkov.Common.Extensions;
|
||||||
using SPTarkov.DI.Annotations;
|
using SPTarkov.DI.Annotations;
|
||||||
using SPTarkov.Server.Core.Extensions;
|
|
||||||
using SPTarkov.Server.Core.Models.Common;
|
using SPTarkov.Server.Core.Models.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common;
|
using SPTarkov.Server.Core.Models.Eft.Common;
|
||||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||||
@@ -12,7 +10,6 @@ using SPTarkov.Server.Core.Models.Utils;
|
|||||||
using SPTarkov.Server.Core.Servers;
|
using SPTarkov.Server.Core.Servers;
|
||||||
using Hideout = SPTarkov.Server.Core.Models.Spt.Hideout.Hideout;
|
using Hideout = SPTarkov.Server.Core.Models.Spt.Hideout.Hideout;
|
||||||
using Locations = SPTarkov.Server.Core.Models.Spt.Server.Locations;
|
using Locations = SPTarkov.Server.Core.Models.Spt.Server.Locations;
|
||||||
using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel;
|
|
||||||
|
|
||||||
namespace SPTarkov.Server.Core.Services;
|
namespace SPTarkov.Server.Core.Services;
|
||||||
|
|
||||||
@@ -26,8 +23,6 @@ public class DatabaseService(
|
|||||||
ServerLocalisationService serverLocalisationService
|
ServerLocalisationService serverLocalisationService
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
private bool _isDataValid = true;
|
|
||||||
|
|
||||||
/// <returns> assets/database/ </returns>
|
/// <returns> assets/database/ </returns>
|
||||||
public DatabaseTables GetTables()
|
public DatabaseTables GetTables()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -192,9 +192,9 @@ public class InsuranceService(
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Store lost gear post-raid inside profile, ready for later code to pick it up and mail it
|
/// Store lost gear post-raid inside profile, ready for later code to pick it up and mail it
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sessionID">Player/session id</param>
|
/// <param name="sessionId">Player/session id</param>
|
||||||
/// <param name="equipmentPkg">Gear to store - generated by GetGearLostInRaid()</param>
|
/// <param name="equipmentPkg">Gear to store - generated by GetGearLostInRaid()</param>
|
||||||
public void StoreGearLostInRaidToSendLater(MongoId sessionID, List<InsuranceEquipmentPkg> equipmentPkg)
|
public void StoreGearLostInRaidToSendLater(MongoId sessionId, List<InsuranceEquipmentPkg> equipmentPkg)
|
||||||
{
|
{
|
||||||
// Process all insured items lost in-raid
|
// Process all insured items lost in-raid
|
||||||
foreach (var gear in equipmentPkg)
|
foreach (var gear in equipmentPkg)
|
||||||
@@ -303,11 +303,16 @@ public class InsuranceService(
|
|||||||
/// <returns>True if exists</returns>
|
/// <returns>True if exists</returns>
|
||||||
protected bool InsuranceTraderArrayExists(MongoId sessionId, MongoId traderId)
|
protected bool InsuranceTraderArrayExists(MongoId sessionId, MongoId traderId)
|
||||||
{
|
{
|
||||||
return Insured[sessionId].GetValueOrDefault(traderId) is not null;
|
if (!Insured.TryGetValue(sessionId, out var value))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return value?.GetValueOrDefault(traderId) is not null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Empty out list holding insured items by sessionid + traderid
|
/// Empty out list holding insured items by sessionId + traderId
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sessionId">Player id (session id)</param>
|
/// <param name="sessionId">Player id (session id)</param>
|
||||||
/// <param name="traderId">Trader items insured with</param>
|
/// <param name="traderId">Trader items insured with</param>
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ public class LocationLifecycleService(
|
|||||||
/// Check player type for pmc or scav
|
/// Check player type for pmc or scav
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="playerSide">string</param>
|
/// <param name="playerSide">string</param>
|
||||||
|
/// <param name="sideCheck">What to check the bot against, default = PMC</param>
|
||||||
/// <returns>bool</returns>
|
/// <returns>bool</returns>
|
||||||
protected internal bool IsSide(string playerSide, string sideCheck = Pmc)
|
protected internal bool IsSide(string playerSide, string sideCheck = Pmc)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PMC/@EntryIndexedValue">PMC</s:String>
|
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=PMC/@EntryIndexedValue">PMC</s:String>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dogtag/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dogtag/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gifter/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Gifter/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Prapor/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=ragfair/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=ragfair/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Randomisable/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=Randomisable/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=randomistion/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/UserDictionary/Words/=randomistion/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
|||||||
Reference in New Issue
Block a user