Changeset 63
- Timestamp:
- Aug 5, 2009, 8:06:27 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/model/realm.php
r62 r63 213 213 $EmulatorConfig = new MangosConfigurationFile($this->Database); 214 214 $EmulatorConfig->Load($EmulatorEtcDir.'mangosd.conf.dist'); 215 $EmulatorConfig->ParameterList['LoginDatabaseInfo'] = 'localhost;3306;server'.$this-> Id.';server'.$this->Id.';server'.$this->Data['Server'].'_realmd';216 $EmulatorConfig->ParameterList['WorldDatabaseInfo'] = 'localhost;3306;server'.$this-> Id.';server'.$this->Id.';realm'.$this->Id.'_mangos';215 $EmulatorConfig->ParameterList['LoginDatabaseInfo'] = 'localhost;3306;server'.$this->Data['Server'].';server'.$this->Data['Server'].';server'.$this->Data['Server'].'_realmd'; 216 $EmulatorConfig->ParameterList['WorldDatabaseInfo'] = 'localhost;3306;server'.$this->Data['Server'].';server'.$this->Data['Server'].';realm'.$this->Id.'_mangos'; 217 217 $EmulatorConfig->ParameterList['CharacterDatabaseInfo'] = 'localhost;3306;server'.$this->Data['Server'].';server'.$this->Data['Server'].';realm'.$this->Id.'_characters'; 218 218 $EmulatorConfig->ParameterList['ScriptDev2DatabaseInfo'] = 'localhost;3306;server'.$this->Data['Server'].';server'.$this->Data['Server'].';realm'.$this->Id.'_scriptdev2'; … … 307 307 $Output = array(); 308 308 if(isset($this->Data['Database']['Emulator']['Id'])) 309 exec('ps -aux|grep "emulator/'.$this->Data['Database']['Emulator']['Id'].'/bin/mangos-worldd -c realm/'.$this->Id.'/etc/mangosd.conf"| grep -v grep', $Output);309 exec('ps aux|grep "emulator/'.$this->Data['Database']['Emulator']['Id'].'/bin/mangos-worldd -c realm/'.$this->Id.'/etc/mangosd.conf"| grep -v grep', $Output); 310 310 if(count($Output) > 0) 311 311 { … … 321 321 while(true) 322 322 { 323 $Re ders = array($File);324 if(stream_select($Re ders, $Writers=null, $Except=null, 0, 15) < 1)323 $Readers = array($File); 324 if(stream_select($Readers, $Writers=null, $Except=null, 0, 15) < 1) 325 325 { 326 326 continue; … … 343 343 return($DbRow['User']); 344 344 } 345 346 function UpdateState() 347 { 348 $State = $this->GetState(); 349 $this->Database->update('Realm', 'Id='.$this->Id, array( 350 'Online' => $State['Online'], 351 'CharacterOnlineCount' => $State['CharacterOnlineCount'], 352 'CharacterCount' => $State['CharacterCount'], 353 )); 354 } 355 356 function UpdateStateAll() 357 { 358 $DbResult = $this->Database->select('Realm', 'Id'); 359 while($DbRow = $DbResult->fetch_assoc()) 360 { 361 $Realm = new Realm($this->Database, $DbRow['Id']); 362 $Realm->UpdateState(); 363 } 364 } 345 365 } 346 366 -
trunk/www/model/server.php
r62 r63 162 162 } 163 163 164 function UpdateServerList() 164 function UpdateState() 165 { 166 $State = $this->GetState(); 167 $this->Database->update('Server', 'Id='.$this->Id, array( 168 'Online' => $State['Online'], 169 'AccountCount' => $State['AccountCount'], 170 )); 171 } 172 173 function UpdateStateAll() 165 174 { 166 175 $DbResult = $this->Database->select('Server', 'Id'); … … 168 177 { 169 178 $Server = new Server($this->Database, $DbRow['Id']); 170 $ServerState = $Server->GetState(); 171 $this->Database->update('Server', 'Id='.$DbRow['Id'], array( 172 'Online' => $ServerState['Online'], 173 'AccountCount' => $ServerState['AccountCount'], 174 )); 179 $Server->UpdateState(); 175 180 } 176 181 } -
trunk/www/model/shell.php
r57 r63 138 138 $this->HistoryUpdate(); 139 139 } else 140 if($Command == 'UpdateState') 141 { 142 $Realm = new Realm($this->Database, 0); 143 $Realm->UpdateStateAll(); 144 $Server = new Server($this->Database, 0); 145 $Server->UpdateStateAll(); 146 } else 140 147 if($Command == 'ServerDatabaseChange') 141 148 { -
trunk/www/view/server.php
r57 r63 84 84 global $Config; 85 85 86 $Server = new Server($this->Database, 0);87 $Server->UpdateServerList();88 86 $Output = '<h4>Seznam serverů</h4>'; 89 87 $Table = new Table($this->ItemListFormClass);
Note:
See TracChangeset
for help on using the changeset viewer.