1. I have corrected the e-mail settings so that outgoing e-mails from these forums should be sent now. If you tried to Register or Reset your Password, please try again!
    Dismiss Notice

[PS2] Paging in character_events

Discussion in 'Census: Planetside 2' started by Evilfi, Mar 22, 2013.

  1. Evilfi

    Evilfi Guest

    I'm building a statistics page for my outfit, more and more members are requesting a Kill board, so I'm currently investigating what kind of API calls you have available for this. After some tinkering I found 2 very interesting calls:

    <a rel="nofollow" href="http://census.daybreakgames.com/get/ps2-beta/characters_event/[CHARID"]http://census.daybreakgames.com/get/ps2-beta/...s_event/[CHARID[/url]]?type=DEATH&c:limit=1000

    <a rel="nofollow" href="http://census.daybreakgames.com/get/ps2-beta/characters_event/[CHARID"]http://census.daybreakgames.com/get/ps2-beta/...s_event/[CHARID[/url]]?type=KILL&c:limit=1000

    This gives me the latest 1000 kills for a character ID. This is great. The problem is that I need some paging in order to collect the next 1000 kills or deaths and so on. A quick search revealed that you have a command called after

    <a rel="nofollow" href="http://census.daybreakgames.com/get/ps2-beta/characters_event/5428018587889856577?type=KILL&c:limit=1000"]http://census.daybreakgames.com/get/ps2-beta/...mp;c:limit=1000[/url]&after=1363547357

    which gives me any kills after a current timestamp. This works, but i need a command that goes the other way like before. I tried before to see if it was that easy. That way I could take the first 1000 records, get the last timestamp and do another call with the before command equals the last timestamp found and page my way through.

    But before does not work (does not fail either). Do you have a command that can solve my problem?

     
  2. Dethdlr

    Dethdlr Guest

    The c:start=  command might work for you.  It basically tells it where in the results list to start.  So for your example, you'd do c:start=1001 for page 2, c:start=2001 for page 3 and so on.  

    You probably want to throw a sort in there as well.  Perhaps like this: &c:sort=timestamp:-1    That sorts it in descending order by timestamp so the most recent ones show up first.

     
  3. Dethdlr

    Dethdlr Guest

  4. Evilfi

    Evilfi Guest

    Your extended calls suggestion are very nice. Getting the names on the attacker aswell is a very nice feature. So thank you very much for that trick. Very handy.

    However I can't seem to get the paging with c:start to function. With or without sort.

     
  5. Dedith

    Dedith Guest

    I beleive this is because you're looking at a list within a specific event and the functions only work on the event itself (which there doesn't look to be a base event object, just this list.  The c:sort on timestamp does nothing.  Querying specifically for a timestamp does nothing.  c:start does nothing as it's returning you the single event.  Although c:limit is limiting the event list oddly enough. 

    This seems custom behavior, likely due to how they are pulling in the data for this collection (mongo db lets you do some interesting stuff).

    What's more interesting, if you do the request with just the eventID and a c:limit 100 you'll get 57 records, none of which match to what you get when you specify type=DEATH (that param will return the cap of 100)... AND there is no type field listed with or without params.

    I even tried interacting (aka, limiting the data) with the base eventId query (event_type and table_type) and go no changes in the data, like it was ignoring it. 

    Effectively, the death data seems hidden, and can go over the API limit of 100 records with no way to page to more of them. 

    This is broken.

     

Share This Page