Giter Club home page Giter Club logo

wowdotnetapi's People

Contributors

33pda avatar briandek avatar chrisb92 avatar fristi avatar grepster avatar harleycarter1234 avatar jamesmcconnell avatar jimmble avatar jsassner avatar lairdstreak avatar mjdean1994 avatar mythos avatar tehmufifnman avatar theeadie avatar zakamurite 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

wowdotnetapi's Issues

Minor Code tweaks for the API

Hi All!

Firstly, great work done so far on the API. Nicely done!

My intensions, in using this API, is to wrap it up in a Dotnetnuke module. In testing it, I just found some minor code snippets which are in need of changing for the project to build correctly wthin the Module.

The following code, found within both the GuildUtility.cs and CharacterUtility.cs files, could be changed from:

"query += string.Join(",", tmp);" towards "query += string.Join(",", tmp.ToArray());"

I would love to help out where possible, however, I am an old school VB6 guy using this as a project to learn C# on the .Net plateform. My expertise is far from perfect.

Roger

Relies on Newtonsoft

Any reason you can't use native .net json handling?

Edit: System.Web.Script.Serialization.JavaScriptSerialize

The value '7.467368' cannot be parsed as the type 'Int32'

Hello,

first of all I want to thank you very much for all the work you put in this project.

The following test fails with System.NullReferenceException: Object reference not set to an instance of an object.:

    [TestMethod]
    public void TestMethodNahrilol()
    {
        WowExplorer we = new WowExplorer(Region.EU, Locale.en_GB);
        Character character = we.GetCharacter("aegwynn", "nahrilol", CharacterOptions.GetEverything);
        Assert.AreEqual(character.Class, WowDotNetAPI.Models.CharacterClass.WARRIOR);
        Assert.AreEqual(57, character.Stats.Int);
    }

we.ErrorInfo.OriginalException.Message is "There was an error deserializing the object of type WowDotNetAPI.Models.Character. The value '7.467368' cannot be parsed as the type 'Int32'." and we.ErrorInfo.OriginalException.Source is "System.Runtime.Serialization".

URL to this character.
7.467368 is his mainHandExpertise and offHandExpertise.

Feature Request: Convert JSON text from file to Character

Sorry in advance if this is already possible and I just didn't see it. I didn't see a public forum or other way to ask you, so I thought I'd file this Issue.

Request: I'd like to read a file representing JSON saved from the Battlet.NET API and have WoWDotNetAPI consume that instead of getting the data live.

Why: What I use WoWDotNetAPI for is to look up characters in a simple winforms app - initially, I just want basic data. Depending on what I see, I may look deeper - looking at talent specs, gear, etc. To make this faster, I download all the data at once (CharacterOptions.Everything) and store it in a file, then only update from the web once a day or if I click my 'force update' button. (This will be the second version of my program, the first version used the XML from the old wow armory.)

Thanks for your hard work on WoWDotNetAPI!

No need for caching lists / objects?

Do we need to even have a cached object for each Explorer ?
leave caching to user?

ie. RealmExplorer has a List of Realms
CharacterExplorer has a Character object
GuildExplorer has a Guild object

Authenticating Problem - "Invalid application signature."

Has anyone tried the API's Authenticating with your issued Private and Public Keys?

I am testing the Keys on my Console, and Blizzard's server responds with "Invalid application signature."

The Code seems to be correct, and my Keys are all valid... Any suggestions?

Define enum mappings

Possible additional enum mappings for itemQuality and faction Standing need to be defined - ie. 4 stands for Epic, etc.

Not documented atm so might need to look at the wowarmory

Object not set to a reference

Hi

Please could you confirm if the API is working correctly. i am able to get all characters in a guild, but character info and a few others are not getting any info. used to work. but seems like since MoP the API is not working.

Regards
Bradley.

GetAuctions Issue

Currently when you run GetAuctions it bypasses the first query and goes directly to the auction file. This results in a 404 error due to the way the server handles the request. You must first issue an auction request via:

host + "/api/wow/auction/data/" + realm

This will return the path to the auction file, which is currently correct in the API, and when you request it the request will be successful.

The type or namespace 'Auctions' could not be found.

Did I sync Git wrong?

