Finish implementing initial setup process

This commit is contained in:
zontreck 2024-05-15 15:53:13 -07:00
parent d47906e10f
commit 7c358d48e0
9 changed files with 340 additions and 41 deletions

31
php/Ping.php Normal file
View file

@ -0,0 +1,31 @@
<?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));
?>