diff --git a/3ds/chat/badwords.txt b/3ds/chat/badwords.txt index c237a93..51360e8 100644 --- a/3ds/chat/badwords.txt +++ b/3ds/chat/badwords.txt @@ -4,6 +4,8 @@ pussy dick penis cock +nigga +nigger fortnite is good minecraft is bad fortnite is awesome diff --git a/3ds/chat/functions.php b/3ds/chat/functions.php new file mode 100644 index 0000000..c546bb7 --- /dev/null +++ b/3ds/chat/functions.php @@ -0,0 +1,28 @@ + 0) { + $splitPos = strpos($source, $partials[$index]); + + $outStr[0] = substr($source, 0, $splitPos - 1); + $outStr[1] = substr($source, $splitPos); + } + + return $outStr; +} + +?> \ No newline at end of file diff --git a/3ds/chat/i/buy_sonic.png b/3ds/chat/i/buy_sonic.png index 528b601..9a06e12 100644 Binary files a/3ds/chat/i/buy_sonic.png and b/3ds/chat/i/buy_sonic.png differ diff --git a/3ds/chat/i/mad.png b/3ds/chat/i/mad.png new file mode 100644 index 0000000..ad6aae3 Binary files /dev/null and b/3ds/chat/i/mad.png differ diff --git a/3ds/chat/icons.php b/3ds/chat/icons.php new file mode 100644 index 0000000..b89fcc7 --- /dev/null +++ b/3ds/chat/icons.php @@ -0,0 +1,37 @@ + + + + + +Nav Browser + +nav index ←
Emoticon Reference:

