GW2.NET a .NET wrapper around the GW2 API

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: TehGear.8702

TehGear.8702

No problem, just wondered.

Besides, great work so far, thank you ;-)

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: Ruhrpottpatriot.7293

Ruhrpottpatriot.7293

MERRY CHRISTMAS FOLKS (or whatever you might celebrate these days)

Finally after months of hard work we have released version 0.9.12 of our popular library. Much has been done since the last version. Finally everything the ANet API has to offer is present in our library. You can query your Quaggans as well as you can use the integrated GW2 Mumble support.

But what has changed exactly? Now that’s too much to remember, but here are the key points:

  • Every endpoint covered
  • Unified query system for everything, safe some few nodes where appropriate documentation is written as you read this text here. You don’t have to keep in mind that the maps endpoint is queried in a different way than events, or items. We did the work for you, so you can code more efficiently and with less errors.
  • Many optimizations to the codebase. Now almost everything can run in parallel. This means, you can query the whole items database in around 30 seconds, opposed to the previous 15 minutes.
  • More strongly typed object, meaning less magic strings and thus even less errors than before.

But where to go from here on?
Sadly we have to announce that this release will be the last release for .NET 4. Operating systems based on XP or even older are in steady decline. With the release of Windows 10 in a few months XP will be more than 13 years old and it’s time to retire it. This and the move to open source for the .NET framework means a wider audience for .NET 4.5 and above. Of course we want to get the biggest user base we can have and this is not possible with .NET 4 anymore.
Therefore we will move to at least .NET 4.5 with the coming versions. We waited so long because we didn’T forget the XP users out there and we wanted to give them the best experience we could offer.
But as I already said: Windows 10 and an open source .NET framework put the nails in the coffin for the current framework version.

I know not everyone is happy about this, but it is final.

So long folks. Happy coding over your (hopefully) free days.

P.S. Yes I know the first post and the Codeplex site are not updated yet. This will happen in the next few hours and days.

Administrator of GW2.NET: GitHub , Forum , NuGet

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: Aerodin.2795

Aerodin.2795

Nice job guys. I know a lot of work went into this release, and it shows. Thanks for continuing to update and be active with your library!

Author of GW2 PAO

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: Ruhrpottpatriot.7293

Ruhrpottpatriot.7293

So I finally got to update the first post. Now with more information for everyone free of charge.

So that you know: We are currently implementing the last of the recently released endpoints. They should be finished in a week, not because they are so hard to implement, but it takes time and between university exams and a job most of the team is currently busy elsewhere.

Administrator of GW2.NET: GitHub , Forum , NuGet

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: StevenL.3761

StevenL.3761

I think that the NuGet package is outdated. This sounds like a bug that I fixed months ago in 0.9.12.1

Does the same code crash for any other repository besides QuagganRepository?

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: StevenL.3761

StevenL.3761

The Codeplex project page always has the most recent package. There are two ways to install the binaries.

1)
download the zip-file, extract the contents, and add references to GW2NET.dll and GW2NET.Core.dll to your project. Also add references to Json.NET (can use NuGet).

2)
download the nupkg file, move it to a directory somewhere memorable (e.g. C:\NuGet), add that folder as a NuGet package source in the NuGet package manager settings, then use the package manager to install the package from the local directory instead of the online NuGet feed

(edited by StevenL.3761)

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: StevenL.3761

StevenL.3761

FYI: we don’t filter unknown cultures like “th-TH”. Instead, we let the API decide which language to use for the response. For “lang=th”, the response defaults to English, so that’s what you get.

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: StevenL.3761

StevenL.3761

I’ll check it out.

Oh… yeah, the code is still broken. Seems that I didn’t fully understand the problem last time I came across this bug.

Update: a new package is available on the Codeplex project page. This package includes a fix for the null references in the QuagganRepository class.

(edited by StevenL.3761)

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: StevenL.3761

StevenL.3761

It works now, thanks : )
In Quaggans part the IDictionaryRange<string, Quaggan>.TotalCount property doesn’t work for me, it always shows 0.

I’ll check it out.

*In ChatLinks part when you decode I think you are using wrong type, it should be ItemChatLink not ChatLink, as it doesn’t have the ItemId property.

Decoding as ‘ChatLink’ is by design. The reason is because we use the same ‘Decode()’ method for all types of chat links, not just item chat links.

You can use a safe cast in combination with a null check to get the item identifier.


    int GetItemId(string chatLinkAsBase64)
    {
        var chatLink = ChatLink.Factory.Decode(chatLinkAsBase64) as ItemChatLink;
        if (chatLink == null)
        {
            return -1;
        }

        return chatLink.ItemId;
    }

Alternatively, you can use the generic ‘Decode<T>()’ overload. Beware that this method throws exceptions (I forgot which type) if the input is not an item chat link .


    int GetItemId(string chatLinkAsBase64)
    {
        try
        {
            var chatLink = ChatLink.Factory.Decode&lt;ItemChatLink&gt;(chatLinkAsBase64);
            return chatLink.ItemId;
        }
        catch
        {
            return -1;
        }
    }

