Changeset 53
- Timestamp:
- Jul 4, 2009, 9:50:22 AM (15 years ago)
- Location:
- trunk/www
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/server.php
r52 r53 403 403 } 404 404 405 function GetPatchList() 406 { 407 // http://us.version.worldofwarcraft.com/update/PatchSequenceFile.txt 408 $Output = array('[WoW]', 'CurrentBuild='.$this->Server['Database']['Emulator']['Client']['BuildNumber']); 409 $DbResult = $this->Database->query('SELECT * FROM Client WHERE BuildNumber <= '.$this->Server['Database']['Emulator']['Client']['BuildNumber'].' AND Patch != "" ORDER BY BuildNumber'); 410 while($DbRow = $DbResult->fetch_assoc()) 411 { 412 $Output[] = $DbRow['BuildNumber'].'='.$DbRow['Patch']; 413 } 414 return(implode("\n", $Output)); 415 } 416 417 function ProcessLog() 418 { 419 $File = fopen('../server/'.$this->Id.'/log/mangos-worldd.log', 'r'); 420 while(true) 421 { 422 $Reders = array($File); 423 if(stream_select($Reders, $Writers=null, $Except=null, 0, 15) < 1) 424 { 425 continue; 426 } else 427 { 428 // read data from the fifo 429 $Data = fread($File, 1024); 430 echo($Data); 431 $this->Database->insert('ServerLog', array('Time' => 'NOW()', 'Server' => $this->Id, 'Text' => $Data)); 432 } 433 sleep(1); 434 } 435 fclose($File); 436 } 405 437 } 406 438 -
trunk/www/shell.php
r51 r53 112 112 } 113 113 } else 114 if($Command == 'ServerProcessLogPipe') 115 { 116 if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2])) 117 { 118 $Server = new Server($this->Database, $_SERVER['argv'][2]); 119 $Server->ProcessLog(); 120 } else $Output = 'Jako druhý parameter je nutno zadat Id serveru.'; 121 } else 114 122 if($Command == 'HistoryUpdate') 115 123 { -
trunk/www/user.php
r52 r53 45 45 $SID = session_id(); 46 46 47 // Remove nonactive users47 // Remove inactive users 48 48 $DbResult = $this->Database->select('UserOnline', 'Id, User', 'ActivityTime < DATE_SUB(NOW(), INTERVAL '.$this->OnlineStateTimeout.' SECOND)'); 49 49 while($DbRow = $DbResult->fetch_array()) 50 50 { 51 $this->System->Modules['User']->User['Id'] = $DbRow['User']; 51 52 if($DbRow['User'] != $this->AnonymousUserId) $this->System->Modules['Log']->NewRecord('User', 'Logout'); 52 53 $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']);
Note:
See TracChangeset
for help on using the changeset viewer.