diff --git a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/GameData.cs b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/GameData.cs index 1d17a7c21..210995a9b 100644 --- a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/GameData.cs +++ b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/GameData.cs @@ -1,6 +1,9 @@ -using System; +using JsonSubTypes; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; @@ -165,6 +168,15 @@ public class _AllPlayer public string team { get; set; } } + [JsonConverter(typeof(JsonSubtypes), "EventName")] + [JsonSubtypes.KnownSubType(typeof(_BaronKillEvent), "BaronKill")] + [JsonSubtypes.KnownSubType(typeof(_HeraldKillEvent), "HeraldKill")] + [JsonSubtypes.KnownSubType(typeof(_DragonKillEvent), "DragonKill")] + [JsonSubtypes.KnownSubType(typeof(_ChampionKillEvent), "ChampionKill")] + [JsonSubtypes.KnownSubType(typeof(_MultikillEvent), "Multikill")] + [JsonSubtypes.KnownSubType(typeof(_AceEvent), "Ace")] + [JsonSubtypes.KnownSubType(typeof(_InhibKillEvent), "InhibKilled")] + [JsonSubtypes.KnownSubType(typeof(_TurretKillEvent), "TurretKilled")] public class _Event { public int EventID { get; set; } @@ -172,6 +184,61 @@ public class _Event public float EventTime { get; set; } } + public class _BaronKillEvent : _Event + { + public bool Stolen { get; set; } + public string KillerName { get; set; } + public string[] Assisters { get; set; } + } + + public class _HeraldKillEvent : _Event + { + public bool Stolen { get; set; } + public string KillerName { get; set; } + public string[] Assisters { get; set; } + } + + public class _DragonKillEvent : _Event + { + public string DragonType { get; set; } + public bool Stolen { get; set; } + public string KillerName { get; set; } + public string[] Assisters { get; set; } + } + + public class _ChampionKillEvent : _Event + { + public string KillerName { get; set; } + public string VictimName { get; set; } + public string[] Assisters { get; set; } + } + + public class _MultikillEvent : _Event + { + public string KillerName { get; set; } + public int KillStreak { get; set; } + } + + public class _AceEvent : _Event + { + public string Acer { get; set; } + public string AcingTeam { get; set; } + } + + public class _InhibKillEvent : _Event + { + public string KillerName { get; set; } + public string InhibKilled { get; set; } + public string[] Assisters { get; set; } + } + + public class _TurretKillEvent : _Event + { + public string KillerName { get; set; } + public string TurretKilled { get; set; } + public string[] Assisters { get; set; } + } + public class _EventList { public IList<_Event> Events { get; set; } diff --git a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/AbilityNode.cs b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/AbilityNode.cs index c01f434f4..ab8742005 100644 --- a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/AbilityNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/AbilityNode.cs @@ -10,7 +10,7 @@ public class AbilityNode : Node { public bool Learned => Level != 0; public int Level; - public string Name; + public string Name = ""; //TODO: there might be additional useful info to add here such as cooldown } diff --git a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/ItemNode.cs b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/ItemNode.cs index b5417dbb6..f00572f5e 100644 --- a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/ItemNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/ItemNode.cs @@ -36,6 +36,7 @@ public SlotNode(_Item item) public enum ItemID { + Unknown = -1, None = 0, BootsofSpeed = 1001, FaerieCharm = 1004, diff --git a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/MatchNode.cs b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/MatchNode.cs index 79d854dea..b6252420f 100644 --- a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/MatchNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/MatchNode.cs @@ -8,18 +8,54 @@ namespace Aurora.Profiles.LeagueOfLegends.GSI.Nodes { public class MatchNode : Node { - public string GameMode; + public MapTerrain MapTerrain; + + //public GameMode GameMode; + //TODO: Find the rest of the enum values. meanwhile i'll leave this as a string + public string GameMode = ""; public float GameTime; public bool InGame; + public int InfernalDragonsKilled; + + public int OceanDragonsKilled; + + public int MountainDragonsKilled; + + public int CloudDragonsKilled; + + public int EarthDragonsKilled; + + public int ElderDragonsKilled; + public int DragonsKilled; public int TurretsKilled; + public int InhibsKilled; + public int BaronsKilled; public int HeraldsKilled; } + + public enum MapTerrain + { + Unknown, + Default, + Infernal, + Cloud, + Mountain, + Ocean + } + + //TODO: Find the rest of these + public enum GameMode + { + Unknown = -1, + None = 0, + PracticeTool + } } diff --git a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/PlayerNode.cs b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/PlayerNode.cs index 5c058d291..914655487 100644 --- a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/PlayerNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/PlayerNode.cs @@ -10,7 +10,8 @@ namespace Aurora.Profiles.LeagueOfLegends.GSI.Nodes { public enum Champion { - Undefined = -1, + Unknown = -1, + None = 0, Aatrox, Ahri, Akali, @@ -163,14 +164,16 @@ public enum Champion public enum Team { - Undefined = -1, + Unknown = -1, + None = 0, Order, Chaos } public enum SummonerSpell { - Undefined = -1, + Unknown = -1, + None = 0, Cleanse,//210 Exhaust,//210 Flash,//300 @@ -187,7 +190,8 @@ public enum SummonerSpell public enum Position { - Undefined, + Unknown = -1, + None = 0, Top, Jungle, Middle, @@ -201,12 +205,12 @@ public class PlayerNode : Node public StatsNode ChampionStats = new StatsNode(); public AbilitiesNode Abilities = new AbilitiesNode(); public InventoryNode Items = new InventoryNode(); - public SummonerSpell SpellD = SummonerSpell.Undefined; - public SummonerSpell SpellF = SummonerSpell.Undefined; - public Champion Champion = Champion.Undefined; - public Team Team = Team.Undefined; - public Position Position = Position.Undefined; - public string SummonerName; + public SummonerSpell SpellD = SummonerSpell.None; + public SummonerSpell SpellF = SummonerSpell.None; + public Champion Champion = Champion.None; + public Team Team = Team.None; + public Position Position = Position.None; + public string SummonerName = ""; public int Level; public float Gold; public bool IsDead; diff --git a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/StatsNode.cs b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/StatsNode.cs index de9a6ba90..ff3ae5212 100644 --- a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/StatsNode.cs +++ b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GSI/Nodes/StatsNode.cs @@ -8,10 +8,10 @@ namespace Aurora.Profiles.LeagueOfLegends.GSI.Nodes { public enum ResourceType { - Undefined = -1, + Unknown = -1, + None = 0, Mana, Energy, - None, Shield, Battlefury, Dragonfury, diff --git a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GameEvent_LoL.cs b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GameEvent_LoL.cs index 68f008bbf..0d351d76b 100644 --- a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GameEvent_LoL.cs +++ b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/GameEvent_LoL.cs @@ -56,7 +56,7 @@ public override void UpdateTick() if (allGameData == null) { - s.Match.InGame = false; + _game_state = new GameState_LoL(); return; } @@ -64,6 +64,7 @@ public override void UpdateTick() { #region Match s.Match.InGame = true; + //s.Match.GameMode = EnumUtils.TryParseOr(allGameData.gameData.gameMode, true, GameMode.Unknown); s.Match.GameMode = allGameData.gameData.gameMode; s.Match.GameTime = allGameData.gameData.gameTime; #endregion @@ -111,7 +112,7 @@ public override void UpdateTick() s.Player.ChampionStats.PhysicalLethality = ap.championStats.physicalLethality; s.Player.ChampionStats.ResourceMax = ap.championStats.resourceMax; s.Player.ChampionStats.ResourceRegenRate = ap.championStats.resourceRegenRate; - s.Player.ChampionStats.ResourceType = EnumUtils.TryParseOr(ap.championStats.resourceType, true, ResourceType.Undefined); + s.Player.ChampionStats.ResourceType = EnumUtils.TryParseOr(ap.championStats.resourceType, true, ResourceType.Unknown); s.Player.ChampionStats.ResourceCurrent = ap.championStats.resourceValue; s.Player.ChampionStats.SpellVamp = ap.championStats.spellVamp; s.Player.ChampionStats.Tenacity = ap.championStats.tenacity; @@ -128,11 +129,11 @@ public override void UpdateTick() return; //if we can't find it, skip - s.Player.Champion = EnumUtils.TryParseOr(p.championName.Replace(" ", "").Replace("'", "").Replace(".", ""), true, Champion.Undefined); - s.Player.SpellD = EnumUtils.TryParseOr(p.summonerSpells.summonerSpellOne.displayName, true, SummonerSpell.Undefined); - s.Player.SpellF = EnumUtils.TryParseOr(p.summonerSpells.summonerSpellTwo.displayName, true, SummonerSpell.Undefined); - s.Player.Team = EnumUtils.TryParseOr(p.team, true, Team.Undefined); - s.Player.Position = EnumUtils.TryParseOr(p.position, true, Position.Undefined); + s.Player.Champion = EnumUtils.TryParseOr(p.championName.Replace(" ", "").Replace("'", "").Replace(".", ""), true, Champion.None); + s.Player.SpellD = EnumUtils.TryParseOr(p.summonerSpells.summonerSpellOne.displayName, true, SummonerSpell.Unknown); + s.Player.SpellF = EnumUtils.TryParseOr(p.summonerSpells.summonerSpellTwo.displayName, true, SummonerSpell.Unknown); + s.Player.Team = EnumUtils.TryParseOr(p.team, true, Team.Unknown); + s.Player.Position = EnumUtils.TryParseOr(p.position, true, Position.Unknown); s.Player.IsDead = p.isDead; s.Player.RespawnTimer = p.respawnTimer; @@ -144,10 +145,20 @@ public override void UpdateTick() #endregion #region Events - s.Match.BaronsKilled = allGameData.events.Events.Count(ev => ev.EventName.Contains("BaronKill")); - s.Match.HeraldsKilled = allGameData.events.Events.Count(ev => ev.EventName.Contains("HeraldKill")); - s.Match.DragonsKilled = allGameData.events.Events.Count(ev => ev.EventName.Contains("DragonKill")); - s.Match.TurretsKilled = allGameData.events.Events.Count(ev => ev.EventName.Contains("TurretKilled")); + var drags = allGameData.events.Events.OfType<_DragonKillEvent>(); + + s.Match.InfernalDragonsKilled = drags.Count(d => d.DragonType.ToLower() == "fire"); + s.Match.EarthDragonsKilled = drags.Count(d => d.DragonType.ToLower() == "earth"); + s.Match.OceanDragonsKilled = drags.Count(d => d.DragonType.ToLower() == "water"); + s.Match.CloudDragonsKilled = drags.Count(d => d.DragonType.ToLower() == "air"); + s.Match.ElderDragonsKilled = drags.Count(d => d.DragonType.ToLower() == "elder"); + + s.Match.BaronsKilled = allGameData.events.Events.Count(ev => ev is _BaronKillEvent); + s.Match.HeraldsKilled = allGameData.events.Events.Count(ev => ev is _HeraldKillEvent); + s.Match.DragonsKilled = allGameData.events.Events.Count(ev => ev is _DragonKillEvent); + s.Match.TurretsKilled = allGameData.events.Events.Count(ev => ev is _TurretKillEvent); + s.Match.InhibsKilled = allGameData.events.Events.Count(ev => ev is _InhibKillEvent); + s.Match.MapTerrain = EnumUtils.TryParseOr(allGameData.gameData.mapTerrain, true, MapTerrain.Unknown); #endregion #region Items diff --git a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/Control_LoLBackgroundLayer.xaml.cs b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/Control_LoLBackgroundLayer.xaml.cs index 05850cdb0..50224c4ad 100644 --- a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/Control_LoLBackgroundLayer.xaml.cs +++ b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/Control_LoLBackgroundLayer.xaml.cs @@ -48,7 +48,7 @@ private void UserControl_Loaded(object sender, RoutedEventArgs e) private void SetSettings() { - this.championPicker.SelectedItem = Champion.Undefined; + this.championPicker.SelectedItem = Champion.None; } private void championPicker_SelectionChanged(object sender, SelectionChangedEventArgs e) diff --git a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/DefaultChampionColors.cs b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/DefaultChampionColors.cs index ce879a139..af30c9f8d 100644 --- a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/DefaultChampionColors.cs +++ b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/DefaultChampionColors.cs @@ -16,7 +16,7 @@ public static class DefaultChampionColors /// public static Dictionary GetDictionary() => new Dictionary() { - [Champion.Undefined] = Color.FromArgb(120, 120, 120), + [Champion.None] = Color.FromArgb(120, 120, 120), [Champion.Aatrox] = Color.FromArgb(237, 83, 79), [Champion.Ahri] = Color.FromArgb(61, 76, 178), [Champion.Akali] = Color.FromArgb(10, 115, 38), diff --git a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/LoLBackgroundLayerHandler.cs b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/LoLBackgroundLayerHandler.cs index 7a63e8bba..d2e55ae76 100644 --- a/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/LoLBackgroundLayerHandler.cs +++ b/Project-Aurora/Project-Aurora/Profiles/LeagueOfLegends/Layers/LoLBackgroundLayerHandler.cs @@ -35,14 +35,14 @@ public class LoLBackgroundLayerHandler : LayerHandler + @@ -2608,6 +2608,9 @@ 2.7.8.1 + + 1.7.0 + 5.6.0