Showing Posts For Caldrick.6920:

API implementation library "master list"

in API Development

Posted by: Caldrick.6920

Caldrick.6920

Talus and I have created a .NET API written in C# that implements the full GW2 API.

Currently it provides a 1 to 1 object mapping of the current GW2 API resources. Essentially
item_details.json —> ItemDetailsEntry
guild_details.json --> GuildDetailsEntry
etc..

Some Features

  • 1 to 1 object mapping: GW2 API object —> .NET Object
  • Full Gw2 API implementation: GwApi
  • Gw2Stats.net API Implementation: Gw2Stats.Gw2StatsApi
  • Object caching with the ability to customize when caching is used per object type.
  • Minor custom Exception handling.
  • Logging: which can be enabled/disable
  • Mumblelink information which provides a player’s position: Gw2PositionReader

I’ve been working on a simple example project that will show how some of the code can be used including how one could produce a GW2 Map tracking a players position using GMap.NET.

check it out here https://gwapinet.codeplex.com/

[Mumble Link Suggestions] Downed,InCombat,etc

in API Development

Posted by: Caldrick.6920

Caldrick.6920


struct identity {
   wchar_t name;
   int           team_color : 2;
   int           health            : 16;
   int           supply            : 6;
   int           profession     : 2;
   int           state                : 2;
   int           commander : 1;
   int           combat          : 1;
   int           capturing      : 1;
   int           instanced      : 1;
}

This would result in a total of 8 bytes for the whole structure. I removed a few of the attributes as I found them to be mostly unusable like gathering (period is way to short) or dungeon which is more or less a duplicate of instanced. But of course all your fields could still be added which would add another 4 bytes due to byte alignment.

Agreed, this would be fine, assuming of course that the upper/lower bounds of the data are met. For example, aren’t there more than 4 professions?

[Mumble Link Suggestions] Downed,InCombat,etc

in API Development

Posted by: Caldrick.6920

Caldrick.6920

Hm, depending on what high frequency is the target, one could think about just using another transport mechanism for those, e.g. a “GWLink”, to meet the requirement of rare updates set by Mumble.
Personally I prefer the context blob method over the JSON string.
The last char of the character name being a null char? Putting that there should avoid messing up the mumble default gui with the data which would be nice indeed.
I guess in_combat could be added to state, saving a byte.

Indeed it is actually desirable to change the Identity information from a string to a binary structure. The main reason for this being the frequency of the updates. Currently the Identity isn’t updated regularly however, the IsCommander field might be switched often enough to warrant this information as binary so that the JSON string isn’t parsed for each access or in some update thread.

GW2's Mumble Link "context" data format

in API Development

Posted by: Caldrick.6920

Caldrick.6920

You guys did a good job tracking down most of it.

Here’s the whole thing:


// uniquely identifies a map instance for mumble
struct MumbleContext {
    byte serverAddress[28]; // contains sockaddr_in or sockaddr_in6
    unsigned mapId;
    unsigned mapType;
    unsigned shardId;
    unsigned instance;
    unsigned buildId;
};

Cliff,
Would it be possible to add in which floor the character is currently at? Each map seems to have different distances between floors, and some floor distances don’t appear to be constant on some maps.

It looks like they are divided into 1000 inch increments from the couple of maps that I’ve looked at.

(edited by Caldrick.6920)

API implementation library "master list"

in API Development

Posted by: Caldrick.6920

Caldrick.6920

Project Name: GwApiNET
Language: C#
Administrator: Caldrick.6920 ,Talus.1402
Website: https://gwapinet.codeplex.com/

Provides 1 to 1 object mapping and object data caching. Also allows custom data caching schemes.

Implementation for Gw2Stats API has also been implemented. Currently working on Maps Service utilities.

(edited by Caldrick.6920)