fixed getPlayer
This commit is contained in:
parent
0ca8793a58
commit
f7070a51e1
@ -357,11 +357,14 @@ class PlayerManager implements CallbackListener, TimerListener {
|
|||||||
/**
|
/**
|
||||||
* Get a Player by Login
|
* Get a Player by Login
|
||||||
*
|
*
|
||||||
* @param string $login
|
* @param mixed $login
|
||||||
* @param bool $connectedPlayersOnly
|
* @param bool $connectedPlayersOnly
|
||||||
* @return Player
|
* @return Player
|
||||||
*/
|
*/
|
||||||
public function getPlayer($login, $connectedPlayersOnly = false) {
|
public function getPlayer($login, $connectedPlayersOnly = false) {
|
||||||
|
if ($login instanceof Player) {
|
||||||
|
return $login;
|
||||||
|
}
|
||||||
if (!isset($this->players[$login])) {
|
if (!isset($this->players[$login])) {
|
||||||
if ($connectedPlayersOnly) {
|
if ($connectedPlayersOnly) {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user