Showing Posts For smiley.1438:

Items API "names" will be broken

in API Development

Posted by: smiley.1438

smiley.1438

Thanks for the heads up.

I have a feeling that something like this would happen after the big patch, so I downloaded all the items and recipes on Monday.

I’ll probably sound like a noob, but is there a simple way to download all the items and recipe details? /item_details.json and /recipe_details.json seem to only be capable of one item/recipe at a time, which would take a long time to get them all. I know about items.json, but that’s only the item_ids

If you’re into PHP, you might want to have a look at my database project: https://github.com/codemasher/gw2-database
The db created by this is basically the backend of http://gw2treasures.de (https://github.com/darthmaim/gw2treasures-webinterface) etc.

Megaservers and API

in API Development

Posted by: smiley.1438

smiley.1438

because they could be used to determine how many people are actually playing the game.

I wonder why this is such a secret anyway…

Simple but important ideas for HUD off play.

in API Development

Posted by: smiley.1438

smiley.1438

You win no prize at all because it’s the wrong subforum. Now that the game suggestions subforum has been closed, you should give it a try in the main GW2 discussion forum (or maybe a moderator will move the post there).

[API Sugestion] Profession Skills / Traits

in API Development

Posted by: smiley.1438

smiley.1438

Y U NO LOOK AT MASTER STICKY?
(in other words: there is already a thread)

https://forum-en.gw2archive.eu/forum/community/api/API-Suggestion-Skills-and-Traits/

(edited by smiley.1438)

Build number implications

in API Development

Posted by: smiley.1438

smiley.1438

for as long as the build number remains the same, will static data remain the same?
Do these sort of changes (always) require a new build?

A yes for both (or more a maybe for the latter).

Static data won’t change as long as the build id doesn’t but of course the “discovery” data does all the time.
A maybe for the changes after patch because at least renamings most likely occur for other languages than english – stat changes on items usually don’t occur unless they’ve been announced.

We’ve created a tracker for new discovered items as well as for renamed items (for all languages):

http://gw2wbot.darthmaim.de/rss/newItems/
http://gw2wbot.darthmaim.de/rss/renamedItems/

(edited by smiley.1438)

Player direction information

in API Development

Posted by: smiley.1438

smiley.1438

events near player in wwww?

in API Development

Posted by: smiley.1438

smiley.1438

WvW events are currently not listed in the API, so no.

(but i like the idea!)

Colors in WvW

in API Development

Posted by: smiley.1438

smiley.1438

Then you might want to revisit your code anyway

Pow Pow, Shots Fired! Man Down!

i lol’d!

https://twitter.com/thomasfuchs/status/445943530788503553

(edited by smiley.1438)

Colors in WvW

in API Development

Posted by: smiley.1438

smiley.1438

Then you might want to revisit your code anyway
I’d just need to change a single line if the order of the colors would change for whatever reason.

Colors in WvW

in API Development

Posted by: smiley.1438

smiley.1438

Edge of the Mists:
Updated the team colors for each of the major regions. Overgrowth is now green; Frostreach is now blue; Badlands is now red.

So NO API related changes.

[API Suggestion] Reflect source in map_floor

in API Development

Posted by: smiley.1438

smiley.1438

That’s how I’m doing it now, but it’s a hack. The ugliest one so far.

Redundant data is even uglier. Seriously.

[API Suggestion] Reflect source in map_floor

in API Development

Posted by: smiley.1438

smiley.1438

You have those values already in your request, where’s the problem to add these to the response object by yourself?

Forum Loading Issue - "Area Not Available"

in Forum and Website Bugs

Posted by: smiley.1438

smiley.1438

Forum Loading Issue - "Area Not Available"

in Forum and Website Bugs

Posted by: smiley.1438

smiley.1438

For the notes, i had this for the last 2 days (on Chrome). Has something been changed on the forums configuration? Never had that before. Also, please add a “clear the forum’s cookies” link to that error page if you can’t fix it – i won’t clear them manually every day, i’ll rather stop using the forums in the long run.

