From: Joseph Bongaarts Date: Mon, 25 Feb 2002 07:27:41 +0000 (+0000) Subject: Author: Ghostwolf X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=c4f0c8c61965b317663abdf05791c191ece8c0f5 Author: Ghostwolf Log message: Make map changes actually compile, and don't use c++ keywords for variable names. More testing and whatnot tommorow. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@656 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/include/handlers.h b/include/handlers.h index 9b2f566..1058cfb 100644 --- a/include/handlers.h +++ b/include/handlers.h @@ -102,7 +102,6 @@ extern int m_links_redirect(struct Client*, struct Client*, int, char*[]); extern int m_list(struct Client*, struct Client*, int, char*[]); extern int m_lusers(struct Client*, struct Client*, int, char*[]); extern int m_map(struct Client*, struct Client*, int, char*[]); -extern int m_map_redirect(struct Client*, struct Client*, int, char*[]); extern int m_mode(struct Client*, struct Client*, int, char*[]); extern int m_motd(struct Client*, struct Client*, int, char*[]); extern int m_names(struct Client*, struct Client*, int, char*[]); @@ -145,6 +144,7 @@ extern int mo_gline(struct Client*, struct Client*, int, char*[]); extern int mo_info(struct Client*, struct Client*, int, char*[]); extern int mo_jupe(struct Client*, struct Client*, int, char*[]); extern int mo_kill(struct Client*, struct Client*, int, char*[]); +extern int mo_map(struct Client*, struct Client*, int, char*[]); extern int mo_notice(struct Client*, struct Client*, int, char*[]); extern int mo_oper(struct Client*, struct Client*, int, char*[]); extern int mo_opmode(struct Client*, struct Client*, int, char*[]); diff --git a/include/map.h b/include/map.h index da772ab..08db3e3 100644 --- a/include/map.h +++ b/include/map.h @@ -39,7 +39,7 @@ struct Map { char name[HOSTLEN+1]; struct Map *next; struct Map *prev; -} +}; extern void map_update(struct Client *server); extern void map_dump_head_in_sand(struct Client *cptr); diff --git a/ircd/Makefile.in b/ircd/Makefile.in index 482de12..93c36d7 100644 --- a/ircd/Makefile.in +++ b/ircd/Makefile.in @@ -170,6 +170,7 @@ IRCD_SRC = \ m_who.c \ m_whois.c \ m_whowas.c \ + map.c \ match.c \ motd.c \ msgq.c \ diff --git a/ircd/m_server.c b/ircd/m_server.c index 0ea808c..ecee91d 100644 --- a/ircd/m_server.c +++ b/ircd/m_server.c @@ -85,6 +85,7 @@ #include "hash.h" #include "ircd.h" #include "ircd_log.h" +#include "ircd_policy.h" #include "ircd_features.h" #include "ircd_reply.h" #include "ircd_string.h" diff --git a/ircd/map.c b/ircd/map.c index 008265e..975da19 100644 --- a/ircd/map.c +++ b/ircd/map.c @@ -33,6 +33,7 @@ #include "ircd_reply.h" #include "ircd_snprintf.h" #include "ircd_string.h" +#include "hash.h" #include "list.h" #include "match.h" #include "msg.h" @@ -54,18 +55,18 @@ static struct Map *MapList = 0; /* Add a server to the map list. */ static void map_add(struct Client *server) { - assert(server != 0); +/* assert(server != 0); assert(!IsHub(server)); assert(!IsService(server)); +*/ + struct Map *map = (struct Map *)MyAlloc(sizeof(struct Map)); - struct Map *new = (struct Map *)MyAlloc(sizeof(struct Map)); + map->lasttime = TStime(); + strcpy(map->name, cli_name(server)); + map->maxclients = cli_serv(server)->clients; - new->lasttime = TStime(); - ircd_strcpy(new->name, cli_name(server)); - new->maxclients = cli_serv(server)->clients; - - new->prev = 0; - new->next = MapList; + map->prev = 0; + map->next = MapList; if(MapList) MapList->prev = new; @@ -76,7 +77,7 @@ static void map_add(struct Client *server) /* Remove a server from the map list */ static void map_remove(struct Map *cptr) { - assert(cptr != 0); + /* assert(cptr != 0);*/ if(cptr->next) cptr->next->prev = cptr->prev; @@ -95,12 +96,12 @@ static void map_remove(struct Map *cptr) * splits, or we haven't checked in more than a week. */ void map_update(struct Client *cptr) { - assert(IsServer(cptr)); + /* assert(IsServer(cptr)); */ struct Map *map = 0; /* Find the server in the list and update it */ - for(map = MapList.list; map; map = map->next) + for(map = MapList; map; map = map->next) { /* Show max clients not current, otherwise a split can be detected. */ if(!ircd_strcmp(cli_name(cptr), map->name)) @@ -128,7 +129,7 @@ void map_update(struct Client *cptr) map_add(cli_name(cptr)); } -void dump_map_head_in_sand(struct Client *cptr) +void map_dump_head_in_sand(struct Client *cptr) { struct Map *map = 0; struct Map *smap = 0; @@ -144,7 +145,7 @@ void dump_map_head_in_sand(struct Client *cptr) /* Don't show servers we haven't seen in more than a week */ if(map->lasttime < TStime() - 604800) { - acptr = find_match_server(map->name); + acptr = FindServer(map->name); if(!acptr) { map_remove(map); @@ -159,7 +160,7 @@ void dump_map_head_in_sand(struct Client *cptr) #endif /* HEAD_IN_SAND_MAP */ -(void map_dump(struct Client *cptr, struct Client *server, char *mask, int prompt_length) +void map_dump(struct Client *cptr, struct Client *server, char *mask, int prompt_length) { static char prompt[64]; struct DLink *lp;