Stuff
parent
9decd046ec
commit
02f50b551d
@ -1,2 +1,3 @@
|
||||
error*
|
||||
stats*
|
||||
error*
|
||||
stats*
|
||||
vendor*
|
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
require 'required.php';
|
||||
|
||||
if (is_empty($VARS['user'])) {
|
||||
sendError("Missing data.", true);
|
||||
}
|
||||
|
||||
$badges = $database->select(
|
||||
'player_badges', ["[>]badges" => ["badgeid" => "badgeid"]], ['badgesid', 'badgename', 'badgedesc', 'gotdate'], ['playeruuid' => file_get_contents("https://sso.netsyms.com/api/getguid.php?user=" . $VARS['user'])]
|
||||
);
|
||||
|
||||
$out = [];
|
||||
$out['status'] = 'OK';
|
||||
$out['badges'] = $badges;
|
||||
<?php
|
||||
|
||||
require 'required.php';
|
||||
|
||||
if (is_empty($VARS['user'])) {
|
||||
sendError("Missing data.", true);
|
||||
}
|
||||
|
||||
$badges = $database->select(
|
||||
'player_badges', ["[>]badges" => ["badgeid" => "badgeid"]], ['badgesid', 'badgename', 'badgedesc', 'gotdate'], ['playeruuid' => file_get_contents("https://sso.netsyms.com/api/getguid.php?user=" . $VARS['user'])]
|
||||
);
|
||||
|
||||
$out = [];
|
||||
$out['status'] = 'OK';
|
||||
$out['badges'] = $badges;
|
||||
echo json_encode($out);
|
@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
require 'required.php';
|
||||
|
||||
if (is_empty($VARS['user'])) {
|
||||
sendError("Missing data.", true);
|
||||
}
|
||||
|
||||
$stats = $database->select('players', ['level', 'energy', 'maxenergy', 'lastping'], ['uuid' => file_get_contents("https://sso.netsyms.com/api/getguid.php?user=" . $VARS['user'])])[0];
|
||||
|
||||
|
||||
$out = [];
|
||||
$out['status'] = 'OK';
|
||||
$out['stats'] = $stats;
|
||||
<?php
|
||||
|
||||
require 'required.php';
|
||||
|
||||
if (is_empty($VARS['user'])) {
|
||||
sendError("Missing data.", true);
|
||||
}
|
||||
|
||||
$stats = $database->select('players', ['level', 'energy', 'maxenergy', 'lastping'], ['uuid' => file_get_contents("https://sso.netsyms.com/api/getguid.php?user=" . $VARS['user'])])[0];
|
||||
|
||||
|
||||
$out = [];
|
||||
$out['status'] = 'OK';
|
||||
$out['stats'] = $stats;
|
||||
echo json_encode($out);
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
require 'required.php';
|
||||
|
||||
if (is_empty($VARS['user'])) {
|
||||
sendError("Missing data.", true);
|
||||
}
|
||||
|
||||
$inv = $database->select('items', ['[>]inventory' => ['itemid' => 'itemid'], '[>]itemclasses' => ['classid', 'classid']], ['inventory.itemuuid', 'inventory.itemid', 'inventory.itemjson', 'items.itemname', 'items.itemdesc', 'itemclasses.classid', 'itemclasses.classname'], ['inventory.playeruuid' => file_get_contents("https://sso.netsyms.com/api/getguid.php?user=" . $VARS['user'])]);
|
||||
|
||||
$out['status'] = 'OK';
|
||||
$out['items'] = $inv;
|
||||
<?php
|
||||
|
||||
require 'required.php';
|
||||
|
||||
if (is_empty($VARS['user'])) {
|
||||
sendError("Missing data.", true);
|
||||
}
|
||||
|
||||
$inv = $database->select('items', ['[>]inventory' => ['itemid' => 'itemid'], '[>]itemclasses' => ['classid', 'classid']], ['inventory.itemuuid', 'inventory.itemid', 'inventory.itemjson', 'items.itemname', 'items.itemdesc', 'itemclasses.classid', 'itemclasses.classname'], ['inventory.playeruuid' => file_get_contents("https://sso.netsyms.com/api/getguid.php?user=" . $VARS['user'])]);
|
||||
|
||||
$out['status'] = 'OK';
|
||||
$out['items'] = $inv;
|
||||
echo json_encode($out);
|
@ -1,2 +1,2 @@
|
||||
<?php
|
||||
<?php
|
||||
die("http://tile.stamen.com/terrain/{z}/{x}/{y}.jpg");
|
@ -1,21 +1,21 @@
|
||||
<?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]);
|
||||
|
||||
<?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();
|
@ -1,28 +1,28 @@
|
||||
<?php
|
||||
|
||||
require 'required.php';
|
||||
|
||||
if (is_empty($VARS['user'])) {
|
||||
sendError("Missing data.", true);
|
||||
}
|
||||
|
||||
$guid = file_get_contents("https://sso.netsyms.com/api/getguid.php?user=" . $VARS['user']);
|
||||
|
||||
if ($database->has('players', ['uuid' => $guid])) {
|
||||
sendOK();
|
||||
} else {
|
||||
$database->insert('players', ['uuid' => $guid, 'level' => 1.0, 'energy' => 100, 'maxenergy' => 100, '#lastping' => 'NOW()']);
|
||||
sendOK("Successfully synced Netsyms account to TerranQuest.");
|
||||
ini_set("sendmail_from", "sso@netsyms.com");
|
||||
|
||||
$message = "This is just a quick message confirming that you have successfully linked TerranQuest to your Netsyms Technologies account. \n\n";
|
||||
$message .= "If you have any questions or need assistance with anything, email admin@netsyms.com and we will be happy to assist you. \n\n";
|
||||
$message .= "Have a nice day, " . $_SESSION['user'] . ". We hope you continue to use our services.";
|
||||
$message .= "\n\n--------\nNetsyms Technologies\n\nThis is an automated email. Do not reply to it.";
|
||||
|
||||
$headers = "From: Account System <sso@netsyms.com>";
|
||||
|
||||
$email = file_get_contents("https://sso.netsyms.com/api/getemail.php?user=" . $VARS['user']);
|
||||
|
||||
mail($email, "Account Update", $message, $headers);
|
||||
<?php
|
||||
|
||||
require 'required.php';
|
||||
|
||||
if (is_empty($VARS['user'])) {
|
||||
sendError("Missing data.", true);
|
||||
}
|
||||
|
||||
$guid = file_get_contents("https://sso.netsyms.com/api/getguid.php?user=" . $VARS['user']);
|
||||
|
||||
if ($database->has('players', ['uuid' => $guid])) {
|
||||
sendOK();
|
||||
} else {
|
||||
$database->insert('players', ['uuid' => $guid, 'level' => 1.0, 'energy' => 100, 'maxenergy' => 100, '#lastping' => 'NOW()']);
|
||||
sendOK("Successfully synced Netsyms account to TerranQuest.");
|
||||
ini_set("sendmail_from", "sso@netsyms.com");
|
||||
|
||||
$message = "This is just a quick message confirming that you have successfully linked TerranQuest to your Netsyms Technologies account. \n\n";
|
||||
$message .= "If you have any questions or need assistance with anything, email admin@netsyms.com and we will be happy to assist you. \n\n";
|
||||
$message .= "Have a nice day, " . $_SESSION['user'] . ". We hope you continue to use our services.";
|
||||
$message .= "\n\n--------\nNetsyms Technologies\n\nThis is an automated email. Do not reply to it.";
|
||||
|
||||
$headers = "From: Account System <sso@netsyms.com>";
|
||||
|
||||
$email = file_get_contents("https://sso.netsyms.com/api/getemail.php?user=" . $VARS['user']);
|
||||
|
||||
mail($email, "Account Update", $message, $headers);
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
|
@ -1,60 +1,60 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Coordinate decimal places to earth resolution
|
||||
decimal
|
||||
places degrees distance
|
||||
------- ------- --------
|
||||
0 1 111 km
|
||||
1 0.1 11.1 km
|
||||
2 0.01 1.11 km
|
||||
3 0.001 111 m
|
||||
4 0.0001 11.1 m
|
||||
5 0.00001 1.11 m
|
||||
6 0.000001 11.1 cm
|
||||
7 0.0000001 1.11 cm
|
||||
8 0.00000001 1.11 mm
|
||||
*/
|
||||
|
||||
require 'required.php';
|
||||
|
||||
use AnthonyMartin\GeoLocation\GeoLocation as GeoLocation;
|
||||
|
||||
if (is_empty($VARS['lat']) || is_empty($VARS['long'])) {
|
||||
sendError("Missing information.", true);
|
||||
}
|
||||
|
||||
if (!preg_match('/-?[0-9]{1,3}\.[0-9]{3,}/', $VARS['lat'])) {
|
||||
sendError("Latitude (lat) is in the wrong format.", true);
|
||||
}
|
||||
|
||||
if (!preg_match('/-?[0-9]{1,3}\.[0-9]{3,}/', $VARS['long'])) {
|
||||
sendError("Longitude (long) is in the wrong format.", true);
|
||||
}
|
||||
|
||||
$radius = 1;
|
||||
if (!is_empty($VARS['radius']) && is_numeric($VARS['radius'])) {
|
||||
$radius = intval($VARS['radius']);
|
||||
}
|
||||
|
||||
$userlocation = GeoLocation::fromDegrees($VARS['lat'], $VARS['long']);
|
||||
$searchbounds = $userlocation->boundingCoordinates($radius, 'miles');
|
||||
|
||||
|
||||
$people = $database->select('players', ['uuid', 'level', 'latitude', 'longitude', 'lastping'], ['AND' => [
|
||||
'latitude[>]' => $searchbounds[0]->getLatitudeInDegrees(),
|
||||
'latitude[<]' => $searchbounds[1]->getLatitudeInDegrees(),
|
||||
'longitude[>]' => $searchbounds[0]->getLongitudeInDegrees(),
|
||||
'longitude[<]' => $searchbounds[1]->getLongitudeInDegrees(),
|
||||
'#lastping[>]' => 'DATE_SUB(NOW(), INTERVAL 5 MINUTE)'],
|
||||
"LIMIT" => 50
|
||||
]);
|
||||
var_dump($database->error());
|
||||
if (!$people) {
|
||||
die('[]');
|
||||
}
|
||||
for ($i = 0; $i < count($people); $i++) {
|
||||
$people[$i]['username'] = file_get_contents('https://sso.netsyms.com/api/getname.php?uuid=' . $people[$i]['uuid']);
|
||||
}
|
||||
|
||||
echo json_encode($people);
|
||||
<?php
|
||||
|
||||
/*
|
||||
Coordinate decimal places to earth resolution
|
||||
decimal
|
||||
places degrees distance
|
||||
------- ------- --------
|
||||
0 1 111 km
|
||||
1 0.1 11.1 km
|
||||
2 0.01 1.11 km
|
||||
3 0.001 111 m
|
||||
4 0.0001 11.1 m
|
||||
5 0.00001 1.11 m
|
||||
6 0.000001 11.1 cm
|
||||
7 0.0000001 1.11 cm
|
||||
8 0.00000001 1.11 mm
|
||||
*/
|
||||
|
||||
require 'required.php';
|
||||
|
||||
use AnthonyMartin\GeoLocation\GeoLocation as GeoLocation;
|
||||
|
||||
if (is_empty($VARS['lat']) || is_empty($VARS['long'])) {
|
||||
sendError("Missing information.", true);
|
||||
}
|
||||
|
||||
if (!preg_match('/-?[0-9]{1,3}\.[0-9]{3,}/', $VARS['lat'])) {
|
||||
sendError("Latitude (lat) is in the wrong format.", true);
|
||||
}
|
||||
|
||||
if (!preg_match('/-?[0-9]{1,3}\.[0-9]{3,}/', $VARS['long'])) {
|
||||
sendError("Longitude (long) is in the wrong format.", true);
|
||||
}
|
||||
|
||||
$radius = 1;
|
||||
if (!is_empty($VARS['radius']) && is_numeric($VARS['radius'])) {
|
||||
$radius = intval($VARS['radius']);
|
||||
}
|
||||
|
||||
$userlocation = GeoLocation::fromDegrees($VARS['lat'], $VARS['long']);
|
||||
$searchbounds = $userlocation->boundingCoordinates($radius, 'miles');
|
||||
|
||||
|
||||
$people = $database->select('players', ['uuid', 'level', 'latitude', 'longitude', 'lastping'], ['AND' => [
|
||||
'latitude[>]' => $searchbounds[0]->getLatitudeInDegrees(),
|
||||
'latitude[<]' => $searchbounds[1]->getLatitudeInDegrees(),
|
||||
'longitude[>]' => $searchbounds[0]->getLongitudeInDegrees(),
|
||||
'longitude[<]' => $searchbounds[1]->getLongitudeInDegrees(),
|
||||
'#lastping[>]' => 'DATE_SUB(NOW(), INTERVAL 5 MINUTE)'],
|
||||
"LIMIT" => 50
|
||||
]);
|
||||
var_dump($database->error());
|
||||
if (!$people) {
|
||||
die('[]');
|
||||
}
|
||||
for ($i = 0; $i < count($people); $i++) {
|
||||
$people[$i]['username'] = file_get_contents('https://sso.netsyms.com/api/getname.php?uuid=' . $people[$i]['uuid']);
|
||||
}
|
||||
|
||||
echo json_encode($people);
|
||||
|
@ -1,27 +1,27 @@
|
||||
<?php
|
||||
|
||||
function sendOK($message = "", $die = false) {
|
||||
if (!is_empty($message) && JSON) {
|
||||
echo '{ "status": "OK", "message": "'.$message.'" }';
|
||||
} elseif (is_empty($message) && JSON) {
|
||||
echo '{ "status": "OK" }';
|
||||
} elseif (!is_empty($message) && !JSON) {
|
||||
echo "OK:$message";
|
||||
} else {
|
||||
echo "OK";
|
||||
}
|
||||
if ($die) {
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
function sendError($error, $die = false) {
|
||||
if (JSON) {
|
||||
echo '{ "status": "ERROR", "message": "' . $error . '" }';
|
||||
} else {
|
||||
echo "Error: $error";
|
||||
}
|
||||
if ($die) {
|
||||
die();
|
||||
}
|
||||
<?php
|
||||
|
||||
function sendOK($message = "", $die = false) {
|
||||
if (!is_empty($message) && JSON) {
|
||||
echo '{ "status": "OK", "message": "'.$message.'" }';
|
||||
} elseif (is_empty($message) && JSON) {
|
||||
echo '{ "status": "OK" }';
|
||||
} elseif (!is_empty($message) && !JSON) {
|
||||
echo "OK:$message";
|
||||
} else {
|
||||
echo "OK";
|
||||
}
|
||||
if ($die) {
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
function sendError($error, $die = false) {
|
||||
if (JSON) {
|
||||
echo '{ "status": "ERROR", "message": "' . $error . '" }';
|
||||
} else {
|
||||
echo "Error: $error";
|
||||
}
|
||||
if ($die) {
|
||||
die();
|
||||
}
|
||||
}
|
Reference in New Issue