diff --git a/Dota2GSI/GameState.cs b/Dota2GSI/GameState.cs index 7f6d77d..c787fca 100644 --- a/Dota2GSI/GameState.cs +++ b/Dota2GSI/GameState.cs @@ -173,7 +173,7 @@ public Events Events { if (events == null) { - events = new Events(GetJObject("events")); + events = new Events(GetJArray("events")); } return events; diff --git a/Dota2GSI/Nodes/Events.cs b/Dota2GSI/Nodes/Events.cs index 6e64d95..05dc642 100644 --- a/Dota2GSI/Nodes/Events.cs +++ b/Dota2GSI/Nodes/Events.cs @@ -17,7 +17,7 @@ public class Events : IEnumerable /// public int Count { get { return _events.Count; } } - internal Events(JObject parsed_data = null) : base() + internal Events(JArray parsed_data = null) : base() { if (parsed_data != null) { diff --git a/Dota2GSI/Nodes/Node.cs b/Dota2GSI/Nodes/Node.cs index d4674eb..07763bc 100644 --- a/Dota2GSI/Nodes/Node.cs +++ b/Dota2GSI/Nodes/Node.cs @@ -53,6 +53,18 @@ internal JObject GetJObject(string property_name) return null; } + internal JArray GetJArray(string property_name) + { + var jtoken = GetJToken(property_name); + + if (jtoken != null) + { + return jtoken as JArray; + } + + return null; + } + internal string GetString(string property_name) {