summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ajax/chat.ajax.php10
-rw-r--r--pages/chat.php18
2 files changed, 25 insertions, 3 deletions
diff --git a/ajax/chat.ajax.php b/ajax/chat.ajax.php
index 415c517..c909754 100644
--- a/ajax/chat.ajax.php
+++ b/ajax/chat.ajax.php
@@ -1,5 +1,10 @@
<?
session_start();
+//For testing purposes send a fake 404.
+// if (rand(1,3) == 2) {
+ // header("HTTP/1.0 404 Not Found");
+ // exit;
+// }
if (strtotime('now') - $_SESSION['chatLastReset'] > 6) {
$_SESSION['chatSendCount'] = 0;
$_SESSION['chatLastReset'] = strtotime('now');
@@ -168,6 +173,11 @@ function chatFilter($chat) {
$chat = str_ireplace("pedophile", "Optimus Prime", $chat);
$chat = str_ireplace("pedo", "Optimus Prime", $chat);
$chat = str_ireplace("rape", "shake hands with", $chat);
+
+ //Easter Eggs
+ $chat = str_ireplace("i just pwned Snap", "Snap just totally pwned me ^^", $chat);
+ $chat = str_ireplace("i just pwned Blue", "Blue just epicly pwned me the with chat filter", $chat);
+ $chat = str_ireplace("language filter", "highly educated team of monkeys employed to filter bad language", $chat);
return $chat;
}
?> \ No newline at end of file
diff --git a/pages/chat.php b/pages/chat.php
index da423bf..08b6393 100644
--- a/pages/chat.php
+++ b/pages/chat.php
@@ -195,20 +195,32 @@ function spoil(obj) {
$(obj).removeClass("spoiler");
}
+var chatIsBusy = false;
function getChat(message) {
+ if (chatIsBusy) return;
+ chatIsBusy = true;
var dataString = 'getChatFromID='+lastID;
+ var backup = new Array();
if (chatBuffer.length > 0) {
dataString += '&send=true&messages='+prepChat(chatBuffer);
+ backup = chatBuffer.slice(0);
+ chatBuffer.length = 0;
}
-
$.ajax({
type: "POST",
url: "ajax/chat.ajax.php",
data: dataString,
+ error: function() {
+ chatBuffer = backup.concat(chatBuffer);
+ //console.log('concated:', chatBuffer, backup);
+ },
success: function(data) {
getChatDone(data);
- chatBuffer.length = 0;
- }
+ //console.log('b:', backup);
+ },
+ complete: function() {
+ chatIsBusy = false;
+ }
});
}