Implement other client requestable servers into the API

master
YandolsZX 3 years ago
parent be98743763
commit 350b9893c3
  1. 33
      servertime.php

@ -22,7 +22,38 @@ echo date_format($rutime,"Y/m/d H:i:s");
exit();
}
// If client requested datetime for St. Sky Universe (General Timezone).
if ($data == 'ssu_general') {
// Set current datetime of St. Sky Universe.
$ssutime=date_create();
date_add($ssutime,date_interval_create_from_date_string("1 days"));
date_add($ssutime,date_interval_create_from_date_string("-1 hours"));
// Return current datetime to requester.
echo date_format($ssutime,"Y/m/d H:i:s");
exit();
}
// If client requested datetime for Kocharion Universe (General Timezone).
if ($data == 'ku_general') {
// Set current datetime of Kocharion Universe.
$kutime=date_create();
date_add($kutime,date_interval_create_from_date_string("-1691 years"));
date_add($kutime,date_interval_create_from_date_string("-8 months"));
date_add($kutime,date_interval_create_from_date_string("8 days"));
date_add($kutime,date_interval_create_from_date_string("6 hours"));
date_add($kutime,date_interval_create_from_date_string("1 minutes"));
date_add($kutime,date_interval_create_from_date_string("14 seconds"));
// Return current datetime to requester.
echo date_format($kutime,"Y/m/d H:i:s");
exit();
}
// If client requested a server not on the list or is request is malformed.
echo "Something went wrong.";
http_response_code(400);
echo "Something went wrong with your request. Valid servers to request: ru_general, ssu_general, ku_general.";
exit();
?>
Loading…
Cancel
Save