Showing Posts For StevenL.3761:

GW2Shinies using Transactions API

in API Development

Posted by: StevenL.3761

StevenL.3761

Well, while you’re at it, sorting on all columns please.

GW2Shinies using Transactions API

in API Development

Posted by: StevenL.3761

StevenL.3761

Awesome, thanks

Minor issue with X-Result-Total

in API Development

Posted by: StevenL.3761

StevenL.3761

That kinda looks like a car license plate.

API key group size pattern

in API Development

Posted by: StevenL.3761

StevenL.3761

For now, this is the formal definition: 1 to 72 US-ASCII characters.

Minor issue with X-Result-Total

in API Development

Posted by: StevenL.3761

StevenL.3761

Well, we use a stupid C# json framework that doesn’t allow specifying an initial capacity for collection types.

Minor issue with X-Result-Total

in API Development

Posted by: StevenL.3761

StevenL.3761

It’s just saying that the response contains 3 objects out of 41110 known objects. I won’t argue its usefulness, but I wouldn’t call that result unexpected.

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

One important thing to note is that X-Result-Count is not necessarily the number of requested items.

For example: https://api.guildwars2.com/v2/items?ids=12452,quack,28445

The request contains 3 identifiers, but the result count is 2.

(edited by StevenL.3761)

GW2Shinies using Transactions API

in API Development

Posted by: StevenL.3761

StevenL.3761

I meant that I want to see how my offer compares to offers by other players.

I made a mockup of what I meant, in case you still don’t get it. See the attached image.

In this image, I’m selling a Bandit Trident for a little over 1 gold. I started this auction 1 week ago. Over the last 7 days, the market has moved, and the top selling offer is now below 1 gold.

This information is very relevant, even if you’re not a power trader. Right now, it’s a pain to find that information for each transaction.

Attachments:

GW2Shinies using Transactions API

in API Development

Posted by: StevenL.3761

StevenL.3761

If you want to be safe, the formal definition of an email address specifies a maximum length of 254 characters.

GW2Shinies using Transactions API

in API Development

Posted by: StevenL.3761

StevenL.3761

I meant that I want to see how my offer compares to offers by other players.

GW2Shinies using Transactions API

in API Development

Posted by: StevenL.3761

StevenL.3761

Very cool.

Could you add a column that displays the current best offer? Right now, you have to make a mental note of your transaction, then click the item to see the current best offer. There is no side-by-side comparison.

Items only exist in commerce/prices?

in API Development

Posted by: StevenL.3761

StevenL.3761

Let’s just wait and see what the devs have to say about this. Sounds like this should be in the API, so who knows why it isn’t.

Items only exist in commerce/prices?

in API Development

Posted by: StevenL.3761

StevenL.3761

Convert the item identifier to a chat link and paste it in-game to find out what item is attached to that identifier. It’s usually some item that is supposed to be unobtainable.

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!

Will "Heart of Maguuma" be continent nr.3?

in API Development

Posted by: StevenL.3761

StevenL.3761

Is there any chance that we (API forum users) could get a guaranteed invite for the closed beta test? For you know… testing purposes…

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: 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

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)

Challenge - crafting profits calculation

in API Development

Posted by: StevenL.3761

StevenL.3761

I think it would be more interesting if you could punch in the number of items that you are planning to craft. It should then give you detailed instructions and statistics for the first, the second, the third,… all the way to the last item. If instructions and statistics remain the same for several items in a row, then they should be grouped together.

For bonus point: plot the overall returns on a graph

