From b83ef4e70b9e520f3be6a6b90b2a1b903dafcb98 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Sun, 31 Mar 2013 13:36:19 +0200 Subject: [PATCH] Automatically remove ANSI codes from chat --- src/Player.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Player.php b/src/Player.php index efd63ab9..29704834 100644 --- a/src/Player.php +++ b/src/Player.php @@ -153,7 +153,6 @@ class Player{ $this->close("timeout"); }else{ if(!empty($this->queue)){ - $cnt = 0; $maxtime = $time + 0.0025; while(microtime(true) < $maxtime){ $p = array_shift($this->queue); @@ -168,7 +167,6 @@ class Player{ eval($p[1]); break; } - ++$cnt; } } @@ -416,7 +414,7 @@ class Player{ }else{ $message = (string) $data; } - $this->sendChat($message); + $this->sendChat(preg_replace('/\x1b\[[0-9;]*m/', "", $message)); //Remove ANSI codes from chat break; } }