ZontreckWebsite/php/Ping.php

31 lines
No EOL
458 B
PHP

<?php
if(!defined("COMMON"))
require("Common.php");
$js = getJsonizedInput();
$psk = "";
$allow=false;
if(!defined("CLIENTPSK")) {
$allow=true;
} else {
if($js['client'] == CLIENTPSK) {
// Authorized. Send the PSK value to the client
$allow=true;
$psk = PSK;
}else {
$allow=false;
}
}
$ret = array(
"type" => "S2CPong",
"authorized" => $allow,
"psk" => $psk
);
die(json_encode($ret));
?>