/[svn]/ircd-hybrid/trunk/modules/m_map.c
ViewVC logotype

Diff of /ircd-hybrid/trunk/modules/m_map.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2988 by michael, Wed Jan 15 23:10:26 2014 UTC revision 2989 by michael, Tue Feb 18 11:21:42 2014 UTC
# Line 44  static void dump_map(struct Client *clie Line 44  static void dump_map(struct Client *clie
44    dlink_node *ptr = NULL;    dlink_node *ptr = NULL;
45    struct Client *target_p = NULL;    struct Client *target_p = NULL;
46    static char prompt[64];    static char prompt[64];
47      static char buf[IRCD_BUFSIZE];
48    char *p = prompt + prompt_length;    char *p = prompt + prompt_length;
49    int cnt = 0;    int cnt = 0;
50      int bufpos = 0;
51    
52    *p = '\0';    *p = '\0';
53    
# Line 54  static void dump_map(struct Client *clie Line 56  static void dump_map(struct Client *clie
56                 client->name, prompt, server->name);                 client->name, prompt, server->name);
57    else    else
58    {    {
59      char buf[IRC_MAXSID + 3] = ""; /* +3 for [, ], \0 */      int dashes;
60    
61        bufpos += snprintf(buf + bufpos, sizeof(buf) - bufpos, "%s", server->name);
62    
63      if (HasUMode(client, UMODE_OPER) && server->id[0])      if (HasUMode(client, UMODE_OPER) && server->id[0])
64        snprintf(buf, sizeof(buf), "[%s]", server->id);        bufpos += snprintf(buf + bufpos, sizeof(buf) - bufpos, "[%s]", server->id);
65    
66        buf[bufpos++] = ' ';
67        dashes = 50 - bufpos - prompt_length;
68        for (; dashes > 0; --dashes)
69          buf[bufpos++] = '-';
70        buf[bufpos++] = ' ';
71        buf[bufpos++] = '|';
72    
73        bufpos += snprintf(buf + bufpos, sizeof(buf) - bufpos, " Users %5d (%1.2f%%)",
74                           dlink_list_length(&server->serv->client_list), 100 *
75                           (float)dlink_list_length(&server->serv->client_list) /
76                           (float)Count.total);
77      sendto_one(client, form_str(RPL_MAP), me.name, client->name,      sendto_one(client, form_str(RPL_MAP), me.name, client->name,
78                 prompt, server->name, buf,                 prompt, buf);
                dlink_list_length(&server->serv->client_list),  
                dlink_list_length(&server->serv->client_list) * 100 / Count.total);  
79    }    }
80    
81    if (prompt_length > 0)    if (prompt_length > 0)

Legend:
Removed from v.2988  
changed lines
  Added in v.2989

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28