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 $id;
|
|
|
|
private $invis;
|
|
|
|
|
|
|
|
function __construct($playerId, $showInvisibility = 1) {
|
|
|
|
$this->id = $playerId;
|
|
|
|
$this->invis = $showInvisibility;
|
2018-03-01 14:51:01 +00:00
|
|
|
}
|
|
|
|
|
2018-03-01 16:56:17 +00:00
|
|
|
public function login(){
|
|
|
|
$user = db::c()->query('SELECT `login`, `level`, `hp`, `align`, `klan`, `hp`, `maxhp` FROM `users` WHERE `id` = ?i',$this->id)->fetch_assoc();
|
|
|
|
if ($this->invis){
|
2018-03-01 18:43:46 +00:00
|
|
|
// db::c()->query('SELECT `time` FROM `effects` WHERE `owner` = ?i AND `type` = ?i', $id, 1022)->fetch_assoc();
|
2018-03-01 16:56:17 +00:00
|
|
|
$user['login'] = 'невидимка';
|
|
|
|
$user['level'] = 100;
|
|
|
|
}
|
|
|
|
return $user;
|
2018-03-01 14:51:01 +00:00
|
|
|
}
|
|
|
|
}
|