JavaScript is required to use Bungie.net

Service Alert
Destiny 2 will receive an update tomorrow. Players will be required to log in to Destiny 2 again after installing the update. Please stay tuned to @BungieHelp for updates.

#Community

originally posted in:BungieNetPlatform
Edited by dazarobbo: 6/13/2015 10:26:24 PM
16

Open Source C# BungieNetPlatform Library

https://github.com/dazarobbo/BungieNetPlatform-CSharp - C# - Visual Studio ([url=http://michaelcrump.net/setting-up-github-to-work-with-visual-studio-2013-step-by-step]Git for VS tutorial[/url]) - JSON.NET via NuGet - Scope: all methods/endpoints provided by the bungie.net platform - Current code is migrated just from what I already had been working with, so it's very much incomplete and might have some odd things still in there I would really like to have this developed up to a point where it can be used for any bungie.net purpose (ie. forums, user accounts, etc...) and not just Destiny-related stuff. So if you have any C# experience and would like to contribute, please post below and we'll try to work out the logistics of it.

Posting in language:

 

Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

View Entire Topic
  • Since there are some people here, I'll give a quick overview of how it currently works. - Responses from bungie.net are JSON encoded, so that's why JSON.NET is included - Currently, class constructors take JObjects which are those parsed by JSON.NET from the response from bungie.net. Those constructors then do the conversion into C# and .NET types. [url=https://github.com/dazarobbo/BungieNetPlatform/blob/master/BungieNetPlatform/BungieNetPlatform/User.cs#L82]Example[/url]. The current code to do a lot of this is woefully incomplete though. - The classes do try to mimic the serialised objects from bungie.net as closely as possible (which I think it probably what we should aim for at the very least), but do and probably should also include any additional functionality that can be provided. [url=https://github.com/dazarobbo/BungieNetPlatform/blob/master/BungieNetPlatform/BungieNetPlatform/Tag.cs]Example[/url]. - Making requests to the Platform requires you pass a [url=https://github.com/dazarobbo/BungieNetPlatform/blob/master/BungieNetPlatform/BungieNetPlatform/RequestingUser.cs]RequestingUser[/url] object to each exposed service method in the [url=https://github.com/dazarobbo/BungieNetPlatform/blob/master/BungieNetPlatform/BungieNetPlatform/Platform.cs]Platform[/url] class. The reason for this is to manage any cookie values and other little bits of information you might need to send, although it's admittedly not the best design. This is also the mechanism I'm using to make authorised requests using an authenticated Google account, although you won't find [i]that[/i] code in there ;) - Since the Platform class is essentially a series of IO bound methods, they should all return a Task<T> from an async method. That's my view anyway. but obviously they shouldn't if for whatever reason it needs to be synchronous.. - The IPlatform interface Platform implements probably doesn't need to exist. I was just using it for WCF stuff with pipes. // What I would like to do is divide and conquer; split up implementing the classes into separate groups: forums, users, destiny, etc... and anyone willing to write up the code for a particular group or sub group can take it on board (assigned via GitHub to keep track of things though).

    Posting in language:

     

    Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

    2 Replies
    You are not allowed to view this content.
    ;
    preload icon
    preload icon
    preload icon