Update Player.php

playing player don't be kicked if another player with same nickname wanna join
This commit is contained in:
ArkQuark 2022-06-21 16:32:38 +03:00
parent 4ee56a48aa
commit 1d8e6c040e

View file

@ -1330,14 +1330,15 @@ class Player{
}
$this->loggedIn = true;
$u = $this->server->api->player->get($this->iusername, false);
if($u !== false){
$u->close("logged in from another location");
}
if(!isset($this->CID) or $this->CID == null){
console("[DEBUG] Player ".$this->username." does not have a CID", true, true, 2);
$this->CID = Utils::readLong(Utils::getRandomBytes(8, false));
}
$u = $this->server->api->player->get($this->iusername, false);
if($u !== false){
$u = $this->server->clients[$this->CID];
$u->close("this player already in game");
}
$this->server->api->player->add($this->CID);
if($this->server->api->handle("player.join", $this) === false){