mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Internal Fixes
This commit is contained in:
parent
c049b5fb72
commit
ef76138a1c
4 changed files with 12 additions and 7 deletions
|
|
@ -47,6 +47,7 @@ class Player{
|
|||
var $spawned = false;
|
||||
var $inventory;
|
||||
var $equipment = array(1, 0);
|
||||
var $loggedIn = false;
|
||||
function __construct(PocketMinecraftServer $server, $clientID, $ip, $port, $MTU){
|
||||
$this->MTU = $MTU;
|
||||
$this->server = $server;
|
||||
|
|
@ -345,6 +346,10 @@ class Player{
|
|||
|
||||
break;
|
||||
case MC_LOGIN:
|
||||
if($this->loggedIn === true){
|
||||
break;
|
||||
}
|
||||
$this->loggedIn = true;
|
||||
$this->username = str_replace(array("\x00", "/", " ", "\r", "\n"), array("", "-", "_", "", ""), $data["username"]);
|
||||
if($this->username == ""){
|
||||
$this->close("bad username", false);
|
||||
|
|
@ -371,7 +376,7 @@ class Player{
|
|||
}
|
||||
$this->server->api->player->add($this->CID);
|
||||
$this->auth = true;
|
||||
if(!isset($this->data["inventory"])){
|
||||
if(!isset($this->data["inventory"]) or $this->server->gamemode === 1){
|
||||
$this->data["inventory"] = $this->inventory;
|
||||
}
|
||||
$this->inventory = &$this->data["inventory"];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue