mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-08 06:40:28 +00:00
- Server Notices (User-Mode "s") implementiert.
This commit is contained in:
parent
6b58ab8427
commit
20a2ffef88
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: defines.h,v 1.18 2002/03/27 16:39:50 alex Exp $
|
* $Id: defines.h,v 1.19 2002/03/27 20:53:30 alex Exp $
|
||||||
*
|
*
|
||||||
* defines.h: (globale) Konstanten
|
* defines.h: (globale) Konstanten
|
||||||
*/
|
*/
|
||||||
@ -61,7 +61,7 @@
|
|||||||
#define STARTUP_DELAY 1 /* Erst n Sek. nach Start zu anderen Servern verbinden */
|
#define STARTUP_DELAY 1 /* Erst n Sek. nach Start zu anderen Servern verbinden */
|
||||||
#define RECONNECT_DELAY 3 /* Server-Links erst nach 3 Sekunden versuchen, wieder aufzubauen */
|
#define RECONNECT_DELAY 3 /* Server-Links erst nach 3 Sekunden versuchen, wieder aufzubauen */
|
||||||
|
|
||||||
#define USERMODES "aio" /* unterstuetzte User-Modes */
|
#define USERMODES "aios" /* unterstuetzte User-Modes */
|
||||||
#define CHANMODES "amnopqstv" /* unterstuetzte Channel-Modes */
|
#define CHANMODES "amnopqstv" /* unterstuetzte Channel-Modes */
|
||||||
|
|
||||||
#define CONNECTED TRUE /* fuer die irc-xxx-Module */
|
#define CONNECTED TRUE /* fuer die irc-xxx-Module */
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: log.c,v 1.24 2002/03/27 16:40:06 alex Exp $
|
* $Id: log.c,v 1.25 2002/03/27 20:53:30 alex Exp $
|
||||||
*
|
*
|
||||||
* log.c: Logging-Funktionen
|
* log.c: Logging-Funktionen
|
||||||
*/
|
*/
|
||||||
@ -31,12 +31,17 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "ngircd.h"
|
#include "ngircd.h"
|
||||||
|
#include "client.h"
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
|
#include "irc-write.h"
|
||||||
|
|
||||||
#include "exp.h"
|
#include "exp.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
|
||||||
|
LOCAL VOID Wall_ServerNotice( CHAR *Msg );
|
||||||
|
|
||||||
|
|
||||||
GLOBAL VOID Log_Init( VOID )
|
GLOBAL VOID Log_Init( VOID )
|
||||||
{
|
{
|
||||||
CHAR txt[127];
|
CHAR txt[127];
|
||||||
@ -106,16 +111,26 @@ GLOBAL VOID Log_Exit( VOID )
|
|||||||
} /* Log_Exit */
|
} /* Log_Exit */
|
||||||
|
|
||||||
|
|
||||||
GLOBAL VOID Log( CONST INT Level, CONST CHAR *Format, ... )
|
GLOBAL VOID Log( INT Level, CONST CHAR *Format, ... )
|
||||||
{
|
{
|
||||||
/* Eintrag in Logfile(s) schreiben */
|
/* Eintrag in Logfile(s) schreiben */
|
||||||
|
|
||||||
CHAR msg[MAX_LOG_MSG_LEN];
|
CHAR msg[MAX_LOG_MSG_LEN];
|
||||||
|
BOOLEAN snotice;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
time_t t;
|
time_t t;
|
||||||
|
|
||||||
assert( Format != NULL );
|
assert( Format != NULL );
|
||||||
|
|
||||||
|
snotice = FALSE;
|
||||||
|
|
||||||
|
if( Level & LOG_snotice )
|
||||||
|
{
|
||||||
|
/* Notice an User mit "s" Mode */
|
||||||
|
snotice = TRUE;
|
||||||
|
Level &= ~LOG_snotice;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if(( Level == LOG_DEBUG ) && ( ! NGIRCd_Debug )) return;
|
if(( Level == LOG_DEBUG ) && ( ! NGIRCd_Debug )) return;
|
||||||
#else
|
#else
|
||||||
@ -135,13 +150,16 @@ GLOBAL VOID Log( CONST INT Level, CONST CHAR *Format, ... )
|
|||||||
fprintf( stderr, "[%d] %s\n\n", Level, msg );
|
fprintf( stderr, "[%d] %s\n\n", Level, msg );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ... und ausgeben */
|
/* Konsole */
|
||||||
if( NGIRCd_NoDaemon ) printf( "[%d] %s\n", Level, msg );
|
if( NGIRCd_NoDaemon ) printf( "[%d] %s\n", Level, msg );
|
||||||
|
|
||||||
#ifdef USE_SYSLOG
|
#ifdef USE_SYSLOG
|
||||||
/* Syslog */
|
/* Syslog */
|
||||||
syslog( Level, msg );
|
syslog( Level, msg );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* lokale User mit "s"-Mode */
|
||||||
|
if( snotice ) Wall_ServerNotice( msg );
|
||||||
} /* Log */
|
} /* Log */
|
||||||
|
|
||||||
|
|
||||||
@ -192,4 +210,19 @@ GLOBAL VOID Log_Resolver( CONST INT Level, CONST CHAR *Format, ... )
|
|||||||
} /* Log_Resolver */
|
} /* Log_Resolver */
|
||||||
|
|
||||||
|
|
||||||
|
LOCAL VOID Wall_ServerNotice( CHAR *Msg )
|
||||||
|
{
|
||||||
|
CLIENT *c;
|
||||||
|
|
||||||
|
assert( Msg != NULL );
|
||||||
|
|
||||||
|
c = Client_First( );
|
||||||
|
while( c )
|
||||||
|
{
|
||||||
|
if(( Client_Conn( c ) > NONE ) && ( Client_HasMode( c, 's' ))) IRC_WriteStrClient( c, "NOTICE :%s", Msg );
|
||||||
|
c = Client_Next( c );
|
||||||
|
}
|
||||||
|
} /* Wall_ServerNotice */
|
||||||
|
|
||||||
|
|
||||||
/* -eof- */
|
/* -eof- */
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: log.h,v 1.9 2002/03/25 17:17:08 alex Exp $
|
* $Id: log.h,v 1.10 2002/03/27 20:53:31 alex Exp $
|
||||||
*
|
*
|
||||||
* log.h: Logging-Funktionen (Header)
|
* log.h: Logging-Funktionen (Header)
|
||||||
*/
|
*/
|
||||||
@ -33,7 +33,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define LOG_SERVERMSG 8192
|
#define LOG_snotice 1024
|
||||||
|
|
||||||
|
|
||||||
GLOBAL VOID Log_Init( VOID );
|
GLOBAL VOID Log_Init( VOID );
|
||||||
|
Loading…
Reference in New Issue
Block a user