(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

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

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?

Enable keep-alive and pipelining?

in API Development

Posted by: StevenL.3761

StevenL.3761

I always thought that the problem with ids=all is that it runs synchronously. I don’t experience any server hiccups when I send hundreds of smaller requests (200 ids) in parallel. Shouldn’t synchronous requests for the same data actually be less demanding?

Unless the problem is that you buffer every json response in memory before you start writing to the underlying socket. I don’t know how difficult it would be to stream the response, but that would give you an immediate, noticeable performance boost.

Corsair K70 Question

in API Development

Posted by: StevenL.3761

StevenL.3761

Well, you could create a new shared memory file not related to mumble and give us the structure

+1

Please?

Corsair K70 Question

in API Development

Posted by: StevenL.3761

StevenL.3761

Yeah. I suspect that the game client generates images with drawn text, so that the Logitech software has to do nothing other than render the images at a specified position.
You could use OCR to get the actual text, but we’re skipping too far ahead.

Corsair K70 Question

in API Development

Posted by: StevenL.3761

StevenL.3761

Here’s a nice visual representation of how it’s supposed to work (taken from a piece of SDK documentation).
https://i.imgur.com/ZWXGZzb.png

Here’s an adjusted version of where and how GW2HUD hijacks this process.
https://i.imgur.com/Vpqysex.png

Source: https://github.com/Fire-Dragon-DoL/CsLglcd/tree/master/CsLglcd/Pdf

Attachments:

Corsair K70 Question

in API Development

Posted by: StevenL.3761

StevenL.3761

The phsycial LCD disconnect only applies to Logitech keyboards, so that shouldn’t be an issue.

Just to be safe, you could activate the official Logitech DLL from your custom DLL in order to forward game data and still keep the physical LCD display working.

So, now, how would we implement that DLL? The real DLL exports the following functions…

  • DllRegisterServer
  • DllUnregisterServer
  • GetInterface

The first two are specific to COM programming (used by regsvr32). The third one, I don’t know. Is anybody with COM programming experience willing to take a stab at this?

(edited by StevenL.3761)

Corsair K70 Question

in API Development

Posted by: StevenL.3761

StevenL.3761

Figured it out. When you install the “Logitech Gaming Software” application, it creates the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{fe750200-b72e-11d9-829b-0050da1a72d3}\ServerBinary

The value of this key is a path to the LCD’s API library. On my machine, the value is: C:\Program Files\Logitech Gaming Software\SDK\LCD\x64\LgLcdApi.dll (yours may differ)

Presumably, the game client uses this registry key to locate the entry point for the LCD. Replace the path with a path to any other DLL, and the game client will use that path as the entry point instead.

Beware that for people who actually have a keyboard with an LCD, this hack will disable communication between all games and the physical LCD.

Side note: you probably don’t need to install the LGS software. Just create the registry key manually.

(edited by StevenL.3761)

Corsair K70 Question

in API Development

Posted by: StevenL.3761

StevenL.3761

Oh, wow. I’ve had that SDK installed on my computer for months without even knowing it. Let’s see what I can find.

(…)

Hmm… I think that the way to do it is to create a DLL (written in native code) that exports the same interfaces as the Logitech keyboard software. Then, somehow, you have to trick the game into calling your DLL instead of a Logitech DLL. What your DLL does with the data is up to you.

(edited by StevenL.3761)

Corsair K70 Question

in API Development

Posted by: StevenL.3761

StevenL.3761

Well… I still don’t know how they did it. I can’t find any documentation on the matter. Not even a reference to the existence of the API behind it. Seems like gw2hud was an inside job(?)

Corsair K70 Question

in API Development

Posted by: StevenL.3761

StevenL.3761

I don’t know how, but it’s possible to tap into data that is meant to be consumed by certain types of gaming keyboards.

Here’s an example of how this can be used: http://www.gw2hud.com/

If anyone actually knows how to do this in code, that would be awesome.

[API Suggestion] Server Time

in API Development

Posted by: StevenL.3761

StevenL.3761

For pure client-side applications, use the operating system’s time zone setting.
Is your application written in HTML/JavaScript? In that case, asking for user input IS actually the right thing to do.

By the way, the GW2 API is also a third party server. The user’s client app is the first party. Your server is the second party. Any other server is third party.

Data Types

in API Development

Posted by: StevenL.3761

StevenL.3761

Dyes and recipes are one of the “interesting” inheritance issues that I was talking about in one of my previous posts. They don’t have their own data structure, but the ‘color_id’ field and the ‘recipe_id’ field depend on ‘unlock_type’ having a specific value.

With that in mind, you would want to split them out into separate tables just so that you can apply a NOT NULL constraint to these fields.

(edited by StevenL.3761)

[API Suggestion] Server Time

in API Development

Posted by: StevenL.3761

StevenL.3761

What do you mean by schedule? If you mean boss rotations and daily resets, then those are all UTC-based. So you only need the current UTC time and the current timezone’s offset (relative to UTC) to calculate a localized schedule.

Data Types

in API Development

Posted by: StevenL.3761

StevenL.3761

Okay… now how do I create a view in SQL that flattens the table hierarchy?

I don’t know how to join the [items] table with one of the many sub-type tables based on the actual values in the [item_type] column.

Someone on stackoverflow suggested left outer joins, but it doesn’t look quite right to me
https://gist.github.com/StevenLiekens/4b66c22ffd1b92e5d498

(edited by StevenL.3761)

[API Suggestion] Server Time

in API Development

Posted by: StevenL.3761

StevenL.3761

Try this: http://www.timeapi.org/utc/now

There is a use case for something like this. For client applications, the operating system’s clock is not necessarily accurate when compared to the game’s clock.

(edited by StevenL.3761)

Changes to API with HoT expansion?

in API Development

Posted by: StevenL.3761

StevenL.3761

Depends on what you consider to be a breaking change. I consider adding new types of data structure to be a breaking change. By data structure type, I mean any object with a ‘type’ discriminator field, and a string constant value to indicate the actual type contained within the data structure.


{
	"type": "constant_value"
}

 
Some examples…

We already know that there will be a new competitive game type. For the items API, that means that all items will have their ‘game_types’ array updated to include the new game type. That could be a breaking change, depending on how you handle game_types that were previously unknown.

We also know that there will be a new borderlands map. This affects the ‘match_details.json’ API. There will be a new borderlands type for that API, and it’s not unthinkable that this map could have match_details that the other maps don’t. This is always a breaking change.

(edited by StevenL.3761)

Mobile "armory"

in API Development

Posted by: StevenL.3761

StevenL.3761

Try Dulfy Database

http://db.dulfy.net/search/

It has some very well thought-out filter options. You can use it to find equipment with certain stat combinations. As an example, here’s a list of all lv 80 heavy boots of exotic rarity with Berserker’s stats: http://db.dulfy.net/search/0/80-80/armor-boots/exotic/0/power,precision,critdamage,heavy/0/0/

Data Types

in API Development

Posted by: StevenL.3761

StevenL.3761

Oh okay. Then it only makes sense for me to allow unbounded strings in my own database.

One more question: do you use a table per type or a table per hierarchy?

I’m asking because the items API has some… interesting… inheritance issues. Do you store all items in a single table regardless of the item type? Or do you have a table for each type? What about subtypes?

The most interesting of all items are probably the unlocker consumables. They have an ‘item_type’, a ‘consumable_type’ and an ‘unlock_type’.

Data Types

in API Development

Posted by: StevenL.3761

StevenL.3761

Huh? There’s a better way to store all this data?

Data Types

in API Development

Posted by: StevenL.3761

StevenL.3761

This has been suggested before (I don’t remember where), but can we get more information about the data types used by the backend’s database? Replicating a database without the original schema takes a lot of guesswork. I’m talking about data type lengths, nullability (is that a word?), default values, and also any other sort of column constraint.

(edited by StevenL.3761)

Item's Karma and Other Currency Cost

in API Development

Posted by: StevenL.3761

StevenL.3761

^ This would make a great addition to the the floors API. Maybe consider it for /v2/floors?

Item's Karma and Other Currency Cost

in API Development

Posted by: StevenL.3761

StevenL.3761

Same question for other currencies (dungeon tokens, bandit crests, …).

Guide to the Black Lion Trading Co API

in API Development

Posted by: StevenL.3761

StevenL.3761

Does that imply that we should get faster loading times now than back when the updated TP was launched?

Guide to the Black Lion Trading Co API

in API Development

Posted by: StevenL.3761

StevenL.3761

Assuming that the original ncplatform APIs were reverse-engineered using web debugging proxies, what is stopping anybody from doing the same for the updated trading post?

How to determine if an event is active

in API Development

Posted by: StevenL.3761

StevenL.3761

World bosses are on a fixed rotation. The exact time table was posted as part of a game update’s release notes somewhere back in april. I believe that Dry Top event rotations are also fixed, but no official time table is available. For every other event, there’s currently no way to retrieve their state.

/v2/commerce/listings returning invalid ID's?

in API Development

Posted by: StevenL.3761

StevenL.3761

You’re doing the extra call to /items for each ID separately?

[Feature Request] HTTP HEAD

in API Development

Posted by: StevenL.3761

StevenL.3761

Actually, if you could provide the same data as JSON, that would make me even happier. Something like this:

GET /v2/items/context

{
“page_size”: 50,
“page_total”: 785,
“result_total”: 39221
}


GET /v2/items/context?page_size=200

{
“page_size”: 200,
“page_total”: 197,
“result_total”: 39221
}


If you can make that happen, just forget that I even mentioned HEAD support.

The reason why I need this data is to figure out how many threads I have to spin up to retrieve all pages in parallel. Downloading the entire first page just to get those X-Page numbers is too much overhead.

Commerce API: "all ids provided are invalid"

in API Development

Posted by: StevenL.3761

StevenL.3761

(edited by StevenL.3761)

Commerce API: "all ids provided are invalid"

in API Development

Posted by: StevenL.3761

StevenL.3761

Suppose that I’m the first and only person to offer +15 agony infusion for sale. That would open up bidding for everyone, right? Considering that there is only a single object for sale, it would probably be gone within minutes, but bidding continues. Did the system succeed in preventing people from influencing the market?

Commerce API: "all ids provided are invalid"

in API Development

Posted by: StevenL.3761

StevenL.3761

Yeah. It’s easy enough to just catch the error and assume that the price is 0 gold, since that’s what the return value would have been. Still, it’s fun to think about these things.