(CoreCompile target) ->
WowExplorer.cs(233,16): error CS0246: The type or namespace name 'Auctions' could not be found (a
re you missing a using directive or an assembly reference?) [C:\git\WowDotNetAPI\Explorers\Explorer
s.csproj]
Interfaces\IExplorer.cs(31,9): error CS0246: The type or namespace name 'Auctions' could not be f
ound (are you missing a using directive or an assembly reference?) [C:\git\WowDotNetAPI\Explorers\E
xplorers.csproj]

0 Warning(s)
2 Error(s)

Proper exception handling

I know that there was a previous issue regarding this which has since been closed, but no real solution was posted. I've been doing some tinkering and some thinking, as well as looking at the suggested solutions, and I think I have what I consider to be a good idea.

One of the suggestions was to wrap all requests in a single object containing the error code, error reason (from the API), as well as the requested object. This idea is a good one, but would require a massive overhaul to the current framework. It's a good idea, but not necessarily an elegant one.

The other idea, which I like the more I think about it, is to store the error in the WowExplorer class itself. Since the framework as it stands right now throws a custom exception containing an ErrorDetail object for just about everything, implementation would be as simple as adding an property of type ErrorDetail to the WowExplorer class, and wrapping all calls in the class in a try/catch. If the request bombs, we grab the ErrorDetail object from the exception, set it in the WowExplorer class, and put the onus on the developer to check this property whenever a call is made.

I think this is best because it requires very little rewriting of the framework as it stands (outside of wrapping all existing calls in a try/catch), and it requires nothing more of the developer consuming this framework than checking the error detail property after every call.

The idea is to fail gracefully and avoid YSOD's whenever possible. If anyone has any comments/suggestions/criticisms with this idea, please post them here. I'll give this issue a few days to generate some conversation before I begin implementing on my end.

Thanks for your time. I know it's a bit TL;DR, but I've always been a very thorough communicator, and like to make sure I address all points effectively.

Use of flags instead of bools for retrieving guild/character optional fields

Having to type 13 bools for retrieving optional fields for a character is rather cumbersome and prone to mistake ("is my true in the good place or off by one ?").
For example, an enum with values in the form of 2^n (1, 2, 4, 8, 16, 32, ...), and then combining them in the form of
Character c = (new WoWExplorer(region)).GetCharacter(realm, charName, CharField.Stats | CharField.Talents);
would be nicer than a false, true, true, false, false, false, false, false, false, false, false, false, false as trailing parameters.

Sample project ERROR

Hello, I try WowDotNetAPI sample, but get error...

Additional information: Could not load type 'WowDotNetAPI.WowExplorer' from assembly 'WowDotNetAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Thank you for help.

5.0.4 Changes

As an FYI there are some changes that need to be made in response to patch 5.0.4. I am working on it but it might be a few days. Until then you might run into some issues with Achievements, Characters and Character Talents. I will update this issue and close it once the changes are synced into the library.

Feature request : lastModified parameter in GetGuild/GetCharacter

Blizzard puts a limit on requests made by day to the API and encourage "good behavior" by allowing more queries. The main "good behavior" cited is the use of Last-Modified header in the requests (source : WoW Forums - Community Platform API - Applications, rate limits and throttling ).

This Last-Modified information is present in the base Guild et Character objects (LastModified property stored as long in Guild and string in Character (I suspect them to be a javascript date object)) and thus can be stored by the application using this API.
It would be useful to be able to pass this parameter to the GetGuild and GetCharacter functions.

I think this request can be done only after doing issue #13 ("Need better exception handling").

JavascriptSerializer Pascalcase/Camelcase

Research JavascriptSerializer Pascalcase/Camelcase serialization/deserialization.

Need consistency in terms of property naming.

Might need to swap to DataContractJsonSerializer ?

Fix for failing test: Failed Get_Realms_Using_Sending_Null_String_List_Returns_Empty_Lists Explorers.Test Test method Explorers.Test.USRealmExplorerTest.Get_Realms_Using_Sending_Null_String_List_Returns_Empty_Lists

This may have been fixed and not pushed, but I'm getting my feet wet on this project.

The test Failed Get_Realms_Using_Sending_Null_String_List_Returns_Empty_Lists and associated tests fail because the IEnumerable has not been instantiated therefore the test throws an exception rather than passing.

Patch file in a gist https://gist.github.com/1089490

Item Random Enchantment are not retrieved correctly

Hello,

