Skip to content

Commit

Permalink
code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pBlueG committed May 4, 2014
1 parent 90f2f46 commit 9d2ef86
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
15 changes: 9 additions & 6 deletions classes/bot.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function _connectBot()
$this->User($this->m_aBotInfo['Username'], $this->m_aBotInfo['Realname']);
return true;
}
Log::Error('>> Bot '.$this->m_aBotInfo['Nick'].' couldn\'t connect to '.$this->m_aNetwork['Name'].' (connect error @ logs/debug.log). Trying again in 5 seconds..');
Log::Error(date('[H:i:s]').' Bot '.$this->m_aBotInfo['Nick'].' couldn\'t connect to '.$this->m_aNetwork['Name'].' (connect error @ logs/debug.log). Trying again in 5 seconds..');
$Timer = Timer::getInstance();
$Timer->_add($this, "_connectBot", $Timer::NO_ARGUMENTS, 5);
return false;
Expand Down Expand Up @@ -189,10 +189,10 @@ public function _EventHandler($in_buffer)
if(!strcasecmp($sCheck[0], 'login') && !Privileges::IsBotAdmin($sIdent)) {
if(!strcmp(Main::getInstance()->m_aSettings['AdminPass'], implode(' ', array_slice($sCheck, 1)))) {
Privileges::AddBotAdmin($sIdent);
$this->PM($sUser, ">> You have been successfully identified");
$this->Notice($sUser, "You have been successfully identified. Use !cmds for a list of all available commands.");
} else {
// todo: log invalid attempts and black after a certain amount of invalid tries
$this->PM($sUser, ">> Invalid login attempt. Ident has been logged.");
$this->Notice($sUser, ">> Invalid login attempt. Ident has been logged.");
}
}
$ptr->_triggerEvent($this, "onPrivateMessage", $sUser, $sMessage, $sIdent);
Expand Down Expand Up @@ -282,9 +282,8 @@ public function _EventHandler($in_buffer)
);*/
break;
case self::NICKNAME_ALREADY_IN_USE:
$this->_sendCommand(
Commands::Nick($this->m_aBotInfo['AltNick'])
);
Log::Error(date('[H:i:s]').' Nickname is already in use. Using alternative nick ('.$this->m_aBotInfo['AltNick'].')');
$this->Nick($this->m_aBotInfo['AltNick']);
break;
case self::END_MOTD:
if(!$this->_isConnected()) {
Expand All @@ -295,6 +294,10 @@ public function _EventHandler($in_buffer)
$ptr->_triggerEvent($this, "onBotConnect");
}
break;
case self::CHANNEL_REQ_KEY:
$sChannel = $sSplit[3];
Log::Error(date('[H:i:s]').' Channel ('.$sChannel.') requires a valid key to join. (+k)');
break;
default:
if($this->_isChild())
return;
Expand Down
4 changes: 2 additions & 2 deletions classes/commandhandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ public function __construct()
'!ident',
'if($bot->_isChild())
return;
$bot->PM(
$bot->Notice(
$sUser,
"Your ident is [i]".$sIdent."[/i]"
"Your ident is ".$sIdent
);',
Privileges::LEVEL_NONE,
'Shows the ident.'
Expand Down
1 change: 1 addition & 0 deletions interfaces/RawEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ interface RawEvents {
const INVALID_CHAN_KEY = '475'; // invalid channel key
const NO_CHAN_PRIVILEGES = '482'; // requires operator to execute command
const TOPIC_REPLY = '332'; // topic reply on channel join
const CHANNEL_REQ_KEY = '475'; // channel requires valid key to join
}

?>
4 changes: 2 additions & 2 deletions plugins/ctcp.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* @version 2.0a
*/

Class Ctcp
Class CtcpReply
{
function __construct()
public function __construct()
{
echo '>> CTCP plugin has been loaded.'.PHP_EOL;
}
Expand Down

0 comments on commit 9d2ef86

Please sign in to comment.