mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Release similar player name check from the beginning
For example, some would like to write `map` for `pemapmodder`, and this is what existed in amai beetroot when we used `SQLite3::query("SELECT ... ALIKE")`.
This commit is contained in:
parent
2066e92f84
commit
c92a1ba7fe
@ -748,7 +748,7 @@ class Server{
|
||||
$name = strtolower($name);
|
||||
$delta = PHP_INT_MAX;
|
||||
foreach($this->getOnlinePlayers() as $player){
|
||||
if(stripos($player->getName(), $name) === 0){
|
||||
if(stripos($player->getName(), $name) !== false){
|
||||
$curDelta = strlen($player->getName()) - strlen($name);
|
||||
if($curDelta < $delta){
|
||||
$found = $player;
|
||||
|
Loading…
x
Reference in New Issue
Block a user