mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-12 03:59:03 -04:00
is_uline was an inefficient piece of crap - fixed.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3428 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
055b733595
commit
17ca73f1f2
@ -308,6 +308,8 @@ class ServerConfig : public classbase
|
||||
*/
|
||||
char CustomVersion[MAXBUF];
|
||||
|
||||
std::vector<irc::string> ulines;
|
||||
|
||||
ServerConfig();
|
||||
|
||||
/** Clears the include stack in preperation for
|
||||
|
@ -177,22 +177,12 @@ void do_whois(userrec* user, userrec* dest,unsigned long signon, unsigned long i
|
||||
/* XXX - these really belong in helperfuncs perhaps -- w00t */
|
||||
bool is_uline(const char* server)
|
||||
{
|
||||
char ServName[MAXBUF];
|
||||
|
||||
if (!server)
|
||||
return false;
|
||||
if (!(*server))
|
||||
if (!*server)
|
||||
return true;
|
||||
|
||||
for (int i = 0; i < Config->ConfValueEnum("uline",&Config->config_f); i++)
|
||||
{
|
||||
Config->ConfValue("uline","server",i,ServName,&Config->config_f);
|
||||
if (!strcasecmp(server,ServName))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return (find(Config->ulines.begin(),Config->ulines.end(),server) != Config->ulines.end());
|
||||
}
|
||||
|
||||
int operstrcmp(char* data,char* input)
|
||||
|
@ -157,7 +157,7 @@ void ServerConfig::Read(bool bail, userrec* user)
|
||||
*/
|
||||
char dbg[MAXBUF],pauseval[MAXBUF],Value[MAXBUF],timeout[MAXBUF],NB[MAXBUF],flood[MAXBUF],MW[MAXBUF],MCON[MAXBUF],MT[MAXBUF];
|
||||
char AH[MAXBUF],AP[MAXBUF],AF[MAXBUF],DNT[MAXBUF],pfreq[MAXBUF],thold[MAXBUF],sqmax[MAXBUF],rqmax[MAXBUF],SLIMT[MAXBUF];
|
||||
char localmax[MAXBUF],globalmax[MAXBUF],HS[MAXBUF],HB[MAXBUF];
|
||||
char localmax[MAXBUF],globalmax[MAXBUF],HS[MAXBUF],HB[MAXBUF],ServName[MAXBUF];
|
||||
ConnectClass c;
|
||||
std::stringstream errstr;
|
||||
include_stack.clear();
|
||||
@ -408,6 +408,15 @@ void ServerConfig::Read(bool bail, userrec* user)
|
||||
}
|
||||
|
||||
}
|
||||
Config->ulines.clear();
|
||||
for (int i = 0; i < ConfValueEnum("uline",&Config->config_f); i++)
|
||||
{
|
||||
ConfValue("uline","server",i,ServName,&Config->config_f);
|
||||
{
|
||||
log(DEBUG,"Read ULINE '%s'",ServName);
|
||||
Config->ulines.push_back(ServName);
|
||||
}
|
||||
}
|
||||
log(DEFAULT,"Reading K lines,Q lines and Z lines from config...");
|
||||
read_xline_defaults();
|
||||
log(DEFAULT,"Applying K lines, Q lines and Z lines...");
|
||||
|
@ -1094,8 +1094,8 @@ class TreeSocket : public InspSocket
|
||||
clientlist[tempnick] = new userrec();
|
||||
clientlist[tempnick]->fd = FD_MAGIC_NUMBER;
|
||||
strlcpy(clientlist[tempnick]->nick, tempnick,NICKMAX-1);
|
||||
strlcpy(clientlist[tempnick]->host, params[2].c_str(),160);
|
||||
strlcpy(clientlist[tempnick]->dhost, params[3].c_str(),160);
|
||||
strlcpy(clientlist[tempnick]->host, params[2].c_str(),63);
|
||||
strlcpy(clientlist[tempnick]->dhost, params[3].c_str(),63);
|
||||
clientlist[tempnick]->server = (char*)FindServerNamePtr(source.c_str());
|
||||
strlcpy(clientlist[tempnick]->ident, params[4].c_str(),IDENTMAX);
|
||||
strlcpy(clientlist[tempnick]->fullname, params[7].c_str(),MAXGECOS);
|
||||
|
Loading…
x
Reference in New Issue
Block a user