5.5 strict warnings, change background color
[php-js-websockets.git] / server.functions.php
blob:a/server.functions.php -> blob:b/server.functions.php
--- a/server.functions.php
+++ b/server.functions.php
@@ -10,10 +10,10 @@
 	}
 }
 
-function sendMessageToAll ($allclients, $session, $msg) {
+function sendMessageToAll ($allclients, $socket, $session, $msg) {
 	global $_sockets;
 	foreach ($allclients as $client) {
-		if ( $_sockets[$client]['session'] == $session ) {
+		if ( $_sockets[intval ($client)]['session'] == $session && intval ($client) != intval ($socket) ) {
 			echo "[".date('Y-m-d H:i:s')."] MESSAGE to ".intval($client)." ".$msg.")\n";
 			@socket_write ($client, encode ($msg));
 		}

comments