Changeset 144
- Timestamp:
- 03/09/08 07:41:54 (9 months ago)
- Files:
-
- trunk/Phergie/Plugin/ChuckNorris.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Phergie/Plugin/ChuckNorris.php
r139 r144 63 63 * @var int 64 64 */ 65 protected $floodCheck = 10;65 protected $floodCheck = 3; 66 66 67 67 /** … … 70 70 * @var int 71 71 */ 72 protected $floodCache = 3;72 protected $floodCache = array(); 73 73 74 74 /** … … 156 156 } 157 157 } 158 unset($contents); 158 159 return true; 159 160 } … … 242 243 if (preg_match('{(chuck\s*norris)}i', $message, $m) && 243 244 strtolower(substr($message, 0, 5)) != 'fact:' && 244 ($this->floodCheck <= 0 || ($this->floodCache < (time() - $this->floodCheck)))) {245 ($this->floodCheck <= 0 || ($this->floodCache[$source] < (time() - $this->floodCheck)))) { 245 246 246 247 // Retrieves a random fact 247 248 $fact = $this->praiseChuckNorris(); 248 if ($fact) {249 if (!empty($fact)) { 249 250 $this->doPrivmsg($source, 'Fact: '.$fact); 250 $this->floodCache = time(); 251 $this->floodCache[$source] = time(); 252 unset($fact); 251 253 } 252 254 }