(edited by StevenL.3761)

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: StevenL.3761

StevenL.3761

In Quaggans part the IDictionaryRange<string, Quaggan>.TotalCount property doesn’t work for me, it always shows 0.

I remember now. This happens because the quaggans API returns the X-Result-Count header, but not the X-Result-Total header. I’ll create a new issue on GitHub.

Edit
https://github.com/arenanet/api-cdi/issues/15

(edited by StevenL.3761)

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: darthmaim.6017

darthmaim.6017

This won’t compile, as chatLink.ItemId will be marked red due to declaration ChatLink chatLink and ChatLink class has no ItemId property.

It probably should be this:

ItemChatLink chatLink = ChatLink.Factory.Decode("[&AgHblwAA]") as ItemChatLink;

// Write to console, but of course you can use it wherever you want.
Console.WriteLine(chatLink.ItemId);

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: StevenL.3761

StevenL.3761

Ohhh… yeah, that’s an error in the documentation. Nice find!

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: Ruhrpottpatriot.7293

Ruhrpottpatriot.7293

I updated the Nuget feed to be the same version as the Codeplex page. Should work now too.

@Steven: If you update to a new version, send me a mail. There is a greater chance I’ll see that

Administrator of GW2.NET: GitHub , Forum , NuGet

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: Ruhrpottpatriot.7293

Ruhrpottpatriot.7293

So everyone. I haven’t posted here in a while, since I was busy with my university classes.
You can expect a new release this weekend. The release will NOT contain any of the new authenticated endpoints.

To clarify:
With the next release we are officially moving out of Beta and into version 1.0. This version will be the last to support the v1 endpoints. Future versions will throw a warning and at some point an error (expect this to be around 1.5 or so).
Of course this does not hold true for endpoints which are not yet available through the v2 interface.

Since 1.0 is a good foundation to implement bigger changes in the deployment process and the like, you will also see a change in Version numbers. From 1.0 onwards we are using semantic versioning so you can finetune which versions you want to use and which not.

As for the authenticated endpoints, expect them around 1.1 or 1.2, that will be released in a month or so (I hope).

Administrator of GW2.NET: GitHub , Forum , NuGet

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: Ruhrpottpatriot.7293

Ruhrpottpatriot.7293

It took us about a week, but we finally released version 1.0.0 of our popular library. We are sorry for the delay, but we had to fix some last minute issues so everything now and in the future is going smoothly.


  • Split the package into smaller packages to make updating and publishing more modular and therefore faster. See bottom of this post more more details!
  • Made GetParameters and GetPathSegment in DiscoveryRequest virtual so they can be used with the /v2/floors url style
  • Changed constructor of abstract class FactoryBase to protected
  • Stylecop fixes across the board
  • Added Support for v2/floors endpoint and made it publicly available although the api endpoint is currently disabled.
  • Added Support for v2/maps endpoint
  • Added Support for v2/skins endpoint
  • Added Support for v2/continents endpoint
  • Added Support for v2/files endpoint
  • Renamed WvW property in Factoryfor V1 to WorldVersusWorld
  • Added missing ObjectInvariant methods.
  • V2 Factories now implement RepositoryFactoryBase to reduce code repitition
  • Added obsolete warnings for all currently available v2 endpoints
  • Added an obsolete error for the v1 events endpoint since it is already disabled
  • Fixed some bugs in the request classes
  • Added interface and model class for v2/files since the old model/interface is not compatible with the new api layout
  • Updated StyleCop settings

Still there are some things to consider when upgrading:
First of all: We changed the ID of the NuGet package to be in line with the namespaces we use in the project itself. However updating from 0.×.x to 1.0.1 is still possible with a helper package. To use this helper package you don’t have to do anything besides updating your GW2.NET NuGet Package. The helper package is appropriately labeled and will download all required packages by itself. After the update process has been completed you can remove the helper package without consequences.

You then might notice that you have dozens of GW2.NET.xyz packages in your package manager. As already stated in the changelog we have split our one big package into multiple smaller ones so we can deliver updates more frequently in the future. This also allows users to modularise the packages according to their needs.
For erxample: A website which only displays WvW scores will definitely not need the items package. So the developers can simply download GW2.NET World versus World Matches and be done with it.
This of course requires more work form the user since he by himself has to create and maintain the repositoriesby himself, which is currently done by the GW2.NET main package, but this is not hard and documentation on this topic will be updated in the next weeks.

This said: For the masses of developers installing the GW2.NET main package is absolutely sufficient!

For anything else, just leave a message here or read the documentation over at Codeplex

And now: Happy coding

~~ Ruhrpottpatriot

P.S. We will be moving to another OSS provider in the near future. We will keep you appraised of that, should anything change for you.

Administrator of GW2.NET: GitHub , Forum , NuGet

GW2.NET a .NET wrapper around the GW2 API

in API Development

Posted by: Lone Wolf.4129

Lone Wolf.4129

Did anyone got this working with unity?

“The truth will set you free, but first it will piss you off.”