PHP SDK

in API Development

Posted by: smiley.1438

smiley.1438

invalid item id response for valid item

in API Development

Posted by: smiley.1438

smiley.1438

Why is the API missing items?

I guess I should add a [bug] to the title or something.

This is a well known problem and has already been reported multiple times – why not just use the existing thread for error reports?

https://forum-en.gw2archive.eu/forum/community/api/API-errors-bugs/page/2#post2899870

invalid item id response for valid item

in API Development

Posted by: smiley.1438

smiley.1438

As healix already pointed out, the “Recipe: Owl Amulet” is actually id 9565. I’ve just checked my local database for 9547 and it hasn’t ever existed in the API (even before the wipe). Also keep in mind that a lot of items (mostly from Karma vendors) are missing and just don’t show up.

Check either http://gw2wbot.darthmaim.de/smiley/ or http://gw2treasures.de (same database working there in the background)

API 2.0?

in API Development

Posted by: smiley.1438

smiley.1438

What about a GitHub repo so that we can discuss over there and eventually send pull requests?

API errors & bugs

in API Development

Posted by: smiley.1438

smiley.1438

https://api.guildwars2.com/v1/guild_details.json?guild_id=A2B136C5-B919-408F-8E47-5EDCD175D663

{
    error: 3019,
    product: 1008,
    module: 1,
    line: 561,
    text: null
}

HTML module for wvwvw scores in your webpage

in API Development

Posted by: smiley.1438

smiley.1438

the great thing about his stuff was that you can add it to a HTML block in guild sites/server pages. A little widget with the current matchup score.

you can’t really do any php with a guild host layout.

That wouldn’t be much of the problem i think – lets see what i can do for you

HTML module for wvwvw scores in your webpage

in API Development

Posted by: smiley.1438

smiley.1438

