1. This forum section contains Blog style threads from the Developers, and/or threads with details about what they have been working on, previews of upcoming content, and sometimes backstory associated with the content. Players are permitted to reply to these threads if the developer has indicated it is permissible by leaving the thread unlocked. Please note that TOS applies, and any abuse or trolling will be moderated.
    Dismiss Notice

Public Stats API

Discussion in 'Developer Work and Blog posts' started by Undone, May 9, 2017.

Thread Status:
Not open for further replies.
  1. Leinad Laurelwreath

    Leinad Laurelwreath Avatar

    Messages:
    253
    Likes Received:
    575
    Trophy Points:
    28
    Gender:
    Male
    Location:
    Jaaanaford
    Any word on this stat being public? @Undone Did you fix those problems @Umuri mentioned? I think this is one of the most interesting stats that should be public!
     
    Jaanelle DeJure likes this.
  2. tuerdkughter

    tuerdkughter Avatar

    Messages:
    6
    Likes Received:
    2
    Trophy Points:
    3
    @devilcult

    Code:
    const elasticsearch = require('elasticsearch')
    const urlencode = require('urlencode')
    
    var client = new elasticsearch.Client({
      host: 'www.shroudoftheavatar.com:9200/'
    })
    
    const request = {
      "size": 2,
      "sort": [
        {
          "@timestamp": {
            "order": "desc",
            "unmapped_type": "boolean"
          }
        }
      ],
      "query": {
        "bool": {
          "must": [
            {
              "query_string": {
                "query": "PlayerName: 'devilcut'",
                "analyze_wildcard": "true"
              }
            },
            {
              "range": {
                "@timestamp": {
                  "gte": "1494501864000",
                  "format": "epoch_millis"
                }
              }
            }
          ],
          "must_not": []
        }
      },
    }
    
    client.search({ method: 'GET', source: JSON.stringify(request) })
      .then(body => { console.log(body.hits.hits) })
      .catch(error => console.log(error))
    
     
    devilcult likes this.
  3. DavidDC

    DavidDC Programmer Moderator SOTA Developer

    Messages:
    1,532
    Likes Received:
    3,237
    Trophy Points:
    113
    Gender:
    Male
    Finaly! Thanks man

    That source: was the key. Couldnt find anything about that anywhere.
     
  4. Umuri

    Umuri Avatar

    Messages:
    527
    Likes Received:
    1,828
    Trophy Points:
    63
    Don't worry, it will be coming back, in some form or another.
    However the problems were not "breaks" or "bugs", they were intentional changes that Undone did, to help secure data and protect players privacy, which I wholeheartedly encouraged and agree with. People don't realize how much their data reveals sometime, when properly correlated with other data. It's why sharing data on the internet is so powerful to marketers nowadays.

    I will continue to work with Undone to ensure that any data interpretations I find fit with Portalarium's desired level of sharing, and that we properly protect player data from unintentional reveals. :)

    Short version: It will be back. Players shouldn't have all the data, pvpers will abuse it, so will griefers, so we gotta make it safe.
     
  5. that_shawn_guy

    that_shawn_guy Bug Hunter

    Messages:
    1,417
    Likes Received:
    3,755
    Trophy Points:
    125
    Location:
    earth... mostly
    When this was first released, it was very easy to keep the result set below 10,000 using the time window. I'm now very concerned about doing that going forward.

    Should we expect the correct timestamps to return for the non-PVP related data? If not, how should we control the size of the result set? i.e. if I want to retrieve all the crafting data for an hour if there are 12,000 "ItemGained_Crafting" events in that hour?

    Thank you
     
  6. Leinad Laurelwreath

    Leinad Laurelwreath Avatar

    Messages:
    253
    Likes Received:
    575
    Trophy Points:
    28
    Gender:
    Male
    Location:
    Jaaanaford
    Thanks @Umuri I understand privacy concerns and exploits must be prevented first.
    However I was just asking for the number of players online, just a number with no extra data ;)
     
    Jaanelle DeJure likes this.
  7. Undone

    Undone Trap Master Moderator SOTA Developer

    Messages:
    346
    Likes Received:
    848
    Trophy Points:
    43
    These things are still in flux and (thankfully) I can change them at any time. I'm currently considering having the timestamps read in 30 or 15m increments but we still need to have some internal discussions about this next week. To more directly answer your question: it is doubtful that an exact timestamp will be returned for many of the reasons already discussed.
     
  8. that_shawn_guy

    that_shawn_guy Bug Hunter

    Messages:
    1,417
    Likes Received:
    3,755
    Trophy Points:
    125
    Location:
    earth... mostly
    Please consider randomizing the timestamps with in the 15-30m window. That would at least distribute it more and while hopefully provide enough protection.

    Alternatively, you could consider pushing the json to S3 or other cloud store that would allow us to pull all the data without adding load to your systems. That would mean we have to process the data ourselves instead of using your systems. But, that has many benefits.

    Thank you for getting this going and dealing with all of us demanding lot. :) . I am very grateful that the your team is working with us.
     
  9. Archer

    Archer Avatar

    Messages:
    285
    Likes Received:
    196
    Trophy Points:
    40
    Location:
    UK, EU, Terra
    @Undone Given that 'price' is different depending on whether one is buying or selling to NPCs, could we also have the 'value' as it would be reported in a users inventory?
     
  10. Tiina Onir

    Tiina Onir Avatar

    Messages:
    1,103
    Likes Received:
    1,900
    Trophy Points:
    125
    Location:
    Bramble, South Paladis
    @Undone: just saw this yesterday and played with it a bit last night. Totally awesome, I'll certainly be using it. I also agree that it would be greatly helpful if a short description could be added for each of the LocationEvent types. Particularly confusing are:
    • ItemGained_ExplodeItem_Merchant
    • ItemGained_Merchant
    • ItemGained_Merchant (why is this on the list twice? typo?)
    • ItemDestroyed_Merchant
    I'd also love to see this data (possibly anonymised) exposed for player-vendors.
     
  11. tuerdkughter

    tuerdkughter Avatar

    Messages:
    6
    Likes Received:
    2
    Trophy Points:
    3
    @Undone What is the threat model for the exploits you are trying to prevent with the timestamp rounding? I haven't seen any explanation, other than Umuri's vague explanations about possible PVP focused players having an advantage of some kind.

    For example, if your worried about PVP focused players using in-game location data to hunt other vulnerable players. I have already found a work around that allows me to track player locations without accurate time stamps using a machine learning technique called classifiers. So, if that is the threat your mitigating with obscuring the timestamps, it doesn't work.

    Time is an important component of log data, obfuscating times shouldn't be done lightly. Especially if it doesn't address the threat your trying to protect against.

    I realize that I'm making an assumption about the treat model.
     
  12. Undone

    Undone Trap Master Moderator SOTA Developer

    Messages:
    346
    Likes Received:
    848
    Trophy Points:
    43
    We are masking the timestamps for the same reason streamers add a delay to their stream. One of the big reasons is to prevent users (like @Umuri) from creating loot tables by correlating monster death times with loot generation times. Not to mention real time position updates are a disincentive for anyone to opt-in to having their name shown given that someone could very easily track them across the world. I'd love to add a time delay and/or a slight randomization but that's not really feasible with the way things are currently setup.
     
    that_shawn_guy likes this.
  13. Lord Andernut

    Lord Andernut Avatar

    Messages:
    3,340
    Likes Received:
    10,087
    Trophy Points:
    165
    Gender:
    Male
    Location:
    New Britannian Market
    Opting in also shows everyone where you like to play, or are playing.



    Perhaps opting in to Categories Such as:
    -PvP Kill stats
    -PvP Death stats
    -Suicides

    etc.


    Maybe I'd want to participate in some activities, but not have everyone know how many COTOs I purchased?
     
  14. tuerdkughter

    tuerdkughter Avatar

    Messages:
    6
    Likes Received:
    2
    Trophy Points:
    3
    @Undone If I make a map that accurately shows player locations in realtime without using timestamps, will you turn them back on and admit that your security controls don't actually work or make sense? For example, the correct compensating control to loot table discovery is to make your loot generating routine use an random number generator or other source of entropy, not to hide the values for loot generation.
     
  15. Undone

    Undone Trap Master Moderator SOTA Developer

    Messages:
    346
    Likes Received:
    848
    Trophy Points:
    43
    Interesting idea but unlikely we will implement that any time soon. There's a lot on my plate for upcoming releases.
    No. If I tell you a monster died at X time, a piece of loot dropped at X time, and you collect enough data then regardless of what RNG you'll be able to put together a loot table. In my original post I mentioned that this whole thing is an experiment in sharing for things like building PVP stats and the like. None of which you need precise timestamps to accomplish. If you wish to build a real time map of player locations then you're likely going to get me to just drop PositionUpdates from the list or just disable the API all together seeing as you'll be querying the stack far too frequently. These sorts of things are not what this API was meant for.
     
    mike11, Kabalyero and Alley Oop like this.
  16. Kabalyero Kidd

    Kabalyero Kidd Avatar

    Messages:
    2,054
    Likes Received:
    5,437
    Trophy Points:
    165
    Location:
    Beran's Reach, Beregost and Whyte Roc
    QFT... and thank you...
     
  17. tuerdkughter

    tuerdkughter Avatar

    Messages:
    6
    Likes Received:
    2
    Trophy Points:
    3
    @Undone "If you wish to build a real time map of player locations then you're likely going to get me to just drop PositionUpdates from the list or just disable the API all together seeing as you'll be querying the stack far too frequently. These sorts of things are not what this API was meant for."

    Haha, so because you don't understand security controls your going to punish users of the API. Awesome attitude.
     
  18. Undone

    Undone Trap Master Moderator SOTA Developer

    Messages:
    346
    Likes Received:
    848
    Trophy Points:
    43
    I will be the first to admit this is not the ideal solution to the problems discussed above. We had data sitting around and thought it might be fun to share some of it with our community so they could be creative with it. What you have before you is the quickest path from A to B that took the least amount of time away from actual game development. If you are unsatisfied with the stopgap solutions I have implemented you are more than welcome to PM me your ideas and we can continue this discussion.

    I should also reiterate that this API launched a few days ago and is still a work in progress. Depending on what happens next week I may be able to devote more time to refining the filtering process. In other words, take a deep breath and relax =)
     
    Last edited: May 12, 2017
  19. Elnoth

    Elnoth Avatar

    Messages:
    724
    Likes Received:
    1,557
    Trophy Points:
    93
    I think the potential for economic abuse of this data needs to be considered.

    For example, I can pull every artifact dropped in the last two weeks and see which components of the warlock chain have dropped the least and know that they will be worth more as they are harder to find.
     
    Jaanelle DeJure and Kabalyero like this.
  20. DavidDC

    DavidDC Programmer Moderator SOTA Developer

    Messages:
    1,532
    Likes Received:
    3,237
    Trophy Points:
    113
    Gender:
    Male
    I got a mixed content error when trying to access your address with my https website. Is it possible to have a SSL web address for it?
     
    Tiina Onir likes this.
Thread Status:
Not open for further replies.