New C# Client Library: GW2SDK — Guild Wars 2 Forums

New C# Client Library: GW2SDK

StevenL.3761StevenL.3761 Member ✭✭
edited May 18, 2019 in API Development

Hello,

Most probably don't remember me but I used to co-author a C# library that provides an abstraction for the GW2 API. Unfortunately changes in my personal life stopped me from working on it about 5 years ago and the project became no longer maintained. If you check out the NuGet page you can see that the last update was in 2015. And that update was mostly just for bug-fixes...

Rather than attempting to modernize an outdated library that's riddled with design issues (all my fault, of course) and outdated dependencies, I decided to take a fresh stab at it. I created a new Git repo and completely started over, using modern C# and .NET.

This discussion exists for me to find out what people are doing these days:

  • Are you currently using C#?
  • Are you interested in using an API client library written in C#, for C#?
  • Are you interested in collaborating on such a project?

My design goals for the library:

  • Provide an unopinionated API wrapper instead of an opinionated abstraction
  • Let you retrieve data, add just enough type-checking to keep you warm and then get out of your way
  • Follow a test-driven approach to add features (documented here)
  • Target .NET Standard 2.0 so you can use the library on a server, desktop, mobile or even an embedded device

Non-goals (A.K.A. things I know you'll eventually need but I refuse to build them):

  • Aggregating data, e.g. correlating recipes with items: you'll have to build this yourself
  • Resilience with circuit breakers and automatic retries: there will be a tutorial on how to do this with Polly
  • Custom timeouts: Polly can do this too
  • Caching: Polly

Operational goals:

  • Test code automatically
  • Merge after it is code-reviewed
  • Publish the library as a NuGet package in a continuous manner
  • Keep the lead time between API changes and package updates short
  • Powered by integration tests that compare real API data to static types
  • Run integration tests daily and notify collaborators whenever schema changes are detected
  • Build trust between collaborators. Everyone gets to participate in both coding and reviewing code (accepting/rejecting pull requests). Respect people from all walks of life. Respect differences in knowledge levels. No code-shaming.
  • Build trust with users by delivering high-quality, self-documenting code and delivering updates quickly

Vision statement:
I believe that software is not something you build once and then ship it off to users that you don't care about. Software is useless without users. Software needs to be operated like a machine. Code is vulnerable to wear and tear and can break in very similar ways if it isn't properly maintained.

If you share this mindset, you understand that a project like this is a pretty big commitment that I can't take on alone. For this project to succeed, I'll need people who are interested in this stuff and who can support my vision with actions, for the benefit of the GW2 community. If this sounds like you, please let me know.

Link: https://github.com/StevenLiekens/gw2sdk

Comments

  • StevenL.3761StevenL.3761 Member ✭✭

    Hey,

    It's been about a week without any replies. Perhaps my intro was too long. :) I'm still working on this but it's a LOT of work for one person.

    If you know C# and are interested in helping (by contributing/reviewing/testing code) then let me know in the comments or in-game mail.
    I've also created a Slack so we can chat!

    Slack invite: https://join.slack.com/t/gw2sdk/shared_invite/enQtNjM5MTY0ODE2MDQ4LTU2M2JjNmNiNTk1NDk3NzE5ZDYwMjgxNThhNWVjNGU1YWZmMGZjMjdkMWJhYWVjODQ5NjY4MDcwNTFiMzk4NDk

    Cheers!

  • StevenL.3761StevenL.3761 Member ✭✭

    Quick update: I'm still looking for devs so if you know some C# and want to help, don't be shy. :smile:

    I just finished configuring automated builds and releases.
    Link: https://dev.azure.com/stevenliekens/GW2SDK/_build?definitionId=1

    There's a private package feed with prerelease packages. Send me a message if you want access. :wink:

  • Hey Steven,

    Do you know if there is a lot of interest in this kind of library? And what is your own motivation to work on this project?
    I'm willing to contribute to this project once I have some more time (read; months) if there is really need for it.

    I myself have written some teamspeak verification bots in C# using the Gw2 API, but it only uses some specific calls. (Like maybe 5 different ones).

    Keep up the good work!
    Greetings,
    Mech

  • StevenL.3761StevenL.3761 Member ✭✭

    Hi Mech,

    I think the C# community here is very small so I haven't been able to gain much traction with other developers. I don't think that's because the idea is bad, there just isn't much C# development happening in this forum.

    My motivation for this library is that plain old C# isn't the greatest language for consuming web APIs. In JavaScript you have simple fetch() and JSON.parse() functions to consume APIs and the browser even takes care of GZIP encoding for you, no extra code needed. Things are much less simple in C#.

    In the end I hope people will use this SDK to build sites and services, mobile apps, desktop apps, game overlays, ... that hopefully have fewer bugs than what's currently out there. :grimace:

    I'm always open to contributions of any kind because this really is a lot of work for one person. You're welcome to join the Slack channel if you want to chat. :smile:

  • Hey Steven,

    Sounds like some good motivation to actually get this project done.
    I will be happy to contribute, I've quite some experience developing/architecting API related projects in C#. If you can message me an invite I will manage to join somewhere in the upcoming days. ;)

    Greetings,
    Mech