Changeset 58
- Timestamp:
- Aug 4, 2009, 7:21:15 PM (15 years ago)
- Location:
- trunk/www
- Files:
-
- 2 added
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/model/realm.php
r57 r58 85 85 } 86 86 // 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'); 88 88 $Database = $DbResult->fetch_assoc(); 89 89 … … 99 99 $this->Task->Add('Inicializace databáze', $CommandList); 100 100 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']; 105 105 $this->Update($NewDatabaseId, false, false); 106 106 } … … 221 221 $EmulatorConfig->ParameterList['WorldServerPort'] = $this->Data['NetworkPortWorldd']; 222 222 $EmulatorConfig->ParameterList['Motd'] = $this->Data['Motd']; 223 print_r($this->Data);224 223 $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'; 226 225 $EmulatorConfig->ParameterList['LogLevel'] = 1; 227 226 $EmulatorConfig->ParameterList['PlayerLimit'] = $Config['MaxOnlinePlayerCountPerServer']; … … 261 260 'php www/shell.php RealmLock '.$this->Id, 262 261 ); 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']); 264 263 $DbRow = $DbResult->fetch_assoc(); 265 264 $DatabaseRevisionStart = $DbRow['Revision']; … … 308 307 { 309 308 $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); 312 311 if(count($Output) > 0) 313 312 { -
trunk/www/sql/updates/54.sql
r54 r58 2 2 `Id` int(11) NOT NULL auto_increment, 3 3 `Name` varchar(255) NOT NULL, 4 `Database` int(11) NOT NULL, 4 5 `Server` int(11) NOT NULL, 5 6 `NetworkPortWorldd` int(11) NOT NULL, … … 23 24 ALTER TABLE `Realm` ADD FOREIGN KEY ( `Database` ) REFERENCES `Database` (`Id`); 24 25 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`);26 INSERT 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`); 26 27 27 28 ALTER 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 1 CREATE 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 63 63 'Table' => '', 64 64 'Items' => array( 65 ' ServerId' => array('Type' => 'Hidden', 'Caption' => 'Id', 'Default' => 0),65 'RealmId' => array('Type' => 'Hidden', 'Caption' => 'Id', 'Default' => 0), 66 66 'SkipCinematics' => array('Type' => 'SkipCinematics', 'Caption' => 'Zobrazovat úvodní video', 'Default' => ''), 67 67 'StartPlayerLevel' => array('Type' => 'Integer', 'Caption' => 'Počáteční úroveň hráčů', 'Default' => 1), … … 143 143 //$Form->Values['UsedMemory'] = $this->System->AddPrefixMultipliers($RealmStatus['UsedMemory'] * 1024, 'B', 4, 'Binary'); 144 144 $Output .= $Form->ShowTable(); 145 $Server = new Server($this->Database, $Realm->Data['Server']);146 145 $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)) 148 147 { 149 148 $Output .= '<br /><a href="http://'.$this->System->Config['Web']['Host'].'/mysql/">Správa databáze</a> '; 150 149 if(array_key_exists('Id', $Realm->Data['Database']) and ($Realm->Data['Lock'] == 0)) 151 150 { 152 if($ ServerStatus['WorlddPortState'] == true) $Output .= ' <a href="?Action=RealmStop&Id='.$Realm->Id.'">Zastavit</a> <a href="?Action=RealmRestart&Id='.$Realm->Id.'">Restartovat</a>';151 if($RealmStatus['WorlddPortState'] == true) $Output .= ' <a href="?Action=RealmStop&Id='.$Realm->Id.'">Zastavit</a> <a href="?Action=RealmRestart&Id='.$Realm->Id.'">Restartovat</a>'; 153 152 else $Output .= ' <a href="?Action=RealmStart&Id='.$Realm->Id.'">Spustit</a>'; 154 153 }
Note:
See TracChangeset
for help on using the changeset viewer.