summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
037b3cc)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7524
e03df62e-2008-0410-955e-
edbf42e46eb7
- t->WriteServ("NOTICE %s :%s",t->nick,textbuffer);
+ {
+ t->WriteServ("NOTICE %s :%s", t->nick, textbuffer);
+ }
- else
- if (flags == WM_OR)
+ else if (flags == WM_OR)
{
for (std::vector<userrec*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
{
{
for (std::vector<userrec*>::const_iterator i = local_users.begin(); i != local_users.end(); i++)
{
- t->WriteServ("NOTICE %s :%s",t->nick,textbuffer);
+ {
+ t->WriteServ("NOTICE %s :%s", t->nick, textbuffer);
+ }
}
}
}
/* Find a user record by nickname and return a pointer to it */
}
}
}
/* Find a user record by nickname and return a pointer to it */
userrec* InspIRCd::FindNick(const std::string &nick)
{
user_hash::iterator iter = clientlist->find(nick);
userrec* InspIRCd::FindNick(const std::string &nick)
{
user_hash::iterator iter = clientlist->find(nick);
}
/* find a channel record by channel name and return a pointer to it */
}
/* find a channel record by channel name and return a pointer to it */
chanrec* InspIRCd::FindChan(const char* chan)
{
chan_hash::iterator iter = chanlist->find(chan);
chanrec* InspIRCd::FindChan(const char* chan)
{
chan_hash::iterator iter = chanlist->find(chan);
-/*
- * sends out an error notice to all connected clients (not to be used
- * lightly!)
- */
+/* Send an error notice to all users, registered or not */
void InspIRCd::SendError(const std::string &s)
{
for (std::vector<userrec*>::const_iterator i = this->local_users.begin(); i != this->local_users.end(); i++)
void InspIRCd::SendError(const std::string &s)
{
for (std::vector<userrec*>::const_iterator i = this->local_users.begin(); i != this->local_users.end(); i++)
-// this function counts all users connected, wether they are registered or NOT.
+/* this function counts all users connected, wether they are registered or NOT. */
int InspIRCd::UserCount()
{
return clientlist->size();
}
int InspIRCd::UserCount()
{
return clientlist->size();
}
-// this counts only registered users, so that the percentages in /MAP don't mess up when users are sitting in an unregistered state
+/* this counts only registered users, so that the percentages in /MAP don't mess up when users are sitting in an unregistered state */
int InspIRCd::RegisteredUserCount()
{
return clientlist->size() - this->UnregisteredUserCount();
}
int InspIRCd::RegisteredUserCount()
{
return clientlist->size() - this->UnregisteredUserCount();
}
+/* return how many users have a given mode e.g. 'a' */
int InspIRCd::ModeCount(const char mode)
{
ModeHandler* mh = this->Modes->FindMode(mode, MODETYPE_USER);
int InspIRCd::ModeCount(const char mode)
{
ModeHandler* mh = this->Modes->FindMode(mode, MODETYPE_USER);
+/* wrapper for readability */
int InspIRCd::InvisibleUserCount()
{
return ModeCount('i');
}
int InspIRCd::InvisibleUserCount()
{
return ModeCount('i');
}
+/* return how many users are opered */
int InspIRCd::OperCount()
{
return this->all_opers.size();
}
int InspIRCd::OperCount()
{
return this->all_opers.size();
}
+/* return how many users are unregistered */
int InspIRCd::UnregisteredUserCount()
{
return this->unregistered_count;
}
int InspIRCd::UnregisteredUserCount()
{
return this->unregistered_count;
}
+/* return channel count */
long InspIRCd::ChannelCount()
{
return chanlist->size();
}
long InspIRCd::ChannelCount()
{
return chanlist->size();
}
+/* return how many local registered users there are */
long InspIRCd::LocalUserCount()
{
/* Doesnt count unregistered clients */
return (local_users.size() - this->UnregisteredUserCount());
}
long InspIRCd::LocalUserCount()
{
/* Doesnt count unregistered clients */
return (local_users.size() - this->UnregisteredUserCount());
}
+
+/* true for valid channel name, false else */
bool InspIRCd::IsChannel(const char *chname)
{
char *c;
bool InspIRCd::IsChannel(const char *chname)
{
char *c;
+/* true for valid nickname, false else */
bool InspIRCd::IsNick(const char* n)
{
if (!n || !*n)
bool InspIRCd::IsNick(const char* n)
{
if (!n || !*n)
return (p < NICKMAX - 1);
}
return (p < NICKMAX - 1);
}
+/* return true for good ident, false else */
bool InspIRCd::IsIdent(const char* n)
{
if (!n || !*n)
bool InspIRCd::IsIdent(const char* n)
{
if (!n || !*n)
+/* open the proper logfile */
void InspIRCd::OpenLog(char** argv, int argc)
{
Config->MyDir = Config->GetFullProgDir();
void InspIRCd::OpenLog(char** argv, int argc)
{
Config->MyDir = Config->GetFullProgDir();