briandek / wowdotnetapi Goto Github PK
View Code? Open in Web Editor NEWC# .Net library to access the World of Warcraft Community Platform API
C# .Net library to access the World of Warcraft Community Platform API
Hi will your API support the AH Calls?
us.battle.net
eu.battle.net
kr.battle.net
tw.battle.net
battlenet.com.cn
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
Existing tests are really sanity tests atm ._.
Any reason you can't use native .net json handling?
Edit: System.Web.Script.Serialization.JavaScriptSerialize
Need to restructure the model folders for each explorer.
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
.
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!
Is there a reason for this?
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
CharacterTalent.CalcSpec
is declared as char
in Models/CharacterTalent.cs:28
. But calcSpec
can be completely empty (like here for example) and cause serialization exceptions.
Changing it to string
fixes the problem but I don't know if there are other and better ways.
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?
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
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.
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.
http://us.battle.net/wow/en/forum/topic/2878768583
The following locale values can be used in our regions:
us.battle.net
en_US
es_MX
eu.battle.net
en_GB
es_ES
fr_FR
ru_RU
de_DE
kr.battle.net
ko_kr
tw.battle.net
zh_TW
battlenet.com.cn
zh_CN
Need to cleanup/remove and update serialization using DataContractJsonSerializer
In order to limit the number of calls to the API endpoints, would enabling caching in JsonUtility.cs be beneficial?
Or maybe it should be implemented at a different layer?
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)
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.
Need to add;
[EnumMember(Value = "fury")]
FURY
to the CharacterPowerType enum located in CharacterClassInfo.cs
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.
Any objections altering tests to use Nunit trying to use Travis for CI
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.
All clients should be using HTTPS by default.
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.
Item ID = 72829 returns Item.Name = null and throws NullReferenceException
ie. when character/guild/realm not found - etc
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").
Research JavascriptSerializer Pascalcase/Camelcase serialization/deserialization.
Need consistency in terms of property naming.
Might need to swap to DataContractJsonSerializer ?
So there are several properties that return numeric values that can be mapped to enum structures. ie. Character Class, Race, Side, etc.
We should start looking into these as well as for the string properties where we can identify a set of options such as Realm Types(pvp, pve, rp..) or Realm population (low,med,high)
This thread of SO might be a good starting point
http://stackoverflow.com/questions/794838/datacontractjsonserializer-and-enums
As described in the title.
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
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.
Character/Guild/Realm
IComparable
EqualityComparer
Equals.
etc
http://support.microsoft.com/kb/320727
http://msdn.microsoft.com/en-us/library/ms173147.aspx
http://msdn.microsoft.com/en-us/library/ms132123.aspx
Getting the following exception on CN
https://battlenet.com.cn/api/wow/data/character/classes?locale=zh_CN
https://battlenet.com.cn/api/wow/data/character/races?locale=zh_CN
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Need a character/guild from CN Region to see that fails as well
references
http://forums.asp.net/p/1174025/1972251.aspx
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
Noticed it was throwing an exception. I'll take care of fixing it since I'm in there working on it, just wanted to get the bug logged here.
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
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.
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.
It's tedious process to have to manually update the nuget package on every change that comes in.
Any suggestions?
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)
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);
http://blizzard.github.com/api-wow-docs/#id3681959
No response yet from [email protected] on access/key
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.