X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fclient.c;h=b3b6118172f6bdcaf3906c9b41890f179354740d;hp=b4c8dd5eabf350e2bb9665bdcd75174eb9e14281;hb=3be7b9ef59cf7425c87e4b44c7345287eb13c425;hpb=b5c16c228bd3f25c0e377480c44b166f5c0b6c36 diff --git a/src/ngircd/client.c b/src/ngircd/client.c index b4c8dd5e..b3b61181 100644 --- a/src/ngircd/client.c +++ b/src/ngircd/client.c @@ -9,7 +9,7 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: client.c,v 1.51 2002/03/25 16:59:36 alex Exp $ + * $Id: client.c,v 1.54 2002/04/14 13:54:51 alex Exp $ * * client.c: Management aller Clients * @@ -105,7 +105,7 @@ GLOBAL VOID Client_Exit( VOID ) while( c ) { cnt++; - next = c->next; + next = (CLIENT *)c->next; free( c ); c = next; } @@ -169,7 +169,7 @@ GLOBAL CLIENT *Client_New( CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, I if( strchr( client->modes, 'a' )) strcpy( client->away, DEFAULT_AWAY_MSG ); /* Verketten */ - client->next = My_Clients; + client->next = (POINTER *)My_Clients; My_Clients = client; return client; @@ -209,7 +209,7 @@ GLOBAL VOID Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN { /* Wir haben den Client gefunden: entfernen */ if( last ) last->next = c->next; - else My_Clients = c->next; + else My_Clients = (CLIENT *)c->next; if( c->type == CLIENT_USER ) { @@ -245,8 +245,8 @@ GLOBAL VOID Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN { if( c != This_Server ) { - if( c->conn_id != NONE ) Log( LOG_NOTICE, "Server \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt ); - else Log( LOG_NOTICE, "Server \"%s\" unregistered: %s", c->id, txt ); + if( c->conn_id != NONE ) Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt ); + else Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" unregistered: %s", c->id, txt ); } /* andere Server informieren */ @@ -274,7 +274,7 @@ GLOBAL VOID Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN break; } last = c; - c = c->next; + c = (CLIENT *)c->next; } } /* Client_Destroy */ @@ -478,7 +478,7 @@ GLOBAL CLIENT *Client_GetFromConn( CONN_ID Idx ) while( c ) { if( c->conn_id == Idx ) return c; - c = c->next; + c = (CLIENT *)c->next; } return NULL; } /* Client_GetFromConn */ @@ -511,7 +511,7 @@ GLOBAL CLIENT *Client_Search( CHAR *Nick ) /* lt. Hash-Wert: Treffer! */ if( strcasecmp( c->id, search_id ) == 0 ) return c; } - c = c->next; + c = (CLIENT *)c->next; } return NULL; } /* Client_Search */ @@ -532,7 +532,7 @@ GLOBAL CLIENT *Client_GetFromToken( CLIENT *Client, INT Token ) while( c ) { if(( c->type == CLIENT_SERVER ) && ( c->introducer == Client ) && ( c->token == Token )) return c; - c = c->next; + c = (CLIENT *)c->next; } return NULL; } /* Client_GetFromToken */ @@ -575,7 +575,7 @@ GLOBAL CHAR *Client_Info( CLIENT *Client ) GLOBAL CHAR *Client_User( CLIENT *Client ) { assert( Client != NULL ); - if( Client->user ) return Client->user; + if( Client->user[0] ) return Client->user; else return "~"; } /* Client_User */ @@ -741,7 +741,7 @@ GLOBAL BOOLEAN Client_CheckID( CLIENT *Client, CHAR *ID ) Conn_Close( Client->conn_id, str, str, TRUE ); return FALSE; } - c = c->next; + c = (CLIENT *)c->next; } return TRUE; @@ -762,7 +762,7 @@ GLOBAL CLIENT *Client_Next( CLIENT *c ) * so wird NULL geliefert. */ assert( c != NULL ); - return c->next; + return (CLIENT *)c->next; } /* Client_Next */ @@ -798,7 +798,17 @@ GLOBAL INT Client_MyServiceCount( VOID ) GLOBAL INT Client_MyServerCount( VOID ) { - return MyCount( CLIENT_SERVER ); + CLIENT *c; + INT cnt; + + cnt = 0; + c = My_Clients; + while( c ) + { + if(( c->type == CLIENT_SERVER ) && ( c->hops == 1 )) cnt++; + c = (CLIENT *)c->next; + } + return cnt; } /* Client_MyServerCount */ @@ -812,7 +822,7 @@ GLOBAL INT Client_OperCount( VOID ) while( c ) { if( c && ( c->type == CLIENT_USER ) && ( strchr( c->modes, 'o' ))) cnt++; - c = c->next; + c = (CLIENT *)c->next; } return cnt; } /* Client_OperCount */ @@ -828,7 +838,7 @@ GLOBAL INT Client_UnknownCount( VOID ) while( c ) { if( c && ( c->type != CLIENT_USER ) && ( c->type != CLIENT_SERVICE ) && ( c->type != CLIENT_SERVER )) cnt++; - c = c->next; + c = (CLIENT *)c->next; } return cnt; } /* Client_UnknownCount */ @@ -867,8 +877,8 @@ LOCAL INT Count( CLIENT_TYPE Type ) c = My_Clients; while( c ) { - if( c && ( c->type == Type )) cnt++; - c = c->next; + if( c->type == Type ) cnt++; + c = (CLIENT *)c->next; } return cnt; } /* Count */ @@ -883,8 +893,8 @@ LOCAL INT MyCount( CLIENT_TYPE Type ) c = My_Clients; while( c ) { - if( c && ( c->introducer == This_Server ) && ( c->type == Type )) cnt++; - c = c->next; + if(( c->introducer == This_Server ) && ( c->type == Type )) cnt++; + c = (CLIENT *)c->next; } return cnt; } /* MyCount */ @@ -941,7 +951,7 @@ LOCAL VOID Generate_MyToken( CLIENT *Client ) c = My_Clients; continue; } - else c = c->next; + else c = (CLIENT *)c->next; } Client->mytoken = token; Log( LOG_DEBUG, "Assigned token %d to server \"%s\".", token, Client->id );