/** * This method handles the IP address message from Nuwani. It will store * the IP and nickname combination together with a date into the * database for even less privacy.. err.. more stats. * * @param Bot $pBot The bot which received the message. * @param integer $nId The ID of the player. * @param string $sNickname The person the IP belongs to. * @param string $sIp The IP in dotted format. * @param array $aChunks The original message in chunks. */ private function handleIpMessage(Bot $pBot, $nId, $sNickname, $sIp, $aChunks) { $this->m_pModule['Players']->setPlayerKey($nId, 'IP', $sIp); if (defined('DEBUG_MODE') && DEBUG_MODE) { // Don't save IPs when in debug mode. return; } $bResult = $this->m_pModule['IP']->insertIp($sNickname, $sIp); if (!$bResult) { $this->m_pModule->error($pBot, LVP::DEBUG_CHANNEL, 'Could not save IP address "' . $sIp . '": Trying again with a new connection...'); LVPDatabase::restart(); $bResult = $this->m_pModule['IP']->insertIp($sNickname, $sIp); if ($bResult) { $this->m_pModule->success($pBot, LVP::DEBUG_CHANNEL, 'Saved IP address "' . $sIp . '".'); } else { $this->m_pModule->error($pBot, LVP::DEBUG_CHANNEL, 'Could not save IP address "' . $sIp . '" with nickname "' . $sNickname . '".'); } } }