PHP game server for TerranQuest. https://terranquest.net

getterrain.php 576B

1234567891011121314151617181920
  1. <?php
  2. require 'required.php';
  3. require 'onlyloggedin.php';
  4. require 'latlong_validate.php';
  5. $terrain = json_decode(file_get_contents("http://gis.terranquest.net/terrain.php?key=" . GIS_API_KEY . "&lat=" . $VARS['lat'] . "&long=" . $VARS['long']), TRUE);
  6. if (!is_empty($terrain['error'])) {
  7. sendError($terrain['error'], true);
  8. } else {
  9. $out = [
  10. "status" => "OK",
  11. "type" => $terrain['type'],
  12. "latitude" => $terrain['latitude'],
  13. "longitude" => $terrain['longitude'],
  14. "name" => $terrain['name']
  15. ];
  16. die(json_encode($out));
  17. }