Something like this: http://gw2.chillerlan.net/examples/gw2wvw.php ?
https://github.com/codemasher/gw2api-tools
Btw. my stats/map page (http://chillerlan.net/gw2/wvw.html) is currently down because i moved to a different webhoster. I’ll do my best to get it back up on the weekend.

Mantle?

in API Development

Posted by: smiley.1438

smiley.1438

No, the API subforum is dedicated to the GW2-API only, suggestions regarding the game itself should be made in the respective subforums (see this post). So in your case possibly the main GW2 discussion forum, along with a more meaningful topic name like “AMD Mantle support?”

(edited by smiley.1438)

Mantle?

in API Development

Posted by: smiley.1438

smiley.1438

Sorry, but… wrong subforum. (too bad the suggestions forum has been closed)

API errors & bugs

in API Development

Posted by: smiley.1438

smiley.1438

https://api.guildwars2.com/v1/item_details.json?item_id=63853

{
    error: 10,
    product: 71,
    module: 2,
    line: 135,
    text: null
}

€: nevermind, it ran in with today’s update. I just wonder how these item IDs pop up about 24h before the actual update…

(edited by smiley.1438)

OData?

in API Development

Posted by: smiley.1438

smiley.1438

a proprietary web service API like what we have now.

Where exactly is a simple JSON response “proprietary”?

map_floor array > same key elements?

in API Development

Posted by: smiley.1438

smiley.1438

Protip:

INSERT IGNORE INTO `mytable`...

(you might want to have a look at this: https://github.com/codemasher/gw2-database )
;)

(edited by smiley.1438)

map_floor array > same key elements?

in API Development

Posted by: smiley.1438

smiley.1438

Floor 1/1 contains all the instance data too, so it’s possible that the same map_id shows up multiple times with different values. To circumvent this, use floor 1/2 instead

See also: https://forum-en.gw2archive.eu/forum/community/api/API-Bug-map-floor-multiple-entries-per-map

OK, so we found the cause of this bug. The underlying map floor content sometimes points to the incorrect map_id for a few map instances.

Since it’s a bug in the underlying content, it’ll take a little while for it to be fixed in a live patch.

At least you found a good workaround in the meantime, which is to read floor 2’s data instead.

(edited by smiley.1438)

OData?

in API Development

Posted by: smiley.1438

smiley.1438

which can return XML or JSON depending on the client headers

https://developer.mozilla.org/de/docs/HTTP/Access_control_CORS says

A simple cross-site request is one that:

  • Only uses GET, HEAD or POST. If POST is used to send data to the server, the Content-Type of the data sent to the server with the HTTP POST request is one of application/x-www-form-urlencoded, multipart/form-data, or text/plain.
  • Does not set custom headers with the HTTP Request (such as X-Modified, etc.)

So what exactly would be the advantage over typing a different file extension and adding some query parameters? There’s not much information in the link you posted.

Yeah, I’m also confused. As with the previous commentator, what problem are you trying to solve?

this.

also these:

Don’t get me wrong, but personally i’d kill XML with fire

Not to speak of the overhead XML has compared to JSON.

(edited by smiley.1438)

New Overwolf apps for GW2 - looking for ideas

in API Development

Posted by: smiley.1438

smiley.1438

Having trouble getting this working in OS X. Cliff, can you verify that the Mac client is writing values to the shared memory object just as the PC version does during its update loop?

If I have Mumble open on my Mac, I’m able to at least get an empty linker object. I didn’t think having Mumble was necessary, but either way, the linker object isn’t being updated with any game values.

It definitely won’t work on the Mac, unless you can hook into the transgaming win32 layer somehow. That’s probably very difficult to do, if it’s possible at all.

Are you sure that Mac overlay is using the Mumble API to get the position data and not some obscure hacks? (Cliff explained roughly somewhere else)

(edited by smiley.1438)

API errors & bugs

in API Development

Posted by: smiley.1438

smiley.1438

Stefan,

thanks for the clarification. So it turns out, the spanish names are even trickier than the others because of the “plural identifier” – i guess there’s an “s” being added like “de” -> “des”. So would it be possible to ignore the spanish grammar for a while and just replace the map name with a placeholder instead of an empty string so that we could simply use functions like sprintf()? Like so:

{
	"de": "%s Grenzlande",
	"en": "%s Borderlands",
	"es": "Tierras fronterizas de %s",
	"fr": "Territoires frontaliers (%s)"
}

If you could provide us a list of the “plural named” maps, you could even use numbered placeholders then:

{
	"de": "%1$s Grenzlande",
	"en": "%1$s Borderlands",
	"es": "Tierras fronterizas de%2$s %1$s",
	"fr": "Territoires frontaliers (%1$s)"
}

(edited by smiley.1438)

Edge of the Mists map tiles?

in API Development

Posted by: smiley.1438

smiley.1438

Wow, the tiles for EotM have finally arrived! But they are still missing for zoom level 6.
Speaking of missing tiles at certain zoom levels: the new Lion’s Arch map is also missing for zoom level 6 & 7.

€: seems like the EotM tiles for zoom 6 appearing slowly now… strange. Maybe a cloudfront caching issue (i have cleared my browser cache a couple of times now)

Attachments:

(edited by smiley.1438)

New Overwolf apps for GW2 - looking for ideas

in API Development

Posted by: smiley.1438

smiley.1438

I have an Overwolf-App in development which combines our location tracker and my wvw stats/maps app. I didn’t plan to release it yet because i’m still waiting on a response by the Overwolf team about the possibilities to receive the mumble link data via Overwolf. Currently you’d need a 3rd-party app to send location data which is what i want to avoid (begging users to install a software for use with a game… no way.).

Forum Search box doesn't work

in Forum and Website Bugs

Posted by: smiley.1438

smiley.1438

In this case thats no excuse because the “Search feature nor working” topic is always on page one of this subforum – guess why… :P

Bug if topic contains exactly 50 messages

in Forum and Website Bugs

Posted by: smiley.1438

smiley.1438

This is basically what i’ve described in the post before yours – you just don’t need to log out and back in – the thread stays the same anyway

[API Suggestion] Few generic API Suggestions

in API Development

Posted by: smiley.1438

smiley.1438

Also:

Not to speak of the overhead XML has compared to JSON.

[API Suggestion] Gathering nodes in Maps API

in API Development

Posted by: smiley.1438

smiley.1438

This was asked a couple of times before. I doubt we’ll see a gathering node API in the future as it could be easily exploited (think of the possibilities of the Mumble link data combined with the maps API and some sort of botting tool). I don’t think that Anet randomized the positions of gathering nodes just for fun…

[item_details] parameter lang=

in API Development

Posted by: smiley.1438

smiley.1438

Thank you but it doesn’t fit my need.

It does, actually. We’re running a multilanguage search/bot edit/item database with it.

for example:

http://gw2wbot.darthmaim.de/rss/renamedItems/
http://gw2wbot.darthmaim.de/smiley/
http://gw2treasures.de/

You still sotre information about types/rarity/weight in english. If i want to provide a filter on item type for french people, I dont want a drop down list with “Weapon” but with “Arme”.

It’s a common agreement that code is usually written in english as it is easy to understand. If i had written all my code in german, you wouldn’t even understand most of it? Would you?

Why do you want to have the (internal, sometimes even uninformative, in fact: identifiers) names in your language – you can easily do this in you front end via javascript. Once again, have a look at that code and see how i solved it for 4 languages (You could even poulate the dropdown fields with localized strings with a little effort…). It’s all in here:

https://github.com/codemasher/gw2-database/blob/master/gw2itemsearch.html

Someting else bother me in your item sql script :


  `pvp` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `attr1` tinytext COLLATE utf8_bin NOT NULL,
  `attr2` tinytext COLLATE utf8_bin NOT NULL,
  `attr3` tinytext COLLATE utf8_bin NOT NULL,
  `unlock_id` MEDIUMINT(6) unsigned NOT NULL DEFAULT '0',

It seems you can store only three attributes. What about celestial items ?

I stored the attribute combinations just for quick searches as most attribute combinations (to be exact: all except for celestial) consist of just 3 values. It would be an idea to also store the attribute prefix/suffix in a single column to enhance this – or you could just do a fulltext search (%…%) on the data fields where the full json response is stored.

(edited by smiley.1438)

[item_details] parameter lang=

in API Development

Posted by: smiley.1438

smiley.1438

Have a look at this:

https://github.com/codemasher/gw2-database

problem solved

API errors & bugs

in API Development

Posted by: smiley.1438

smiley.1438

Oh, these 2 were broken for ages – i wonder how they got in again after the items API was truncated…

[item_details] parameter lang=

in API Development

Posted by: smiley.1438

smiley.1438

Any other values than the name and description are for internal use only, thats why the lang parameter is basically useless in this case and some other APIs. See these proposals of mine for example:
https://forum-en.gw2archive.eu/forum/community/api/The-general-suggestion-thread/2070794
https://forum-en.gw2archive.eu/forum/community/api/API-Suggestion-World-vs-World/2455807

[API Suggestion] World vs World

in API Development

Posted by: smiley.1438

smiley.1438

Double post because “Message Body length must be less than 5001.” (…), see the posting before, too.

→ If i didn’t know about WvW matches (which I do), what does b, g, r mean? (yea, I knew it’s blue green red, but I really wouldn’t know)

→ Each map has it’s name (red world, blue world and green world)

I think it’s kinda irrelevant how the identifiers are named – the point is that they have a name so that we can assign them correctly without having to guess (like the scores in match_details.json, see a few posts above). Of course you could name them like “red”, “RedHome” or “red_world_id” but then you would add a lot of overhead again which is not nessecary in this case (not to mention the underscores in the current response instead of camelCasing which add 170 bytes alone).
You said it already: “APIs are made for computers”. (see edit below)

→ But at the cost of making the json not self-explanatory. I really would make some hybrid that anyone can still understand but takes less bandwith than the current one. Else why don’t you just pass binary data instead of json?

What I mean is that APIs are made for computers, so it should be fast for a computer to process the data. But it also has to be understandable for a developer.

It’s always a struggle between a lightweight response and adding too much overhead for having a self descriptive API. The latter thing is less important – thats what API documentations are for, so i’d prefer less overhead for a faster API.
JSON is the weapon of choice nowadays since it’s lightweight and usable in most languages – binary data would be more of a problem for web developers.

The updated gist: https://gist.github.com/codemasher/8876102

Edit:

I’ve added another version of the file with even less overhead and maybe more self-explaining:
https://gist.github.com/codemasher/8876102#file-matches2-json

Edit #2:

While i’m at it, i’ve also created a parsed match_details.json – ~200 bytes smaller than the current and a kittenload more detailed info:
https://gist.github.com/codemasher/8894954
It’s built by this https://github.com/codemasher/gw2api-tools/blob/master/inc/wvw_stats.inc.php (see it live) which i have now ported to Javascript for [SECRET PROJECT].

and using my objectives.json:
https://gist.github.com/codemasher/bac2b4f87e7af128087e

Edit #3:

In the latest version of my objectives.json i’ve dropped the map names (RedHome, BlueHome, GreenHome, Center) in favor of a flat array, so that you can access each item directly without hassle. If you want to keep the sub arrays, you should rather change everey occurence of Red/Blue/GreenHome/Center to their respective map_id to that we can easily merge the data with the mapdata from map_floor.json without having to guess which map belongs to a color.

(edited by smiley.1438)

[API Suggestion] World vs World

in API Development

Posted by: smiley.1438

smiley.1438

Hey, thanks for your feedback! In the following i’ll explain some points why i did certain things:

→ What’s start and end?

→ Each match “object” has start_time and end_time, with a human-readible date format (And then I found out you put it as UNIX timestamp, that’s great for computers)

Ok, i must admit i could have named these startTime and endTime. Since these are (currently) the same for all matches per region, it’s completely useless to add them for each match item – ~1000 bytes of useless overhead – also due to the suboptimal time format which you would parse to a timestamp or a better human readable format in most cases anyway.

→ Why EU and NA “objects” have indexed values (“1”: {}, “2”:{}, “3”:{}, …) instead of making them an array?

→ Each match object has it’s match id, composed by 2 numbers. I suppose the ones that start by 1 is one region and the ones that start by 2 is the other, and then they’re numbered. But you really can’t split this thing, as it’s an id. You really shouldn’t care about what does it mean

→ I wouldn’t split the id’s. I would do {"EU":{"1-1":{…},1-2,“NA”:{"2-1":{…},2-2. (or changing 1 by 2, idk which is eu and na…) Id’s can’t be splitted. They identify something. [Actually, the id’s should be “EU-1”..“EU-N” and “NA-1”…“NA-N” but… that could be hard to change]

The match_id isn’t actually an ID but 2 IDs, joined by a hyphen: the region and the matchup tier. I still wonder why Anet chose this format instead of having 2 parameters for the match_details.json like region and tier, both optional so that you could retrieve the match_details for all, a region or a single match if you like. That way it would make the life for database maintainers like millenium.org way easier since you wouldn’t need to loop through the matches.json and call the API 17 times to get the data for all matches.
As soon as i saved the gist yesterday, i realized that it would be much better to have the region IDs instead of “EU” and “NA” as identifiers. You may have noticed that it’s currently impossible to access the data for a single matchup or the start and end times for a specific region directly: you have to loop through the whole thing, and check for the match_id since the response is completely unordered. (i have already updated the gist added a regions object which holds the region IDs with the corresponding region to make it a little more descriptive)

So if you had a JSON like mine, you would just do this:

var matchData = {...} // the JSON response

var match = matchData.matches[2][3]; // data for match id 2-3 which is the EU tier 3 matchup

If you still need to loop through the whole thing (or lets say through all matches in a region) you could do this:

var regionID = 1; // your region id of choice, from a config or wherever you want

// prototype.js
// http://api.prototypejs.org/language/Hash/prototype/each/
$H(matchData.matches[regionID]).each(function(match){
	console.log(regionID+'-'+match.key); // match id
	console.log(match.value); // match worlds

	//yada yada yada...
});

In PHP it could be something like this:

$json = '{...}'; // get it e.g. via file_get_contents()

// the second parameter for json_decode makes it an associative array 
// i prefer these over objects because of the more handy syntax
$matchdata = json_decode($json, true); 

$match = $matchdata['matches'][2][3]; // EU tier 3 matchup

$regionID = 1;

foreach($matchdata['matches'][$regionID] as $tier => $worlds){
	echo $regionID.'-'.$tier;
	print_r($worlds);
	
	// ...
}

[API Suggestion] World vs World

in API Development

Posted by: smiley.1438

smiley.1438

I’ve just had an idea for a more convinient matches.json, shrinked down to ~1/4 of the size of the current response:
https://gist.github.com/codemasher/8876102

opinions?

Search feature not working

in Forum and Website Bugs

Posted by: smiley.1438

smiley.1438

Just suck up your pride anet, get one of already well working available solution and mod it to your needs, that would have been easier and probably cheaper if that was done in the first place

Just a few postings before (i guess your answer was merged from another topic): https://forum-en.gw2archive.eu/forum/support/forum/Search-feature-not-working/3411380

GW2's Mumble Link "context" data format

in API Development

Posted by: smiley.1438

smiley.1438

Now that the world/map display in friendlist etc. have been fixed, any chance that this will be also fixed for the mumble link data? I still receive “garbage” values when in WvW like 2147483655 for RoF borderland and 3221225491 for the EoTM instance i’ve been. Can’t you just return the actual home world id for players in WvW and overflows (e.g. 2005 in my case)?

Built a site for rendering emblems...

in API Development

Posted by: smiley.1438

smiley.1438

You’ll need also to recalculate the color base depending on the background color, see here:

https://github.com/codemasher/gw2api-tools/blob/master/inc/color.inc.php#L117

The script calculates the color base for every pixel. Since SVG paths/elements can only have gradients or uni colors, you can possibly shrink that down and pick only 2 or 3 colors as base and do the calculation on these.

this is my emblem script: https://github.com/codemasher/gw2api-tools/blob/master/examples/gw2emblems.php

(edited by smiley.1438)

Built a site for rendering emblems...

in API Development

Posted by: smiley.1438

smiley.1438

(edited by smiley.1438)

Edge of the Mists map tiles?

in API Development

Posted by: smiley.1438

smiley.1438

It’s already in map_floor.json (map id 968):
https://api.guildwars2.com/v1/map_floor.json?continent_id=2&floor=3

I doubt that there will be any changes to the current WvW APIs because a) EotM scores don’t count to the WvW scores and b) scores on EotM are not bound to a specific world. I could imagine an extra score API for this map.

  • All European worlds will be matched up with one another in the Edge of the Mists.
  • All North American worlds will be matched up with one another as well.
  • Worlds will be matched according to which color they are in the current WvW matchup. For example, all green worlds will be on the same team in the Edge of the Mists.
  • The Edge of the Mists resets every 4 hours, and the score from the map does not affect the score for the current WvW matchup.

(edited by smiley.1438)

Edge of the Mists map tiles?

in API Development

Posted by: smiley.1438

smiley.1438

They should be visible on floor 2/1 (the Mists) and 2/3 (WvW), right? Can’t see them yet.
http://gw2.chillerlan.net/examples/gw2maps-gmaps-simple.html (floor 1)
http://gw2.chillerlan.net/examples/gw2staticmaps.php (single map, floor 3)

(edited by smiley.1438)

PSA: Attention API wrapper authors!

in API Development

Posted by: smiley.1438

smiley.1438

It is interesting that Stefan mentioned GW2Spidy when GW2Spidy is not even using the official API.

Where exactly does Stefan mention GW2Spidy? It’s mentioned be the articles author (who doesn’t seem to know the difference) as an example for GW2-API usage.