mercs/api/world

API: World

Описание

Запрос

Ответ

Запрос инфо-списка планет

command: getplanetlist

{
  auth_key: "somekey",
  command: {
    name: "getplanetlist"
  }
}

response: planet-collection

{
  response: "ok",
  data: [
    {name: "test1", xpos: "12", ypos="5"},
    {name: "test2", xpos: "2", ypos="7"},
    {name: "test3", xpos: "7", ypos="10"},
    {name: "test4", xpos: "12", ypos="3"}
  ]
}

Расстояние от планеты А до планеты Б

command: getdistance, params: planet1, planet2

{
  auth_key: "somekey",
  command: {
    name: "getdistance",
    params: [
      planet1: "p14",
      planet2: "p23"
    ]
  }
}

response: result

{
  response: "ok",
  data: {
    result: 12
  }
}