I've just downloaded your API and found it great.
But I think, I've found a issue.

When I retrieve a character with the "CharacterOptions.GetItems" option, some item stats are not present.
I've searched a bit and found that the items that are wrongly retrived are described as having "Random Enchantment" on wow head.

for exemple:
stats from http://www.wowhead.com/item=98137 are retrieved correctly
but form http://www.wowhead.com/item=95681, only Armor, Agi & Stamina are retrieved.

I hope this is not a limitation from Wow Api.

Handling of the 404 Error Header Response

Hi all,

This is not an issue with the code itself per se; but more so with me, as I am unable to handle the 404 error when retrieving character fields from a user who's account is deemed dormant by Blizzard.

I see the error is being properly handled via an exception as per the Jason Utility. However, how do I recover from this exception when iterating through the Guild's membership?

In searching the Forums Straton made the suggestion:

"This is definitely a case where you want to store and track the last modified header and use it in subsequent requests. As the first pull will fetch the entire guild, later requests for characters that haven't updated or changed that use the last modified header will return a cached response and allow you to make additional calls toward your daily limit." (http://us.battle.net/wow/en/forum/topic/2957166127)

Yes this could work, and perhaps a partial resolution to Issue #22 (Feature request: lastModified parameter in GetGuild/GetCharacter), however, you would have to manually exclude members who were dormant upon that initial pull, while members who suddenly have become active once again would have to be manually reinstated. I cannot see a means to programmatically maintain the database should the application fail on a 404 header response.

As I must be missing something, any suggestions would be most helpful and welcomed

Old Auction Data?

Hi,

for some days I parse auction data with your API. Today I noticed that I always get the same set of auctions again and again.
I took a set of auction data from my program and compared it with the latest version via. Webbrowser and it was not there.
So where does this old set of auctions come from?
My fault?
Blizzards fault?^^

Realm is Anub'arak (EU) Fraction is Horde

Multistrike in CharacterStats is absent.

Hi,

the file WowDotNetAPI/Explorers/Models/CharacterStats.cs does not contain multistrike.

From the json file return by the following url:

https://eu.api.battle.net/wow/character/REALM/CHARACTER?fields=stats&locale=LOCALE&apikey=API_KEY

we can see:

[...]
"multistrike": 23.984848,
"multistrikeRating": 23.984848,
"multistrikeRatingBonus": 23.984848,
[...]

Probably add this code may fix the problem:

[DataMember(Name = "multistrike")]
        public double Multistrike { get; set; }
// etc...

Is it possible to add Multistrike to this ? Even if it isn't possible, I will try to make a pull request with fonctionnal and tested code.

PS: Sorry for my poor english level, english is not my mothertongue.

Encoding problem

When getting the roster via the guild, and then fetching each character using the guild.Members[].Character.Name, the Name is garbled, so the request returns a 404.
After checking the issued requests and corresponding answers, it seems the encoding used by battle.net is utf-8.
By setting WebClient.Encoding = System.Text.Encoding.UTF8; in the WoWExplorer constructor and using Encoding.UTF8.GetBytes instead of Encoding.Unicode.GetBytes in GetData<T>, the problem seems to be resolved.

API Migration

From the new https://dev.battle.net/ site release today:
"The existing Battle.net Community APIs are being migrated to a new host. The WoW, SC2, and D3 APIs hosted at *.battle.net/api are being moved to *.api.battle.net. We're also changing the protocol from HTTP to HTTPS."

Also an API key have to be added as an parameter to the library:
"When communicating with the community APIs using Mashery, you'll need to provide your API key in the query parameters of all requests as the "apikey" parameter."

Is this project still active? I'm using this as part of http://www.guildtoolkit.com (which is in RC state)

Wrong number of arguments for function string.Format()

You're passing the wrong number of arguments to function String.Format() in method GetItemClasses() in WoWExplorer.cs so query string parameters are invalid :)

string.Format(@"{0}/wow/data/item/classes/{1}?locale={2}&apikey={3}", Host, Locale, APIKey),
out itemclassdata);

Rogue line of code :)

Hi Brian,

I could not find the purpose for the following line of code within the Jason Utility:

req.Date = date;

Left over debris? If so, perhaps table it as part of your next cleanup. :)

Roger

PS, It always nice to see the fruits of ones efforts. You can see your API at work within my Guild's website: www.aoneth.com

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.