Skip to content

Commit

Permalink
fix hsreplay return invalid archetype
Browse files Browse the repository at this point in the history
  • Loading branch information
icetbr committed Jan 29, 2021
1 parent 976eb13 commit cc0f4b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Advisor/AdvisorPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void OnUpdate()
{
}

public Version Version => new Version(1, 3, 1);
public Version Version => new Version(1, 3, 2);

public async Task CheckForUpdate()
{
Expand Down
14 changes: 12 additions & 2 deletions Advisor/Services/HsReplay/HsReplaySnapshotImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,18 @@ private Deck GetDeck(JToken deckJson, Dictionary<string, HsReplayArchetype> allA
Deck deck = new Deck();

HsReplayArchetype archetype = allArchetypesById.TryGetValue(hsReplayDeck.ArchetypeId, out HsReplayArchetype value) ? value : unknownArchetype;
deck.Name = archetype.Name;
deck.Class = hsReplayClassToDeckTrackerClass[archetype.Class];

if (hsReplayClassToDeckTrackerClass.TryGetValue(archetype.Class, out string className))
{
deck.Name = archetype.Name;
deck.Class = className;
}
else
{
Log.Info($"Archetype class not found {archetype.Class}");
deck.Name = "dummyName";
deck.Class = archetype.Class;
}
deck.Cards = GetCardsFromHsReplayDeckList(hsReplayDeck.DeckList);
deck.LastEdited = DateTime.Now;
deck.Note = hsReplayDeck.DeckId + "-" + hsReplayDeck.TotalGames + "-" + hsReplayDeck.WinRate;
Expand Down

0 comments on commit cc0f4b9

Please sign in to comment.