Skip to content

Commit

Permalink
Add logic for getting extra events
Browse files Browse the repository at this point in the history
  • Loading branch information
dend committed Jun 8, 2024
1 parent 0d69445 commit 4ec9089
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CURRENTRELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# OpenSpartan Workshop 1.0.6 (`CRUCIBLE-06072024`)

- Fixes an issue with matches not being populated in full search mode.
- Fixes an issue where extra events are not loaded on first (cold) boot.
- Fixes an issue where matches based on a medal are not loaded due to a malformed SQLite query.

>[!NOTE]
>This is a point release with a hotfix. Original changelog with new functionality captured in [1.0.4](https://github.com/OpenSpartan/openspartan-workshop/releases/tag/1.0.4).
Expand Down
3 changes: 3 additions & 0 deletions src/OpenSpartan.Workshop/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ private async static void LoadSettings()
SettingsViewModel.Instance.Settings.Build = settings.Build;
SettingsViewModel.Instance.Settings.Sandbox = settings.Sandbox;
SettingsViewModel.Instance.Settings.UseObanClearance = settings.UseObanClearance;
SettingsViewModel.Instance.Settings.ExtraRitualEvents = settings.ExtraRitualEvents;

SettingsManager.StoreSettings(SettingsViewModel.Instance.Settings);
}
}
catch (Exception ex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ WITH RAW_MATCHES AS (
MS.MatchId,
MS.Teams,
json_extract(MS.MatchInfo, '$.StartTime') AS StartTime,
json_extract(MS.MatchInfo, '$.EndTime') AS EndTime,
json_extract(MS.MatchInfo, '$.Duration') AS Duration,
json_extract(MS.MatchInfo, '$.GameVariantCategory') AS GameVariantCategory,
json_extract(MS.MatchInfo, '$.MapVariant.AssetId') AS Map,
Expand Down Expand Up @@ -37,6 +38,18 @@ MATCH_DETAILS AS (
json_extract(PE.value, '$.Result.TeamMmr') AS TeamMmr,
json_extract(PE.value, '$.Result.Counterfactuals.SelfCounterfactuals.Deaths') AS ExpectedDeaths,
json_extract(PE.value, '$.Result.Counterfactuals.SelfCounterfactuals.Kills') AS ExpectedKills,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Bronze.Deaths') AS ExpectedBronzeDeaths,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Bronze.Kills') AS ExpectedBronzeKills,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Silver.Deaths') AS ExpectedSilverDeaths,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Silver.Kills') AS ExpectedSilverKills,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Gold.Deaths') AS ExpectedGoldDeaths,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Gold.Kills') AS ExpectedGoldKills,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Platinum.Deaths') AS ExpectedPlatinumDeaths,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Platinum.Kills') AS ExpectedPlatinumKills,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Diamond.Deaths') AS ExpectedDiamondDeaths,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Diamond.Kills') AS ExpectedDiamondKills,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Onyx.Deaths') AS ExpectedOnyxDeaths,
json_extract(PE.value, '$.Result.Counterfactuals.TierCounterfactuals.Onyx.Kills') AS ExpectedOnyxKills,
json_extract(PE.value, '$.Result.RankRecap.PostMatchCsr.Value') AS PostMatchCsr,
json_extract(PE.value, '$.Result.RankRecap.PreMatchCsr.Value') AS PreMatchCsr,
json_extract(PE.value, '$.Result.RankRecap.PostMatchCsr.Tier') AS Tier,
Expand All @@ -59,6 +72,7 @@ SELECTIVE_MATCHES AS (
MatchId,
Teams,
StartTime,
EndTime,
Duration,
"Rank",
Outcome,
Expand All @@ -80,6 +94,7 @@ SELECT
SM.MatchId,
SM.Teams,
SM.StartTime,
SM.EndTime,
SM.Duration,
SM."Rank",
SM.Outcome,
Expand All @@ -93,6 +108,18 @@ SELECT
MD.TeamMmr AS TeamMmr,
MD.ExpectedDeaths AS ExpectedDeaths,
MD.ExpectedKills AS ExpectedKills,
MD.ExpectedBronzeDeaths AS ExpectedBronzeDeaths,
MD.ExpectedBronzeKills AS ExpectedBronzeKills,
MD.ExpectedSilverDeaths AS ExpectedSilverDeaths,
MD.ExpectedSilverKills AS ExpectedSilverKills,
MD.ExpectedGoldDeaths AS ExpectedGoldDeaths,
MD.ExpectedGoldKills AS ExpectedGoldKills,
MD.ExpectedPlatinumDeaths AS ExpectedPlatinumDeaths,
MD.ExpectedPlatinumKills AS ExpectedPlatinumKills,
MD.ExpectedDiamondDeaths AS ExpectedDiamondDeaths,
MD.ExpectedDiamondKills AS ExpectedDiamondKills,
MD.ExpectedOnyxDeaths AS ExpectedOnyxDeaths,
MD.ExpectedOnyxKills AS ExpectedOnyxKills,
MD.PostMatchCsr AS PostMatchCsr,
MD.PreMatchCsr AS PreMatchCsr,
MD.Tier AS Tier,
Expand Down
15 changes: 15 additions & 0 deletions src/OpenSpartan.Workshop/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using OpenSpartan.Workshop.Core;
using OpenSpartan.Workshop.Models;
using System.Collections.Generic;
using System.Runtime.CompilerServices;

namespace OpenSpartan.Workshop.ViewModels
Expand Down Expand Up @@ -162,6 +163,20 @@ public WorkshopSettings Settings
}
}

public List<string> ExtraRitualEvents
{
get => Settings.ExtraRitualEvents;
set
{
if (Settings.ExtraRitualEvents != value)
{
Settings.ExtraRitualEvents = value;
SettingsManager.StoreSettings(Settings);
NotifyPropertyChanged();
}
}
}

public static string Version
{
get => $"{Configuration.Version}-{Configuration.BuildId}";
Expand Down

0 comments on commit 4ec9089

Please sign in to comment.