mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
Automatically remove ANSI codes from chat
This commit is contained in:
parent
e2d4b49266
commit
b83ef4e70b
1 changed files with 1 additions and 3 deletions
|
|
@ -153,7 +153,6 @@ class Player{
|
||||||
$this->close("timeout");
|
$this->close("timeout");
|
||||||
}else{
|
}else{
|
||||||
if(!empty($this->queue)){
|
if(!empty($this->queue)){
|
||||||
$cnt = 0;
|
|
||||||
$maxtime = $time + 0.0025;
|
$maxtime = $time + 0.0025;
|
||||||
while(microtime(true) < $maxtime){
|
while(microtime(true) < $maxtime){
|
||||||
$p = array_shift($this->queue);
|
$p = array_shift($this->queue);
|
||||||
|
|
@ -168,7 +167,6 @@ class Player{
|
||||||
eval($p[1]);
|
eval($p[1]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++$cnt;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -416,7 +414,7 @@ class Player{
|
||||||
}else{
|
}else{
|
||||||
$message = (string) $data;
|
$message = (string) $data;
|
||||||
}
|
}
|
||||||
$this->sendChat($message);
|
$this->sendChat(preg_replace('/\x1b\[[0-9;]*m/', "", $message)); //Remove ANSI codes from chat
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue