Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CSGSI/Nodes/BombNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public class BombNode : NodeBase
/// </summary>
public float Countdown { get; set; }

/// <summary>
/// The SteamID of the owner of the C4.
/// </summary>
public int Owner { get; set; }

/// <summary>
/// Initializes a new <see cref="BombNode"/> from the given JSON string.
/// </summary>
Expand All @@ -30,6 +35,7 @@ public BombNode(string json)
State = GetEnum<BombState>("state");
Position = GetVector3("position");
Countdown = GetFloat("countdown");
Owner = GetInt32("player");
}
}

Expand Down
16 changes: 14 additions & 2 deletions CSGSI/Nodes/MapTeamNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,22 @@ public class MapTeamNode : NodeBase
public int TimeoutsRemaining { get; set; }

/// <summary>
/// Unknown.
/// The number of matches clinched in the current series (used for BO3, BO5, etc.).
/// </summary>
public int MatchesWonThisSeries { get; set; }

/// <summary>
/// Name of the team (e.g. Clan name if all players have the same tag or FACEIT teams).
/// The number of rounds lost consecutively by this team (drawed rounds count as lost ones).
/// </summary>
public int ConsecutiveRoundLosses { get; set; }

/// <summary>
/// The abbreviation of the region of the team.
/// </summary>
public string Flag { get; set; }

/// <summary>
/// The name of the team.
/// </summary>
public string Name { get; set; }

Expand All @@ -31,6 +41,8 @@ internal MapTeamNode(string json)
Score = GetInt32("score");
TimeoutsRemaining = GetInt32("timeouts_remaining");
MatchesWonThisSeries = GetInt32("matches_won_this_series");
ConsecutiveRoundLosses = GetInt32("consecutive_round_losses");
Flag = GetString("flag");
Name = GetString("name");
}
}
Expand Down
5 changes: 3 additions & 2 deletions CSGSI/Nodes/NodeBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class NodeBase
/// <summary>
/// The data that was passed via JSON.
/// </summary>
protected JObject _data;
protected readonly JObject _data;

/// <summary>
/// The raw JSON string that was used to construct this node.
Expand All @@ -22,7 +22,7 @@ public class NodeBase
/// <summary>
/// Whether or not this node contains data (i.e. JSON string is not empty)
/// </summary>
public bool HasData => !string.IsNullOrWhiteSpace(JSON);
public bool HasData { get; private set; }

internal NodeBase(string json)
{
Expand All @@ -31,6 +31,7 @@ internal NodeBase(string json)
if (json.Equals("") || json.Equals("true", StringComparison.InvariantCultureIgnoreCase))
{
json = "{}";
HasData = false;
}
_data = JObject.Parse(json);
JSON = json;
Expand Down
7 changes: 6 additions & 1 deletion CSGSI/Nodes/WeaponNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ public enum WeaponType
/// <summary>
/// Melee weapons (such as hammer/wrench) in Danger Zone.
/// </summary>
Melee
Melee,

/// <summary>
/// Bump mine in Danger Zone.
/// </summary>
BumpMine
}

/// <summary>
Expand Down