mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +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){
|
||||
if($p !== $this and strtolower($p->getName()) === strtolower($this->getName())){
|
||||
if($this->server->getConfigBoolean("kick-duplicate-names",true)) {
|
||||
$p->close($p->getName() . " has left the game", "logged in from another location");
|
||||
} else {
|
||||
$this->close($this->username . " has left the game", "You are already logged on!");
|
||||
if($p->kick("logged in from another location") === false){
|
||||
$this->close($p->getName() . " has left the game", "already logged in");
|
||||
return;
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user