Mojang / AccountsClient

Java client for accessing Mojang's account/profile API
115 stars 37 forks source link

Bad design for bulk queries #9

Closed jomo closed 10 years ago

jomo commented 10 years ago

Why does every user need an agent? This is way more data than required. Instead of

[
  {"name":"jeb_", "agent": "minecraft"},
  {"name":"Dinnerbone", "agent":"minecraft"}
]

it would be much better (saving badwith and time) to use:

[
  {
    "agent": "minecraft",
    "names": ["jeb_", "Dinnerbone"]
  }
]

It would still be possible to get usernames for different agents (Scrolls?) in the same request although I can hardly imagine a case where that would happen.

I made a quick test with 50 users and the payload went from 2401 bytes to 938 (!) The normal payload is more than 2.5 x the size.

Support for this doesn't break the current system, so there's only pros and no cons. :)

codename-B commented 10 years ago

This can be closed now :)

jomo commented 10 years ago

Indeed.