mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-08 04:38:35 +00:00
Added __get() magic methods to Player and set some properties private
This commit is contained in:
parent
78167a3cd4
commit
c3a0600ffd
@ -33,16 +33,16 @@ class Player{
|
|||||||
private $nextBuffer = 0;
|
private $nextBuffer = 0;
|
||||||
private $recovery = array();
|
private $recovery = array();
|
||||||
private $evid = array();
|
private $evid = array();
|
||||||
public $lastMovement = 0;
|
private $lastMovement = 0;
|
||||||
public $timeout;
|
private $timeout;
|
||||||
public $connected = true;
|
private $connected = true;
|
||||||
public $clientID;
|
private $clientID;
|
||||||
public $ip;
|
private $ip;
|
||||||
public $port;
|
private $port;
|
||||||
public $counter = array(0, 0, 0);
|
private $counter = array(0, 0, 0);
|
||||||
public $username;
|
private $username;
|
||||||
public $iusername;
|
private $iusername;
|
||||||
public $eid = false;
|
private $eid = false;
|
||||||
public $data;
|
public $data;
|
||||||
public $entity = false;
|
public $entity = false;
|
||||||
public $auth = false;
|
public $auth = false;
|
||||||
@ -55,8 +55,8 @@ class Player{
|
|||||||
public $loggedIn = false;
|
public $loggedIn = false;
|
||||||
public $gamemode;
|
public $gamemode;
|
||||||
public $lastBreak;
|
public $lastBreak;
|
||||||
public $windowCnt = 0;
|
private $windowCnt = 0;
|
||||||
public $windows = array();
|
private $windows = array();
|
||||||
public $blocked = true;
|
public $blocked = true;
|
||||||
private $chunksLoaded = array();
|
private $chunksLoaded = array();
|
||||||
private $chunksOrder = array();
|
private $chunksOrder = array();
|
||||||
@ -64,7 +64,14 @@ class Player{
|
|||||||
public $itemEnforcement;
|
public $itemEnforcement;
|
||||||
public $lastCorrect;
|
public $lastCorrect;
|
||||||
|
|
||||||
function __construct($clientID, $ip, $port, $MTU){
|
public function __get($name){
|
||||||
|
if(isset($this->{$name})){
|
||||||
|
return ($this->{$name});
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __construct($clientID, $ip, $port, $MTU){
|
||||||
$this->MTU = $MTU;
|
$this->MTU = $MTU;
|
||||||
$this->server = ServerAPI::request();
|
$this->server = ServerAPI::request();
|
||||||
$this->lastBreak = microtime(true);
|
$this->lastBreak = microtime(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user