stadia-avatar/endpoint/get.php
Victor Westerlund ef58aa530e Added DB interface and get/update endpoints.
The bot userscript is now fully operational, the only thing left to do is to make it send the actual payload we need for the endpoint.

Added setup for MySQL database.

Added DB interface with a concept-stage set/update endpoint.
2021-02-04 17:50:24 +01:00

16 lines
No EOL
355 B
PHP

<?php
require "../classes/Message.php";
require "../classes/Database.php";
$user_id = $_GET["userID"] ?? error("400","No userID provided");
$db = new DBConnector();
$avatar = $db->get_avatar($user_id);
if($avatar) {
echo "{\"status\":\"OK\",\"avatar\":\"${avatar}\"}";
return;
}
error("404","No avatar was found for the supplied userID");