lots of updates... check changelog

This commit is contained in:
fishwaldo 2002-10-15 07:30:09 +00:00
parent 57dea6cd93
commit 8c77a21e32
6 changed files with 84 additions and 39 deletions

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * USA
* *
* $Id: m_server.c,v 1.9 2002/10/15 02:44:33 fishwaldo Exp $ * $Id: m_server.c,v 1.10 2002/10/15 07:30:09 fishwaldo Exp $
*/ */
#include "stdinc.h" #include "stdinc.h"
@ -67,7 +67,7 @@ _moddeinit(void)
{ {
mod_del_cmd(&server_msgtab); mod_del_cmd(&server_msgtab);
} }
const char *_version = "$Revision: 1.9 $"; const char *_version = "$Revision: 1.10 $";
#endif #endif
int bogus_host(char *host); int bogus_host(char *host);
@ -252,7 +252,9 @@ static void mr_server(struct Client *client_p, struct Client *source_p,
/* clear the Ulined flag */ /* clear the Ulined flag */
client_p->flags &= ~FLAGS_ULINED; client_p->flags &= ~FLAGS_ULINED;
if (srvopt & SERVER_HIDDEN) client_p->hidden_server = 1; if (srvopt & SERVER_HIDDEN) {
client_p->hidden_server = 1;
}
set_server_gecos(client_p, info); set_server_gecos(client_p, info);
/* if this server is trying to set itself Ulined, its Not allowed, so exit it */ /* if this server is trying to set itself Ulined, its Not allowed, so exit it */
if (srvopt & SERVER_ULINED) { if (srvopt & SERVER_ULINED) {
@ -499,8 +501,10 @@ static void ms_server(struct Client *client_p, struct Client *source_p,
/* clear the Ulined flag before we look at info for (U) */ /* clear the Ulined flag before we look at info for (U) */
target_p->flags &= ~FLAGS_ULINED; target_p->flags &= ~FLAGS_ULINED;
if (srvopt && SERVER_ULINED) target_p->flags |= FLAGS_ULINED; if (srvopt & SERVER_ULINED) target_p->flags |= FLAGS_ULINED;
if (srvopt && SERVER_HIDDEN) target_p->hidden_server = 1; if (srvopt & SERVER_HIDDEN) {
target_p->hidden_server = 1;
}
set_server_gecos(target_p, info); set_server_gecos(target_p, info);

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * USA
* *
* $Id: m_sjoin.c,v 1.10 2002/09/23 10:47:30 fishwaldo Exp $ * $Id: m_sjoin.c,v 1.11 2002/10/15 07:30:09 fishwaldo Exp $
*/ */
#include "stdinc.h" #include "stdinc.h"
@ -43,6 +43,7 @@
static void ms_sjoin(struct Client*, struct Client*, int, char**); static void ms_sjoin(struct Client*, struct Client*, int, char**);
static void move_user(dlink_list *list);
struct Message sjoin_msgtab = { struct Message sjoin_msgtab = {
"SJOIN", 0, 0, 0, 0, MFLG_SLOW, 0, "SJOIN", 0, 0, 0, 0, MFLG_SLOW, 0,
@ -62,7 +63,7 @@ _moddeinit(void)
mod_del_cmd(&sjoin_msgtab); mod_del_cmd(&sjoin_msgtab);
} }
const char *_version = "$Revision: 1.10 $"; const char *_version = "$Revision: 1.11 $";
#endif #endif
/* /*
* ms_sjoin * ms_sjoin
@ -374,7 +375,7 @@ static void ms_sjoin(struct Client *client_p,
if (*s == '!') if (*s == '!')
{ {
fl |= MODE_ADMIN; fl |= MODE_ADMIN;
if (keep_new_modes) if (keep_new_modes || IsOper(find_client(s)))
{ {
*hops++ = *s; *hops++ = *s;
num_prefix++; num_prefix++;
@ -407,7 +408,7 @@ static void ms_sjoin(struct Client *client_p,
else if (*s == '%') else if (*s == '%')
{ {
fl |= MODE_HALFOP; fl |= MODE_HALFOP;
if (keep_new_modes) if (keep_new_modes || IsOper(find_client(s)))
{ {
*hops++ = *s; *hops++ = *s;
num_prefix++; num_prefix++;
@ -437,7 +438,7 @@ static void ms_sjoin(struct Client *client_p,
hops += ircsprintf(hops, "%s ", s); hops += ircsprintf(hops, "%s ", s);
assert((hops - sjbuf_hops) < sizeof(sjbuf_hops)); assert((hops - sjbuf_hops) < sizeof(sjbuf_hops));
if (!keep_new_modes) if (!keep_new_modes && !IsOper(target_p))
{ {
if ((fl & MODE_CHANOP) || (fl & MODE_HALFOP) || (fl & MODE_ADMIN)) if ((fl & MODE_CHANOP) || (fl & MODE_HALFOP) || (fl & MODE_ADMIN))
{ {
@ -712,21 +713,48 @@ static void remove_our_modes( int hide_or_not,
struct Channel *chptr, struct Channel *top_chptr, struct Channel *chptr, struct Channel *top_chptr,
struct Client *source_p) struct Client *source_p)
{ {
remove_a_mode(hide_or_not, chptr, top_chptr, source_p, &chptr->chanops, 'o'); remove_a_mode(hide_or_not, chptr, top_chptr, source_p, &chptr->chanops, 'o');
remove_a_mode(hide_or_not, chptr, top_chptr, source_p, &chptr->voiced, 'v'); remove_a_mode(hide_or_not, chptr, top_chptr, source_p, &chptr->voiced, 'v');
remove_a_mode(hide_or_not, chptr, top_chptr, source_p, &chptr->chanadmins, 'a');
/* Move all voice/ops etc. to non opped list */
dlinkMoveList(&chptr->chanops, &chptr->peons);
dlinkMoveList(&chptr->voiced, &chptr->peons);
dlinkMoveList(&chptr->chanadmins, &chptr->peons);
dlinkMoveList(&chptr->locchanops, &chptr->locpeons);
dlinkMoveList(&chptr->locvoiced, &chptr->locpeons);
dlinkMoveList(&chptr->locchanadmins, &chptr->locpeons);
remove_a_mode(hide_or_not, chptr, top_chptr, source_p, &chptr->halfops, 'h'); remove_a_mode(hide_or_not, chptr, top_chptr, source_p, &chptr->halfops, 'h');
dlinkMoveList(&chptr->halfops, &chptr->peons); remove_a_mode(hide_or_not, chptr, top_chptr, source_p, &chptr->chanadmins, 'a');
dlinkMoveList(&chptr->lochalfops, &chptr->locpeons);
move_user(&chptr->chanops);
move_user(&chptr->locchanops);
move_user(&chptr->voiced);
move_user(&chptr->locvoiced);
move_user(&chptr->chanadmins);
move_user(&chptr->locchanadmins);
move_user(&chptr->halfops);
move_user(&chptr->lochalfops);
}
/* move_user
*
* inputs - List to check
* outputs - NONE
* side effects - Moves uses to the peons list if they are not services
*
*/
static void move_user(dlink_list *list)
{
dlink_node *ptr;
dlink_node *ptr_next;
struct Client *target_p;
/* Move all voice/ops etc. to non opped list */
DLINK_FOREACH_SAFE(ptr, ptr_next, list->head)
{
target_p = ptr->data;
/* services never loose the TS battle */
if (IsOper(target_p))
continue;
dlinkDelete(ptr, list);
dlinkAdd(target_p, ptr, list);
}
} }
@ -762,6 +790,11 @@ static void remove_a_mode( int hide_or_not,
for (ptr = list->head; ptr && ptr->data; ptr = ptr->next) for (ptr = list->head; ptr && ptr->data; ptr = ptr->next)
{ {
target_p = ptr->data; target_p = ptr->data;
/* Services clients never loose their mode in a TS battle! */
if (IsOper(target_p))
continue;
lpara[count++] = target_p->name; lpara[count++] = target_p->name;
*mbuf++ = flag; *mbuf++ = flag;

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * USA
* *
* $Id: m_links.c,v 1.4 2002/09/13 06:50:06 fishwaldo Exp $ * $Id: m_links.c,v 1.5 2002/10/15 07:30:08 fishwaldo Exp $
*/ */
#include "stdinc.h" #include "stdinc.h"
@ -62,7 +62,7 @@ _moddeinit(void)
mod_del_cmd(&links_msgtab); mod_del_cmd(&links_msgtab);
} }
const char *_version = "$Revision: 1.4 $"; const char *_version = "$Revision: 1.5 $";
#endif #endif
/* /*
* m_links - LINKS message handler * m_links - LINKS message handler
@ -141,6 +141,9 @@ static void mo_links(struct Client *client_p, struct Client *source_p,
if (*mask && !match(mask, target_p->name)) if (*mask && !match(mask, target_p->name))
continue; continue;
if (target_p->hidden_server && !IsOper(source_p))
continue;
if(target_p->info[0]) if(target_p->info[0])
{ {

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * USA
* *
* $Id: m_map.c,v 1.1 2002/09/13 07:05:32 fishwaldo Exp $ * $Id: m_map.c,v 1.2 2002/10/15 07:30:08 fishwaldo Exp $
*/ */
#include "stdinc.h" #include "stdinc.h"
@ -54,7 +54,7 @@ void _moddeinit(void)
mod_del_cmd(&map_msgtab); mod_del_cmd(&map_msgtab);
} }
const char *_version = "$Revision: 1.1 $"; const char *_version = "$Revision: 1.2 $";
#endif #endif
static char buf[BUFSIZE]; static char buf[BUFSIZE];
@ -98,7 +98,10 @@ static void dump_map(struct Client *client_p,struct Client *root_p, char *pbuf)
struct Client *server_p,*user_p; struct Client *server_p,*user_p;
*pbuf= '\0'; *pbuf= '\0';
if (root_p->hidden_server && !IsOper(client_p)) {
goto nextserver;
}
strncat(pbuf,root_p->name,BUFSIZE - ((size_t) pbuf - (size_t) buf)); strncat(pbuf,root_p->name,BUFSIZE - ((size_t) pbuf - (size_t) buf));
len = strlen(buf); len = strlen(buf);
buf[len] = ' '; buf[len] = ' ';
@ -120,7 +123,7 @@ static void dump_map(struct Client *client_p,struct Client *root_p, char *pbuf)
100 * (float) users / (float) Count.total); 100 * (float) users / (float) Count.total);
sendto_one(client_p, form_str(RPL_MAP),me.name,client_p->name,buf); sendto_one(client_p, form_str(RPL_MAP),me.name,client_p->name,buf);
nextserver:
if ((server_p = root_p->serv->servers)) if ((server_p = root_p->serv->servers))
{ {
for (; server_p; server_p = server_p->lnext) for (; server_p; server_p = server_p->lnext)
@ -141,7 +144,7 @@ static void dump_map(struct Client *client_p,struct Client *root_p, char *pbuf)
for (i = 1,server_p = root_p->serv->servers; server_p; server_p=server_p->lnext) for (i = 1,server_p = root_p->serv->servers; server_p; server_p=server_p->lnext)
{ {
*pbuf = ' '; *pbuf = ' ';
if (i < cnt) if ((i < cnt) && (!server_p->lnext->hidden_server && !IsOper(client_p)))
*(pbuf + 1) = '|'; *(pbuf + 1) = '|';
else else
*(pbuf + 1) = '`'; *(pbuf + 1) = '`';

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * USA
* *
* $Id: m_stats.c,v 1.6 2002/09/19 05:41:10 fishwaldo Exp $ * $Id: m_stats.c,v 1.7 2002/10/15 07:30:08 fishwaldo Exp $
*/ */
#include "stdinc.h" #include "stdinc.h"
@ -80,7 +80,7 @@ _moddeinit(void)
mod_del_cmd(&stats_msgtab); mod_del_cmd(&stats_msgtab);
} }
const char *_version = "$Revision: 1.6 $"; const char *_version = "$Revision: 1.7 $";
#endif #endif
const char* Lformat = ":%s %d %s %s %u %u %u %u %u :%u %u %s"; const char* Lformat = ":%s %d %s %s %u %u %u %u %u :%u %u %s";
@ -752,7 +752,7 @@ stats_ziplinks(struct Client *source_p)
static void static void
stats_servlinks(struct Client *source_p) stats_servlinks(struct Client *source_p)
{ {
static char Sformat[] = ":%s %d %s %s %u %u %u %u %u :%u %u %s"; static char Sformat[] = ":%s %d %s %s %u %u %u %u %u :%u %u %s %s";
long uptime, sendK, receiveK; long uptime, sendK, receiveK;
struct Client *target_p; struct Client *target_p;
dlink_node *ptr; dlink_node *ptr;
@ -769,11 +769,12 @@ stats_servlinks(struct Client *source_p)
DLINK_FOREACH(ptr, serv_list.head) DLINK_FOREACH(ptr, serv_list.head)
{ {
target_p = ptr->data; target_p = ptr->data;
if (!IsOper(source_p) && target_p->hidden_server)
continue;
j++; j++;
sendK += target_p->localClient->sendK; sendK += target_p->localClient->sendK;
receiveK += target_p->localClient->receiveK; receiveK += target_p->localClient->receiveK;
sendto_one(source_p, Sformat, me.name, RPL_STATSLINKINFO, sendto_one(source_p, Sformat, me.name, RPL_STATSLINKINFO,
source_p->name, source_p->name,
IsOperAdmin(source_p) ? get_client_name(target_p, SHOW_IP) IsOperAdmin(source_p) ? get_client_name(target_p, SHOW_IP)
@ -785,7 +786,8 @@ stats_servlinks(struct Client *source_p)
(int)target_p->localClient->receiveK, (int)target_p->localClient->receiveK,
CurrentTime - target_p->firsttime, CurrentTime - target_p->firsttime,
(CurrentTime > target_p->since) ? (CurrentTime - target_p->since): 0, (CurrentTime > target_p->since) ? (CurrentTime - target_p->since): 0,
IsOper(source_p) ? show_capabilities(target_p) : "TS"); IsOper(source_p) ? show_capabilities(target_p) : "TS",
target_p->hidden_server ? "H" : "");
} }
sendto_one(source_p, ":%s %d %s :%u total server(s)", sendto_one(source_p, ":%s %d %s :%u total server(s)",

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * USA
* *
* $Id: m_whois.c,v 1.9 2002/09/19 05:41:10 fishwaldo Exp $ * $Id: m_whois.c,v 1.10 2002/10/15 07:30:08 fishwaldo Exp $
*/ */
#include "stdinc.h" #include "stdinc.h"
@ -76,7 +76,7 @@ _moddeinit(void)
mod_del_cmd(&whois_msgtab); mod_del_cmd(&whois_msgtab);
} }
const char *_version = "$Revision: 1.9 $"; const char *_version = "$Revision: 1.10 $";
#endif #endif
/* /*
** m_whois ** m_whois
@ -433,8 +433,8 @@ whois_person(struct Client *source_p,struct Client *target_p, int glob)
if ((IsOper(source_p) || !ConfigServerHide.hide_servers) || target_p == source_p) if ((IsOper(source_p) || !ConfigServerHide.hide_servers) || target_p == source_p)
sendto_one(source_p, form_str(RPL_WHOISSERVER), sendto_one(source_p, form_str(RPL_WHOISSERVER),
me.name, source_p->name, target_p->name, server_name, me.name, source_p->name, target_p->name, !target_p->servptr->hidden_server ? server_name : ServerInfo.network_name,
a2client_p?a2client_p->info:"*Not On This Net*"); target_p->servptr->hidden_server ? ServerInfo.network_desc : a2client_p ? a2client_p->info:"*Not On This Net*");
else else
sendto_one(source_p, form_str(RPL_WHOISSERVER), sendto_one(source_p, form_str(RPL_WHOISSERVER),
me.name, source_p->name, target_p->name, me.name, source_p->name, target_p->name,