summaryrefslogtreecommitdiffstats
path: root/pages
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-01-23 22:38:30 -0800
committerPatrick Davison <snapwilliam@gmail.com>2013-01-23 22:38:30 -0800
commitda05d696e7469d67d6df76d28aad711ee0e828e7 (patch)
tree8ef4a080d965baa6524a94c6f38e2676ca235404 /pages
parent7969dcfa62ac271ed6ef6d6b8d10bcf0659e25b5 (diff)
downloadpathery-da05d696e7469d67d6df76d28aad711ee0e828e7.tar.xz
Chat fixes
Diffstat (limited to 'pages')
-rw-r--r--pages/admin.php1
-rw-r--r--pages/chat.php9
2 files changed, 8 insertions, 2 deletions
diff --git a/pages/admin.php b/pages/admin.php
index 0f54285..dddacaa 100644
--- a/pages/admin.php
+++ b/pages/admin.php
@@ -29,6 +29,7 @@ if ($_GET['applyall'] == 'true') {
}
else if ($_GET['recalcStats'] == 'true') {
echo "Recalculating all player stats...";
+ flush(); //This sends the above echo
recalculateStatsForAllPlayers();
diff --git a/pages/chat.php b/pages/chat.php
index 10e8f7f..094f86a 100644
--- a/pages/chat.php
+++ b/pages/chat.php
@@ -191,11 +191,17 @@ function getChatDone(data) {
//console.log('(END) lastID', lastID);
}
+function prepChat(chat) {
+ chat = chat.join('|:|');
+ chat = chat.replace(/\&/g,'%26')
+ return chat;
+}
+
function getChat(message) {
//console.log('LASTID:', lastID);
var dataString = 'getChatFromID='+lastID;
if (chatBuffer.length > 0) {
- dataString += '&send=true&messages='+chatBuffer.join('|:|');
+ dataString += '&send=true&messages='+prepChat(chatBuffer);
chatBuffer.length = 0;
}
//$.getJSON('ajax_chat.php?getChatFromID='+lastID++message, );
@@ -206,7 +212,6 @@ function getChat(message) {
data: dataString,
success: function(data) {getChatDone(data);}
});
-
}
function sendChat() {