From 02f50b551de5d7de61f893da9fb2de5c276b154d Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Mon, 4 Jul 2016 00:51:42 -0600 Subject: [PATCH] Stuff --- .gitignore | 5 ++- getbadges.php | 30 ++++++------- getstats.php | 28 ++++++------ inventory.php | 24 +++++----- maptileurl.php | 2 +- ping.php | 40 ++++++++--------- pinglogin.php | 54 +++++++++++----------- places.php | 16 +++---- proximity.php | 120 ++++++++++++++++++++++++------------------------- response.php | 52 ++++++++++----------- 10 files changed, 186 insertions(+), 185 deletions(-) diff --git a/.gitignore b/.gitignore index a8c5f1a..27390aa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -error* -stats* \ No newline at end of file +error* +stats* +vendor* \ No newline at end of file diff --git a/getbadges.php b/getbadges.php index 67fee13..a7533db 100644 --- a/getbadges.php +++ b/getbadges.php @@ -1,16 +1,16 @@ -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; +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); \ No newline at end of file diff --git a/getstats.php b/getstats.php index 7c9720c..c89a127 100644 --- a/getstats.php +++ b/getstats.php @@ -1,15 +1,15 @@ -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; +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); \ No newline at end of file diff --git a/inventory.php b/inventory.php index 49528ad..e7fbb86 100644 --- a/inventory.php +++ b/inventory.php @@ -1,13 +1,13 @@ -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; +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); \ No newline at end of file diff --git a/maptileurl.php b/maptileurl.php index 32d6bbc..ece7624 100644 --- a/maptileurl.php +++ b/maptileurl.php @@ -1,2 +1,2 @@ -update('players', ['latitude' => $VARS['lat'], 'longitude' => $VARS['long'], '#lastping' => 'NOW()'], ['uuid' => $uuid]); - +update('players', ['latitude' => $VARS['lat'], 'longitude' => $VARS['long'], '#lastping' => 'NOW()'], ['uuid' => $uuid]); + sendOK(); \ No newline at end of file diff --git a/pinglogin.php b/pinglogin.php index 4be1cc7..6d211c0 100644 --- a/pinglogin.php +++ b/pinglogin.php @@ -1,28 +1,28 @@ -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 "; - - $email = file_get_contents("https://sso.netsyms.com/api/getemail.php?user=" . $VARS['user']); - - mail($email, "Account Update", $message, $headers); +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 "; + + $email = file_get_contents("https://sso.netsyms.com/api/getemail.php?user=" . $VARS['user']); + + mail($email, "Account Update", $message, $headers); } \ No newline at end of file diff --git a/places.php b/places.php index 3ac00fa..fb9e0c3 100644 --- a/places.php +++ b/places.php @@ -1,8 +1,8 @@ -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); +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); diff --git a/response.php b/response.php index c382143..ec26082 100644 --- a/response.php +++ b/response.php @@ -1,27 +1,27 @@ -