mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
Update Player.php
playing player don't be kicked if another player with same nickname wanna join
This commit is contained in:
parent
4ee56a48aa
commit
1d8e6c040e
1 changed files with 5 additions and 4 deletions
|
|
@ -1330,14 +1330,15 @@ class Player{
|
||||||
}
|
}
|
||||||
$this->loggedIn = true;
|
$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){
|
if(!isset($this->CID) or $this->CID == null){
|
||||||
console("[DEBUG] Player ".$this->username." does not have a CID", true, true, 2);
|
console("[DEBUG] Player ".$this->username." does not have a CID", true, true, 2);
|
||||||
$this->CID = Utils::readLong(Utils::getRandomBytes(8, false));
|
$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);
|
$this->server->api->player->add($this->CID);
|
||||||
if($this->server->api->handle("player.join", $this) === false){
|
if($this->server->api->handle("player.join", $this) === false){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue