* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
*/
-
-#include "sys.h"
-#include "h.h"
-#include "struct.h"
+#include "map.h"
+#include "client.h"
+#include "ircd.h"
+#include "ircd_reply.h"
+#include "list.h"
+#include "match.h"
#include "numeric.h"
+#include "numnicks.h"
+#include "querycmds.h"
#include "send.h"
-#include "match.h"
-#include "list.h"
-#include "s_err.h"
-#include "ircd.h"
-#include "s_bsd.h"
-#include "s_misc.h"
-#include "map.h"
+#include "struct.h"
-RCSTAG_CC("$Id$");
+#include <stdio.h> /* sprintf */
-static void dump_map(aClient *cptr, aClient *server, char *mask,
- int prompt_length)
+void dump_map(struct Client *cptr, struct Client *server, char *mask, int prompt_length)
{
static char prompt[64];
- register Dlink *lp;
- register char *p = &prompt[prompt_length];
- register int cnt = 0;
+ struct DLink *lp;
+ char *p = &prompt[prompt_length];
+ int cnt = 0;
*p = '\0';
if (prompt_length > 60)
- sendto_one(cptr, rpl_str(RPL_MAPMORE), me.name, cptr->name,
- prompt, server->name);
- else
- sendto_one(cptr, rpl_str(RPL_MAP), me.name, cptr->name,
- prompt, server->name);
+ send_reply(cptr, RPL_MAPMORE, prompt, server->name);
+ else {
+ char lag[512];
+ if (server->serv->lag>10000)
+ lag[0]=0;
+ else if (server->serv->lag<0)
+ strcpy(lag,"(0s)");
+ else
+ sprintf(lag,"(%is)",server->serv->lag);
+ send_reply(cptr, RPL_MAP, prompt, ((IsBurstOrBurstAck(server)) ? "*" : ""),
+ server->name, lag, (server == &me) ? UserStats.local_clients :
+ server->serv->clients);
+ }
if (prompt_length > 0)
{
p[-1] = ' ';
p[-1] = '-';
}
+#if 0
/*
* m_map -- by Run
*
* parv[0] = sender prefix
* parv[1] = server mask
*/
-int m_map(aClient *UNUSED(cptr), aClient *sptr, int parc, char *parv[])
+int m_map(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
{
if (parc < 2)
parv[1] = "*";
dump_map(sptr, &me, parv[1], 0);
- sendto_one(sptr, rpl_str(RPL_MAPEND), me.name, parv[0]);
+ sendto_one(sptr, rpl_str(RPL_MAPEND), me.name, parv[0]); /* XXX DEAD */
return 0;
}
+#endif /* 0 */
+