Id = $Id; $DbResult = $this->Database->query('SELECT * FROM Realm WHERE Id='.$Id.' AND Enabled=1'); $this->Data = $DbResult->fetch_assoc(); $this->CharactersDatabase = new Database(); $this->CharactersDatabase->Connect($this->Data['DatabaseHost'], $this->Data['DatabaseUser'], $this->Data['DatabasePassword'], $this->Data['DatabaseCharacters']); $this->CharactersDatabase->select_db($this->Data['DatabaseCharacters']); //if($this->CharactersDatabase->connect_error) //{ // die('Přihlášení k databázi realmu '.$this->Id.' selhalo: '.$this->Database->connect_error); //} $this->CharactersDatabase->charset($this->Config['Database']['Charset']); $this->MangosDatabase = new Database(); $this->MangosDatabase->Connect($this->Data['DatabaseHost'], $this->Data['DatabaseUser'], $this->Data['DatabasePassword'], $this->Data['DatabaseMangos']); $this->MangosDatabase->select_db($this->Data['DatabaseMangos']); //if($this->MangosDatabase->connect_error) //{ // die('Přihlášení k databázi realmu '.$this->Id.' selhalo: '.$this->MangosDatabase->connect_error); //} $this->MangosDatabase->charset($this->Config['Database']['Charset']); } function OnlineCharactersCount() { if($this->CharactersDatabase->connect_error) return(0); else { $DbResult = $this->CharactersDatabase->query('SELECT COUNT(*) FROM `characters` WHERE `online` = 1'); $DbRow = $DbResult->fetch_row(); return($DbRow[0]); } } function OnlineStateImage($Status) { global $html; if($Status) return(' Mimo provoz'); else return(' V provozu'); } function Uptime() { $Database->OpenLogonServerDatabase(); $row = $Database->query('SELECT `starttime`, `uptime` FROM `uptime` WHERE `realmid`='.$this->Id.' ORDER BY `starttime` DESC LIMIT 1') ->fetch_array(); $uptime = round($row['uptime'] / 3600); return($uptime); } public function CharacterCount() { if($this->CharactersDatabase->connect_error) return(''); else { $DbResult = $this->CharactersDatabase->query('SELECT COUNT(*) FROM `characters`'); $DbRow = $DbResult->fetch_row(); return($DbRow[0]); } } public function GuidToCharName($guid) { if($this->CharactersDatabase->connect_error) return(0); else { $row = $this->CharactersDatabase->query('SELECT `name` FROM `characters` WHERE `guid` = "'.$guid.'" LIMIT 1')->fetch_array(); return($row['name']); } } public function ShowGmLog($log) { echo('
Čas | GM | Příkaz | Vybrán |
---|---|---|---|
'.$human_date.' | '.$edited_arr[2].' | '.$edited_arr[1].' | '.$edited_arr[4].$sel_name.' |
'.$human_date.' | '.$edited_arr[1].' | Send : '.$edited_arr[3].') | - |
'.$human_date.' | '.$edited_arr[1].' | Trade : '.$edited_arr[3].') | - |