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

creating leaderboards for guilds, trying to sort data, need some help

Discussion in 'Census: General Discussion' started by Xythus007, Oct 5, 2017.

  1. Xythus007

    Xythus007 New Member

    hey all, i've been working on some leaderboards for EQ2 (more as a personal project, but well see how it goes hehe). I'm using php and simplexml, which is all good, but my question is with the get request and the response to the server:

    so far ive managed to load the guild members and each of their stats that i want for the leaderboard system, but im having trouble sorting it (is it even possible?), this is the request i using for example:

    http://census.daybreakgames.com/xml/get/eq2/guild/?name=Handle It&world=Thurgadin&c:resolve=members(displayname,type,statistics)&c:sort=statistics.kills:1

    i've tried 1 and -1 for sort, it changes the results but doesn't sort it. i'm just wondering is their anyway of sorting the guild members by stat, or am i going to have to do a lookup on the /character area instead?

    or have i missed something really obvious? thanks
     
  2. Feldon

    Feldon Administrator Staff Member

    Just a suggestion -- reading XML with PHP is rather painful. I suggest requesting json data and using the built-in PHP function "json_decode". I only use XML when browsing data in the web browser.

    So c:sort lets you sort the results of a census request. You are requesting 1 guild, so there's really nothing to sort. Even if you were requesting multiple results, c:sort cannot sort after a resolve. The resolve happens first.

    The globaly unique ID of guild "Handle It" on Thurgadin is 3153127673. Easiest is to do a query on characters in that guild and then sort by that value:

    http://census.daybreakgames.com/xml...cationdata.world,statistics.kills&c:limit=100
     
    • Like Like x 1

Share This Page