This solution isn't ideal, but it works...
This commit is contained in:
Dylan K. Taylor
2017-08-23 13:19:18 +01:00
parent 0f2ca99c67
commit 84c8ac03fb
2 changed files with 22 additions and 3 deletions

View File

@ -1770,7 +1770,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
return;
}
foreach($this->server->getOnlinePlayers() as $p){
foreach($this->server->getLoggedInPlayers() as $p){
if($p !== $this and $p->iusername === $this->iusername){
if($p->kick("logged in from another location") === false){
$this->close($this->getLeaveMessage(), "Logged in from another location");
@ -1827,6 +1827,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->sendPlayStatus(PlayStatusPacket::LOGIN_SUCCESS);
$this->loggedIn = true;
$this->server->onPlayerLogin($this);
$pk = new ResourcePacksInfoPacket();
$manager = $this->server->getResourceManager();
@ -1910,8 +1911,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
}
$this->server->addOnlinePlayer($this);
$this->server->onPlayerLogin($this);
$this->server->onPlayerCompleteLoginSequence($this);
}
public function handleLogin(LoginPacket $packet) : bool{
@ -3467,6 +3467,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->loadQueue = [];
if($this->loggedIn){
$this->server->onPlayerLogout($this);
foreach($this->server->getOnlinePlayers() as $player){
if(!$player->canSee($this)){
$player->showPlayer($this);