summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-11 13:37:50 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-11 13:37:50 +0000
commiteea1acd36c3dbbc49d0a0db2b752b09b823d9a87 (patch)
tree8c5c2134596b8a431096af67cd8c24da62657598
parentde122d16f47737bce6d0670763a0d52e62bc84ac (diff)
Addition to usercounts in /map
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@524 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/inspircd.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index c1eac632f..1b1da19ad 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -5381,6 +5381,16 @@ char islast(serverrec* s)
return c;
}
+long map_count(serverrec* s)
+{
+ int c = 0;
+ for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++)
+ {
+ if ((i->second->fd) && (isnick(i->second->nick)) && (strcasecmp(i->second->server,s->name))) c++;
+ }
+ return c;
+}
+
void handle_links(char **parameters, int pcnt, userrec *user)
{
WriteServ(user->fd,"364 %s %s %s :0 %s",user->nick,ServerName,ServerName,ServerDesc);
@@ -5401,7 +5411,11 @@ void handle_map(char **parameters, int pcnt, userrec *user)
{
if (servers[j] != NULL)
{
- WriteServ(user->fd,"006 %s :%c-%s",user->nick,islast(servers[j]),servers[j]->name);
+ char line[MAXBUF];
+ snprintf(line,MAXBUF,"006 %s :%c-%s",user->nick,islast(servers[j]),servers[j]->name);
+ while (strlen(line) < 40)
+ strcat(line," ");
+ WriteServ(user->fd,"%s%d",line,map_count(servers[j]));
}
}
WriteServ(user->fd,"007 %s :End of /MAP",user->nick);
@@ -6377,6 +6391,19 @@ void process_restricted_commands(char token,char* params,serverrec* source,serve
nb_start = time(NULL);
WriteOpers("Server %s is starting netburst.",source->name);
break;
+ // ?
+ // ping
+ case '?':
+ reply->SendPacket("!",udp_host,udp_port,MyKey);
+ break;
+ // ?
+ // pong
+ case '!':
+ break;
+ // *
+ // no operation
+ case '*':
+ break;
// N <TS> <NICK> <HOST> <DHOST> <IDENT> <MODES> <SERVER> :<GECOS>
// introduce remote client
case 'N':