[srvx-commits] CVS: services/src opserv.c,1.281,1.282 opserv.help,1.51,1.52 proto-bahamut.c,1.24,1.2
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2002-10-21 03:49:17
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv26346/src
Modified Files:
opserv.c opserv.help proto-bahamut.c proto-p10.c proto.h
Log Message:
add ?settime command, document
also document the "?addalert <name> kill" reaction
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.281
retrieving revision 1.282
diff -C2 -r1.281 -r1.282
*** opserv.c 21 Oct 2002 03:19:06 -0000 1.281
--- opserv.c 21 Oct 2002 03:49:13 -0000 1.282
***************
*** 186,189 ****
--- 186,190 ----
#define OSMSG_SET_BAD_TYPE "$b%s$b is not a string, and cannot be set."
#define OSMSG_SET_SUCCESS "$b%s$b has been set to $b%s$b."
+ #define OSMSG_SETTIME_SUCCESS "Set time for servers named like $b%s$b."
#define OSMSG_NOT_IP "You must provide a valid IPv4 address."
#define OSMSG_DOMAIN_HOSTINFO "%s %lu"
***************
*** 2822,2825 ****
--- 2823,2835 ----
}
+ static MODCMD_FUNC(cmd_settime)
+ {
+ const char *srv_name_mask = "*";
+ if (argc > 1) srv_name_mask = argv[1];
+ irc_settime(srv_name_mask);
+ reply(OSMSG_SETTIME_SUCCESS, srv_name_mask);
+ return 1;
+ }
+
static discrim_t
opserv_discrim_create(struct userNode *user, unsigned int argc, unsigned char *argv[])
***************
*** 4035,4038 ****
--- 4045,4049 ----
opserv_define_func("RESTART", cmd_restart, 900, 0);
opserv_define_func("SET", cmd_set, 900, 0);
+ opserv_define_func("SETTIME", cmd_settime, 901, 0);
opserv_define_func("STATS ALERTS", cmd_stats_alerts, 0, 0);
opserv_define_func("STATS BAD", cmd_stats_bad, 0, 0);
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -r1.51 -r1.52
*** opserv.help 24 Sep 2002 19:21:01 -0000 1.51
--- opserv.help 21 Oct 2002 03:49:14 -0000 1.52
***************
*** 38,41 ****
--- 38,42 ----
"Valid alert actions (to be taken when an alert is hit) are:",
"$bNOTICE$b: Send a notice to the $b$O$b alert channel",
+ "$bKILL$b: Disconnect the user",
"$bGLINE$b: Gline the user that tripped the alert",
"$uSee Also:$u addalert, delalert");
***************
*** 419,422 ****
--- 420,424 ----
" RAW [${level/raw}]",
" STATS [${level/stats}]",
+ " SETTIME [${level/settime}]",
" VERSION [${level/version}]");
"DUMP" ("/msg $O DUMP <raw line>",
***************
*** 426,429 ****
--- 428,434 ----
"Dumps a raw server message into the stream. Unlike $bdump$b, $braw$b does $bNOT$b check line syntax before sending it, making $braw$b dangerous. It will however, after the line is sent, warn of a parse error if there is a problem with the line. It is $bHIGHLY$b recommended that $bdump$b be used instead of $braw$b because it is much safer.",
"$uSee Also:$u dump");
+ "SETTIME" ("/msg $O SETTIME [servermask]",
+ "Sets the time on the named server(s) to match the time known to srvx.",
+ "For example, using $b*$b as the mask sets the time on all servers; using a server's full name sets the time only on that one.");
"STATS" ("/msg $O STATS <subject>",
"Displays statistics about a specified subject. Subjects include:",
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** proto-bahamut.c 21 Oct 2002 02:33:24 -0000 1.24
--- proto-bahamut.c 21 Oct 2002 03:49:14 -0000 1.25
***************
*** 405,408 ****
--- 405,415 ----
void
+ irc_settime(const char *srv_name_mask)
+ {
+ /* Bahamut has nothing like this, so ignore it. */
+ (void)srv_name_mask;
+ }
+
+ void
irc_ungline(const char *mask) {
char host[HOSTLEN+1], ident[USERLEN+1], *sep;
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** proto-p10.c 21 Oct 2002 03:18:19 -0000 1.38
--- proto-p10.c 21 Oct 2002 03:49:14 -0000 1.39
***************
*** 517,520 ****
--- 517,527 ----
void
+ irc_settime(const char *srv_name_mask)
+ {
+ putsock("%s " P10_SETTIME " " FMT_TIME_T " %s",
+ self->numeric, now, srv_name_mask);
+ }
+
+ void
irc_ungline(const char *mask)
{
Index: proto.h
===================================================================
RCS file: /cvsroot/srvx/services/src/proto.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -r1.67 -r1.68
*** proto.h 18 Sep 2002 14:53:59 -0000 1.67
--- proto.h 21 Oct 2002 03:49:14 -0000 1.68
***************
*** 144,147 ****
--- 144,148 ----
/* network maintenance */
void irc_gline(struct server *srv, struct gline *gline);
+ void irc_settime(const char *srv_name_mask);
void irc_ungline(const char *mask);
void irc_error(const char *to, const char *message);
|