'Restarty', 'Table' => 'Debug', 'Items' => array( 'Time' => array('Type' => 'String', 'Caption' => 'Čas', 'Default' => ''), 'MangosVersion' => array('Type' => 'String', 'Caption' => 'Verze emulátoru', 'Default' => ''), 'DbVersion' => array('Type' => 'String', 'Caption' => 'Verze databáze', 'Default' => ''), 'MaxPlayerCount' => array('Type' => 'Integer', 'Caption' => 'Max. online hráčů', 'Default' => ''), 'Uptime' => array('Type' => 'String', 'Caption' => 'Doba běhu', 'Default' => ''), ), ); var $ItemFormClass = array( 'Title' => 'Záznam restartu', 'Table' => 'Debug', 'Items' => array( 'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => ''), 'MangosVersion' => array('Type' => 'String', 'Caption' => 'Verze emulátoru', 'Default' => ''), 'DbVersion' => array('Type' => 'String', 'Caption' => 'Verze databáze', 'Default' => ''), 'MaxPlayerCount' => array('Type' => 'Integer', 'Caption' => 'Max. online hráčů', 'Default' => ''), 'Uptime' => array('Type' => 'String', 'Caption' => 'Doba běhu', 'Default' => ''), ), ); function ShowListOnRow($Row) { $Row['Time'] = ''.str_replace(' ', ' ', $Row['Time']).''; $Row['Uptime'] = TimeToHumanTime($Row['Uptime']); return($Row); } function ItemList() { if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) { $Realm = new Realm($this->System, $_GET['Id']); if(($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) { $Output = '

Ladící záznamy restartů

'; $Table = new Table($this->ItemListFormClass, $this->System); $Table->OnRow = array($this, 'ShowListOnRow'); $Table->Definition['Table'] = '(SELECT * FROM Debug WHERE Realm='.$_GET['Id'].')'; $Table->LoadValuesFromDatabase($this->Database); $Output .= $Table->Show(); if($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR) { //$Output .= '
Zálohovat'; } } else $this->SystemMessage('Ladící záznamy', 'Nemáte oprávnění'); } else $Output .= USER_BAD_ROLE; return($Output); } function Item() { if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) { $Realm = new Realm($this->System, $_GET['Id']); if(($this->System->Modules['User']->User['Id'] == $Realm->GetUser()) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR)) { $Output = '
Ladící informace serveru
'; $MangosDebug = new MangosDebug($this->System, $this->System); $Form = new Form($this->System, $this->ItemFormClass); if($Form->LoadValuesFromDatabase($_GET['Id'])) { $Form->Values['Uptime'] = TimeToHumanTime($Form->Values['Uptime']); $Output .= $Form->ShowTable(); $Output .= 'Backtrace'. ' Mangos log'. ' Console error log'. ' Database error log'. ' Mangos configuration'. '
'; if(array_key_exists('Show', $_GET)) { $Show = addslashes($_GET['Show']); switch($Show) { case 'Backtrace': $DbResult = $this->Database->select('Debug', 'Backtrace', 'Id='.$_GET['Id']); $DbRow = $DbResult->fetch_assoc(); $Content = htmlspecialchars($DbRow['Backtrace']); for($I = 1; $I < $MangosDebug->MaxMangosThreadCount; $I++) { $Content = str_replace('Thread '.$I.' ', '
Thread '.$I.'', $Content); $Content = str_replace(' '.$I.' Thread ', ''.$I.' Thread', $Content); } $Output .= 'Backtrace:
'.$Content.'
'; break; case 'Log': $DbResult = $this->Database->select('Debug', 'Log', 'Id='.$_GET['Id']); $DbRow = $DbResult->fetch_assoc(); $Output .= 'Console standard output log:
'.htmlspecialchars($DbRow['Log']).'
'; break; case 'Error': $DbResult = $this->Database->select('Debug', 'ErrorLog', 'Id='.$_GET['Id']); $DbRow = $DbResult->fetch_assoc(); $Output .= 'Console error log:
'.htmlspecialchars($DbRow['ErrorLog']).'
'; break; case 'DbErrors': $DbResult = $this->Database->select('Debug', 'DbErrors', 'Id='.$_GET['Id']); $DbRow = $DbResult->fetch_assoc(); $Output .= 'Database error log:
'.htmlspecialchars($DbRow['DbErrors']).'
'; break; case 'Configuration': $DbResult = $this->Database->select('Debug', 'Configuration', 'Id='.$_GET['Id']); $DbRow = $DbResult->fetch_assoc(); $Output .= 'Mangos configuration:
'.htmlspecialchars($DbRow['Configuration']).'
'; break; } } } else $Output = 'Položka nenalezena'; } else $this->SystemMessage('Ladící informace', 'Nemáte oprávnění'); } else $Output = USER_BAD_ROLE; return($Output); } }