These are chat archives for arenanet/api-cdi

11th
Mar 2016
windwarrior
@windwarrior
Mar 11 2016 00:06 UTC
@lye: I agree that /v2/guild/:id1/teams/:id2/games/ looks horrible, especially when you can also go with ?ids=. But what are the options other then seperating the namespace of guilds and guild teams
so I think its either that, or /v2/guild/guildteams/:id2/, assuming a guild teams id is unique
iff only the combination (id1, id2) is unique, the fully namespaced url is the only one that is correct
I'm not even sure if the current proposal (just dumping all the games of all the teams into /v2/guild/:id/teams) is that bad.
I mostly just don't like that it doesn't feel the same as /v2/pvp/games but maybe that's unavoidable
One option is to not bulk-expand teams for the ../games route, so /v2/guild/:id/teams/1/games would only bulk-expand the games. But that kind of feels silly from an application perspective since realistically you probably want all games.
I dunno I'm kind of waffling
windwarrior
@windwarrior
Mar 11 2016 00:13 UTC
(One remark at a time) well from an API consumer perspective, you would mostly (clientside) group the results on team of your proposed /v2/guild/:id/teams call anyway right? Whats the usecase of having all games in a single result?
and I dont think I get your second remark
right, I need to learn to read
It mostly avoids needing additional API requests (which tbh is almost a non-issue). Since our retention policy on PvP games is pretty bad (e.g., only storing the last 10 games), I pretty much assume anything hitting those endpoints is an hourly job to save data. Actual UI is likely pulling data stored by that hourly job so it can have an actual match history.
windwarrior
@windwarrior
Mar 11 2016 00:27 UTC
Right, I must agree, dumping all games in /v2/guild/:id/teams is not a bad option. But mainly because otherwise you will open a can of worms for having two id's in an url which you can probably both ?ids= expand (what about 3 guild id's and 2 team id's, whats the combination of what?)
If games were bulk-expanded, it would only allow you to fetch a single team's games per request. E.g., /v2/guild/:id/teams/1/games?ids=all would return all games for team id=1. I don't think there's a good way to request "all games for teams 1 and 2"
I'm leaning towards "just dump them all in the same response" since the alternatives feel even worse.
windwarrior
@windwarrior
Mar 11 2016 00:32 UTC
that, the rest feels worse
Nabrok
@Nabrok
Mar 11 2016 00:40 UTC
Same response should be fine, assuming of course there's an indication of which team it is for each game.
and that it's the last 10 games for each team, not just the last 10 games.
it's last 10 games for each team; each team object has a .games array so you can tell which team the game belongs to
Nabrok
@Nabrok
Mar 11 2016 00:50 UTC
ah, so ids in the games array inside the teams endpoint, and then match the ids
And as I'm gathering the individual games for most of my members anyway, I could just match to those instead of getting the teams game list?
so... theoretically
IIRC team ids aren't globally unique -- they're only unique within a guild
so the member games from /v2/pvp/games could theoretically be amended to have .team : ["guild-id", "team-id"] but that's a surprisingly amount of work
I may have lost the question
Nabrok
@Nabrok
Mar 11 2016 00:57 UTC
I don't think that would be necessary if I have the teams game ids
Because I have the members game ids also
Which I'm already using to show where people played together (or against each other)
oh, yeah, that makes sense.
Nabrok
@Nabrok
Mar 11 2016 01:01 UTC
I think the only case I'd need the team games data (other than ids) is if 3 people who haven't given me a key play together.
Robert Logiewa
@Ruhrpottpatriot
Mar 11 2016 01:19 UTC
This message was deleted
I think dumping a complete list is absolutely fine. Fitering can be done by the client.
REST is all about simplicity, even if we send more data (which shouldn't be that much of a problem). If the API endpoint URLs get too complicated there's something wrong
@queicherius btw, when you get chance you should reindex achievements. With tuesday's patch, additional requirements for https://api.guildwars2.com/v2/achievements/2646 have been revealed.
darthmaim
@darthmaim
Mar 11 2016 07:29 UTC
I would prefer consistency, everything that returns a list of entries with an id should be bulk extended. And ?ids=X should always be for the last id. Maybe you could add /v2/guild/:id/games?ids=all&teams=1,2 if you want to provide a way to get all games of team 1 and 2 with one request, otherwise I would prefer /v2/guild/:id/teams/1/games?ids=all + /v2/guild/:id/teams/2/games?ids=all
smiley
@codemasher
Mar 11 2016 10:23 UTC
:rage3: is missing from the reactions though
Robert Logiewa
@Ruhrpottpatriot
Mar 11 2016 12:08 UTC
that script is not universal... it doesn't have the new official M$ pacakge manager, not chocolatey nerd mode off and yes I kow this is a Linux/UNIX script
darthmaim
@darthmaim
Mar 11 2016 12:11 UTC
its even missing some really common package managers running on unix, for example gem and composer
smiley
@codemasher
Mar 11 2016 12:11 UTC
send a PR to Randall :P
darthmaim
@darthmaim
Mar 11 2016 12:11 UTC
:P
Robert Logiewa
@Ruhrpottpatriot
Mar 11 2016 12:21 UTC
Anyone got a link to how make a Linux kernel as small as possible? I couldn't find anything good on out mighty overlord google
Edgar Doiron
@Coffee4cr
Mar 11 2016 12:32 UTC
where would it be if it's not on google
:P
darthmaim
@darthmaim
Mar 11 2016 12:34 UTC
Finally got around to make my recently added items list better: https://en.gw2treasures.com/stats/items/new :)
Edgar Doiron
@Coffee4cr
Mar 11 2016 12:37 UTC
that looks nice!
darthmaim
@darthmaim
Mar 11 2016 12:39 UTC
thanks :)
Robert Logiewa
@Ruhrpottpatriot
Mar 11 2016 13:42 UTC
Does anyone know what happens if I try to make a request against the api with a page size > returnedObjectCount (e.g. requesting 200 items from the endpoint, where only 120 are available)
still a 200?
smiley
@codemasher
Mar 11 2016 13:44 UTC
HTTP/206
Robert Logiewa
@Ruhrpottpatriot
Mar 11 2016 13:46 UTC
thanks
that actually makes things really easy
man, i whish C# 7 was here. Out params are a pain in the ass. I want multiple return values...
Shii Kayano
@BryghtShadow
Mar 11 2016 14:03 UTC
Unless you meant ids?=1,2,3,....,198,199,200.
Robert Logiewa
@Ruhrpottpatriot
Mar 11 2016 14:11 UTC
Funny thing you mention it. If I do a request against https://api.guildwars2.com/v2/continents?page_size=200 i get a 200 back, even though it should be a 206
Shii Kayano
@BryghtShadow
Mar 11 2016 14:12 UTC
Yep. Same with every endpoint. Seems to do 206 if you ask for non-existing ids along with existing ids.
smiley
@codemasher
Mar 11 2016 14:13 UTC
oh, nice find, didn't notice on paginated requests as i'm always using IDs. Perhaps a bug tho.
Robert Logiewa
@Ruhrpottpatriot
Mar 11 2016 14:14 UTC
could be
I ask because I need to use pagination to decouple my retrival logic from ids.
That's why I need to use pagination.
Shii Kayano
@BryghtShadow
Mar 11 2016 14:16 UTC
Would using the number of returned results in header suffice as a 206 substitute?
X-Page-Size: 200
X-Page-Total: 1
X-Result-Count: 27
X-Result-Total: 27
Robert Logiewa
@Ruhrpottpatriot
Mar 11 2016 14:20 UTC

