mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 08:39:53 +00:00
Added ability to disallow auto-kick of logged in players without using external properties, and using the event system
This commit is contained in:
parent
076bf2f2fe
commit
c6f189f93f
@ -1318,11 +1318,11 @@ class Player extends Human implements CommandSender, IPlayer{
|
|||||||
|
|
||||||
foreach($this->server->getOnlinePlayers() as $p){
|
foreach($this->server->getOnlinePlayers() as $p){
|
||||||
if($p !== $this and strtolower($p->getName()) === strtolower($this->getName())){
|
if($p !== $this and strtolower($p->getName()) === strtolower($this->getName())){
|
||||||
if($this->server->getConfigBoolean("kick-duplicate-names",true)) {
|
if($p->kick("logged in from another location") === false){
|
||||||
$p->close($p->getName() . " has left the game", "logged in from another location");
|
$this->close($p->getName() . " has left the game", "already logged in");
|
||||||
} else {
|
|
||||||
$this->close($this->username . " has left the game", "You are already logged on!");
|
|
||||||
return;
|
return;
|
||||||
|
}else{
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user