Changeset 35 for trunk/www/server.php
- Timestamp:
- Jun 15, 2009, 10:19:02 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/server.php
r34 r35 58 58 $this->Lock(); 59 59 $CommandList = array( 60 'php www/shell.php ServerLock '.$this->Id, 61 ); 62 if($Delete == true) 63 { 64 $CommandList = array_merge($CommandList, array( 65 'mysql --silent --skip-column-names -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_mangos -e "show tables" | gawk \'{print "drop table " $1 ";"}\' | mysql -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_mangos', 66 'mysql --silent --skip-column-names -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_characters -e "show tables" | gawk \'{print "drop table " $1 ";"}\' | mysql -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_characters', 67 'mysql --silent --skip-column-names -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_realmd -e "show tables" | gawk \'{print "drop table " $1 ";"}\' | mysql -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_realmd', 68 'mysql --silent --skip-column-names -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_scriptdev2 -e "show tables" | gawk \'{print "drop table " $1 ";"}\' | mysql -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_scriptdev2', 69 )); 70 } 71 $CommandList = array_merge($CommandList, array( 60 72 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_mangos < database/'.$this->Server['Database']['Id'].'/'.$this->Server['Database']['SourceFileName'], 61 73 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_scriptdev2 < emulator/'.$this->Server['Database']['Emulator']['Id'].'/source/src/bindings/ScriptDev2/sql/scriptdev2_create_structure.sql', … … 64 76 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_realmd < emulator/'.$this->Server['Database']['Emulator']['Id'].'/share/mangos/sql/realmd.sql', 65 77 'mysql --user=server'.$this->Id.' --password=server'.$this->Id.' server'.$this->Id.'_characters < emulator/'.$this->Server['Database']['Emulator']['Id'].'/share/mangos/sql/characters.sql', 66 ); 67 if($Delete == true) 68 { 69 array_unshift($CommandList, 'mysql --silent --skip-column-names -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_mangos -e "show tables" | gawk \'{print "drop table " $1 ";"}\' | mysql -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_mangos'); 70 array_unshift($CommandList, 'mysql --silent --skip-column-names -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_characters -e "show tables" | gawk \'{print "drop table " $1 ";"}\' | mysql -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_characters'); 71 array_unshift($CommandList, 'mysql --silent --skip-column-names -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_realmd -e "show tables" | gawk \'{print "drop table " $1 ";"}\' | mysql -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_realmd'); 72 array_unshift($CommandList, 'mysql --silent --skip-column-names -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_scriptdev2 -e "show tables" | gawk \'{print "drop table " $1 ";"}\' | mysql -u server'.$this->Id.' -pserver'.$this->Id.' server'.$this->Id.'_scriptdev2'); 73 } 78 'php www/shell.php ServerDatabaseChange '.$this->Server['Database']['Id'], 79 'php www/shell.php ServerUnLock '.$thisr->Id, 80 )); 74 81 $this->Task->Add('Inicializace databáze', $CommandList); 82 return('Úloha načtení nové databáze zařazena do fronty.'); 75 83 } 76 84 … … 79 87 $this->Lock(); 80 88 $this->Task->Add('Start emulátoru', array( 89 'php www/shell.php ServerLock '.$this->Id, 81 90 'screen -A -m -d -S server'.$this->Id.'-realmd emulator/'.$this->Server['Database']['Emulator']['Id'].'/bin/mangos-realmd -c server/'.$this->Id.'/etc/realmd.conf', 82 91 'screen -A -m -d -S server'.$this->Id.'-worldd server/'.$this->Id.'/bin/start.sh', 92 'php www/shell.php ServerUnLock '.$this->Id, 83 93 )); 84 94 return('Požadavek na start serveru zařazen.'); … … 89 99 $this->Lock(); 90 100 $this->Task->Add('Zastavení emulátoru', array( 101 'php www/shell.php ServerLock '.$this->Id, 91 102 'server/'.$this->Id.'/bin/stop.sh', 103 'php www/shell.php ServerUnLock '.$this->Id, 92 104 )); 93 105 return('Požadavek na zastavení serveru zařazen.'); … … 283 295 284 296 // Do update 285 $Commands = array(); 297 $Commands = array( 298 'php www/shell.php ServerLock '.$this->Id, 299 ); 286 300 $DbResult = $this->Database->query('SELECT `Revision` FROM `Database` WHERE `Id` = '.$this->Server['Database']['Id']); 287 301 $DbRow = $DbResult->fetch_assoc(); … … 302 316 } 303 317 } 318 $Commands = array_merge($Commands, array( 319 'php www/shell.php ServerDatabaseChange '.$DatabaseId, 320 'php www/shell.php ServerUnLock '.$this->Id, 321 )); 322 304 323 $this->Task->Add('Aktualizace databáze', $Commands); 305 324 $Output .= '<br />Úloha aktualizace serveru byla přidána do fronty.'; … … 316 335 $this->Database->update('Server', 'Id='.$this->Id, array('Lock' => 0)); 317 336 } 337 338 function ChangeDatabaseId($Id) 339 { 340 $this->Database->update('Server', 'Id='.$this->Id, array('Database' => $Id)); 341 $this->SaveConfiguration(); 342 } 318 343 } 319 344
Note:
See TracChangeset
for help on using the changeset viewer.