battles/classes/nick.php
2018-03-03 02:37:05 +02:00

41 lines
1.1 KiB
PHP

<?php
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game
*/
class nick
{
private $invis;
private $user_data;
/**
* nick constructor.
* @param int $playerId
*/
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;
}
}
/**
* @param int $showInvisibility
* @return array
*/
public function login($showInvisibility = 0){
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'] = 'невидимка';
// $user['level'] = 100;
// }
return $this->user_data;
}
}