Changeset 58


Ignore:
Timestamp:
Aug 4, 2009, 7:21:15 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Zobrazení souboru realmlist.wtf pro servery.
  • Opraveno: Třídy pro zpracování realmů.
Location:
trunk/www
Files:
2 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/model/realm.php

    r57 r58  
    8585    }
    8686    // Lookup nearest database with full import
    87     $DbResult = $this->Database->query('SELECT * FROM `Database` WHERE (`Emulator` <> 0) AND (`Revision` <= '.$this->Server['Database']['Revision'].') AND (`SourceFileName` <> "") ORDER BY `Revision` DESC');
     87    $DbResult = $this->Database->query('SELECT * FROM `Database` WHERE (`Emulator` <> 0) AND (`Revision` <= '.$this->Realm['Database']['Revision'].') AND (`SourceFileName` <> "") ORDER BY `Revision` DESC');
    8888    $Database = $DbResult->fetch_assoc();
    8989   
     
    9999    $this->Task->Add('Inicializace databáze', $CommandList);
    100100   
    101     if($Database['Id'] != $this->Server['Database']['Id'])
    102     {
    103       $NewDatabaseId = $this->Server['Database']['Id'];
    104       $this->Server['Database']['Id'] = $Database['Id'];
     101    if($Database['Id'] != $this->Data['Database']['Id'])
     102    {
     103      $NewDatabaseId = $this->Data['Database']['Id'];
     104      $this->Data['Database']['Id'] = $Database['Id'];
    105105      $this->Update($NewDatabaseId, false, false);
    106106    }
     
    221221    $EmulatorConfig->ParameterList['WorldServerPort'] = $this->Data['NetworkPortWorldd'];
    222222    $EmulatorConfig->ParameterList['Motd'] = $this->Data['Motd'];
    223     print_r($this->Data);
    224223    $EmulatorConfig->ParameterList['DataDir'] = 'wowclient/'.$this->Data['Database']['Emulator']['Client']['Version'];
    225     $EmulatorConfig->ParameterList['LogsDir'] = 'server/'.$this->Id.'/log';
     224    $EmulatorConfig->ParameterList['LogsDir'] = 'realm/'.$this->Id.'/log';
    226225    $EmulatorConfig->ParameterList['LogLevel'] = 1;
    227226    $EmulatorConfig->ParameterList['PlayerLimit'] = $Config['MaxOnlinePlayerCountPerServer'];
     
    261260     'php www/shell.php RealmLock '.$this->Id,
    262261    );
    263     $DbResult = $this->Database->query('SELECT `Revision` FROM `Database` WHERE `Id` = '.$this->Server['Database']['Id']);
     262    $DbResult = $this->Database->query('SELECT `Revision` FROM `Database` WHERE `Id` = '.$this->Data['Database']['Id']);
    264263    $DbRow = $DbResult->fetch_assoc();
    265264    $DatabaseRevisionStart = $DbRow['Revision'];
     
    308307  {
    309308    $Output = array();
    310     if(isset($this->Server['Database']['Emulator']['Id']))
    311       exec('ps -aux|grep "emulator/'.$this->Server['Database']['Emulator']['Id'].'/bin/mangos-worldd -c realm/'.$this->Id.'/etc/mangosd.conf"| grep -v grep', $Output);
     309    if(isset($this->Data['Database']['Emulator']['Id']))
     310      exec('ps -aux|grep "emulator/'.$this->Data['Database']['Emulator']['Id'].'/bin/mangos-worldd -c realm/'.$this->Id.'/etc/mangosd.conf"| grep -v grep', $Output);
    312311    if(count($Output) > 0)
    313312    {
  • trunk/www/sql/updates/54.sql

    r54 r58  
    22  `Id` int(11) NOT NULL auto_increment,
    33  `Name` varchar(255) NOT NULL,
     4  `Database` int(11) NOT NULL,
    45  `Server` int(11) NOT NULL,
    56  `NetworkPortWorldd` int(11) NOT NULL,
     
    2324ALTER TABLE `Realm` ADD FOREIGN KEY ( `Database` ) REFERENCES `Database` (`Id`);
    2425
    25 INSERT INTO `Realm` (SELECT 0 AS `Id`, "" AS `Name`, `Server`.`Id` AS `Server`, `NetworkPortWorldd`, `Motd`, "" AS `Description`, `Type`, "" AS `Homepage`, `TimeCreate`, 0 AS `Online`, `CharacterOnlineCount`, `CharacterCount`, `AccountCount`, 0 AS `Lock` FROM `Server`);
     26INSERT INTO `Realm` (SELECT 0 AS `Id`, "" AS `Name`, `Server`.`Database` AS `Database`, `Server`.`Id` AS `Server`, `NetworkPortWorldd`, `Motd`, "" AS `Description`, `Type`, "" AS `Homepage`, `TimeCreate`, 0 AS `Online`, `CharacterOnlineCount`, `CharacterCount`, `AccountCount`, 0 AS `Lock` FROM `Server`);
    2627
    2728ALTER TABLE `Server` DROP `NetworkPortWorldd` , DROP `Motd` , DROP `Type` ;
  • trunk/www/sql/updates/57.sql

    r57 r58  
    1 RENAME TABLE `ServerLog`  TO `RealmLog` ;
    2 
    3 ALTER TABLE `RealmLog` DROP FOREIGN KEY `RealmLog_ibfk_1` ;
    4 
    5 ALTER TABLE `RealmLog` CHANGE `Server` `Realm` INT( 11 ) NOT NULL ;
    6 
    7 ALTER TABLE `RealmLog` ADD FOREIGN KEY ( `Realm` ) REFERENCES `Realm` (`Id`);
    8 
     1CREATE TABLE IF NOT EXISTS `RealmLog` (
     2  `Id` int(11) NOT NULL auto_increment,
     3  `Realm` int(11) NOT NULL,
     4  `Time` datetime NOT NULL,
     5  `Text` text NOT NULL,
     6  PRIMARY KEY  (`Id`),
     7  KEY `Server` (`Realm`),
     8  KEY `Time` (`Time`)
     9) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  • trunk/www/view/realm.php

    r57 r58  
    6363    'Table' => '',
    6464    'Items' => array(
    65       'ServerId' => array('Type' => 'Hidden', 'Caption' => 'Id', 'Default' => 0),
     65      'RealmId' => array('Type' => 'Hidden', 'Caption' => 'Id', 'Default' => 0),
    6666      'SkipCinematics' => array('Type' => 'SkipCinematics', 'Caption' => 'Zobrazovat úvodní video', 'Default' => ''),
    6767      'StartPlayerLevel' => array('Type' => 'Integer', 'Caption' => 'Počáteční úroveň hráčů', 'Default' => 1),
     
    143143    //$Form->Values['UsedMemory'] = $this->System->AddPrefixMultipliers($RealmStatus['UsedMemory'] * 1024, 'B', 4, 'Binary');
    144144    $Output .= $Form->ShowTable();
    145     $Server = new Server($this->Database, $Realm->Data['Server']);
    146145    $Output .= '<div style="text-align: center">';
    147     if((($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) and ($this->System->Modules['User']->User['Id'] == $Server->Server['User'])) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
     146    if((($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER) and ($this->System->Modules['User']->User['Id'] == $Realm->GetUser())) or ($this->System->Modules['User']->User['Role'] >= USER_ROLE_ADMINISTRATOR))
    148147    {
    149148      $Output .= '<br /><a href="http://'.$this->System->Config['Web']['Host'].'/mysql/">Správa databáze</a> ';
    150149      if(array_key_exists('Id', $Realm->Data['Database']) and ($Realm->Data['Lock'] == 0))
    151150      {
    152         if($ServerStatus['WorlddPortState'] == true) $Output .= ' <a href="?Action=RealmStop&amp;Id='.$Realm->Id.'">Zastavit</a>  <a href="?Action=RealmRestart&amp;Id='.$Realm->Id.'">Restartovat</a>';
     151        if($RealmStatus['WorlddPortState'] == true) $Output .= ' <a href="?Action=RealmStop&amp;Id='.$Realm->Id.'">Zastavit</a>  <a href="?Action=RealmRestart&amp;Id='.$Realm->Id.'">Restartovat</a>';
    153152          else $Output .= ' <a href="?Action=RealmStart&amp;Id='.$Realm->Id.'">Spustit</a>';
    154153      }
Note: See TracChangeset for help on using the changeset viewer.