multicasttask.class.php (fogproject-1.5.8) | : | multicasttask.class.php (fogproject-1.5.9) | ||
---|---|---|---|---|
skipping to change at line 248 | skipping to change at line 248 | |||
$this->_strImage = $image; | $this->_strImage = $image; | |||
$this->_strEth = $eth; | $this->_strEth = $eth; | |||
$this->_intClients = $clients; | $this->_intClients = $clients; | |||
$this->_intImageType = $imagetype; | $this->_intImageType = $imagetype; | |||
$this->_intOSID = $osid; | $this->_intOSID = $osid; | |||
$this->_isNameSess = $nameSess; | $this->_isNameSess = $nameSess; | |||
$this->_taskIDs = $taskIDs; | $this->_taskIDs = $taskIDs; | |||
$this->_MultiSess = new MulticastSession($this->getID()); | $this->_MultiSess = new MulticastSession($this->getID()); | |||
} | } | |||
/** | /** | |||
* Get session clients | ||||
* | ||||
* @return object | ||||
*/ | ||||
public function getSessClients() | ||||
{ | ||||
return $this->_MultiSess->get('clients') == 0; | ||||
} | ||||
/** | ||||
* Is this a named session | * Is this a named session | |||
* | * | |||
* @return bool | * @return bool | |||
*/ | */ | |||
public function isNamedSession() | public function isNamedSessionFinished() | |||
{ | { | |||
return (bool)$this->_isNameSess; | if ($this->_isNameSess | |||
&& $this->_MultiSess->get('clients') == 0 | ||||
&& !$this->isRunning($this->procRef)) { | ||||
return true; | ||||
} else { | ||||
return false; | ||||
} | ||||
} | } | |||
/** | /** | |||
* Returns the task ids | * Returns the task ids | |||
* | * | |||
* @return array | * @return array | |||
*/ | */ | |||
public function getTaskIDs() | public function getTaskIDs() | |||
{ | { | |||
return $this->_taskIDs; | return $this->_taskIDs; | |||
} | } | |||
skipping to change at line 701 | skipping to change at line 698 | |||
return $this->isRunning($this->procRef); | return $this->isRunning($this->procRef); | |||
} | } | |||
/** | /** | |||
* Kills the tasking as needed | * Kills the tasking as needed | |||
* | * | |||
* @return bool | * @return bool | |||
*/ | */ | |||
public function killTask() | public function killTask() | |||
{ | { | |||
$this->killTasking(); | $this->killTasking(); | |||
unlink($this->getUDPCastLogFile()); | if (file_exists($this->getUDPCastLogFile())) { | |||
unlink($this->getUDPCastLogFile()); | ||||
} | ||||
return true; | return true; | |||
} | } | |||
/** | /** | |||
* Updates the stats of the tasking | * Updates the stats of the tasking | |||
* | * | |||
* @return void | * @return void | |||
*/ | */ | |||
public function updateStats() | public function updateStats() | |||
{ | { | |||
Route::listem( | Route::listem( | |||
skipping to change at line 728 | skipping to change at line 727 | |||
$TaskPercent = []; | $TaskPercent = []; | |||
foreach ($MSAssocs as &$Task) { | foreach ($MSAssocs as &$Task) { | |||
$TaskPercent[] = self::getClass('Task', $Task->taskID)->get('percent '); | $TaskPercent[] = self::getClass('Task', $Task->taskID)->get('percent '); | |||
unset($Task); | unset($Task); | |||
} | } | |||
$TaskPercent = array_unique((array)$TaskPercent); | $TaskPercent = array_unique((array)$TaskPercent); | |||
$this->_MultiSess | $this->_MultiSess | |||
->set('percent', @max($TaskPercent)) | ->set('percent', @max($TaskPercent)) | |||
->save(); | ->save(); | |||
} | } | |||
/** | ||||
* Updates task ID list in case of MC session joins via PXE menu | ||||
* | ||||
* @return void | ||||
*/ | ||||
public function setTaskIDs($newTaskIDs) | ||||
{ | ||||
$this->_taskIDs = $newTaskIDs; | ||||
} | ||||
} | } | |||
End of changes. 5 change blocks. | ||||
12 lines changed or deleted | 20 lines changed or added |