Changeset 16 for trunk/www/server.php
- Timestamp:
- Jun 12, 2009, 8:47:16 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/server.php
r15 r16 9 9 var $Id; 10 10 var $Server; 11 var $Task; 11 12 var $WorlddBaseNetworkPort = 8085; 12 13 var $RealmdBaseNetworkPort = 3724; … … 16 17 { 17 18 $this->Database = $Database; 19 $this->Task = new Task(&$Database); 18 20 $this->Id = $Id; 19 21 $DbResult = $this->Database->query('SELECT * FROM `Server` WHERE `Id`='.$Id); … … 31 33 else $this->Server['Database']['Emulator']['ClientVersion'] = array(); 32 34 } 33 } 34 35 function AddTask($Title, $Task) 36 { 37 global $System; 38 39 $this->Database->insert('Task', array('User' => $System->Modules['User']->User['Id'], 'Title' => $Title, 'Time' => 'NOW()', 'CommandList' => implode("\n", $Task)."\n")); 40 } 35 } 41 36 42 37 function CreateDatabase() … … 79 74 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'); 80 75 } 81 $this-> AddTask('Inicializace databáze', $CommandList);82 } 76 $this->Task->Add('Inicializace databáze', $CommandList); 77 } 83 78 84 79 function AddServer($Version) … … 89 84 function Start() 90 85 { 91 $this-> AddTask('Start emulátoru', array(86 $this->Task->Add('Start emulátoru', array( 92 87 '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', 93 88 'screen -A -m -d -S server'.$this->Id.'-worldd server/'.$this->Id.'/bin/start.sh', … … 98 93 function Stop() 99 94 { 100 $this-> AddTask('Zastavení emulátoru', array(95 $this->Task->Add('Zastavení emulátoru', array( 101 96 'server/'.$this->Id.'/bin/stop.sh', 102 97 ));
Note:
See TracChangeset
for help on using the changeset viewer.