Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
*Removed "Added" node, game isn't giving proper information there.
*Fixed MatchID crashing because of an int limit, switched to long
*Added "DOTA_GAMERULES_STATE_CUSTOM_GAME_SETUP"
Fixed hero level not showing up properly.
  • Loading branch information
antonpup committed Feb 13, 2016
1 parent 41804cf commit 5f69c81
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Dota2GSI/Dota2GSI/GameState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public GameState Previously
}
}

/*
public GameState Added
{
get
Expand All @@ -131,6 +132,7 @@ public GameState Added
return added;
}
}
*/

private String GetNode(string name)
{
Expand Down
2 changes: 1 addition & 1 deletion Dota2GSI/Dota2GSI/Nodes/Hero.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ internal Hero(string json_data) : base(json_data)
{
ID = GetInt("id");
Name = GetString("name");
Level = GetInt("level");
IsAlive = GetBool("alive");
ID = GetInt("id");
SecondsToRespawn = GetInt("respawn_seconds");
BuybackCost = GetInt("buyback_cost");
BuybackCooldown = GetInt("buyback_cooldown");
Expand Down
7 changes: 4 additions & 3 deletions Dota2GSI/Dota2GSI/Nodes/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public enum DOTA_GameState
DOTA_GAMERULES_STATE_POST_GAME,
DOTA_GAMERULES_STATE_PRE_GAME,
DOTA_GAMERULES_STATE_STRATEGY_TIME,
DOTA_GAMERULES_STATE_WAIT_FOR_PLAYERS_TO_LOAD
DOTA_GAMERULES_STATE_WAIT_FOR_PLAYERS_TO_LOAD,
DOTA_GAMERULES_STATE_CUSTOM_GAME_SETUP
}

public enum PlayerTeam
Expand All @@ -25,7 +26,7 @@ public enum PlayerTeam
public class Map : Node
{
public readonly string Name;
public readonly int MatchID;
public readonly long MatchID;
public readonly int GameTime;
public readonly int ClockTime;
public readonly bool IsDaytime;
Expand All @@ -38,7 +39,7 @@ public class Map : Node
internal Map(string json_data) : base(json_data)
{
Name = GetString("name");
MatchID = GetInt("matchid");
MatchID = GetLong("matchid");
GameTime = GetInt("game_time");
ClockTime = GetInt("clock_time");
IsDaytime = GetBool("daytime");
Expand Down
10 changes: 10 additions & 0 deletions Dota2GSI/Dota2GSI/Nodes/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ internal int GetInt(string Name)
return -1;
}

internal long GetLong(string Name)
{
Newtonsoft.Json.Linq.JToken value;

if (_ParsedData.TryGetValue(Name, out value))
return Convert.ToInt64(value.ToString());
else
return -1;
}

internal T GetEnum<T>(string Name)
{
Newtonsoft.Json.Linq.JToken value;
Expand Down
4 changes: 2 additions & 2 deletions Dota2GSI/Dota2GSI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyVersion("1.0.3.0")]
[assembly: AssemblyFileVersion("1.0.3.0")]

0 comments on commit 5f69c81

Please sign in to comment.