/** * After a bot shuts down, we have to be informed and remove it from the * bot tracking array. It will no longer be used for whatever service * possible. * * @param Bot $pBot The bot that is going to be unregistered. * @return boolean */ public function unregister(Bot $pBot) { foreach ($this->m_aBotList as $nIndex => $pListedBot) { if ($pListedBot['Instance'] != $pBot) { /** This is another bot. **/ continue; } $pBot->destroy(); unset($pListedBot, $pBot); // silly php refcount unset($this->m_aBotList[$nIndex]); return true; } return false; }