diff options
-rw-r--r-- | ajax_chat.php | 2 | ||||
-rw-r--r-- | pages/admin.php | 1 | ||||
-rw-r--r-- | pages/chat.php | 9 |
3 files changed, 10 insertions, 2 deletions
diff --git a/ajax_chat.php b/ajax_chat.php index 04a6fd4..2b6d909 100644 --- a/ajax_chat.php +++ b/ajax_chat.php @@ -1,5 +1,7 @@ <?
session_start();
+session_write_close();
+//Just doing this as evidence that $_SESSION as read-only is still available.
$userID = $_SESSION['userID'];
include('includes/chats.php');
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() {
|