You forgot ``` in your message

But in the end it does not matter for me if I get a 200 or 206, since I need to query X-Result-Total anyways to get my total number of pages I need to query.

Edgar Doiron
@Coffee4cr
Mar 11 2016 14:23 UTC
guys, I had never tried angular before, i'm falling in love with it
smiley
@codemasher
Mar 11 2016 14:29 UTC
have you heard about that new hip framework called "vanilla"? :D
Edgar Doiron
@Coffee4cr
Mar 11 2016 14:35 UTC
nope?
smiley
@codemasher
Mar 11 2016 14:39 UTC
go for it! 'ts amazing!
Edgar Doiron
@Coffee4cr
Mar 11 2016 14:40 UTC
i'll start by finishing this Angular tutorial on codeschool
smiley
@codemasher
Mar 11 2016 14:40 UTC
you can even spare that tutorial then! ;)
Edgar Doiron
@Coffee4cr
Mar 11 2016 14:41 UTC
lol
@Coffee4cr don't fall for it, angular is a trap
Edgar Doiron
@Coffee4cr
Mar 11 2016 18:11 UTC
:(
Eearslya Sleiarion
@Eearslya
Mar 11 2016 18:29 UTC
@lye javascript is a trap
true. we should switch everything to haskell
Robert Logiewa
@Ruhrpottpatriot
Mar 11 2016 19:45 UTC
on that I agree
Haskell is just beautiful
guh, I'm really not happy with how this looks for exposing chosen stats on choosy-stat items
{
    id: 78587,
    slot: "Helm",
    upgrades: [
        24836
    ],
    stats: {
        id: 161,
        name: "Berserker's",
        attributes: {
            Power: 63,
            Precision: 45,
            CritDamage: 45
        }
    }
}
Nabrok
@Nabrok
Mar 11 2016 20:36 UTC
What's wrong with it?
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:36 UTC
seems fine to me
it more than doubles the size of the item stack
also none of the itemstack endpoints are localized, and that's a localized string
I may be splitting hairs, I don't know
Nabrok
@Nabrok
Mar 11 2016 20:37 UTC
What
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:37 UTC
choosy stats are only on lvl 80 items right?
Nabrok
@Nabrok
Mar 11 2016 20:37 UTC
What's the id refer to?
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:37 UTC
id of the stats
smiley
@codemasher
Mar 11 2016 20:37 UTC
leave the localization out and give us a localized endpoint to resolve the attribute names
the id is the stat combo id
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:37 UTC
so beserker
IIRC there are choosy-stat levelling items (those might actually be containers, don't recall)
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:37 UTC
ah
Nabrok
@Nabrok
Mar 11 2016 20:37 UTC
Why have an id and the actual stats?
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:38 UTC
will we have a place to pull all the choosy stats from id?
not sure
the attributes on the stats object varies by item (realistically, the rarity+level of the item)
the stats object just has multipliers, mostly
I'm debating whether it even makes sense to expose those via API since there's another 2-3 LUTs that you'd need to use them :/
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:39 UTC
so there's only a single beserker id 161, but the attribute are calculated?
smiley
@codemasher
Mar 11 2016 20:39 UTC
pardon me, but what is a LUT?
look-up table
smiley
@codemasher
Mar 11 2016 20:39 UTC
ah :D
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:40 UTC

so there's only a single beserker id 161, but the attribute are calculated?

Or is there multiple beserker id, each with their different attribute value?

@Coffee4cr basically, yeah. The stat objects are basically attribute ratios
AFAIK they're unique per-name, now that I'm looking at it
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:41 UTC
so you either bake it in each item, or we get the formula and calculate it on our side.
and you just add the id, which would be pullable from another endpoint
baking it in is probably the most straightforward
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:41 UTC
and that endpoint wouldn't move much, only when adding new stats
yes, so your piece above is fine :)
thanks for the help guys
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:42 UTC
np
we talked sense into you
darthmaim
@darthmaim
Mar 11 2016 20:46 UTC

why not just

stats: {
    id: 161,
    attributes: {
        Power: 63,
        Precision: 45,
        CritDamage: 45
    }
}

and the localized name in /v2/attributesets/161?lang=en

smiley
@codemasher
Mar 11 2016 20:46 UTC
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:46 UTC
do we actually need the name of the stats?
darthmaim
@darthmaim
Mar 11 2016 20:47 UTC
the name of the item changes
@darthmaim that's I think what I'm going to do.
Might also throw the attribute multipliers in, I don't know
darthmaim
@darthmaim
Mar 11 2016 20:48 UTC
yeah, sounds good
wasn't clear which solution you'd take
smiley
@codemasher
Mar 11 2016 20:48 UTC
also a flag if the attribute is primary
Seems kind of weird to just have
{ id : 161, name : "Berserker's" }
David Reeß
@queicherius
Mar 11 2016 20:48 UTC
@lye Thanks for the notice with the achievements :)
np, someone gave me a bug for it :D
David Reeß
@queicherius
Mar 11 2016 20:48 UTC
And I agree with the represenation of @darthmaim
@codemasher I'm not sure the game has any notion of primary attributes
smiley
@codemasher
Mar 11 2016 20:49 UTC
would be nice to have at least ;)
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:49 UTC
primary is just the higher number :P
David Reeß
@queicherius
Mar 11 2016 20:49 UTC
And @tivac thanks for the post on that reddit thread. Got a message from chris too, but wasn't sure if I could write that publicly. :D
Pat Cavit
@tivac
Mar 11 2016 20:49 UTC
np
lol @ // celestial todo: HARDCODE ALL THE THINGS!
smiley
@codemasher
Mar 11 2016 20:51 UTC
tehehe, just the anet way :P
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:51 UTC
can't the api just push it out the way they're listed in-game?
@Coffee4cr how does the game differ from putting the stats on the item?
or are you talking about the stat combo names
Edgar Doiron
@Coffee4cr
Mar 11 2016 20:53 UTC

well I was just wondering about the need to show the primary stats?

If we list it as they are on our items, what does it change? the player knows which is the primary.

oh, fair. I'm going to leave the primary stats to the API clients.
IMO it's enough for the end-user to know "Berserker" instead of "Clerics"
smiley
@codemasher
Mar 11 2016 21:02 UTC
unrelated but i've just listened to this new album and it is killer!
https://twitter.com/NataliePrass/status/708213007159963648
ha, great trick to not embed youtube videos over the whole page
i'm sad