2018-03-01 14:51:01 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Copyright (c) 2018.
|
|
|
|
* Author: Igor Barkov <lopar.4ever@gmail.com>
|
|
|
|
* Project name: Battles-Game
|
|
|
|
*/
|
|
|
|
|
|
|
|
class nick
|
|
|
|
{
|
2018-03-01 16:56:17 +00:00
|
|
|
private $invis;
|
2018-03-02 23:49:16 +00:00
|
|
|
private $user_data;
|
|
|
|
|
2018-03-03 00:07:27 +00:00
|
|
|
/**
|
|
|
|
* nick constructor.
|
|
|
|
* @param $playerId
|
|
|
|
* @param int $showInvisibility
|
|
|
|
*/
|
2018-03-02 23:49:16 +00:00
|
|
|
public function __construct($playerId, $showInvisibility = 1) {
|
|
|
|
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;
|
|
|
|
}
|
2018-03-01 16:56:17 +00:00
|
|
|
|
2018-03-01 14:51:01 +00:00
|
|
|
}
|
|
|
|
|
2018-03-01 16:56:17 +00:00
|
|
|
public function login(){
|
2018-03-02 23:49:16 +00:00
|
|
|
|
|
|
|
// 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;
|
2018-03-01 14:51:01 +00:00
|
|
|
}
|
|
|
|
}
|