diff --git a/3ds/chat/discord.php b/3ds/chat/discord.php index 1c656a3..594c11a 100644 --- a/3ds/chat/discord.php +++ b/3ds/chat/discord.php @@ -4,7 +4,7 @@ if(isset($_POST["msg"]) && isset($_POST["usr"]) && isset($_POST["room"])){ if(!(file_exists("dkey.global")) && !(file_exists("dhook.global"))){ echo "tunnel.setupfailure"; - } else if(isset($_POST["key"]) && $_POST["key"] == file_get_contents("dkey.global") && file_exists("dhook.global")){ + } else if(isset($_POST["key"]) && $_POST["key"] == file_get_contents("dkey.global")){ if(file_exists("data/".$_POST["room"].".json")){ // Room exists // Set needed variables diff --git a/3ds/chat/discordn.php b/3ds/chat/discordn.php new file mode 100644 index 0000000..9e96d05 --- /dev/null +++ b/3ds/chat/discordn.php @@ -0,0 +1,27 @@ += strval($jsonD["max"])){ + array_pop($jsonD["msg"]); + } + $finalmsg = array("cont"=>$_POST["msg"],"time"=>time(),"type"=>"message","color"=>"red","visibility"=>"dall","from"=>$_POST["usr"]); + array_unshift($jsonD["msg"], $finalmsg); + $jsonString = json_encode($jsonD); + file_put_contents("data/".$_POST["room"].".json",$jsonString); + } else { + echo "tunnel.roomnotexistorhooknotexist"; + } + } else { + echo "tunnel.security.invalidkey"; + } +} \ No newline at end of file