Changeset 63 for trunk/www/model/realm.php
- Timestamp:
- Aug 5, 2009, 8:06:27 AM (15 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.