These are chat archives for arenanet/api-cdi

23rd
Mar 2017
darthmaim
@darthmaim
Mar 23 2017 00:56

@lye:

There's some additional bits that aren't documented here -- specifically that this endpoint provides both unauthenticated and authenticated access (providing a functional API key of a guild member will let you see some extra data, like MOTD). Will do that tomorrow.

:P
Well it's not tomorrow yet, is it?
Been busy trying to thread X-Rate-Limit-Remaining through the system
darthmaim
@darthmaim
Mar 23 2017 01:00
is it not? you wrote that 19 hours ago
just a reminder though :P
I'll do it tomorrow :D
maybe.
darthmaim
@darthmaim
Mar 23 2017 01:01
;D
orz
smiley
@codemasher
Mar 23 2017 01:01
for us it's tomorrow already!
darthmaim
@darthmaim
Mar 23 2017 01:01
no, for eu its tomorrow
us is behind us
smiley
@codemasher
Mar 23 2017 01:01
"us"
darthmaim
@darthmaim
Mar 23 2017 01:01
:P
smiley
@codemasher
Mar 23 2017 01:01
over here :D
darthmaim
@darthmaim
Mar 23 2017 01:01
i know :D
for EU it was tomorrow yesterday when I wrote that so tomorrow yesterday is tomorrow today in NA
smiley
@codemasher
Mar 23 2017 01:03
heh
darthmaim
@darthmaim
Mar 23 2017 01:03
soon™
Jonathan Andrist
@rwfrk_twitter
Mar 23 2017 02:33
Question
blob
... This is the first time I've seen this. The account is 4 years old and my first transaction of the evening? Uh..backend timeout issue or ?
Archomeda
@Archomeda
Mar 23 2017 02:34
!RemindLye needs to be a thing :D
@rwfrk_twitter never seen that before
Darqam
@Darqam
Mar 23 2017 02:46
I've seen that once before when my friend upgraded from old core gw2 to HoT (I think). Or maybe it was when enable 2FA...
Pat Cavit
@tivac
Mar 23 2017 02:59
There's a rendering bug preventing a third item from being shown
you need to add TOTP or SMS 2-factor auth on your account
Archomeda
@Archomeda
Mar 23 2017 03:00
lol
now that you mention it, that "OK" button does seem a little bit too far to the bottom of that window
Pat Cavit
@tivac
Mar 23 2017 03:02
:unamused: C++ UI is apparently quite difficult
Eearslya Sleiarion
@Eearslya
Mar 23 2017 03:09
after trying to design a coherent UI in C on Tizen OS..can confirm
Jonathan Andrist
@rwfrk_twitter
Mar 23 2017 04:56
@tivac I've had 2FA on for more than a year =)
UI is complex!
Pat Cavit
@tivac
Mar 23 2017 04:57
Interesting, you should file a support ticket
include that busted-ass dialog in the ticket for sure
been yelling at them about it for a while
Jonathan Andrist
@rwfrk_twitter
Mar 23 2017 04:57
If I could duplicate it. It started working a few hours later.
Pat Cavit
@tivac
Mar 23 2017 04:57
oh weird
what time was it happening?
Jonathan Andrist
@rwfrk_twitter
Mar 23 2017 04:58
7:32, MST (No daylight savings time here, so don't ask me which way that goes.) Dailies Reset +2h 32m
Archomeda
@Archomeda
Mar 23 2017 05:00
so you're UTC+5 currently then
Jonathan Andrist
@rwfrk_twitter
Mar 23 2017 05:00
Seems right.
Pat Cavit
@tivac
Mar 23 2017 05:47
hmph
don't think anyone was futzing w/ that around then
windwarrior
@windwarrior
Mar 23 2017 06:45
I think countries above the equator go forward in time, or at least most of europe goes from UTC+1 to UTC+2 next weekend for daylight savings time
Nabrok
@Nabrok
Mar 23 2017 14:38
Just confirming ... we can see victory points now, but there's still no way to see the score for just the current skirmish?
Darqam
@Darqam
Mar 23 2017 14:40
confirming victory points, not sure about score
Archomeda
@Archomeda
Mar 23 2017 15:22
score is the accumulated total, not the skirmish total
so yeah, i don't think it exists yet
#461 got merged
windwarrior
@windwarrior
Mar 23 2017 15:23
this example shows accumulated scores
but indeed not per skirmish
Archomeda
@Archomeda
Mar 23 2017 15:23
but that's only about the victory_points
#381 is still there
lye added needs deploy and removed ready labels 17 hours ago
windwarrior
@windwarrior
Mar 23 2017 15:25
it -would- theoretically be possible that a world wins by small margin in a majority of the skirmishes, and be obliterated in the others
no?
Archomeda
@Archomeda
Mar 23 2017 15:25
yes
windwarrior
@windwarrior
Mar 23 2017 15:26
maybe have a /v2/wvw/matches/{id}/skirmish_details or similair?
Archomeda
@Archomeda
Mar 23 2017 15:26
R:100, G:99, B:90 - R:50, G:100, B:55 -> R:150, G:199, B: 145
windwarrior
@windwarrior
Mar 23 2017 15:27
just a list of all (played) skirmishes, their final scores, their awarded victory points etc.
Archomeda
@Archomeda
Mar 23 2017 15:27
i think @lye mentioned that skirmishes weren't saved
darthmaim
@darthmaim
Mar 23 2017 15:27
I think @lye said somewhere that there is no history
Archomeda
@Archomeda
Mar 23 2017 15:27
so a history is impossible
windwarrior
@windwarrior
Mar 23 2017 15:27
ah right
darthmaim
@darthmaim
Mar 23 2017 15:28
its probably just going to be a skirmish object in the match with the current scores
Archomeda
@Archomeda
Mar 23 2017 15:28
it might contain a previous skirmish, but he wasn't sure about that either
darthmaim
@darthmaim
Mar 23 2017 15:29
oh wait
I’m still reviewing the implementation bits for the skirmish stuff, but by my reading the API should be able to expose the skirmish results for all skirmishes within the current match.
Archomeda
@Archomeda
Mar 23 2017 15:29
although #381 does mention multiple skirmishes
windwarrior
@windwarrior
Mar 23 2017 15:30
you can mimic the behaviour by querying a few seconds before skirmish end
or... maybe still during the grace/reset period?
darthmaim
@darthmaim
Mar 23 2017 15:30
it seems like it will have a list of all skirimishes
windwarrior
@windwarrior
Mar 23 2017 15:30
it takes a few minutes for a skirmish to reset no?
windwarrior
@windwarrior
Mar 23 2017 15:31
I have no knowledge of WvW other then that Viper-Engi really gets trashed there :P
Archomeda
@Archomeda
Mar 23 2017 15:32
i think wvw mainly suffers from distributed systems and is therefore slowed sometimes or not on time with updating
i dunno
i've actually never looked at how a skirmish updates ingame, so i can't really comment on that
Eearslya Sleiarion
@Eearslya
Mar 23 2017 15:43
lye has mentioned on several occasions that wvw things like K/D is somewhat broken because of best-effort logging
windwarrior
@windwarrior
Mar 23 2017 16:17
You would say that there is some form of messagequeue between servers that you can split.... But that would be the way how I would (probably very naively) implement that
Or tee actually
Eearslya Sleiarion
@Eearslya
Mar 23 2017 16:35
@Archomeda WvW is based off 5 minute "ticks" of points. Each 5 minutes the objectives owned grant their points. When the clock strikes zero, the timer shows --:-- and sometimes stays there for a moment or two, and sometimes instantaneously moves over.
windwarrior
@windwarrior
Mar 23 2017 17:09
OH I can start with my armorer project
maybe
Jeppe Vennekilde
@vennekilde
Mar 23 2017 17:39
Speaking of victory points, would it be possible to also add it to v2/wvw/matches/scores
Darqam
@Darqam
Mar 23 2017 17:41
so duplicate it from /v2/wvw/matches?
Jeppe Vennekilde
@vennekilde
Mar 23 2017 17:56
Yeah, as it is right now, the scores endpoint is pretty much useless, as score is not used in the game anymore and for all intent and purpose has been replaced by victory points
Darqam
@Darqam
Mar 23 2017 18:13
unless I'm missing something, then why not just use matches endpoint if scores has no valuable info for you? If not, you could add an issue on github for Lye
Eearslya Sleiarion
@Eearslya
Mar 23 2017 18:14
They want victory_points on the scores endpoint to make it useful. matches does have all the info, but apparently whatever they're making doesn't need quite that much info
Darqam
@Darqam
Mar 23 2017 18:16
yeah, but I don't think Lye like to change where things are located after implementing, so it would have to be a duplicate value. I'm not sure why you couldn't just call matches instead if that's where the data you want it. Not to say Lye couldn't move/duplicate it.
Eearslya Sleiarion
@Eearslya
Mar 23 2017 18:18
I mean, /v2/wvw/matches/scores is already 100% duplicate data
It's just less to save on network fetching
windwarrior
@windwarrior
Mar 23 2017 18:36
eh, javascript
I just want a sane frontend framework, that doesnt overload me with concepts the moment I tried to use it
Archomeda
@Archomeda
Mar 23 2017 18:39
good luck
windwarrior
@windwarrior
Mar 23 2017 18:41
I tried ember just a second ago, but the moment I install a single plugin it becomes a flaming fireball of doom
smiley
@codemasher
Mar 23 2017 18:41
javascript is ded
killed by overengineering
windwarrior
@windwarrior
Mar 23 2017 18:45
it manage to create 40mb worth of temp files
how
smiley
@codemasher
Mar 23 2017 18:45
wat
ChieftainAlex
@ChieftainAlex
Mar 23 2017 18:46
question about whitelisted items. Should the PvP rune/sigil choices be visible in v2/items? I can see the "rune of leadership" link, but not the "rune of the lynx"
Archomeda
@Archomeda
Mar 23 2017 18:47
the "rune of leadership" is the pvp variant
"rune of the lynx" might not exist in pvp
ChieftainAlex
@ChieftainAlex
Mar 23 2017 18:47
Archomeda
@Archomeda
Mar 23 2017 18:48
oh... ehh
nvm me, i clearly did not read well enough

Speaking of victory points, would it be possible to also add it to v2/wvw/matches/scores

@vennekilde opened #472

yeah, but I don't think Lye like to change where things are located after implementing, so it would have to be a duplicate value.

@Darqam ehh, I don't, but in this case there's a lot of use-cases that are benefited by having certain endpoints return a subset of data.

/v2/wvw/matches?ids=all is a lot of data, and there are some sites that only care about scores (for historical logging and such).
Archomeda
@Archomeda
Mar 23 2017 20:04
omg lol @ gw2e
There was an error accessing the API
Please check if you have any privacy extensions enabled and try disabling them. If the problem persists, please send me the text on the right.
okay @queicherius, i'll send you what's on the right:
{}
a refresh fixed it though :P
the page just changed itself to that error page while i was scrolling in the inventory of one of my characters
David Reeß
@queicherius
Mar 23 2017 20:29
:D
John Carroll
@johncarroll
Mar 23 2017 21:36
does the /v2/account/achievements?ids=list work or is it just planned?
what's ?ids=list
oh 1,2,3 derp
it should work?
might not be deployed yet, I don't recall
works for me on live
guess it got picked up with the "oh god oh god ratelimiting" deploy
John Carroll
@johncarroll
Mar 23 2017 21:38
hmm, maybe i got something wrong. i'll double check
John Carroll
@johncarroll
Mar 23 2017 21:43
i think it may be my http module not merging query strings correctly
or rather, how i expect it to
John Carroll
@johncarroll
Mar 23 2017 22:35
i've come to realise i have no idea how this module works
I shouldn't trust magic things
unless you're a wizard :tada:
Michael Dougall
@madou
Mar 23 2017 22:36
Eh everyone ends up using magic at one point.
What http mod u using
@lye knows a thing or two about being a wizard
you callin' me a wizard
now you're thinking to yourself, "did he use fire five or six spells"
John Carroll
@johncarroll
Mar 23 2017 22:38
it's python requests
i have no idea how to check what it's really sending
if you give a list as a parameter it does '?ids=1&ids=2&ids=3'
i've only found that out because of hidden functions
John Carroll
@johncarroll
Mar 23 2017 22:49
also, doesn't matter how many spells you fired. lava font off cooldown on downstate
Archomeda
@Archomeda
Mar 23 2017 22:50
just get all the ids and join them, separated by a comma
and then feed them to the query string
John Carroll
@johncarroll
Mar 23 2017 22:51
tried. something is going wrong
John Carroll
@johncarroll
Mar 23 2017 23:00
i noticed that during the outage, noone was outbidding anyone else. can we have more so i can make money?
lol no
John Carroll
@johncarroll
Mar 23 2017 23:00
damn
pls no
Darqam
@Darqam
Mar 23 2017 23:00
can't even ddos api to do that now :/
you know... not that anyone would do that... of course
requests.get("https://api.guildwars2.com/v2/account/achievements", { access_token : "xyz", ids : "1,2,3" }) should work best I can tell
FWIW
@Darqam nothing is un-DDOS'able
John Carroll
@johncarroll
Mar 23 2017 23:01
i know the format, i just can't get it in that format :/
because magic
using data={stuff}
is that the wrong thing?
what is {stuff}
John Carroll
@johncarroll
Mar 23 2017 23:03
that dict
{ access_token : "xyz", ids : "1,2,3" }
that doesn't generate the right r.url from the returned request object?
John Carroll
@johncarroll
Mar 23 2017 23:03
r.url just shows the base url, not the query string
https://github.com/kennethreitz/requests/blob/master/requests/models.py#L82 doesn't seem like it inspects the underlying string
ah I guess you have to manually call .prepare to get the r.url set
.prepare is presumably called automatically when the request is dispatched
are the docs wrong or something? I didn't see this
oh, requests.get calls .prepare on the created request, but returns the un-prepared copy
that's a super weird way to do it
r = requests.get(url, { params })
r.prepare().url # should output the _actual_ URL used
EDIT: this might be wrong
EDIT2: No, request.Requests totally has a prepare method that does this
John Carroll
@johncarroll
Mar 23 2017 23:07
no, i'm just assembling the parameters and passing them
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:07

Item Exists (0.0ms) SELECT 1 AS one FROM "items" WHERE "items"."id" = $1 AND ("items"."id" != $2) LIMIT $3 [["id", 48144], ["id", 48144], ["LIMIT", 1]]

activerecord what are you doing

John Carroll
@johncarroll
Mar 23 2017 23:07
it's just not acting the way it says
@Eearslya hey at least it's fast!
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:08
but
It doesn't even touch the table!
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:08
it's
@johncarroll wouldn't you be happier just using urllib2
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:09
I don't even understand why it would do that
John Carroll
@johncarroll
Mar 23 2017 23:09
no. jesus no
urllib2 isn't that bad
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:10
that call should be checking the validity of the item, making sure there are no duplicate IDs
especially if you're only making GET requests
John Carroll
@johncarroll
Mar 23 2017 23:10
it's pretty bad
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:10
well you're not gonna find duplicate IDs LIKE THAT
John Carroll
@johncarroll
Mar 23 2017 23:10
anyway, don't waste any more time on my problems. i'll get them solved eventually
thanks for the assistance though
@Eearslya you're probably doing something by accident like doing a Model#find within a context that triggers an instance method that automagically inserts the id = #{self.id} clause or something
lye @lye is waiting for a compile
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:11
      Item.transaction do
          @items = item_data.map do |item_json|
              item = Item.find_by_id(item_json.id)
              if item.nil?
                    item = Item.new
              end
              item.load_from_json(item_json)
          end
      end
@Eearslya wouldn't you be happier just using C99
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:11
tbh no
I have tried doing things in C and there's way more overhead than actual coding
I love C
I really do, but it's..tedious
Well for example, does ruby have a debugger? So you can see what that find_by_id is doing (or which method it's dispatching to)?
./scripts/server --debugger with a JavaScript-style debugger statement, it seems
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:15
well I mean, I can run the code manually in a ruby console
>> item = Item.find_by_id(12542)
  Item Load (9.0ms)  SELECT  "items".* FROM "items" WHERE "items"."id" = $1 LIMIT $2  [["id", 12542], ["LIMIT", 1]]
#<Item id: 12542, name: "Jar of Red Curry Paste", icon: "https://render.guildwars2.com/file/A10E77B83A7BACC...", <snip>
>> item.valid?
  Item Exists (1.0ms)  SELECT  1 AS one FROM "items" WHERE "items"."id" = $1 AND ("items"."id" != $2) LIMIT $3  [["id", 12542], ["id", 12542], ["LIMIT", 1]]
true
why
oh
what validations do you have on that model?
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:17
    validates_presence_of :id, :name, :icon, :item_type, :rarity
    validates_uniqueness_of :id
pretty sure you can't do validates_uniqueness_of :id
That's where the extra clause is
Better to have a UNIQUE CONSTRAINT on that column IMO
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:20
But that doesn't tell Rails anything about it; it'll still try to insert, then throw a fit when PG complains
Instead of creating new items during a scrape, try to look them up in the DB first and use the DB-initialized ones
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:22
I am doing that D:
e.g. item = Item.find_by_id(id) || Item.new
really
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:23
first code block I pasted
darthmaim
@darthmaim
Mar 23 2017 23:23
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:23
not as concise as that but
Are you sure that like
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:23
(I might steal that)
A unique constraint breaks that?
it shouldn't
that's kinda scary
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:23
I guess..unique constraints don't work well on the built-in id column..?
if it's a PRIMARY KEY it's already got a unique constraint :/
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:24
Yeah, on the postgres side only though
Rails will still happily say that a record is valid with a duplicate key up until you try to save it
ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "items_pkey"
Bah. This crawler is basically the only thing that's ever gonna write to that table..I guess if I just make sure it checks first, I shouldn't need the validation..
how is it even assigning a duplicate key i don't understand
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:27
i = Item.new
i.id = 12542
i.valid? => true
i.save => ActiveRecord::RecordNotUnique
uhh
why is id set after Item.new
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:29
Why not? It doesn't have to be set in the new call
Item.new basically marks the object to persist with INSERT; retrieving objects via the ORM mark them to persist with UPDATE
so if there's already a record you need to find it with Item.find_by_id first rather than using Item.new to create it
darthmaim
@darthmaim
Mar 23 2017 23:31
can't you just always use Item.find_or_create_by(id: 12542)?
does that still exist
darthmaim
@darthmaim
Mar 23 2017 23:31
no idea
because that's cleaner
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:31
I don't like find_or_create_by
Archomeda
@Archomeda
Mar 23 2017 23:31
why not?
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:31
It used 2 separate SELECTs for some reason
Archomeda
@Archomeda
Mar 23 2017 23:31
:|
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:32
>> Item.find_or_create_by(id:123123)
  Item Load (1.0ms)  SELECT  "items".* FROM "items" WHERE "items"."id" = $1 LIMIT $2  [["id", 123123], ["LIMIT", 1]]
   (0.0ms)  BEGIN
  Item Exists (1.0ms)  SELECT  1 AS one FROM "items" WHERE "items"."id" = $1 LIMIT $2  [["id", 123123], ["LIMIT", 1]]
   (0.0ms)  ROLLBACK
>> Item.find_by_id(123123) || Item.new
  Item Load (1.0ms)  SELECT  "items".* FROM "items" WHERE "items"."id" = $1 LIMIT $2  [["id", 123123], ["LIMIT", 1]]
I was running my item crawler on my actual server, and I noticed every single item was taking 4 DB calls each, which is what prompted me to start inspecting this closer
Eearslya Sleiarion
@Eearslya
Mar 23 2017 23:37
I'll probably just nix the id validation for now..Gotta drive home though, back soon.
John Carroll
@johncarroll
Mar 23 2017 23:52
i have to say, drunk coding is great until you have to debug
darthmaim
@darthmaim
Mar 23 2017 23:52
i have to say, coding is great until you have to debug
FTFY
John Carroll
@johncarroll
Mar 23 2017 23:52
thanks
darthmaim
@darthmaim
Mar 23 2017 23:52
:P
John Carroll
@johncarroll
Mar 23 2017 23:54
well at least it's reset soon so i can go and play
only decent players + me on after midnight so i can get carried through fractals