All Projects → innocenzi → LeagueReplayParser

innocenzi / LeagueReplayParser

Licence: other
C# library which can read some data from a .rofl file, and start a replay in the client. (no longer actively maintained)

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to LeagueReplayParser

KBotExt
Application that sends custom requests to League of Legends LCU api
Stars: ✭ 86 (+330%)
Mutual labels:  league-of-legends, lol, league, leagueoflegends
LeagueAPI
League of Legends API & Data Framework in Swift
Stars: ✭ 50 (+150%)
Mutual labels:  league-of-legends, league, leagueoflegends
Mecha
🚀 Debugger and plugin loader for the League of Legends client
Stars: ✭ 48 (+140%)
Mutual labels:  league-of-legends, league, leagueoflegends
Sentinel
👀 Native notifications for League of Legends
Stars: ✭ 38 (+90%)
Mutual labels:  lol, league, leagueoflegends
legendary-rune-maker
An automation app for League of Legends
Stars: ✭ 75 (+275%)
Mutual labels:  league-of-legends, lol, leagueoflegends
league-bot
A League of Legends bot to level up accounts. For best results use the settings required settings in the code/README. This bot is designed for Windows computers.
Stars: ✭ 19 (-5%)
Mutual labels:  league-of-legends, league, leagueoflegends
Timewinder
⏪ New stats with the old client.
Stars: ✭ 17 (-15%)
Mutual labels:  lol, league, leagueoflegends
Angourimath
Open-source symbolic algebra library for C# and F#. One of the most powerful in .NET
Stars: ✭ 266 (+1230%)
Mutual labels:  parse, parsing, nuget
MindCorpViewer
League Of Legends Model Viewer
Stars: ✭ 19 (-5%)
Mutual labels:  league-of-legends, lol, leagueoflegends
python-yamlable
A thin wrapper of PyYaml to convert Python objects to YAML and back
Stars: ✭ 28 (+40%)
Mutual labels:  parse, parsing
lol-pick-ban-ui
Web-Based UI to display the league of legends champ select in esports tournaments.
Stars: ✭ 181 (+805%)
Mutual labels:  league-of-legends, league
ChromaLeague
Java open-source Razer Chroma keyboard integration for League of Legends
Stars: ✭ 34 (+70%)
Mutual labels:  league-of-legends, leagueoflegends
golio
League of Legends API client written in Golang
Stars: ✭ 45 (+125%)
Mutual labels:  league-of-legends, lol
Parjs
JavaScript parser-combinator library
Stars: ✭ 145 (+625%)
Mutual labels:  parse, parsing
game apis
This repository is for integrating with different apis to allow you to pull player or game data
Stars: ✭ 24 (+20%)
Mutual labels:  league-of-legends, leagueoflegends
leagueoflegends
A command-line interface for League of Legends Esports.
Stars: ✭ 28 (+40%)
Mutual labels:  lol, leagueoflegends
league-toolkit
⚙️ A set of additional options for the updated League of Legends client.
Stars: ✭ 20 (+0%)
Mutual labels:  league-of-legends, lol
runeterra
Legends of Runeterra deck code encoder/decoder in JavaScript
Stars: ✭ 45 (+125%)
Mutual labels:  league-of-legends, leagueoflegends
Antlr4
ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
Stars: ✭ 11,227 (+56035%)
Mutual labels:  parse, parsing
desktop
Extendable calculator for the 21st Century ⚡
Stars: ✭ 85 (+325%)
Mutual labels:  parse, parsing

League Replay Parser

This is a library which allows you to easily parse a League of Legend replay file. Those files are default-located in your documents under League of Legends/Replays folder and have the .rofl (Replay of League) extention.

Getting started

GitHub release GitHub issues Github downloads   NuGet NuGet downloads

Installation

You will first need to install the library by either downloading it or installing it from NuGet.

Usage

At first, you will need to deal with the League object. It is the object that will give you informations about the installed League of Legends version and which will allow you to start a replay.

League

Initialization

First, instanciate it: League league = new League(@"C:\Riot Games");. It will check if the given repertory exists, and if not, it will throw an IOException.

You may overload League constructor with the replay directory: new League("@C:\Riot Games", @"D:\League\Replays");. By default, your replay directory is in your documents and the library will find it.

Also, League contains properties DefaultRiotDirectory and DefaultReplaysDirectory which contains the default paths for the game and the replays.

Loading replays

Once League is initialized, you will need to load the replays. It is recommended to load them asynchronously just in case you have a slow machine and the parsing take long enough to freeze an eventual UI.

// Async
await league.LoadReplaysAsync();

// Sync 
league.LoadReplays();

You can now access all available replays by using league.Replays property.

Starting replays

After getting your Replay object, you will be able to start it thanks to your League instance.

The following code will start all the playable replays in a row.

foreach (Replay replay in league.Replays)
  if (replay.CanBePlayed.GetDefaultOrValue(true))
    await league.StartReplayAsync(replay);

The nullable bool CanBePlayed property will return true if your League of Legends' version is equal (or lower but this should not happen, right?) to the replay's League version, but will return false if not or null if you never instanciated any League object.

In a simplier way, you can start a replay file by just using league.StartReplayAsync(@"C:\League\Replays\yourReplay.rofl");.

Replay

The Replay object contains some data about your replay file, such as informations about the two teams, their champions, their stuff, level, and other stuff.

// Display purple team informations
foreach (Player player in replay.PurpleTeam.Players)
{
    Console.WriteLine();
    Console.WriteLine($"› {player.PlayerName} as {player.ChampionName}:");
    Console.WriteLine($"   Level: {player.Level}");
    Console.WriteLine($"   KDA: {player.KDA.Kills}/{player.KDA.Deaths}/{player.KDA.Assistances} ({player.KDA.Ratio})");
    Console.WriteLine($"   Lane: {player.Lane.ToString()}");
    Console.WriteLine($"   Minion score: {player.MinionScore}");
}

Example code

As an example, this code will display some data from the first available replay file as well as the stats from the wining team.

League league = new League(League.DefaultRiotDirectory);
  await league.LoadReplaysAsync(Encoding.UTF8);

  Console.WriteLine($"League version: {league.Version}");
  Console.WriteLine($"Found {league.Replays.Count} replays.");

  if (league.Replays.Count > 0)
  {
      Replay replay = league.Replays[0];
      Console.WriteLine($"Looking out first replay.");
      Console.WriteLine($"League version: {replay.GameVersion.ToString()}");
      Console.WriteLine($"Game duration: {replay.GameLength.ToString()}");
      Console.WriteLine($"Winning team: {replay.WiningTeam.Side.ToString()}");

      foreach (Player player in replay.WiningTeam.Players)
      {
          Console.WriteLine();
          Console.WriteLine($"+ {player.PlayerName} as {player.ChampionName}:");
          Console.WriteLine($"   Level: {player.Level}");
          Console.WriteLine($"   KDA: {player.KDA.Kills}/{player.KDA.Deaths}/{player.KDA.Assistances} ({player.KDA.Ratio})");
          Console.WriteLine($"   Lane: {player.Lane}");
          Console.WriteLine($"   Minion score: {player.MinionScore}");
      }

  }

To-do

  • Instead of having only one replay directory, add multiple ones.
  • Get more stats and data from the replay file (I'll do that if you ask me).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].