+:)  happy
:D  grin
;)  wink
;(  cry
:con:  confused
:@  mad
:grr:  annoyed
XD  ecksdee
:omg:  omg
:fp:  facepalm
:thinking:  thinking
:eyes:  eyes
R(  negitiveepicface
RB:  rainbowepicface
R:  epicface
:ponything:  ponything
:waah:  waah
:nuu:  nuu
:caps:  caps
:lenny:  ( ͡° ͜ʖ ͡°)
:shrug:  ¯\_(ツ)_/¯
:megusta:  megusta
:lol:  lol
:troll:  troll
:no:  no
:pface:  pokerface
:raeg:  raeg
:ohplz:  ohplz
:ydsay:  ydsay
:falone:  falone
:doge:  <DOGE (not the currency)>
:trig:  triggered
:wolfthing:  <•o•>
:mccreeper:  mccreeper
:mchappy:  mchappy
:sonic:  sonic
:yoshi:  yoshi
:mario:  mario
:luigi:  luigi
:weegee:  weegee
:pokeball:  pokeball
:ds:  ds
:baby:  baby
:bheart:  heart
:taco:  taco
:burger:  burger
:icecream:  icecream
:cake:  cake
:file:  file
:rec:  RECOMMENDED
:stb:  STABLE
:uns:  UNSTABLE
:pre:  PRERELEASE
+ + \ No newline at end of file diff --git a/3ds/chat/index.php b/3ds/chat/index.php index 0580c47..f10d315 100644 --- a/3ds/chat/index.php +++ b/3ds/chat/index.php @@ -58,11 +58,25 @@ if(isset($_GET["room"])){ var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState == XMLHttpRequest.DONE) { - console.log(document.getElementById("chatscreen").innerHTML.split("")[0].replace("
","
")); - console.log(xhr.responseText); - if(xhr.responseText !== document.getElementById("chatscreen").innerHTML.split("")[0].replace("
","
").replace(/"/gi, "'")){ + last=""; + console.log("Hey: "+(document.getElementById("chatscreen").innerHTML.split("")[0].replace("
","
").replace(/"/gi, "'").endsWith(""))); + if((document.getElementById("chatscreen").innerHTML.split("")[0].replace("
","
").replace(/"/gi, "'").endsWith(""))){ + console.log("Chatscreen has no endmsg!"); - console.log(xhr.responseText); + } + last = ""; + console.log("Fixed: " + document.getElementById("chatscreen").innerHTML.split("")[0].replace("
","
").replace(/"/gi, "'")+last); + console.log("This must be true always: true"); + // console.log("XHR: " + xhr.responseText); + + if(!(document.getElementById("chatscreen").innerHTML.split("")[0].replace("
","
").replace(/"/gi, "'").endsWith(""))){ + chatInner = document.getElementById("chatscreen").innerHTML.split("")[0].replace("
","
").replace(/"/gi, "'")+""; + } else { + chatInner = document.getElementById("chatscreen").innerHTML.split("")[0].replace("
","
").replace(/"/gi, "'"); + } + if(xhr.responseText.replace(/' \/>/gi, "'>").replace(/\x3C/gi, "<") != chatInner){ + + console.log("XHR: " + xhr.responseText.replace(/' \/>/gi, "'>")+last); document.getElementById("chatscreen").innerHTML = xhr.responseText+ "" + document.getElementById("chatscreen").innerHTML; getMax().then(res => {window.maxMsg = res}); if(window.maxMsg <= document.getElementById("chatscreen").innerHTML.split("").length){ @@ -104,6 +118,13 @@ if(isset($_GET["room"])){ // We don't need to do anything with the response text. // alert(http.responseText); document.getElementById("msg").value = ""; + if(http.responseText.startsWith("::message;")){ + alert(http.responseText.replace("::message;","")); + } + if(http.responseText.startsWith("::eval;")){ + eval(http.responseText.replace("::eval;","")); + } + } }; http.send(params); @@ -124,7 +145,8 @@ if(isset($_GET["room"])){
- Back Online List: + Back
+
diff --git a/3ds/chat/innerchat.php b/3ds/chat/innerchat.php index fe22186..3fb096c 100644 --- a/3ds/chat/innerchat.php +++ b/3ds/chat/innerchat.php @@ -9,13 +9,16 @@ if(isset($_GET["room"]) && file_exists("data/".$_GET["room"].".json")){ if(count($jsonD["msg"]) != 0){ foreach($jsonD["msg"] as $key => $message){ - + $toYou = (isset($_SESSION["ts_user"]) && $_SESSION["ts_user"] == $message["visibility"] && $message["type"] != "rawbr"); if($message["visibility"] !== "all"){ - if(isset($_SESSION["ts_user"]) && $_SESSION["ts_user"] == $message["visibility"] && $message["type"] != "rawbr"){ - $color = bin2hex(substr($message["from"], 0, 3)); + $color = bin2hex(substr($message["from"], 0, 3)); + if($toYou){ echo "".$message["from"].": ".process($message["cont"])." [To you]
"; } - } else { + if($message["from"] == $_SESSION["ts_user"] && $message["visibility"] != $_SESSION["ts_user"]){ + echo "".$message["from"].": ".process($message["cont"])." [To ".$message["visibility"]."]
"; + } + } if($message["type"] === "message" && $message["visibility"] === "all"){ $color = bin2hex(substr($message["from"], 0, 3)); echo "".$message["from"].": ".process($message["cont"])."
"; @@ -25,5 +28,4 @@ if(isset($_GET["room"]) && file_exists("data/".$_GET["room"].".json")){ } } - } -} \ No newline at end of file + } \ No newline at end of file diff --git a/3ds/chat/latest.php b/3ds/chat/latest.php index f633f2f..8c8666f 100644 --- a/3ds/chat/latest.php +++ b/3ds/chat/latest.php @@ -14,6 +14,9 @@ if(isset($_GET["room"]) && file_exists("data/".$_GET["room"].".json")){ if(isset($_SESSION["ts_user"]) && $_SESSION["ts_user"] == $message["visibility"] && $message["type"] != "rawbr"){ echo "".$message["from"].": ".process($message["cont"])." [To you]
"; } + if($message["from"] == $_SESSION["ts_user"] && $message["visibility"] != $_SESSION["ts_user"]){ + echo "".$message["from"].": ".process($message["cont"])." [To ".$message["visibility"]."]
"; + } } else { if($message["type"] === "message" && $message["visibility"] === "all"){ diff --git a/3ds/chat/nav.html b/3ds/chat/nav.html deleted file mode 100644 index dff6d27..0000000 --- a/3ds/chat/nav.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - -Nav Browser - -nav index ←
Emoticon Reference:

-:)  happy
:D  grin
;)  wink
;(  cry
:con:  confused
:@  mad
:grr:  annoyed
XD  ecksdee
:omg:  omg
:fp:  facepalm
:thinking:  thinking
:eyes:  eyes
R(  negitiveepicface
RB:  rainbowepicface
R:  epicface
:ponything:  ponything
:waah:  waah
:nuu:  nuu
:caps:  caps
:lenny:  ( ͡° ͜ʖ ͡°)
:shrug:  ¯\_(ツ)_/¯
:megusta:  megusta
:lol:  lol
:troll:  troll
:no:  no
:pface:  pokerface
:raeg:  raeg
:ohplz:  ohplz
:ydsay:  ydsay
:falone:  falone
:doge:  <DOGE (not the currency)>
:trig:  triggered
:wolfthing:  <•o•>
:mccreeper:  mccreeper
:mchappy:  mchappy
:sonic:  sonic
:yoshi:  yoshi
:mario:  mario
:luigi:  luigi
:weegee:  weegee
:pokeball:  pokeball
:ds:  ds
:baby:  baby
:bheart:  heart
:taco:  taco
:burger:  burger
:icecream:  icecream
:cake:  cake
:file:  file
:rec:  RECOMMENDED
:stb:  STABLE
:uns:  UNSTABLE
:pre:  PRERELEASE
- - \ No newline at end of file diff --git a/3ds/chat/process.php b/3ds/chat/process.php index fe5d98a..6da2e50 100644 --- a/3ds/chat/process.php +++ b/3ds/chat/process.php @@ -25,7 +25,7 @@ "R(" => "negitiveepicface", "RB:" => "rainbowepicface", "R:" => "epicface", - ":ponything:" => "ponything", + ":ponything:" => "ponything", ":waah:" => "waah", ":nuu:" => "nuu", ":caps:" => "caps", @@ -59,7 +59,7 @@ ":icecream:" => "icecream", ":cake:" => "cake", ":file:" => "file", - ":rec:" => "RECOMMENDED", + ":rec:" => "RECOMMENDED", ":stb:" => "STABLE", ":uns:" => "UNSTABLE", ":pre:" => "pre" diff --git a/3ds/chat/sender.php b/3ds/chat/sender.php index fae883d..0a9e751 100644 --- a/3ds/chat/sender.php +++ b/3ds/chat/sender.php @@ -1,4 +1,15 @@ = strval($jsonD["max"])); - if(count($jsonD["msg"])+1 >= strval($jsonD["max"])){ - array_pop($jsonD["msg"]); + if(startsWith($_POST["msg"], "/")){ + // This is a command! + /* + Types of responses: + ::message;text - Message for client + ::eval;code - Javascript code to execute + ::setmsg;text - Set message box text + ::addmsg;text - Add text to message box + */ + if(startsWith($_POST["msg"], "/clear")){ + echo "::eval;getfullchat()"; + }else if(startsWith($_POST["msg"], "/eval ")){ + echo "::eval;".str_replace("/eval ", "",$_POST["msg"]); + }else if(startsWith($_POST["msg"], "/whisper ")){ + $x = explode(" ", $_POST["msg"]); + $who = $x[1]; + $msg = strSplit($_POST["msg"], 2, " "); + if(count($jsonD["msg"])+1 >= strval($jsonD["max"])){ + array_pop($jsonD["msg"]); + } + $finalmsg = array("cont"=>$msg[1],"time"=>time(),"type"=>"message","color"=>"red","visibility"=>$who,"from"=>$_SESSION["ts_user"]); + array_unshift($jsonD["msg"], $finalmsg); + $jsonString = json_encode($jsonD); + file_put_contents("data/".$room.".json",$jsonString); + }else{ + echo "::message;Command \"" . explode(" ", $_POST["msg"])[0] . "\" not found."; + + } + + } else { + var_dump(count($jsonD["msg"])+1 >= strval($jsonD["max"])); + if(count($jsonD["msg"])+1 >= strval($jsonD["max"])){ + array_pop($jsonD["msg"]); + } + $finalmsg = array("cont"=>$_POST["msg"],"time"=>time(),"type"=>"message","color"=>"red","visibility"=>"all","from"=>$_SESSION["ts_user"]); + array_unshift($jsonD["msg"], $finalmsg); + $jsonString = json_encode($jsonD); + file_put_contents("data/".$room.".json",$jsonString); } - $finalmsg = array("cont"=>$_POST["msg"],"time"=>time(),"type"=>"message","color"=>"red","visibility"=>"all","from"=>$_SESSION["ts_user"]); - array_unshift($jsonD["msg"], $finalmsg); - $jsonString = json_encode($jsonD); - file_put_contents("data/".$room.".json",$jsonString); } } ?> diff --git a/3ds/chat/sonic-hd.png b/3ds/chat/sonic-hd.png new file mode 100644 index 0000000..f9f905d Binary files /dev/null and b/3ds/chat/sonic-hd.png differ diff --git a/3ds/chat/sonic.jpg b/3ds/chat/sonic.jpg new file mode 100644 index 0000000..dc7bef9 Binary files /dev/null and b/3ds/chat/sonic.jpg differ