#botzilla.class.php /** Send the formatted buffer text back to @return void */ function process() { $buff =& $this->buffer; if($buff['hostname']!='services.') // something to thrwart server MOD { if(is_array($this->ziggis)) { $pipeParts = explode(PIPE_CHAR,$buff['text']); foreach($pipeParts as $pipeIndex=>$in) { if(!is_array($pipeOut)) $pipeOut=array($in); foreach($pipeOut as $pipeIn) { $buff['pipe']=trim($pipeIn); $buff['text']=trim($in); reset($this->ziggis); foreach(array_keys($this->ziggis) as $zindex) { if(!is_object($this->ziggis[$zindex])) { echo "problem with ziggi $zindex !\n"; unset($this->ziggis[$zindex]); continue; } $got=null; $access=$this->getUserAccessLevel($this->username()); $hasAccess = ($access >= $this->ziggis[$zindex]->user_access); #\|/ $got = $this->ziggis[$zindex]->listen($buff,$hasAccess); #/|\ // ziggi get anything? if(is_array($got)) { // send any server commands (quit, kick, etc) if(is_array($got['bz_send'])) { foreach($got['bz_send'] as $e) $this->send($e); } if(is_array($got['pm'])) { // final output if($pipeIndex==max(array_keys($pipeParts))) { foreach($got['pm'] as $pm) { if(is_array($pm)) { $to = ($pm[1] == false ? $channel : $pm[1]); $this->pm($pm[0],$to); } else $this->pm($pm,$got['channel']); } } else { $pipeOut = array(); // this what I want to do here?? foreach($got['pm'] as $pm) { if(is_array($pm)) array_push($pipeOut,current($pm)); else array_push($pipeOut,$pm); } } } }// has return }// each ziggi }// each line of out }// piped parts }// are ziggis } } # ziggi.class.php /** botzilla calls this each incoming line you should probably leave it alone, @access private @return array of good stuff botzilla likes */ function listen($to_buffer = false,$access=true) { $this->bz_buffer = $to_buffer; $this->bz_ret = false; $e = $this->checkTimedEvents(); if($access || $e) $this->parseBuffer(); return $this->z_finish(); } function isEmpty() { return (trim($this->getText())=='' && $this->getEvent()==false); }