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 @@
+
+
+
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:
-:) 
:D 
;) 
;( 
:con: 
:@ 
:grr: 
XD 
:omg: 
:fp: 
:thinking: 
:eyes: 
R( 
RB: 
R: 
:ponything: 
:waah: 
:nuu: 
:caps: 
:lenny: ( ͡° ͜ʖ ͡°)
:shrug: ¯\_(ツ)_/¯
:megusta: 
:lol: 
:troll: 
:no: 
:pface: 
:raeg: 
:ohplz: 
:ydsay: 
:falone: 
:doge: 
:trig: 
:wolfthing: 
:mccreeper: 
:mchappy: 
:sonic: 
:yoshi: 
:mario: 
:luigi: 
:weegee: 
:pokeball: 
:ds: 
:baby: 
:bheart: 
:taco: 
:burger: 
:icecream: 
:cake: 
:file: 
:rec: 
:stb: 
:uns: 
:pre: 
-
-
\ 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(" => "

",
"RB:" => "

",
"R:" => "

",
- ":ponything:" => "

",
+ ":ponything:" => "

",
":waah:" => "

",
":nuu:" => "

",
":caps:" => "

",
@@ -59,7 +59,7 @@
":icecream:" => "

",
":cake:" => "

",
":file:" => "

",
- ":rec:" => "

",
+ ":rec:" => "

",
":stb:" => "

",
":uns:" => "

",
":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