mirror of
https://github.com/osmarks/ngircd.git
synced 2024-12-12 09:50:29 +00:00
- neue Funktion Client_CheckID(), diverse Aenderungen fuer Server-Links.
This commit is contained in:
parent
ed406b4a93
commit
07903baa61
@ -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.17 2002/01/02 02:42:58 alex Exp $
|
||||
* $Id: client.c,v 1.18 2002/01/03 02:28:06 alex Exp $
|
||||
*
|
||||
* client.c: Management aller Clients
|
||||
*
|
||||
@ -21,6 +21,9 @@
|
||||
* Server gewesen, so existiert eine entsprechende CONNECTION-Struktur.
|
||||
*
|
||||
* $Log: client.c,v $
|
||||
* Revision 1.18 2002/01/03 02:28:06 alex
|
||||
* - neue Funktion Client_CheckID(), diverse Aenderungen fuer Server-Links.
|
||||
*
|
||||
* Revision 1.17 2002/01/02 02:42:58 alex
|
||||
* - Copyright-Texte aktualisiert.
|
||||
*
|
||||
@ -298,6 +301,39 @@ GLOBAL BOOLEAN Client_CheckNick( CLIENT *Client, CHAR *Nick )
|
||||
} /* Client_CheckNick */
|
||||
|
||||
|
||||
GLOBAL BOOLEAN Client_CheckID( CLIENT *Client, CHAR *ID )
|
||||
{
|
||||
/* Nick ueberpruefen */
|
||||
|
||||
CHAR str[COMMAND_LEN];
|
||||
CLIENT *c;
|
||||
|
||||
assert( Client != NULL );
|
||||
assert( Client->conn_id > NONE );
|
||||
assert( ID != NULL );
|
||||
|
||||
/* Nick zu lang? */
|
||||
if( strlen( ID ) > CLIENT_ID_LEN ) return IRC_WriteStrClient( Client, This_Server, ERR_ERRONEUSNICKNAME_MSG, Client_Nick( Client ), ID );
|
||||
|
||||
/* ID bereits vergeben? */
|
||||
c = My_Clients;
|
||||
while( c )
|
||||
{
|
||||
if( strcasecmp( c->nick, ID ) == 0 )
|
||||
{
|
||||
/* die Server-ID gibt es bereits */
|
||||
sprintf( str, "ID \"%s\" already registered!", ID );
|
||||
Log( LOG_ALERT, "%s (detected on connection %d)", str, Client->conn_id );
|
||||
Conn_Close( Client->conn_id, str );
|
||||
return FALSE;
|
||||
}
|
||||
c = c->next;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
} /* Client_CheckID */
|
||||
|
||||
|
||||
GLOBAL CHAR *Client_GetID( CLIENT *Client )
|
||||
{
|
||||
/* Client-"ID" liefern, wie sie z.B. fuer
|
||||
|
@ -9,11 +9,14 @@
|
||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*
|
||||
* $Id: client.h,v 1.12 2002/01/02 02:42:58 alex Exp $
|
||||
* $Id: client.h,v 1.13 2002/01/03 02:28:06 alex Exp $
|
||||
*
|
||||
* client.h: Konfiguration des ngircd (Header)
|
||||
*
|
||||
* $Log: client.h,v $
|
||||
* Revision 1.13 2002/01/03 02:28:06 alex
|
||||
* - neue Funktion Client_CheckID(), diverse Aenderungen fuer Server-Links.
|
||||
*
|
||||
* Revision 1.12 2002/01/02 02:42:58 alex
|
||||
* - Copyright-Texte aktualisiert.
|
||||
*
|
||||
@ -70,6 +73,8 @@ typedef enum
|
||||
CLIENT_GOTNICK, /* Client hat NICK gesendet */
|
||||
CLIENT_GOTUSER, /* Client hat USER gesendet */
|
||||
CLIENT_USER, /* Client ist ein Benutzer (USER wurde gesendet) */
|
||||
CLIENT_UNKNOWNSERVER, /* unregistrierte Server-Verbindung */
|
||||
CLIENT_GOTPASSSERVER, /* Client hat PASS nach "Server-Art" gesendet */
|
||||
CLIENT_SERVER, /* Client ist ein Server */
|
||||
CLIENT_SERVICE /* Client ist ein Service */
|
||||
} CLIENT_TYPE;
|
||||
@ -101,12 +106,18 @@ GLOBAL VOID Client_Exit( VOID );
|
||||
|
||||
GLOBAL CLIENT *Client_NewLocal( CONN_ID Idx, CHAR *Hostname );
|
||||
GLOBAL VOID Client_Destroy( CLIENT *Client );
|
||||
|
||||
GLOBAL VOID Client_SetHostname( CLIENT *Client, CHAR *Hostname );
|
||||
|
||||
GLOBAL CLIENT *Client_GetFromConn( CONN_ID Idx );
|
||||
GLOBAL CLIENT *Client_GetFromNick( CHAR *Nick );
|
||||
|
||||
GLOBAL CHAR *Client_Nick( CLIENT *Client );
|
||||
GLOBAL BOOLEAN Client_CheckNick( CLIENT *Client, CHAR *Nick );
|
||||
GLOBAL CHAR *Client_GetID( CLIENT *Client );
|
||||
|
||||
GLOBAL BOOLEAN Client_CheckNick( CLIENT *Client, CHAR *Nick );
|
||||
GLOBAL BOOLEAN Client_CheckID( CLIENT *Client, CHAR *ID );
|
||||
|
||||
GLOBAL CLIENT *Client_Search( CHAR *ID );
|
||||
GLOBAL CLIENT *Client_First( VOID );
|
||||
GLOBAL CLIENT *Client_Next( CLIENT *c );
|
||||
|
Loading…
Reference in New Issue
Block a user