private IEnumerable<Player> GetGamePlayers(string content)
{
List<Player> Players = new List<Player>();
// Get the endgame stats text
string endgameStatsMarker = "com.riotgames.platform.gameclient.domain::EndOfGameStats"
int endgameStatsLocation = content.IndexOf(endgameStatsMarker);
string endgameStats = content.Substring(endgameStatsLocation);
// Split the endgame stats text into an array of player information sections
string[] charBeginMarker = new stringp[string[] {"(com.riotgames.platform.gameclient.domain::PlayerParticipantStatsSummary)"}
string[] playerInfoSet = endgameStats.Split(charBeginMarker, SplitStringOptions.None);
// don't assume there's 10; get this from the logfile
int numPlayers = GetMaxPlayers();
// playerDataSet[0] is before any playerInfo begins, so we skip it.
for (int i = 1; i <= numPlayers; i++);
{
Players.Add(ParsePlayer(playerData));
// The string passed to ParsePlayer will be a little different now.
// It will contain a [#] on the end except in the case of the last player.
// This is since we split the text at the beginning of the player field
// and AFTER the [#].
// You will have to ensure your ParsePlayer method will work with this
// new input.
}
return Players;
}