You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

21 lines
652 B
PHP

<?php
require 'required.php';
if (is_empty($VARS['user']) || is_empty($VARS['lat']) || is_empty($VARS['long'])) {
sendError("Missing data.", true);
}
if (!preg_match('/-?[0-9]{1,3}\.[0-9]{4,}/', $VARS['lat'])) {
sendError("Latitude (lat) is in the wrong format.", true);
}
if (!preg_match('/-?[0-9]{1,3}\.[0-9]{4,}/', $VARS['long'])) {
sendError("Longitude (long) is in the wrong format.", true);
}
$uuid = file_get_contents("https://sso.netsyms.com/api/getguid.php?user=" . $VARS['user']);
$database->update('players', ['latitude' => $VARS['lat'], 'longitude' => $VARS['long'], '#lastping' => 'NOW()'], ['uuid' => $uuid]);
sendOK();