SourceCodeDude / n-battle-net-api

Automatically exported from code.google.com/p/n-battle-net-api
1 stars 0 forks source link

Can't get many of the BattleNetClient.Get* to work #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Using the following code :

using (BattleNetClient client = new 
BattleNetClient(BattleNet.API.WoW.Region.US))
{
    client.UseCache = false;
    Character ch = client.GetCharacter("Thunderhorn", "Femor");
    List<AuctionFile> auctions = (List<AuctionFile>)client.GetAuctions("Thunderhorn");
    Guild guild = client.GetGuild("Thunderhorn", "Chaos%20Theory");
    Image ic = client.GetIcon("inv_helmet_robe_dungeonrobe_c_03");
    Image tb =  client.GetThumbnail("thunderhorn/227/10569699-avatar.jpg");
    List<Realm> realms = client.RealmStatus(new string[] { "Thunderhorn" });
}

What is the expected output? What do you see instead?
I can't get any result except RealmStatus() and GetThumbnail().

GetCharacter, GetGuild each throw a NullReferenceException (according to the 
stack trace, this occur at the function that take a CharacterQuery / GuildQuery 
as parameter, or maybe deeper, but i can't step through as i don't have the 
source code)

GetIcon also throws a NullReferenceException at GetUrl(Uri url, Cache cache)

And GetAuctions return 0 results

What version of the product are you using? On what operating system?
I'm running Visual Studio 2010 (not SP1) on Windows 7 64bits (French edition), 
with .Net 4.0

Please provide any additional information below.
Maybe this is related to the previous cache issue, but it occurs even when 
caching is disabled.

I attached the exception caught from GetCharacter (in french, sorry for that)

Also tried to put locale to en-US with no success :
client.Locale = CultureInfo.GetCultureInfo("en-US");

Original issue reported on code.google.com by barra...@gmail.com on 5 Aug 2011 at 12:49

Attachments:

GoogleCodeExporter commented 8 years ago
what version of the library are you using.

Also, you shouldn't use %20 for the space.  The library will automatically 
change spaces to %20 correctly.

Original comment by shimmanning@gmail.com on 5 Aug 2011 at 1:23

GoogleCodeExporter commented 8 years ago
The first time i tried the library was v0.2.0.1, and already had the 
NullReferenceException.

It still crash with 0.3.0.0

I replaced %20 with a space, and still crash.

Original comment by barra...@gmail.com on 5 Aug 2011 at 1:28

GoogleCodeExporter commented 8 years ago
Ok, i downloaded the solution and now i'm able to debug.

When i call GetCharacter or GetGuild, the exception is raised by UnixTimestamp 
ctr.

i replaced :
time = DateTime.MinValue;
to :
time = DateTimeOffset.MinValue;

And now both functions work.

I think this is  timezone related
My computer is UTC +2

Original comment by barra...@gmail.com on 5 Aug 2011 at 1:53

GoogleCodeExporter commented 8 years ago
I forgot to add ".jpg" to the icon url, that's why it couldn't find it.

But the catch block for BattleNetClient.GetUrl(Uri url, Cache cache) failed (r 
is null), which throws an unhandled exception,

Original comment by barra...@gmail.com on 5 Aug 2011 at 2:01

GoogleCodeExporter commented 8 years ago
Both of these issues have been fixed in the newest source 

Changeset: 28 (912633d42290) 

Thank you for tracking it down

Original comment by shimmanning@gmail.com on 5 Aug 2011 at 2:06

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
see r912633d42290

Original comment by shimmanning@gmail.com on 5 Aug 2011 at 2:08

GoogleCodeExporter commented 8 years ago
Confirmed

Auction list is still empty, i keep searching why

Original comment by barra...@gmail.com on 5 Aug 2011 at 2:18

GoogleCodeExporter commented 8 years ago
im closing this issue as issue 11 is for the auction data not working

Original comment by shimmanning@gmail.com on 12 Aug 2011 at 1:49