mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-12 19:14:46 +02:00
Index: Changes
=================================================================== RCS file: /home/cmunk/ircsystems/cvsroot/unreal/Changes,v retrieving revision 1.1.1.1.2.1.2.1.2.187 diff -u -r1.1.1.1.2.1.2.1.2.187 Changes --- Changes 2000/08/11 19:31:50 1.1.1.1.2.1.2.1.2.187 +++ Changes 2000/08/13 14:39:47 @@ -543,3 +543,4 @@ - Added Dianora's /userhost - Recoded /links using NS - Recoded /map a bit using NS, and added usercounts to Server struct +- Some crazy time_t -> TS stuff, will save us some time in 2038
This commit is contained in:
Vendored
+1
@@ -17,6 +17,7 @@
|
||||
--declaration-indentation5
|
||||
-T size_t
|
||||
-T aClass
|
||||
-T TS
|
||||
-T aClient
|
||||
-T aServer
|
||||
-T anUser
|
||||
|
||||
@@ -543,3 +543,4 @@
|
||||
- Added Dianora's /userhost
|
||||
- Recoded /links using NS
|
||||
- Recoded /map a bit using NS, and added usercounts to Server struct
|
||||
- Some crazy time_t -> TS stuff, will save us some time in 2038
|
||||
|
||||
+6
-4
@@ -85,6 +85,8 @@ void free();
|
||||
#endif
|
||||
|
||||
|
||||
#define TS time_t
|
||||
|
||||
extern int match PROTO((char *, char *));
|
||||
#define mycmp(a,b) \
|
||||
( (toupper((a)[0])!=toupper((b)[0])) || smycmp((a)+1,(b)+1) )
|
||||
@@ -115,7 +117,7 @@ extern int inet_netof PROTO((struct IN_ADDR));
|
||||
#endif
|
||||
|
||||
int global_count, max_global_count;
|
||||
extern char *myctime PROTO((time_t));
|
||||
extern char *myctime PROTO((TS));
|
||||
extern char *strtoken PROTO((char **, char *, char *));
|
||||
|
||||
#define PRECISE_CHECK
|
||||
@@ -225,7 +227,7 @@ extern struct SLink *find_user_link( /* struct SLink *, struct Client * */ );
|
||||
" CHANTYPES=%s" \
|
||||
" PREFIX=%s" \
|
||||
" :are supported by this server"
|
||||
|
||||
|
||||
#define PROTOCTL_PARAMETERS MAXWATCH, \
|
||||
MAXSILES, \
|
||||
MAXMODEPARAMS, \
|
||||
@@ -235,7 +237,7 @@ extern struct SLink *find_user_link( /* struct SLink *, struct Client * */ );
|
||||
TOPICLEN, \
|
||||
TOPICLEN, \
|
||||
"#", \
|
||||
"(ohv)@%+"
|
||||
"(ohv)@%+"
|
||||
|
||||
/* Server-Server PROTOCTL -Stskeeps */
|
||||
#define PROTOCTL_SERVER "NOQUIT TOKEN NICKv2 SJOIN SJOIN2 UMODE2 VL SJ3 NS" ZIPSTUFF
|
||||
@@ -257,6 +259,6 @@ extern int lu_noninv, lu_inv, lu_serv, lu_oper,
|
||||
lu_unknown, lu_channel, lu_lu, lu_lulocal, lu_lserv,
|
||||
lu_clu, lu_mlu, lu_cglobalu, lu_mglobalu;
|
||||
|
||||
time_t now;
|
||||
TS now;
|
||||
|
||||
#endif /* __common_include__ */
|
||||
|
||||
+8
-8
@@ -34,14 +34,14 @@ extern char *getreply(int);
|
||||
#define rpl_str(x) getreply(x)
|
||||
#define err_str(x) getreply(x)
|
||||
|
||||
extern time_t nextconnect, nextdnscheck, nextping;
|
||||
extern TS nextconnect, nextdnscheck, nextping;
|
||||
extern aClient *client, me, *local[];
|
||||
extern aChannel *channel;
|
||||
extern struct stats *ircstp;
|
||||
extern int bootopt;
|
||||
extern time_t TSoffset;
|
||||
extern TS TSoffset;
|
||||
/* Prototype added to force errors -- Barubary */
|
||||
extern time_t check_pings(time_t now, int check_kills);
|
||||
extern TS check_pings(TS now, int check_kills);
|
||||
|
||||
/* Remmed out for win32 compatibility.. as stated of 467leaf win32 port.. */
|
||||
|
||||
@@ -171,9 +171,9 @@ extern int inetport PROTO((aClient *, char *, int));
|
||||
extern void init_sys PROTO(());
|
||||
|
||||
#ifdef NO_FDLIST
|
||||
extern int read_message PROTO((time_t));
|
||||
extern int read_message PROTO((TS));
|
||||
#else
|
||||
extern int read_message PROTO((time_t, fdlist *));
|
||||
extern int read_message PROTO((TS, fdlist *));
|
||||
#endif
|
||||
|
||||
extern void report_error PROTO((char *, aClient *));
|
||||
@@ -254,7 +254,7 @@ extern int check_registered_user PROTO((aClient *));
|
||||
extern char *get_client_name PROTO((aClient *, int));
|
||||
extern char *get_client_host PROTO((aClient *));
|
||||
extern char *my_name_for_link PROTO((char *, aConfItem *));
|
||||
extern char *myctime PROTO((time_t)), *date PROTO((time_t));
|
||||
extern char *myctime PROTO((TS)), *date PROTO((TS));
|
||||
extern int exit_client PROTO((aClient *, aClient *, aClient *, char *));
|
||||
extern void initstats PROTO(()), tstats PROTO((aClient *, char *));
|
||||
extern char *check_string PROTO((char *));
|
||||
@@ -308,8 +308,8 @@ extern struct hostent *gethost_byaddr PROTO((char *, Link *));
|
||||
extern struct hostent *gethost_byname PROTO((char *, Link *));
|
||||
extern void flush_cache PROTO(());
|
||||
extern int init_resolver PROTO((int));
|
||||
extern time_t timeout_query_list PROTO((time_t));
|
||||
extern time_t expire_cache PROTO((time_t));
|
||||
extern TS timeout_query_list PROTO((TS));
|
||||
extern TS expire_cache PROTO((TS));
|
||||
extern void del_queries PROTO((char *));
|
||||
|
||||
extern void clear_channel_hash_table PROTO(());
|
||||
|
||||
+29
-29
@@ -593,7 +593,7 @@ typedef struct Whowas {
|
||||
char *realname;
|
||||
char *away;
|
||||
long umodes;
|
||||
time_t logoff;
|
||||
TS logoff;
|
||||
struct Client *online; /* Pointer to new nickname for chasing or NULL */
|
||||
struct Whowas *next; /* for hash table... */
|
||||
struct Whowas *prev; /* for hash table... */
|
||||
@@ -623,7 +623,7 @@ struct ConfItem {
|
||||
char *passwd;
|
||||
char *name;
|
||||
int port;
|
||||
time_t hold; /* Hold action until this time (calendar time) */
|
||||
TS hold; /* Hold action until this time (calendar time) */
|
||||
int tmpconf;
|
||||
#ifndef VMSP
|
||||
aClass *class; /* Class of connection */
|
||||
@@ -683,7 +683,7 @@ struct User {
|
||||
Link *invited; /* chain of invite pointer blocks */
|
||||
Link *silence; /* chain of silence pointer blocks */
|
||||
char *away; /* pointer to away message */
|
||||
time_t last;
|
||||
TS last;
|
||||
u_int32_t servicestamp; /* Services' time stamp variable */
|
||||
int refcnt; /* Number of times this block is referenced */
|
||||
int joined; /* number of channels joined */
|
||||
@@ -705,9 +705,9 @@ struct Server {
|
||||
char *up; /* uplink for this server */
|
||||
char by[NICKLEN + 1];
|
||||
aConfItem *nline; /* N-line pointer for this server */
|
||||
time_t timestamp; /* Remotely determined connect try time */
|
||||
unsigned short numeric; /* NS numeric, 0 if none */
|
||||
long users;
|
||||
TS timestamp; /* Remotely determined connect try time */
|
||||
unsigned short numeric; /* NS numeric, 0 if none */
|
||||
long users;
|
||||
#ifdef LIST_DEBUG
|
||||
aClient *bcptr;
|
||||
#endif
|
||||
@@ -741,8 +741,8 @@ struct t_kline {
|
||||
char *hostmask;
|
||||
char *reason;
|
||||
char *setby;
|
||||
time_t expire_at;
|
||||
time_t set_at;
|
||||
TS expire_at;
|
||||
TS set_at;
|
||||
aTKline *next;
|
||||
aTKline *prev;
|
||||
};
|
||||
@@ -793,12 +793,12 @@ struct Client {
|
||||
struct Client *next, *prev, *hnext;
|
||||
anUser *user; /* ...defined, if this is a User */
|
||||
aServer *serv; /* ...defined, if this is a server */
|
||||
time_t lasttime; /* ...should be only LOCAL clients? --msa */
|
||||
time_t firsttime; /* time client was created */
|
||||
time_t since; /* last time we parsed something */
|
||||
time_t lastnick; /* TimeStamp on nick */
|
||||
time_t nextnick; /* Time the next nick change will be allowed */
|
||||
time_t nexttarget; /* Time until a change in targets is allowed */
|
||||
TS lasttime; /* ...should be only LOCAL clients? --msa */
|
||||
TS firsttime; /* time client was created */
|
||||
TS since; /* last time we parsed something */
|
||||
TS lastnick; /* TimeStamp on nick */
|
||||
TS nextnick; /* Time the next nick change will be allowed */
|
||||
TS nexttarget; /* Time until a change in targets is allowed */
|
||||
u_char targets[MAXTARGETS]; /* Hash values of current targets */
|
||||
aWhowas *whowas;
|
||||
long flags; /* client flags */
|
||||
@@ -863,7 +863,7 @@ struct Client {
|
||||
*/
|
||||
char passwd[PASSWDLEN + 1];
|
||||
#ifdef DEBUGMODE
|
||||
time_t cputime;
|
||||
TS cputime;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -885,8 +885,8 @@ struct stats {
|
||||
unsigned long is_ckr; /* k-bytes received to clients */
|
||||
unsigned long is_sks; /* k-bytes sent to servers */
|
||||
unsigned long is_skr; /* k-bytes received to servers */
|
||||
time_t is_cti; /* time spent connected by clients */
|
||||
time_t is_sti; /* time spent connected by servers */
|
||||
TS is_cti; /* time spent connected by clients */
|
||||
TS is_sti; /* time spent connected by servers */
|
||||
unsigned int is_ac; /* connections accepted */
|
||||
unsigned int is_ref; /* accepts refused */
|
||||
unsigned int is_unco; /* unknown commands */
|
||||
@@ -909,11 +909,11 @@ struct ListOptions {
|
||||
short int showall;
|
||||
unsigned short usermin;
|
||||
int usermax;
|
||||
time_t currenttime;
|
||||
time_t chantimemin;
|
||||
time_t chantimemax;
|
||||
time_t topictimemin;
|
||||
time_t topictimemax;
|
||||
TS currenttime;
|
||||
TS chantimemin;
|
||||
TS chantimemax;
|
||||
TS topictimemin;
|
||||
TS topictimemax;
|
||||
};
|
||||
|
||||
/* mode structure for channels */
|
||||
@@ -929,7 +929,7 @@ struct SMode {
|
||||
/* x:y */
|
||||
int msgs; /* x */
|
||||
int per; /* y */
|
||||
unsigned short kmode; /* mode 0 = kick 1 = ban */
|
||||
unsigned short kmode; /* mode 0 = kick 1 = ban */
|
||||
};
|
||||
|
||||
/* Message table structure */
|
||||
@@ -954,7 +954,7 @@ struct Message {
|
||||
|
||||
struct Notify {
|
||||
aNotify *hnext;
|
||||
time_t lasttime;
|
||||
TS lasttime;
|
||||
Link *notify;
|
||||
char nick[1];
|
||||
};
|
||||
@@ -975,7 +975,7 @@ struct SLink {
|
||||
struct {
|
||||
char *banstr;
|
||||
char *who;
|
||||
time_t when;
|
||||
TS when;
|
||||
} ban;
|
||||
} value;
|
||||
};
|
||||
@@ -984,7 +984,7 @@ struct SBan {
|
||||
struct SBan *next;
|
||||
char *banstr;
|
||||
char *who;
|
||||
time_t when;
|
||||
TS when;
|
||||
};
|
||||
|
||||
struct DSlink {
|
||||
@@ -1003,10 +1003,10 @@ struct DSlink {
|
||||
struct Channel {
|
||||
struct Channel *nextch, *prevch, *hnextch;
|
||||
Mode mode;
|
||||
time_t creationtime;
|
||||
TS creationtime;
|
||||
char *topic;
|
||||
char *topic_nick;
|
||||
time_t topic_time;
|
||||
TS topic_time;
|
||||
int users;
|
||||
Link *members;
|
||||
Link *invites;
|
||||
@@ -1100,7 +1100,7 @@ struct Channel {
|
||||
|
||||
struct FloodOpt {
|
||||
int nmsg;
|
||||
time_t lastmsg;
|
||||
TS lastmsg;
|
||||
};
|
||||
|
||||
/* Misc macros */
|
||||
|
||||
@@ -25,5 +25,5 @@ Set netdomain .....: testnet.ircsystems.net
|
||||
Set helpchan ......: #testnet
|
||||
Set STATS_SERVER ..: stats.testnet.ircsystems.net
|
||||
Set HUB ...........: 1
|
||||
Set iNAH ..........: 0
|
||||
Set iNAH ..........: 1
|
||||
Set net_quit ......: test
|
||||
|
||||
+174
-145
@@ -770,7 +770,7 @@ static int send_mode_list(cptr, chname, creationtime, top, mask, flag)
|
||||
Link *top;
|
||||
int mask;
|
||||
char flag, *chname;
|
||||
time_t creationtime;
|
||||
TS creationtime;
|
||||
{
|
||||
Link *lp;
|
||||
char *cp, *name;
|
||||
@@ -2194,7 +2194,7 @@ int DoesOp(modebuf)
|
||||
int sendmodeto_one(cptr, from, name, mode, param, creationtime)
|
||||
aClient *cptr;
|
||||
char *from, *name, *mode, *param;
|
||||
time_t creationtime;
|
||||
TS creationtime;
|
||||
{
|
||||
if ((IsServer(cptr) && DoesOp(mode) && creationtime) ||
|
||||
IsULine(cptr, cptr))
|
||||
@@ -2431,7 +2431,7 @@ static aChannel *get_channel(cptr, chname, flag)
|
||||
chptr->topic_nick = NULL;
|
||||
chptr->prevch = NULL;
|
||||
chptr->nextch = channel;
|
||||
chptr->creationtime = MyClient(cptr) ? TStime() : (time_t) 0;
|
||||
chptr->creationtime = MyClient(cptr) ? TStime() : (TS)0;
|
||||
channel = chptr;
|
||||
(void)add_to_channel_hash_table(chname, chptr);
|
||||
IRCstats.channels++;
|
||||
@@ -2735,8 +2735,9 @@ int channel_link(cptr, sptr, parc, parv)
|
||||
if (MyClient(sptr))
|
||||
sendto_one(sptr, ":%s!%s@%s JOIN :%s",
|
||||
sptr->name, sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->user->
|
||||
virthost : sptr->user->realhost), name);
|
||||
(IsHidden(sptr) ? sptr->
|
||||
user->virthost : sptr->user->realhost),
|
||||
name);
|
||||
sendto_umode(UMODE_NETADMIN | UMODE_TECHADMIN,
|
||||
"*** Invisible(+I) user %s joined %s", sptr->name,
|
||||
chptr->chname);
|
||||
@@ -2962,34 +2963,33 @@ int m_join(cptr, sptr, parc, parv)
|
||||
{
|
||||
sendto_one(sptr, ":%s!%s@%s JOIN :%s",
|
||||
sptr->name, sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->user->
|
||||
virthost : sptr->user->realhost),
|
||||
(IsHidden(sptr) ? sptr->
|
||||
user->virthost : sptr->user->realhost),
|
||||
chptr->chname);
|
||||
sendto_umode(UMODE_ADMIN,
|
||||
"*** [+I] %s invisible joined %s",
|
||||
sptr->name, chptr->chname);
|
||||
sendto_serv_butone_token(&me, me.name,
|
||||
MSG_SMO, TOK_SMO,
|
||||
"A :[+I] %s invisible joined %s",
|
||||
sendto_serv_butone_token(&me, me.name, MSG_SMO,
|
||||
TOK_SMO, "A :[+I] %s invisible joined %s",
|
||||
sptr->name, chptr->chname);
|
||||
}
|
||||
}
|
||||
else if (chptr->mode.mode & MODE_AUDITORIUM) {
|
||||
else if (chptr->mode.mode & MODE_AUDITORIUM)
|
||||
{
|
||||
if (MyClient(sptr))
|
||||
sendto_one(sptr, ":%s!%s@%s JOIN :%s",
|
||||
sptr->name, sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->user->
|
||||
virthost : sptr->user->realhost),
|
||||
chptr->chname);
|
||||
sendto_chanops_butone(NULL, chptr, ":%s!%s@%s JOIN :%s",
|
||||
sptr->name, sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->user->
|
||||
virthost : sptr->user->realhost),
|
||||
chptr->chname);
|
||||
}
|
||||
sptr->name, sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->
|
||||
user->virthost : sptr->user->realhost),
|
||||
chptr->chname);
|
||||
sendto_chanops_butone(NULL, chptr, ":%s!%s@%s JOIN :%s",
|
||||
sptr->name, sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->user->virthost : sptr->
|
||||
user->realhost), chptr->chname);
|
||||
}
|
||||
else
|
||||
sendto_channel_butserv(chptr, sptr,
|
||||
":%s JOIN :%s", parv[0], chptr->chname);
|
||||
":%s JOIN :%s", parv[0], chptr->chname);
|
||||
|
||||
sendto_serv_butone_token(cptr, parv[0], MSG_JOIN,
|
||||
TOK_JOIN, "%s", chptr->chname);
|
||||
@@ -3129,59 +3129,72 @@ int m_part(cptr, sptr, parc, parv)
|
||||
sptr->user->realhost),
|
||||
chptr->chname, comment);
|
||||
}
|
||||
else if (chptr->mode.mode & MODE_AUDITORIUM) {
|
||||
if (MyClient(sptr)) {
|
||||
if (parc < 3) {
|
||||
sendto_chanops_butone(NULL, chptr,
|
||||
":%s!%s@%s PART %s",
|
||||
sptr->name,
|
||||
sptr->user->username,
|
||||
(IsHidden(sptr) ?
|
||||
sptr->user->virthost :
|
||||
sptr->user->realhost),
|
||||
chptr->chname);
|
||||
if (!is_chan_op(sptr, chptr))
|
||||
sendto_one(sptr, ":%s!%s@%s PART %s",
|
||||
sptr->name,
|
||||
sptr->user->username,
|
||||
(IsHidden(sptr) ?
|
||||
sptr->user->virthost :
|
||||
sptr->user->realhost),
|
||||
chptr->chname);
|
||||
}
|
||||
else {
|
||||
sendto_chanops_butone(NULL, chptr,
|
||||
":%s!%s@%s PART %s %s",
|
||||
sptr->name,
|
||||
sptr->user->username,
|
||||
(IsHidden(sptr) ?
|
||||
sptr->user->virthost :
|
||||
sptr->user->realhost),
|
||||
chptr->chname, comment);
|
||||
if (!is_chan_op(cptr, chptr))
|
||||
sendto_one(sptr, ":%s!%s@%s PART %s %s",
|
||||
sptr->name,
|
||||
sptr->user->username,
|
||||
(IsHidden(sptr) ?
|
||||
sptr->user->virthost :
|
||||
sptr->user->realhost),
|
||||
chptr->chname, comment);
|
||||
else if (chptr->mode.mode & MODE_AUDITORIUM)
|
||||
{
|
||||
if (MyClient(sptr))
|
||||
{
|
||||
if (parc < 3)
|
||||
{
|
||||
sendto_chanops_butone(NULL,
|
||||
chptr, ":%s!%s@%s PART %s",
|
||||
sptr->name,
|
||||
sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->
|
||||
user->virthost : sptr->
|
||||
user->realhost),
|
||||
chptr->chname);
|
||||
if (!is_chan_op(sptr, chptr))
|
||||
sendto_one(sptr,
|
||||
":%s!%s@%s PART %s",
|
||||
sptr->name,
|
||||
sptr->user->
|
||||
username,
|
||||
(IsHidden(sptr) ?
|
||||
sptr->user->
|
||||
virthost : sptr->
|
||||
user->realhost),
|
||||
chptr->chname);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_chanops_butone(NULL,
|
||||
chptr,
|
||||
":%s!%s@%s PART %s %s",
|
||||
sptr->name,
|
||||
sptr->user->username,
|
||||
(IsHidden(sptr) ? sptr->
|
||||
user->virthost : sptr->
|
||||
user->realhost),
|
||||
chptr->chname, comment);
|
||||
if (!is_chan_op(cptr, chptr))
|
||||
sendto_one(sptr,
|
||||
":%s!%s@%s PART %s %s",
|
||||
sptr->name,
|
||||
sptr->user->
|
||||
username,
|
||||
(IsHidden(sptr) ?
|
||||
sptr->user->
|
||||
virthost : sptr->
|
||||
user->realhost),
|
||||
chptr->chname,
|
||||
comment);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
if (parc < 3)
|
||||
|
||||
|
||||
sendto_channel_butserv(chptr,
|
||||
sptr, PartFmt, parv[0],
|
||||
chptr->chname);
|
||||
sptr, PartFmt, parv[0],
|
||||
chptr->chname);
|
||||
else
|
||||
sendto_channel_butserv(chptr,
|
||||
sptr, PartFmt2, parv[0],
|
||||
chptr->chname, comment);
|
||||
}
|
||||
sptr, PartFmt2, parv[0],
|
||||
chptr->chname, comment);
|
||||
}
|
||||
remove_user_from_channel(sptr, chptr);
|
||||
}
|
||||
}
|
||||
@@ -3278,8 +3291,10 @@ int m_kick(cptr, sptr, parc, parv)
|
||||
}
|
||||
|
||||
if (IsOper(sptr))
|
||||
if (!is_chan_op(sptr, chptr) && !is_halfop(sptr, chptr)
|
||||
|| (is_halfop(sptr, chptr) && is_chan_op(who, chptr)))
|
||||
if (!is_chan_op(sptr, chptr)
|
||||
&& !is_halfop(sptr, chptr)
|
||||
|| (is_halfop(sptr, chptr)
|
||||
&& is_chan_op(who, chptr)))
|
||||
{
|
||||
sendto_umode(UMODE_EYES,
|
||||
"*** OperKick [%s @ %s -> %s (%s)]",
|
||||
@@ -3291,8 +3306,9 @@ int m_kick(cptr, sptr, parc, parv)
|
||||
if (is_chanprot(who, chptr)
|
||||
|| is_chanowner(who, chptr)
|
||||
|| IsServices(who))
|
||||
if IsOper(sptr)
|
||||
{ /* IRCop kicking owner/prot */
|
||||
if IsOper
|
||||
(sptr)
|
||||
{ /* IRCop kicking owner/prot */
|
||||
sendto_umode(UMODE_EYES,
|
||||
"*** OperKick [%s @ %s -> %s (%s)]",
|
||||
sptr->name,
|
||||
@@ -3300,7 +3316,8 @@ int m_kick(cptr, sptr, parc, parv)
|
||||
who->name, comment);
|
||||
goto attack;
|
||||
}
|
||||
else if (!IsULine(cptr, sptr) && who != sptr)
|
||||
else if (!IsULine(cptr, sptr)
|
||||
&& who != sptr)
|
||||
{
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** You cannot kick %s from %s because %s is channel protected",
|
||||
@@ -3394,7 +3411,7 @@ int m_topic(cptr, sptr, parc, parv)
|
||||
{
|
||||
aChannel *chptr = NullChn;
|
||||
char *topic = NULL, *name, *p = NULL, *tnick = NULL;
|
||||
time_t ttime = 0;
|
||||
TS ttime = 0;
|
||||
int topiClen = 0;
|
||||
int nicKlen = 0;
|
||||
|
||||
@@ -3702,17 +3719,19 @@ void send_list(aClient *cptr, int numsend)
|
||||
&& !IsMember(cptr, chptr)
|
||||
&& !IsAnOper(cptr))
|
||||
continue;
|
||||
|
||||
if ((!lopt->showall)
|
||||
&& ((chptr->users < lopt->usermin) || ((lopt->usermax >= 0)
|
||||
|
||||
if ((!lopt->showall)
|
||||
&& ((chptr->users < lopt->usermin)
|
||||
|| ((lopt->usermax >= 0)
|
||||
&& (chptr->users > lopt->usermax))
|
||||
|| ((chptr->creationtime) <= lopt->chantimemin)
|
||||
/* || (chptr->topic_time <
|
||||
lopt->topictimemin)
|
||||
|| (chptr->creationtime >=
|
||||
lopt->chantimemax)
|
||||
|| (chptr->topic_time >
|
||||
lopt->topictimemax) */))
|
||||
|| ((chptr->creationtime) <=
|
||||
lopt->chantimemin)
|
||||
/* || (chptr->topic_time <
|
||||
lopt->topictimemin)
|
||||
|| (chptr->creationtime >=
|
||||
lopt->chantimemax)
|
||||
|| (chptr->topic_time >
|
||||
lopt->topictimemax) */ ))
|
||||
continue;
|
||||
|
||||
if (lopt->nolist &&
|
||||
@@ -3829,8 +3848,8 @@ int check_for_chan_flood(cptr, sptr, chptr)
|
||||
if (chptr->mode.kmode == 1)
|
||||
{ /* ban. */
|
||||
ircsprintf(mask, "*!*@%s",
|
||||
(IsHidden(sptr) ? sptr->user->virthost : sptr->
|
||||
user->realhost));
|
||||
(IsHidden(sptr) ? sptr->user->
|
||||
virthost : sptr->user->realhost));
|
||||
add_banid(&me, chptr, mask);
|
||||
sendto_serv_butone(&me, ":%s MODE %s +b %s 0",
|
||||
me.name, chptr->chname, mask);
|
||||
@@ -3857,13 +3876,13 @@ int check_for_chan_flood(cptr, sptr, chptr)
|
||||
int m_list(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
aChannel *chptr;
|
||||
time_t currenttime = time(NULL);
|
||||
TS currenttime = time(NULL);
|
||||
char *name, *p = NULL;
|
||||
LOpts *lopt = NULL;
|
||||
Link *lp, *next;
|
||||
int usermax, usermin, error = 0, doall = 0;
|
||||
time_t chantimemin, chantimemax;
|
||||
time_t topictimemin, topictimemax;
|
||||
TS chantimemin, chantimemax;
|
||||
TS topictimemin, topictimemax;
|
||||
Link *yeslist = NULL, *nolist = NULL;
|
||||
|
||||
static char *usage[] = {
|
||||
@@ -4163,10 +4182,12 @@ int m_names(cptr, sptr, parc, parv)
|
||||
if (IsHiding(acptr) && acptr != sptr)
|
||||
continue;
|
||||
if (chptr->mode.mode & MODE_AUDITORIUM)
|
||||
if (!is_chan_op(sptr, chptr) && !is_chanprot(sptr, chptr) &&
|
||||
!is_chanowner(sptr, chptr))
|
||||
if (!(cm->flags & (CHFL_CHANOP | CHFL_CHANPROT | CHFL_CHANOWNER))
|
||||
&& acptr != sptr)
|
||||
if (!is_chan_op(sptr, chptr)
|
||||
&& !is_chanprot(sptr, chptr)
|
||||
&& !is_chanowner(sptr, chptr))
|
||||
if (!(cm->
|
||||
flags & (CHFL_CHANOP | CHFL_CHANPROT |
|
||||
CHFL_CHANOWNER)) && acptr != sptr)
|
||||
continue;
|
||||
|
||||
if (cm->flags & CHFL_CHANOP)
|
||||
@@ -4435,7 +4456,7 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
aClient *acptr, *tempptr;
|
||||
aChannel *chptr;
|
||||
Link *lp;
|
||||
Ban *ban;
|
||||
Ban *ban;
|
||||
aParv *ap;
|
||||
int ts, oldts, pcount, x, y, z, i, f;
|
||||
unsigned short b, c;
|
||||
@@ -4847,12 +4868,12 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
{
|
||||
sendto_one(sptr,
|
||||
":%s KICK %s %s :Fake direction",
|
||||
me.name,chptr->chname, acptr->name);
|
||||
me.name, chptr->chname,
|
||||
acptr->name);
|
||||
sendto_ops
|
||||
("Fake direction from user %s in SJOIN from %s(%s) at %s",
|
||||
nick,
|
||||
sptr->from->name, sptr->name,
|
||||
chptr->chname);
|
||||
nick, sptr->srvptr->name,
|
||||
sptr->name, chptr->chname);
|
||||
goto nextnick;
|
||||
}
|
||||
if (removetheirs)
|
||||
@@ -4892,7 +4913,7 @@ int m_sjoin(cptr, sptr, parc, parv)
|
||||
}
|
||||
|
||||
}
|
||||
nextnick:
|
||||
nextnick:
|
||||
t++;
|
||||
c++;
|
||||
}
|
||||
@@ -4922,7 +4943,7 @@ nextnick:
|
||||
if (!parv[i])
|
||||
{
|
||||
sendto_ops("Got null parv in SJ3 code");
|
||||
continue;
|
||||
continue;
|
||||
}
|
||||
strcat(parabuf, parv[i]);
|
||||
if (((i + 1) <= (parc - 2)))
|
||||
@@ -4932,7 +4953,8 @@ nextnick:
|
||||
/* This sends out to SJ3 servers .. */
|
||||
sendto_serv_butone_token_opt(cptr, OPT_SJOIN | OPT_SJ3, sptr->name,
|
||||
MSG_SJOIN, TOK_SJOIN, "%s :%s", parabuf, parv[parc - 1]);
|
||||
Debug((DEBUG_DEBUG, "Sending '%s :%s' to sj3", parabuf, parv[parc - 1]));
|
||||
Debug((DEBUG_DEBUG, "Sending '%s :%s' to sj3", parabuf,
|
||||
parv[parc - 1]));
|
||||
/* We strip out & and " here, for SJ2 */
|
||||
strcpy(parabuf, "");
|
||||
t = parv[parc - 1];
|
||||
@@ -4959,33 +4981,36 @@ nextnick:
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN | OPT_SJOIN2 | OPT_NOT_SJ3, sptr->name, MSG_SJOIN,
|
||||
TOK_SJOIN, "%s %s + <-> :%s", parv[1], parv[2], parabuf);
|
||||
Debug((DEBUG_DEBUG, "Sending to SJ2: %s %s + <-> :%s", parv[1], parv[2], parabuf));
|
||||
Debug((DEBUG_DEBUG, "Sending to SJ2: %s %s + <-> :%s", parv[1],
|
||||
parv[2], parabuf));
|
||||
if (*banbuf)
|
||||
{
|
||||
for (s = (char *) strtok(banbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
for (s = (char *)strtok(banbuf, " "); s && (*s != ' ');
|
||||
s = (char *)strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +b %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
OPT_SJOIN2 | OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +b %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (*exbuf)
|
||||
{
|
||||
for (s = (char *) strtok(exbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
for (s = (char *)strtok(exbuf, " "); s && (*s != ' ');
|
||||
s = (char *)strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +e %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
OPT_SJOIN2 | OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +e %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (nopara)
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
@@ -4993,29 +5018,31 @@ nextnick:
|
||||
TOK_SJOIN, "%s %s %s <-> :%s", parv[1], parv[2], parv[3],
|
||||
parabuf);
|
||||
Debug((DEBUG_DEBUG, "Sending to SJ2: %s %s %s <-> :%s",
|
||||
parv[1], parv[2], parv[3], parabuf));
|
||||
parv[1], parv[2], parv[3], parabuf));
|
||||
if (*banbuf)
|
||||
{
|
||||
for (s = (char *) strtok(banbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
for (s = (char *)strtok(banbuf, " "); s && (*s != ' ');
|
||||
s = (char *)strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +b %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
OPT_SJOIN2 | OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +b %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (*exbuf)
|
||||
{
|
||||
for (s = (char *) strtok(exbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
for (s = (char *)strtok(exbuf, " "); s && (*s != ' ');
|
||||
s = (char *)strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +e %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
OPT_SJOIN2 | OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +e %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -5031,30 +5058,32 @@ nextnick:
|
||||
MSG_SJOIN, TOK_SJOIN, "%s %s %s %s :%s",
|
||||
parv[1], parv[2], parv[3], paraback, parabuf);
|
||||
Debug((DEBUG_DEBUG, "sending to SJ2: %s %s %s %s :%s",
|
||||
parv[1], parv[2], parv[3], paraback, parabuf));
|
||||
parv[1], parv[2], parv[3], paraback, parabuf));
|
||||
/* Syncing bans to sj2 .. correctly. */
|
||||
if (*banbuf)
|
||||
{
|
||||
for (s = (char *) strtok(banbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
for (s = (char *)strtok(banbuf, " "); s && (*s != ' ');
|
||||
s = (char *)strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +b %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
OPT_SJOIN2 | OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +b %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (*exbuf)
|
||||
{
|
||||
for (s = (char *) strtok(exbuf, " "); s && (*s != ' '); s = (char *) strtok(NULL, " "))
|
||||
for (s = (char *)strtok(exbuf, " "); s && (*s != ' ');
|
||||
s = (char *)strtok(NULL, " "))
|
||||
{
|
||||
sendto_serv_butone_token_opt(cptr,
|
||||
OPT_SJOIN2|OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +e %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
OPT_SJOIN2 | OPT_NOT_SJ3,
|
||||
sptr->name, MSG_MODE, TOK_MODE,
|
||||
"%s +e %s %li", chptr->chname, s,
|
||||
chptr->creationtime);
|
||||
}
|
||||
}
|
||||
/* And we are synched */
|
||||
return 0;
|
||||
@@ -5064,7 +5093,7 @@ nextnick:
|
||||
static int send_ban_list(cptr, chname, creationtime, channel)
|
||||
aClient *cptr;
|
||||
char *chname;
|
||||
time_t creationtime;
|
||||
TS creationtime;
|
||||
aChannel *channel;
|
||||
{
|
||||
Ban *top;
|
||||
@@ -5283,7 +5312,7 @@ void send_channel_modes_sjoin3(cptr, chptr)
|
||||
return;
|
||||
|
||||
nomode = 0;
|
||||
nopara = 1;
|
||||
nopara = 0;
|
||||
members = chptr->members;
|
||||
|
||||
/* First we'll send channel, channel modes and members and status */
|
||||
|
||||
+34
-34
@@ -116,12 +116,12 @@ float highest_rate = 0;
|
||||
float highest_rate2 = 0;
|
||||
int lifesux = 0;
|
||||
int LRV = LOADRECV;
|
||||
time_t LCF = LOADCFREQ;
|
||||
TS LCF = LOADCFREQ;
|
||||
int currlife = 0;
|
||||
int HTMLOCK = 0;
|
||||
int noisy_htm = 1;
|
||||
|
||||
time_t check_fdlists();
|
||||
TS check_fdlists();
|
||||
#endif
|
||||
void server_reboot(char *);
|
||||
void restart PROTO((char *));
|
||||
@@ -129,7 +129,7 @@ static void open_debugfile(), setup_signals();
|
||||
extern void init_glines(void);
|
||||
|
||||
int do_garbage_collect = 0;
|
||||
time_t last_garbage_collect = 0;
|
||||
TS last_garbage_collect = 0;
|
||||
char **myargv;
|
||||
int portnum = -1; /* Server port number, listening this */
|
||||
char *configfile = CONFIGFILE; /* Server configuration file */
|
||||
@@ -140,19 +140,19 @@ char *sbrk0; /* initial sbrk(0) */
|
||||
static int dorehash = 0;
|
||||
static char *dpath = DPATH;
|
||||
int booted = FALSE;
|
||||
time_t nextconnect = 1; /* time for next try_connections call */
|
||||
time_t nextping = 1; /* same as above for check_pings() */
|
||||
time_t nextdnscheck = 0; /* next time to poll dns to force timeouts */
|
||||
time_t nextexpire = 1; /* next expire run on the dns cache */
|
||||
time_t nextkillcheck = 1; /* next time to check for nickserv kills */
|
||||
time_t lastlucheck = 0;
|
||||
TS nextconnect = 1; /* time for next try_connections call */
|
||||
TS nextping = 1; /* same as above for check_pings() */
|
||||
TS nextdnscheck = 0; /* next time to poll dns to force timeouts */
|
||||
TS nextexpire = 1; /* next expire run on the dns cache */
|
||||
TS nextkillcheck = 1; /* next time to check for nickserv kills */
|
||||
TS lastlucheck = 0;
|
||||
|
||||
#ifdef UNREAL_DEBUG
|
||||
#undef CHROOTDIR
|
||||
#define CHROOT
|
||||
#endif
|
||||
|
||||
time_t NOW;
|
||||
TS NOW;
|
||||
#if defined(PROFIL) && !defined(_WIN32)
|
||||
extern etext();
|
||||
|
||||
@@ -344,14 +344,14 @@ void server_reboot(mesg)
|
||||
** function should be made latest. (No harm done if this
|
||||
** is called earlier or later...)
|
||||
*/
|
||||
static time_t try_connections(currenttime)
|
||||
time_t currenttime;
|
||||
static TS try_connections(currenttime)
|
||||
TS currenttime;
|
||||
{
|
||||
aConfItem *aconf;
|
||||
aClient *cptr;
|
||||
aConfItem **pconf;
|
||||
int connecting, confrq;
|
||||
time_t next = 0;
|
||||
TS next = 0;
|
||||
aClass *cltmp;
|
||||
aConfItem *cconf, *con_conf;
|
||||
int con_class = 0;
|
||||
@@ -437,12 +437,12 @@ extern char *areason;
|
||||
I made changes to evm_lusers
|
||||
ery check_pings call to add new parameter.
|
||||
-- Barubary */
|
||||
extern time_t check_pings(time_t currenttime, int check_kills)
|
||||
extern TS check_pings(TS currenttime, int check_kills)
|
||||
{
|
||||
aClient *cptr;
|
||||
int killflag;
|
||||
int ping = 0, i, i1, rflag = 0;
|
||||
time_t oldest = 0, timeout;
|
||||
TS oldest = 0, timeout;
|
||||
|
||||
for (i1 = 0; i1 <= 7; i1++)
|
||||
{
|
||||
@@ -690,17 +690,17 @@ int InitwIRCD(argc, argv)
|
||||
WSADATA wsaData;
|
||||
#else
|
||||
uid_t uid, euid;
|
||||
time_t delay = 0;
|
||||
TS delay = 0;
|
||||
#endif
|
||||
int portarg = 0;
|
||||
#ifdef FORCE_CORE
|
||||
struct rlimit corelim;
|
||||
#endif
|
||||
#ifndef NO_FDLIST
|
||||
time_t nextfdlistcheck = 0; /*end of priority code */
|
||||
TS nextfdlistcheck = 0; /*end of priority code */
|
||||
#endif
|
||||
time_t last_tune = 0;
|
||||
static time_t lastglinecheck = 0;
|
||||
TS last_tune = 0;
|
||||
static TS lastglinecheck = 0;
|
||||
|
||||
#if !defined(_WIN32) && !defined(_AMIGA)
|
||||
sbrk0 = (char *)sbrk((size_t)0);
|
||||
@@ -786,8 +786,8 @@ int InitwIRCD(argc, argv)
|
||||
dpath = p;
|
||||
break;
|
||||
case 'F':
|
||||
bootopt |= BOOT_NOFORK;
|
||||
break;
|
||||
bootopt |= BOOT_NOFORK;
|
||||
break;
|
||||
#ifndef _WIN32
|
||||
#ifdef CMDLINE_CONFIG
|
||||
case 'f':
|
||||
@@ -815,8 +815,8 @@ int InitwIRCD(argc, argv)
|
||||
(void)printf("sizeof(aConfItem) == %u\n", sizeof(aConfItem));
|
||||
(void)printf("sizeof(aVhost) == %u\n", sizeof(aVhost));
|
||||
(void)printf("sizeof(aTKline) == %u\n", sizeof(aTKline));
|
||||
|
||||
(void)printf("sizeof(struct ircstatsx) == %u\n",
|
||||
|
||||
(void)printf("sizeof(struct ircstatsx) == %u\n",
|
||||
sizeof(struct ircstatsx));
|
||||
(void)printf("aClient remote == %u\n",
|
||||
CLIENT_REMOTE_SIZE);
|
||||
@@ -1104,7 +1104,7 @@ int InitwIRCD(argc, argv)
|
||||
#endif
|
||||
check_class();
|
||||
write_pidfile();
|
||||
|
||||
|
||||
Debug((DEBUG_NOTICE, "Server ready..."));
|
||||
#ifdef USE_SYSLOG
|
||||
syslog(LOG_NOTICE, "Server Ready");
|
||||
@@ -1112,7 +1112,7 @@ int InitwIRCD(argc, argv)
|
||||
#ifndef NO_FDLIST
|
||||
check_fdlists(TStime());
|
||||
#endif
|
||||
nextkillcheck = TStime() + (time_t) 1;
|
||||
nextkillcheck = TStime() + (TS)1;
|
||||
|
||||
#ifdef _WIN32
|
||||
return 1;
|
||||
@@ -1121,11 +1121,11 @@ int InitwIRCD(argc, argv)
|
||||
|
||||
void SocketLoop(void *dummy)
|
||||
{
|
||||
time_t delay = 0, now;
|
||||
static time_t lastglinecheck = 0;
|
||||
time_t last_tune;
|
||||
TS delay = 0, now;
|
||||
static TS lastglinecheck = 0;
|
||||
TS last_tune;
|
||||
#ifndef NO_FDLIST
|
||||
time_t nextfdlistcheck = 0; /*end of priority code */
|
||||
TS nextfdlistcheck = 0; /*end of priority code */
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
@@ -1188,10 +1188,10 @@ void SocketLoop(void *dummy)
|
||||
|
||||
#ifndef NO_FDLIST
|
||||
{
|
||||
static time_t lasttime = 0;
|
||||
static TS lasttime = 0;
|
||||
static long lastrecvK, lastsendK;
|
||||
static int init = 0;
|
||||
static time_t loadcfreq = LOADCFREQ;
|
||||
static TS loadcfreq = LOADCFREQ;
|
||||
static int lrv;
|
||||
|
||||
if (now - lasttime < LCF)
|
||||
@@ -1330,7 +1330,7 @@ void SocketLoop(void *dummy)
|
||||
flush_fdlist_connections(&serv_fdlist);
|
||||
}
|
||||
{
|
||||
static time_t lasttime = 0;
|
||||
static TS lasttime = 0;
|
||||
if ((lasttime + (lifesux + 1) * 2) < (now = TStime()))
|
||||
{
|
||||
read_message(delay, NULL); /* check everything */
|
||||
@@ -1376,8 +1376,8 @@ void SocketLoop(void *dummy)
|
||||
}
|
||||
}
|
||||
#ifndef NO_FDLIST
|
||||
time_t check_fdlists(now)
|
||||
time_t now;
|
||||
TS check_fdlists(now)
|
||||
TS now;
|
||||
{
|
||||
aClient *cptr;
|
||||
int pri; /* temp. for priority */
|
||||
|
||||
+108
-82
@@ -63,7 +63,7 @@ extern char zlinebuf[];
|
||||
int tkl_add_line(type, usermask, hostmask, reason, setby, expire_at, set_at)
|
||||
int type;
|
||||
char *usermask, *hostmask, *reason, *setby;
|
||||
time_t expire_at, set_at;
|
||||
TS expire_at, set_at;
|
||||
{
|
||||
aTKline *nl;
|
||||
|
||||
@@ -126,7 +126,7 @@ aTKline *tkl_expire(aTKline * tmp)
|
||||
char whattype[512];
|
||||
long i, i1;
|
||||
char *chost, *cname, *cip;
|
||||
int is_ip;
|
||||
int is_ip;
|
||||
aClient *acptr;
|
||||
if (!tmp)
|
||||
return NULL;
|
||||
@@ -189,21 +189,33 @@ aTKline *tkl_expire(aTKline * tmp)
|
||||
chost = acptr->sockhost;
|
||||
cname = acptr->user->username;
|
||||
|
||||
cip = (char *)inet_ntoa(acptr->ip);
|
||||
cip =
|
||||
(char *)inet_ntoa(acptr->
|
||||
ip);
|
||||
|
||||
|
||||
if (!(*tmp->hostmask < '0') && (*tmp->hostmask > '9'))
|
||||
|
||||
if (!(*tmp->hostmask < '0')
|
||||
&& (*tmp->hostmask > '9'))
|
||||
is_ip = 1;
|
||||
else
|
||||
is_ip = 0;
|
||||
|
||||
if (is_ip == 0 ? (!match(tmp->hostmask, chost)
|
||||
&& !match(tmp->usermask, cname)) : (!match(tmp->hostmask,
|
||||
chost) || !match(tmp->hostmask, cip))
|
||||
&& !match(tmp->usermask, cname))
|
||||
if (is_ip ==
|
||||
0 ? (!match(tmp->hostmask,
|
||||
chost)
|
||||
&& !match(tmp->usermask,
|
||||
cname)) : (!match(tmp->
|
||||
hostmask, chost)
|
||||
|| !match(tmp->hostmask,
|
||||
cip))
|
||||
&& !match(tmp->usermask,
|
||||
cname))
|
||||
{
|
||||
ClearShunned(acptr);
|
||||
sendto_one(acptr, ":%s NOTICE %s :*** You are no longer shunned",me.name, acptr->name);
|
||||
sendto_one(acptr,
|
||||
":%s NOTICE %s :*** You are no longer shunned",
|
||||
me.name,
|
||||
acptr->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,7 +229,7 @@ aTKline *tkl_expire(aTKline * tmp)
|
||||
void tkl_check_expire(void)
|
||||
{
|
||||
aTKline *gp, t;
|
||||
time_t nowtime;
|
||||
TS nowtime;
|
||||
|
||||
nowtime = TStime();
|
||||
|
||||
@@ -244,7 +256,7 @@ int find_tkline_match(cptr, xx)
|
||||
{
|
||||
aTKline *lp;
|
||||
char *chost, *cname, *cip;
|
||||
time_t nowtime;
|
||||
TS nowtime;
|
||||
int is_ip;
|
||||
char msge[1024];
|
||||
char gmt2[256];
|
||||
@@ -268,9 +280,9 @@ int find_tkline_match(cptr, xx)
|
||||
is_ip = 0;
|
||||
|
||||
if (xx != 2 ? is_ip == 0 ? (!match(lp->hostmask, chost)
|
||||
&& !match(lp->usermask, cname)) :
|
||||
(!match(lp->hostmask, chost) || !match(lp->hostmask, cip))
|
||||
: !match(lp->hostmask, chost))
|
||||
&& !match(lp->usermask, cname)) :
|
||||
(!match(lp->hostmask, chost) || !match(lp->hostmask, cip))
|
||||
: !match(lp->hostmask, chost))
|
||||
{
|
||||
if (lp->type & TKL_KILL)
|
||||
{
|
||||
@@ -324,22 +336,28 @@ int find_tkline_match(cptr, xx)
|
||||
return -1;
|
||||
SetShunned(cptr);
|
||||
#ifndef __OpenBSD__
|
||||
strncpy(gmt2, asctime(gmtime((clock_t *) &lp->expire_at)),
|
||||
sizeof(gmt2));
|
||||
strncpy(gmt2,
|
||||
asctime(gmtime((clock_t *) & lp->
|
||||
expire_at)), sizeof(gmt2));
|
||||
|
||||
#else
|
||||
strncpy(gmt2, asctime(gmtime((time_t *) &lp->expire_at)),
|
||||
sizeof(gmt2));
|
||||
strncpy(gmt2,
|
||||
asctime(gmtime((TS *)&lp->expire_at)),
|
||||
sizeof(gmt2));
|
||||
|
||||
#endif
|
||||
gmt2[strlen(gmt2) - 1] = '\0';
|
||||
#endif
|
||||
gmt2[strlen(gmt2) - 1] = '\0';
|
||||
if (lp->expire_at)
|
||||
sendto_one(cptr, ":%s NOTICE %s :*** You have been shunned by %s until %s (Reason: %s)",
|
||||
me.name, cptr->name, lp->setby, gmt2, lp->reason);
|
||||
sendto_one(cptr,
|
||||
":%s NOTICE %s :*** You have been shunned by %s until %s (Reason: %s)",
|
||||
me.name, cptr->name, lp->setby,
|
||||
gmt2, lp->reason);
|
||||
else
|
||||
sendto_one(cptr, ":%s NOTICE %s :*** You have been shunned permanently by %s (Reason: %s)",
|
||||
me.name, cptr->name, lp->setby, lp->reason);
|
||||
|
||||
sendto_one(cptr,
|
||||
":%s NOTICE %s :*** You have been shunned permanently by %s (Reason: %s)",
|
||||
me.name, cptr->name, lp->setby,
|
||||
lp->reason);
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -372,7 +390,7 @@ void tkl_stats(cptr)
|
||||
aClient *cptr;
|
||||
{
|
||||
aTKline *tk;
|
||||
time_t curtime;
|
||||
TS curtime;
|
||||
|
||||
/*
|
||||
We output in this row:
|
||||
@@ -388,36 +406,41 @@ void tkl_stats(cptr)
|
||||
{
|
||||
sendto_one(cptr, rpl_str(RPL_STATSGLINE), me.name,
|
||||
cptr->name, 'G', tk->usermask, tk->hostmask,
|
||||
(tk->expire_at != 0) ? (tk->expire_at - curtime) : 0, (curtime - tk->set_at),
|
||||
tk->setby, tk->reason);
|
||||
(tk->expire_at !=
|
||||
0) ? (tk->expire_at - curtime) : 0,
|
||||
(curtime - tk->set_at), tk->setby, tk->reason);
|
||||
}
|
||||
if (tk->type == (TKL_ZAP | TKL_GLOBAL))
|
||||
{
|
||||
sendto_one(cptr, rpl_str(RPL_STATSGLINE), me.name,
|
||||
cptr->name, 'Z', tk->usermask, tk->hostmask,
|
||||
(tk->expire_at != 0) ? (tk->expire_at - curtime) : 0, (curtime - tk->set_at),
|
||||
tk->setby, tk->reason);
|
||||
(tk->expire_at !=
|
||||
0) ? (tk->expire_at - curtime) : 0,
|
||||
(curtime - tk->set_at), tk->setby, tk->reason);
|
||||
}
|
||||
if (tk->type == (TKL_SHUN | TKL_GLOBAL))
|
||||
{
|
||||
sendto_one(cptr, rpl_str(RPL_STATSGLINE), me.name,
|
||||
cptr->name, 's', tk->usermask, tk->hostmask,
|
||||
(tk->expire_at != 0) ? (tk->expire_at - curtime) : 0, (curtime - tk->set_at),
|
||||
tk->setby, tk->reason);
|
||||
(tk->expire_at !=
|
||||
0) ? (tk->expire_at - curtime) : 0,
|
||||
(curtime - tk->set_at), tk->setby, tk->reason);
|
||||
}
|
||||
if (tk->type == (TKL_KILL))
|
||||
{
|
||||
sendto_one(cptr, rpl_str(RPL_STATSGLINE), me.name,
|
||||
cptr->name, 'K', tk->usermask, tk->hostmask,
|
||||
(tk->expire_at != 0) ? (tk->expire_at - curtime) : 0, (curtime - tk->set_at),
|
||||
tk->setby, tk->reason);
|
||||
(tk->expire_at !=
|
||||
0) ? (tk->expire_at - curtime) : 0,
|
||||
(curtime - tk->set_at), tk->setby, tk->reason);
|
||||
}
|
||||
if (tk->type == (TKL_ZAP))
|
||||
{
|
||||
sendto_one(cptr, rpl_str(RPL_STATSGLINE), me.name,
|
||||
cptr->name, 'z', tk->usermask, tk->hostmask,
|
||||
(tk->expire_at != 0) ? (tk->expire_at - curtime) : 0, (curtime - tk->set_at),
|
||||
tk->setby, tk->reason);
|
||||
(tk->expire_at !=
|
||||
0) ? (tk->expire_at - curtime) : 0,
|
||||
(curtime - tk->set_at), tk->setby, tk->reason);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -478,7 +501,7 @@ int m_tkl(cptr, sptr, parc, parv)
|
||||
int found = 0;
|
||||
char gmt[256], gmt2[256];
|
||||
char txt[256];
|
||||
time_t expiry_1, setat_1;
|
||||
TS expiry_1, setat_1;
|
||||
|
||||
|
||||
if (!IsServer(sptr) && !IsOper(sptr) && !IsMe(sptr))
|
||||
@@ -507,8 +530,9 @@ int m_tkl(cptr, sptr, parc, parv)
|
||||
else if (parv[2][0] == 'k')
|
||||
type = TKL_KILL;
|
||||
else if (parv[2][0] == 's')
|
||||
type = TKL_SHUN |TKL_GLOBAL;
|
||||
else return 0;
|
||||
type = TKL_SHUN | TKL_GLOBAL;
|
||||
else
|
||||
return 0;
|
||||
|
||||
found = 0;
|
||||
for (tk = tklines; tk; tk = tk->next)
|
||||
@@ -536,18 +560,16 @@ int m_tkl(cptr, sptr, parc, parv)
|
||||
|
||||
#ifndef __OpenBSD__
|
||||
strncpy(gmt, asctime(gmtime((clock_t *) & setat_1)),
|
||||
sizeof(gmt));
|
||||
sizeof(gmt));
|
||||
#else
|
||||
strncpy(gmt, asctime(gmtime((time_t *)& setat_1)),
|
||||
sizeof(gmt));
|
||||
strncpy(gmt, asctime(gmtime((TS *)&setat_1)), sizeof(gmt));
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __OpenBSD__
|
||||
strncpy(gmt2, asctime(gmtime((clock_t *) & expiry_1)),
|
||||
sizeof(gmt2));
|
||||
#else
|
||||
strncpy(gmt2, asctime(gmtime((time_t *) & expiry_1)),
|
||||
sizeof(gmt2));
|
||||
strncpy(gmt2, asctime(gmtime((TS *)&expiry_1)), sizeof(gmt2));
|
||||
#endif
|
||||
gmt[strlen(gmt) - 1] = '\0';
|
||||
gmt2[strlen(gmt2) - 1] = '\0';
|
||||
@@ -566,28 +588,32 @@ int m_tkl(cptr, sptr, parc, parv)
|
||||
case TKL_ZAP | TKL_GLOBAL:
|
||||
strcpy(txt, "Global Z:line");
|
||||
break;
|
||||
case TKL_SHUN | TKL_GLOBAL:
|
||||
strcpy(txt, "Shun");
|
||||
break;
|
||||
case TKL_SHUN | TKL_GLOBAL:
|
||||
strcpy(txt, "Shun");
|
||||
break;
|
||||
default:
|
||||
strcpy(txt, "Unknown *:Line");
|
||||
}
|
||||
if (expiry_1 != 0) {
|
||||
sendto_umode(UMODE_EYES,
|
||||
"*** %s added for %s@%s on %s GMT (from %s to expire at %s GMT: %s)",
|
||||
txt, parv[3], parv[4], gmt, parv[5], gmt2, parv[8]);
|
||||
ircd_log
|
||||
("%s added for %s@%s on %s GMT (from %s to expire at %s GMT: %s)",
|
||||
txt, parv[3], parv[4], gmt, parv[5], gmt2, parv[8]);
|
||||
}
|
||||
else {
|
||||
sendto_umode(UMODE_EYES,
|
||||
"*** Permanent %s added for %s@%s on %s GMT (from %s: %s)", txt, parv[3], parv[4],
|
||||
gmt, parv[5], parv[8]);
|
||||
ircd_log
|
||||
("Permanent %s added for %s@%s on %s GMT (from %s: %s)", txt, parv[3], parv[4],
|
||||
gmt, parv[5], parv[8]);
|
||||
}
|
||||
if (expiry_1 != 0)
|
||||
{
|
||||
sendto_umode(UMODE_EYES,
|
||||
"*** %s added for %s@%s on %s GMT (from %s to expire at %s GMT: %s)",
|
||||
txt, parv[3], parv[4], gmt, parv[5], gmt2,
|
||||
parv[8]);
|
||||
ircd_log
|
||||
("%s added for %s@%s on %s GMT (from %s to expire at %s GMT: %s)",
|
||||
txt, parv[3], parv[4], gmt, parv[5], gmt2,
|
||||
parv[8]);
|
||||
}
|
||||
else
|
||||
{
|
||||
sendto_umode(UMODE_EYES,
|
||||
"*** Permanent %s added for %s@%s on %s GMT (from %s: %s)",
|
||||
txt, parv[3], parv[4], gmt, parv[5], parv[8]);
|
||||
ircd_log
|
||||
("Permanent %s added for %s@%s on %s GMT (from %s: %s)",
|
||||
txt, parv[3], parv[4], gmt, parv[5], parv[8]);
|
||||
}
|
||||
tkl_sweep();
|
||||
if (type & TKL_GLOBAL)
|
||||
{
|
||||
@@ -615,8 +641,9 @@ int m_tkl(cptr, sptr, parc, parv)
|
||||
else if (*parv[2] == 'k')
|
||||
type = TKL_KILL;
|
||||
else if (*parv[2] == 's')
|
||||
type = TKL_SHUN | TKL_GLOBAL;
|
||||
else return 0;
|
||||
type = TKL_SHUN | TKL_GLOBAL;
|
||||
else
|
||||
return 0;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@@ -633,7 +660,7 @@ int m_tkl(cptr, sptr, parc, parv)
|
||||
strcpy(txt, "Global Z:line");
|
||||
break;
|
||||
case TKL_SHUN | TKL_GLOBAL:
|
||||
strcpy(txt, "Shun");
|
||||
strcpy(txt, "Shun");
|
||||
break;
|
||||
default:
|
||||
strcpy(txt, "Unknown *:Line");
|
||||
@@ -653,8 +680,8 @@ int m_tkl(cptr, sptr, parc, parv)
|
||||
tk->set_at)), sizeof(gmt));
|
||||
#else
|
||||
strncpy(gmt,
|
||||
asctime(gmtime((time_t *) &
|
||||
tk->set_at)), sizeof(gmt));
|
||||
asctime(gmtime((TS *)&tk->
|
||||
set_at)), sizeof(gmt));
|
||||
#endif
|
||||
gmt[strlen(gmt) - 1] = '\0';
|
||||
sendto_umode(UMODE_EYES,
|
||||
@@ -699,7 +726,7 @@ int m_tkl(cptr, sptr, parc, parv)
|
||||
int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
aTKline *tk;
|
||||
time_t secs;
|
||||
TS secs;
|
||||
int whattodo = 0; /* 0 = add 1 = del */
|
||||
int found = 0;
|
||||
int i;
|
||||
@@ -867,9 +894,9 @@ int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
if (whattodo == 0)
|
||||
{
|
||||
if (secs == 0)
|
||||
ircsprintf(mo, "%li", secs);
|
||||
ircsprintf(mo, "%li", secs);
|
||||
else
|
||||
ircsprintf(mo, "%li", secs + TStime());
|
||||
ircsprintf(mo, "%li", secs + TStime());
|
||||
ircsprintf(mo2, "%li", TStime());
|
||||
tkllayer[6] = mo;
|
||||
tkllayer[7] = mo2;
|
||||
@@ -898,11 +925,11 @@ int m_gline(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
int m_shun(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
aTKline *tk;
|
||||
time_t secs;
|
||||
TS secs;
|
||||
int whattodo = 0; /* 0 = add 1 = del */
|
||||
int found = 0;
|
||||
int i;
|
||||
int quiet = 0;
|
||||
int quiet = 0;
|
||||
aClient *acptr;
|
||||
char *mask = NULL;
|
||||
char mo[1024], mo2[1024], mo3[512];
|
||||
@@ -991,15 +1018,15 @@ int m_shun(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
mask = mo3;
|
||||
goto mm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sendto_one(sptr,
|
||||
":%s NOTICE %s :*** [Shun error] Please use a user@host mask or an existing nickname.",
|
||||
me.name, sptr->name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mm:
|
||||
|
||||
mm:
|
||||
if (whattodo == 1)
|
||||
goto nochecks;
|
||||
if (p)
|
||||
@@ -1072,10 +1099,10 @@ int m_shun(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
(IsHidden(sptr) ? sptr->user->virthost : sptr->user->realhost));
|
||||
if (whattodo == 0)
|
||||
{
|
||||
if (secs ==0)
|
||||
ircsprintf(mo, "%li", secs);
|
||||
if (secs == 0)
|
||||
ircsprintf(mo, "%li", secs);
|
||||
else
|
||||
ircsprintf(mo, "%li", secs + TStime());
|
||||
ircsprintf(mo, "%li", secs + TStime());
|
||||
ircsprintf(mo2, "%li", TStime());
|
||||
tkllayer[6] = mo;
|
||||
tkllayer[7] = mo2;
|
||||
@@ -1090,4 +1117,3 @@ int m_shun(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user