mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-18 17:11:28 +00:00
Fixed players being able to add color codes in names and be shown on console (on kick)
This commit is contained in:
parent
7be9ea68c7
commit
1a8cbdd6c7
@ -1262,7 +1262,8 @@ class Player extends Human implements CommandSender, IPlayer{
|
||||
if($this->loggedIn === true){
|
||||
break;
|
||||
}
|
||||
$this->username = $packet->username;
|
||||
|
||||
$this->username = TextFormat::clean($packet->username);
|
||||
$this->displayName = $this->username;
|
||||
$this->iusername = strtolower($this->username);
|
||||
$this->loginData = array("clientId" => $packet->clientId, "loginData" => $packet->loginData);
|
||||
@ -1286,7 +1287,7 @@ class Player extends Human implements CommandSender, IPlayer{
|
||||
|
||||
return;
|
||||
}
|
||||
if(preg_match('#^[a-zA-Z0-9_]{3,16}$#', $this->username) == 0 or $this->username === "" or $this->iusername === "rcon" or $this->iusername === "console"){
|
||||
if(preg_match('#^[a-zA-Z0-9_]{3,16}$#', $packet->username) == 0 or $this->username === "" or $this->iusername === "rcon" or $this->iusername === "console"){
|
||||
$this->close("", "Bad username");
|
||||
|
||||
return;
|
||||
|
10
start.cmd
10
start.cmd
@ -19,8 +19,12 @@ if exist PocketMine-MP.phar (
|
||||
)
|
||||
)
|
||||
|
||||
if exist bin\mintty.exe (
|
||||
start "" bin\mintty.exe -o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o Font="DejaVu Sans Mono" -o FontHeight=10 -o CursorType=0 -o CursorBlinks=1 -h error -t "PocketMine-MP" -i bin/pocketmine.ico -w max %PHP_BINARY% %POCKETMINE_FILE% --enable-ansi %*
|
||||
if exist bin\php\php_wxwidgets.dll (
|
||||
%PHP_BINARY% %POCKETMINE_FILE% --enable-gui %*
|
||||
) else (
|
||||
%PHP_BINARY% %POCKETMINE_FILE% %*
|
||||
if exist bin\mintty.exe (
|
||||
start "" bin\mintty.exe -o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o Font="DejaVu Sans Mono" -o FontHeight=10 -o CursorType=0 -o CursorBlinks=1 -h error -t "PocketMine-MP" -i bin/pocketmine.ico -w max %PHP_BINARY% %POCKETMINE_FILE% --enable-ansi %*
|
||||
) else (
|
||||
%PHP_BINARY% %POCKETMINE_FILE% %*
|
||||
)
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user