void InspIRCd::Log(int level, const char* text, ...)
{
/* sanity check, just in case */
- if (!this->Config)
+ if (!this->Config || !this->Logger)
return;
/* Do this check again here so that we save pointless vsnprintf calls */
void InspIRCd::Log(int level, const std::string &text)
{
/* sanity check, just in case */
- if (!this->Config)
+ if (!this->Config || !this->Logger)
return;
/* If we were given -debug we output all messages, regardless of configured loglevel */
/* Find a user record by nickname and return a pointer to it */
userrec* InspIRCd::FindNick(const std::string &nick)
{
+ if (!nick.empty() && isdigit(*nick.begin()))
+ return FindUUID(nick);
+
user_hash::iterator iter = clientlist->find(nick);
if (iter == clientlist->end())
userrec* InspIRCd::FindNick(const char* nick)
{
+ if (isdigit(*nick))
+ return FindUUID(nick);
+
user_hash::iterator iter = clientlist->find(nick);
if (iter == clientlist->end())
return iter->second;
}
+userrec *InspIRCd::FindUUID(const std::string &uid)
+{
+ return InspIRCd::FindUUID(uid.c_str());
+}
+
+userrec *InspIRCd::FindUUID(const char *uid)
+{
+ user_hash::iterator finduuid = uuidlist->find(uid);
+
+ if (finduuid == uuidlist->end())
+ return NULL;
+
+ return finduuid->second;
+}
+
/* find a channel record by channel name and return a pointer to it */
chanrec* InspIRCd::FindChan(const char* chan)
{
}
/* return true for good ident, false else */
-bool InspIRCd::IsIdent(const char* n)
+bool IsIdentHandler::Call(const char* n)
{
if (!n || !*n)
return false;
}
/* open the proper logfile */
-void InspIRCd::OpenLog(char** argv, int argc)
+bool InspIRCd::OpenLog(char** argv, int argc)
{
Config->MyDir = Config->GetFullProgDir();
if (!Config->log_file)
{
- printf("ERROR: Could not write to logfile %s: %s\n\n", Config->logpath.c_str(), strerror(errno));
- Exit(EXIT_STATUS_LOG);
+ this->Logger = NULL;
+ return false;
}
this->Logger = new FileLogger(this, Config->log_file);
+ return true;
}
void InspIRCd::CheckRoot()