Steven Fuqua

Senior Software Engineer, Microsoft

Home

Project: League of Legends Wardrobe

Project page: Bitbucket

NOTE - this project is on indefinite hold due to major changes to how League of Legends handles item set data (Riot also implemented a similar interface in the official game client).

The LoL Wardrobe was a project I used primarily to learn WPF and tinker with scraping websites. It's a little known fact that the game League of Legends used to provide an API of sorts for customizing the 'Recommended' item loadout each champion sees in-game. This was handled through the use of INI files in the LoL data directory.

The project provided numerous interesting challenges. First of all, locating the data directory itself. LoL has a default install location, which I try first. Failing that, the installer sometimes sets a registry key with the directory's location. I consult that, or finally, prompt the user for the location and fail cleanly if need be. The directory requires a very specific structure, with a changing version number in the middle of the path. I had to account for this, and, again, fail cleanly if one of any number of things goes wrong.

Once the app has a hold of where to read/write data, it needs to populate its database of champions and items from the game. Other people solving the same problem provide dropbox links with text files, or implement a web service to keep the program up to up to date. My solution was to scrape the game's official website, which I've noticed is well maintained and cleanly formatted.

The network scraping provided a new set of challenges, and I had a lot of fun writing a robust, maintainable library for extracting data from the HTML in multithreaded fashion, while providing an on-disk cache for performance when executing in the future. Along the way I got to learn all about WPF databinding, themes, implementing my own controls, and a great deal more.

Technology Leveraged

  • WPF (C# + XAML)
  • LINQ
  • .NET 4 parallelism API
  • HTTP

Challenges Faced

  • Learning WPF/XAML
  • Scraping/parsing Riot's website for up-to-date champion and item data
  • Properly leveraging GET requests to get cached data as appropriate
  • Locally caching retrieved data for performance
  • Synchronizing cached and scraped data in real time without blocking the user
  • Best effort at locating the League of Legends data directory without user effort