removing notices

This commit is contained in:
lopar 2018-03-03 02:34:12 +02:00
parent b70edbbb7c
commit ccfbc36694
3 changed files with 13 additions and 8 deletions

View File

@ -16,5 +16,5 @@ echo '<hr>';
$obj = new nick(11221); echo $obj->login()['login']."[{$obj->login()['level']}]";
//echo '<hr>';
//$obj2 = new nick(11221,0); var_dump($obj2->login()); echo $obj2->login()['login']['level'];
echo '<hr>';
echo $obj->login(0)['login']."[{$obj->login()['level']}]";

View File

@ -12,10 +12,9 @@ class nick
/**
* nick constructor.
* @param $playerId
* @param int $showInvisibility
* @param int $playerId
*/
public function __construct($playerId, $showInvisibility = 1) {
public function __construct($playerId) {
if (!$this->user_data) {
$user = db::c()->query('SELECT `login`, `level`, `hp`, `align`, `klan`, `hp`, `maxhp` FROM `users` WHERE `id` = ?i',$playerId)->fetch_assoc();
$this->user_data = $user;
@ -23,8 +22,15 @@ class nick
}
public function login(){
/**
* @param int $showInvisibility
* @return array
*/
public function login($showInvisibility = 1){
if ($showInvisibility) {
$this->user_data['login'] = 'Невидимка';
$this->user_data['level'] = '??';
}
// if ($this->invis){
// // db::c()->query('SELECT `time` FROM `effects` WHERE `owner` = ?i AND `type` = ?i', $id, 1022)->fetch_assoc();
// $user['login'] = 'невидимка';

View File

@ -19,7 +19,6 @@ class u
if (!$this->user_id) {
$this->user_id = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i',$playerId)->fetch_assoc();
}
}