Finish implementing initial setup process
This commit is contained in:
parent
d47906e10f
commit
7c358d48e0
9 changed files with 340 additions and 41 deletions
31
php/Ping.php
Normal file
31
php/Ping.php
Normal 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));
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue