Giter Site home page Giter Site logo

sirdoombox / overwatch.net Goto Github PK

View Code? Open in Web Editor NEW
34.0 10.0 13.0 1.65 MB

An unofficial player stats API targetting .NET Standard 2.0

Home Page: https://www.nuget.org/packages/Overwatch.Net

License: MIT License

C# 100.00%
overwatch netstandard

overwatch.net's Introduction

NO LONGER MAINTAINED - If anyone wants to take over, please feel free to contact me.

Overwatch.Net

An unofficial player stats API for the Blizzard game "Overwatch" - Targetting .NET Standard 2.0.

Build statusNuGet version

What is it?

A simple web scraper that grabs player stats from a users PlayOverwatch.com profile and parses it to be used however you like. It's written entirely in C# using AngleSharp to parse the data from the page. The only limiting factor is the speed at which the PlayOverwatch profile can be loaded.

Current Features

  • Supports PC, Xbox 1 and Playstation 4 players.
  • Entirely async
  • Serializable - No complex data.
  • Platform detection
  • Identifies and gracefully handles private profiles - parsing as much data as is available.
  • Finding player aliases where a player plays on multiple platforms.

Planned Features

  • None at the moment - Any feature requests will be placed here, however new features do make themselves into the library from time to time.

Dependencies

  • AngleSharp - Used to parse the data from the PlayOverwatch page as no other data source is available from Blizzard.
  • Newtonsoft.Json - Used to parse XHR requests for player aliases.

Usage

using(var owClient = new OverwatchClient()) // Initialising without an "OverwatchConfig" will use the Default config.
{
  Player player = await owClient.GetPlayerAsync("SirDoombox#2603");
  var allHeroesHealingDone = player.CasualStats.GetStatExact("All Heroes", "Assists", "Healing Done");
  IEnumerable<Stat> allHealingDoneStats = player.CasualStats.FilterByName("Healing Done");
  foreach(var stat in player.CasualStats)
  {
    string statHeroName = stat.HeroName
    string statName = stat.Name;
    string statCategoryName = stat.CategoryName;
    string statValue = stat.Value;
  }
}

NOTE: If you plan on making many requests over the lifetime of your application, I recommend keeping an instance of OverwatchClient around and disposing of it explicitly later.

Contact

If you wish to contact me about contributing to the project, or have any questions / suggestions please feel free to come find me on the C# discord server. - @Doombox#0661

Please report any issues or bugs that you may find at your earliest convenience so I can get them fixed ASAP.

overwatch.net's People

Contributors

moiph avatar scottrfrost avatar sirdoombox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

overwatch.net's Issues

The problem of the data of the never-played heroes.

If the user has never played some hero, then, the drop-down list for selecting hero on the playoverwatch stat page does not contain the item of the hero not played.

the method, PlayerStats.UpdateStatsFromPage, uses that list and omits the stats of the hero.
So the stats group object of the hero remain NULL and cannot access to the stats group.
It would be the obstacle when using the stats generally.

Require PhantomJS & Selenium to fully parse data that is loaded in from other sources.

It's not difficult to do, but the extra dependencies could be a problem so I'm putting this up here just in case someone specifically has an issue with that, otherwise I'll steam ahead and add those dependencies to the project.

This could noticeably slow down pageloads and therefore act to damage the performance of people who make a lot of requests all, for data that you may not want or need. I'll do my best to make it optional whilst highlighting data (via XAML docs) that is dependent on using the new libs so you can make a decision for yourself.

Ana not supported.

I no longer play Overwatch nor maintain this library so for the foreseeable future anyone who plays Ana will no longer be processed by the API.

Competitive Release Broke the API completely.

Thanks to the changes to Blizzards site in the wake of the competitive release, the API has been broken somewhat.

I'm working on a fix as we speak, hopefully it should be up sooner rather than later.

Player.Platform always returns PC

Player.Platform always returns PC, even for console players.

Very simple to reproduce:

  1. Create a new client
  2. Try to get a console player (Example: XBL zSuperSaiyanGod, PSN boomboom2k)
  3. Check the platform

Endorsements return non-whole numbers.

Another pesky Blizzard change for you to try to sort out.

Up until about yesterday endorsements would return whole numbers for each type of endorsement. Today, however, they return numbers below one. I believe these numbers are percentages because when they're added up, they always add up to one.

Unable to get any stats

The changes regarding TLS 1.2 seems to have broken lookups altogether for .Net Core.
I have tried on .Net Core 2.0 as well as .Net Core 2.1 and I get the same exception.

If it helps, I'm running Windows 10 and Visual Studio 2017 Community.

Sombra Stats

Doesn't display stats for the new hero 'Sombra'. Not entirely sure if this is just user error, or if there is an actual problem with this API.
untitled

TSL1.2 Support required by PlayOverwatch.com

It seems like everyone is dropping anything that isn't TSL1.2 in it's entirety, I continuously get TSL/SSL errors now so I'm trying an upgrade to Netstandard 2.0 to see if that solves it.

I hope it turns out to be some other kind of issue that I'm missing and I can revert to 1.1 but time will tell.

Player level and time played returning incorrect values.

More blizzard changes :(

Time played for QP and comp are wrong.
Player.CasualStats.GetStatExact("All Heroes", "Game", "Time Played").Value and Player.CompetitiveStats.GetStatExact("All Heroes", "Game", "Time Played").Value will return 0.
This isn't consistent, but for some players both QP and comp will be 0 while others will have one or the other return 0.

Player.PlayerLevel seems to not return prestige at all. For example, I'm level 655 (level 55 silver portrait with no stars) but only 55 is being returned.

I took a look around at other projects to see if I could find something that might help you patch this.
Looks like I was right about the prestige. Take a look at Fuyukai/OWAPI#251. Perhaps some of the information there can help you track down the issue and find a solution. I managed to find a project written in Go that has a patch for the prestiege changes; perhaps you could get the idea of what's going on there and implement it here. I'd write up a PR, but I'd probably end up breaking more than I fix.

I haven't found anything in other projects relating to the incorrect play times yet, so I'm assuming it's some internal thing going on with your library. If I find anything, I'll let you know.

Wrong player stats

Both CasualStats and CompetitiveStats are using List<> when it should be IEnumerable<> so that the extensions work.

Different errors

When I try running
OverwatchPlayer player = new OverwatchPlayer("kyle#12341", Region.US);
await player.UpdateStats();
Console.WriteLine(player.Stats.AllHeroes.Best.DamageDoneMostinGame)

I get: Additional information: OverwatchPlayer's Battletag is not valid - Format is 'User#1234`

So I try manually replacing the # with a - and it appears to work until it hits player.UpdateStats() and i get the message "Value cannot be null."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.