NEO-149: fix analyzer warnings in encounter wiring
RCS1123 parentheses in quest wiring test, CA1873 guarded LogDebug, CA1859 List parameter for CompensatingRemoveGrants.pull/190/head
parent
68ba26724b
commit
6f735f8643
|
|
@ -45,7 +45,7 @@ public sealed class QuestObjectiveWiringTests
|
||||||
Assert.True(deps.ProgressStore.TryGetProgress(PlayerId, GatherQuestId, out var progress));
|
Assert.True(deps.ProgressStore.TryGetProgress(PlayerId, GatherQuestId, out var progress));
|
||||||
Assert.Equal(QuestProgressStatus.Completed, progress.Status);
|
Assert.Equal(QuestProgressStatus.Completed, progress.Status);
|
||||||
Assert.Equal(
|
Assert.Equal(
|
||||||
3 * GatherSkillXpConstants.ActivityXpPerResourceNodeGather + 25,
|
(3 * GatherSkillXpConstants.ActivityXpPerResourceNodeGather) + 25,
|
||||||
deps.XpStore.GetXpTotals(PlayerId).GetValueOrDefault("salvage"));
|
deps.XpStore.GetXpTotals(PlayerId).GetValueOrDefault("salvage"));
|
||||||
Assert.True(deps.DeliveryStore.TryGet(PlayerId, GatherQuestId, out var deliveryEvent));
|
Assert.True(deps.DeliveryStore.TryGet(PlayerId, GatherQuestId, out var deliveryEvent));
|
||||||
Assert.Single(deliveryEvent.GrantedSkillXp);
|
Assert.Single(deliveryEvent.GrantedSkillXp);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using NeonSprawl.Server.Game.Contracts;
|
using NeonSprawl.Server.Game.Contracts;
|
||||||
using NeonSprawl.Server.Game.Factions;
|
using NeonSprawl.Server.Game.Factions;
|
||||||
using NeonSprawl.Server.Game.Items;
|
using NeonSprawl.Server.Game.Items;
|
||||||
|
|
@ -115,11 +116,15 @@ public static class EncounterCombatWiring
|
||||||
|
|
||||||
if (!completion.Success)
|
if (!completion.Success)
|
||||||
{
|
{
|
||||||
logger?.LogDebug(
|
if (logger?.IsEnabled(LogLevel.Debug) == true)
|
||||||
"Encounter completion grant skipped for player {PlayerId} encounter {EncounterId} ({ReasonCode})",
|
{
|
||||||
playerId,
|
logger.LogDebug(
|
||||||
encounterId,
|
"Encounter completion grant skipped for player {PlayerId} encounter {EncounterId} ({ReasonCode})",
|
||||||
completion.ReasonCode);
|
playerId,
|
||||||
|
encounterId,
|
||||||
|
completion.ReasonCode);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,7 @@ public static class EncounterCompletionOperations
|
||||||
|
|
||||||
private static void CompensatingRemoveGrants(
|
private static void CompensatingRemoveGrants(
|
||||||
string playerId,
|
string playerId,
|
||||||
IReadOnlyList<EncounterGrantApplied> grants,
|
List<EncounterGrantApplied> grants,
|
||||||
IItemDefinitionRegistry itemRegistry,
|
IItemDefinitionRegistry itemRegistry,
|
||||||
IPlayerInventoryStore inventoryStore)
|
IPlayerInventoryStore inventoryStore)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue