rockbot-changes Mailing List for RockBot
Brought to you by:
rubin
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
(17) |
May
(4) |
Jun
|
Jul
(13) |
Aug
(1) |
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2003 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <roc...@li...> - 2003-03-16 23:44:10
|
Update of /cvsroot/rockbot/RockBot/source
In directory sc8-pr-cvs1:/tmp/cvs-serv15402
Modified Files:
commands.c main.c misc.c
Log Message:
fixed channel JOIN loop; tries to join failed channels only every 10 seconds now
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** commands.c 21 May 2002 06:20:05 -0000 1.25
--- commands.c 16 Mar 2003 23:44:06 -0000 1.26
***************
*** 1619,1622 ****
--- 1619,1623 ----
ListStruct *Dummy;
int i;
+ int fl = 0;
char buf[MAXLEN];
CHAN_list *ChanPtr;
***************
*** 1726,1733 ****
sendprivmsg(to, "Bye %s", getnick(from));
}
! if(is_flood_str(rest))
{
sendmode(to, "+b *!*@%s", gethost(from));
! sendkick(to, getnick(from), "Flood kick");
}
}
--- 1727,1735 ----
sendprivmsg(to, "Bye %s", getnick(from));
}
! if(fl = is_flood_str(rest))
{
sendmode(to, "+b *!*@%s", gethost(from));
! sprintf(buf, "Flood kick (%d)", fl);
! sendkick(to, getnick(from), buf);
}
}
Index: main.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/main.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** main.c 4 Sep 2001 08:13:53 -0000 1.7
--- main.c 16 Mar 2003 23:44:06 -0000 1.8
***************
*** 487,491 ****
int s;
time_t sendtime = 0, timeleft = WAIT_SEC;
!
/* send_from_queue returns the ammount of time
* to wait before it will be able to send more.
--- 487,492 ----
int s;
time_t sendtime = 0, timeleft = WAIT_SEC;
! time_t tensectic = 0;
! tensectic = time(NULL);
/* send_from_queue returns the ammount of time
* to wait before it will be able to send more.
***************
*** 578,582 ****
/* Only join channels we might have been kicked of */
! reset_channels(SOFTRESET);
break;
}
--- 579,587 ----
/* Only join channels we might have been kicked of */
! if(time(NULL) > tensectic + 10)
! {
! tensectic = time(NULL);
! reset_channels(SOFTRESET);
! }
break;
}
Index: misc.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/misc.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** misc.c 21 May 2002 06:13:34 -0000 1.4
--- misc.c 16 Mar 2003 23:44:06 -0000 1.5
***************
*** 147,151 ****
/* Its a flood if it has more than 8 ctrl chars in it! */
! floodlev = count_ctrl_chars(str);
/* Strip out all the control codes */
--- 147,151 ----
/* Its a flood if it has more than 8 ctrl chars in it! */
! floodlev = count_ctrl_chars(str) / 2;
/* Strip out all the control codes */
***************
*** 156,166 ****
}
if(strstr(buf, "[GaRDa]"))
! floodlev += 8;
if(strstr(buf, "http://"))
! floodlev += 3;
if(strstr(buf, "[PEACE]"))
! floodlev += 5;
! if(floodlev > 10)
! return(true);
}
--- 156,168 ----
}
if(strstr(buf, "[GaRDa]"))
! floodlev += 10;
if(strstr(buf, "http://"))
! floodlev += 10;
if(strstr(buf, "[PEACE]"))
! floodlev += 10;
! if(strstr(buf, "OWNEDANDSCREWINGYOU"))
! floodlev += 10;
! if(floodlev > 12)
! return(floodlev);
}
|
|
From: <roc...@li...> - 2002-05-21 06:20:07
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv23938
Modified Files:
commands.c
Log Message:
added a TODO for mode tracking
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** commands.c 21 May 2002 06:13:33 -0000 1.24
--- commands.c 21 May 2002 06:20:05 -0000 1.25
***************
*** 602,605 ****
--- 602,608 ----
if(!strcasecmp(nick, current_nick))
{ /* Its me! */
+ /* TODO: Store the fact that I have ops
+ * in this channel, and use chanop features
+ * intelegently! */
if (is_in_list(StealList, channel))
{
|
|
From: <roc...@li...> - 2002-05-21 06:13:47
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv21822/source
Modified Files:
commands.c misc.c misc.h
Log Message:
Added some anti-flooding stuff. Pretty basic but was necessary. Later someone should put in some adjustments/toggles forthis stuff and do it right ;)
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** commands.c 8 Nov 2001 12:47:53 -0000 1.23
--- commands.c 21 May 2002 06:13:33 -0000 1.24
***************
*** 1723,1726 ****
--- 1723,1731 ----
sendprivmsg(to, "Bye %s", getnick(from));
}
+ if(is_flood_str(rest))
+ {
+ sendmode(to, "+b *!*@%s", gethost(from));
+ sendkick(to, getnick(from), "Flood kick");
+ }
}
Index: misc.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/misc.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** misc.c 17 Apr 2001 12:08:28 -0000 1.3
--- misc.c 21 May 2002 06:13:34 -0000 1.4
***************
*** 127,130 ****
--- 127,168 ----
}
+ int count_ctrl_chars(char *str)
+ {
+ int i, c=0;
+ for(i=0;i<strlen(str);i++)
+ {
+ if(iscntrl(str[i]))
+ c++;
+ }
+ return c;
+
+ }
+
+ int is_flood_str(char *str)
+ {
+ char buf[MAXLEN * 2];
+ char* tmp;
+ int b = 0;
+ int floodlev = 0;
+
+ /* Its a flood if it has more than 8 ctrl chars in it! */
+ floodlev = count_ctrl_chars(str);
+
+ /* Strip out all the control codes */
+ for(tmp = str;*tmp;tmp++)
+ {
+ if(isprint(*tmp))
+ buf[b++] = *tmp;
+ }
+ if(strstr(buf, "[GaRDa]"))
+ floodlev += 8;
+ if(strstr(buf, "http://"))
+ floodlev += 3;
+ if(strstr(buf, "[PEACE]"))
+ floodlev += 5;
+ if(floodlev > 10)
+ return(true);
+ }
+
int ismask(char *mask)
{
Index: misc.h
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/misc.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** misc.h 17 Apr 2001 12:08:28 -0000 1.2
--- misc.h 21 May 2002 06:13:34 -0000 1.3
***************
*** 6,9 ****
--- 6,10 ----
int AddyOk(char *Address);
int ismask(char *mask);
+ int is_flood_str(char *str);
int IsAllDigits(char *string);
int KeyOk(char *Key);
|
|
From: <roc...@li...> - 2001-11-08 12:47:56
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv18938
Modified Files:
commands.c
Log Message:
fixed a bug in !seen where the times would pile up if more than one entry was listed.
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** commands.c 2001/10/09 01:35:53 1.22
--- commands.c 2001/11/08 12:47:53 1.23
***************
*** 4541,4544 ****
--- 4541,4545 ----
{
num++;
+ strcpy(buf, "");
difference = time(NULL) - temp->time;
|
|
From: <roc...@li...> - 2001-10-09 01:35:59
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv21327
Modified Files:
commands.c config.h send.c
Log Message:
To avoid a condition where the bot can build up an enormus send queue,
I added a timestamp to each message. Messages are checked at each send
cycle, and if they exceed the age limit they are discarded. (Currently set to 60 seconds). This will prevent the bot from ever being more than 60 seconds lagged.
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** commands.c 2001/09/04 08:13:53 1.21
--- commands.c 2001/10/09 01:35:53 1.22
***************
*** 4330,4336 ****
{
QueueListType qptr;
for(qptr = Queue;qptr;qptr = qptr->Next)
{
! Debug(DBGNOTICE, "%d - %s", qptr->priority, qptr->buff);
}
Debug(DBGNOTICE, "--end of list--");
--- 4330,4337 ----
{
QueueListType qptr;
+ Debug(DBGNOTICE, "-- %lu --", time(NULL));
for(qptr = Queue;qptr;qptr = qptr->Next)
{
! Debug(DBGNOTICE, "%lu %d - %s", qptr->ts, qptr->priority, qptr->buff);
}
Debug(DBGNOTICE, "--end of list--");
Index: config.h
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/config.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** config.h 2001/09/16 11:46:21 1.9
--- config.h 2001/10/09 01:35:53 1.10
***************
*** 99,102 ****
--- 99,103 ----
#define BIG_BUFFER 1024
#define MAXNICKLEN 35
+ #define MAXQUEUEAGE 60 /*in seconds; older msgs will be discarded */
/* Some defines to make code more readable */
***************
*** 391,394 ****
--- 392,396 ----
int priority;
char *buff;
+ time_t ts;
struct QueueStruct *Next;
Index: send.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/send.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** send.c 2001/04/17 12:08:28 1.5
--- send.c 2001/10/09 01:35:53 1.6
***************
*** 128,131 ****
--- 128,144 ----
return(WAIT_SEC);
+ /* Check how long the message has been
+ * waiting. If too long, drop it and get the next.
+ */
+ if(time(NULL) - Queue->ts > MAXQUEUEAGE)
+ {
+ Debug(DBGNOTICE, "Dropping line, age limit exceeded: %s", Queue->buff);
+ qptr = Queue;
+ Queue = Queue->Next;
+ free(qptr->buff);
+ free(qptr);
+ continue;
+ }
+
timeleft = timeleft + (time(NULL) - lasttime);
if(timeleft > 9)
***************
*** 170,173 ****
--- 183,187 ----
newq = (QueueListType) malloc(sizeof(struct QueueStruct));
newq->priority = priority;
+ newq->ts = time(NULL);
newq->buff = (char *) malloc(strlen(buff)+1);
strcpy(newq->buff, buff);
|
|
From: <roc...@li...> - 2001-09-16 11:46:26
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv1717/source
Modified Files:
config.h parse.c userlist.c
Log Message:
Fixed a buffer overflow in the userhost system, caused by
part messages being on the end of channel names. Also increased the
allowed length of channel names in the userhost list, as I think 100
probably was surpassable. This should be looked into later for a real non guessing
number.
Index: config.h
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/config.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** config.h 2001/09/04 01:20:12 1.8
--- config.h 2001/09/16 11:46:21 1.9
***************
*** 220,225 ****
typedef struct UserHostType
{
! char name[100];
! char channel[100];
time_t time;
time_t kicktime, bantime, deoptime, killtime;
--- 220,225 ----
typedef struct UserHostType
{
! char name[200]; /* 100 is not big enough i think? */
! char channel[200]; /* Esp. here */
time_t time;
time_t kicktime, bantime, deoptime, killtime;
Index: parse.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/parse.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** parse.c 2001/04/17 12:08:28 1.4
--- parse.c 2001/09/16 11:46:21 1.5
***************
*** 630,634 ****
else if (strcmp(command, "PART") == 0)
{
! update_userhostlist(from, rest, time((time_t *) NULL));
/* again, put this is on_leave? */
remove_user_from_channel(rest, getnick(from));
--- 630,636 ----
else if (strcmp(command, "PART") == 0)
{
! char *chan;
! chan = (char *) strtok(rest, " ");
! update_userhostlist(from, chan, time((time_t *) NULL));
/* again, put this is on_leave? */
remove_user_from_channel(rest, getnick(from));
Index: userlist.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/userlist.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** userlist.c 2001/09/04 08:13:53 1.4
--- userlist.c 2001/09/16 11:46:21 1.5
***************
*** 1089,1093 ****
int write_userhost(char *unused)
{
! UserHostStruct *dummy;
FILE *out;
char filename[MAXLEN];
--- 1089,1093 ----
int write_userhost(char *unused)
{
! UserHostStruct *dummy, *dbglast;
FILE *out;
char filename[MAXLEN];
***************
*** 1099,1102 ****
--- 1099,1103 ----
for (dummy = UserHostList; dummy; dummy = dummy->next)
+ {
fprintf(out, "%s %s %li %li %li %li %li %i %i %i %i %i %i %i %i %i %i\n",
dummy->name, dummy->channel, dummy->time, dummy->kicktime,
***************
*** 1104,1107 ****
--- 1105,1110 ----
dummy->kicknum, dummy->totmsg, dummy->msgnum, dummy->totop,
dummy->totban, dummy->totdeop, dummy->totkick, dummy->totkill);
+ dbglast = dummy;
+ }
fclose(out);
return (TRUE);
|
|
From: <roc...@li...> - 2001-09-09 21:16:40
|
Update of /cvsroot/rockbot/RockBot/source In directory usw-pr-cvs1:/tmp/cvs-serv21840 Modified Files: function.c Log Message: Fixed compile bug using select Index: function.c =================================================================== RCS file: /cvsroot/rockbot/RockBot/source/function.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** function.c 2001/09/04 08:13:53 1.6 --- function.c 2001/09/09 21:16:35 1.7 *************** *** 4,7 **** --- 4,8 ---- #include <ctype.h> #include <sys/types.h> + #include <sys/time.h> #ifndef MSDOS #include <strings.h> *************** *** 9,12 **** --- 10,14 ---- #include <time.h> #include <signal.h> + #include <unistd.h> #include "config.h" #include "channel.h" |
|
From: <roc...@li...> - 2001-09-04 08:13:56
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv16063/source
Modified Files:
channel.c commands.c function.c main.c userlist.c
Log Message:
Fixed addhost so it can be done to other users, and does not require a password but instead requires you be logged in. Also added addmask alias for it, and an alias of add for the cnu command. This should go a long way toward making rockbot eaisier to use.
Index: channel.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/channel.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** channel.c 2001/09/04 01:48:04 1.9
--- channel.c 2001/09/04 08:13:53 1.10
***************
*** 439,442 ****
--- 439,445 ----
exit(1);
}
+ /* NOTE: CANNOT save the data file here. We might be just in the process
+ * of reading it! will have to save after other calls.
+ */
}
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** commands.c 2001/09/04 01:48:04 1.20
--- commands.c 2001/09/04 08:13:53 1.21
***************
*** 235,241 ****
{ "NICK", c_nick, BotCoOwner, 0, FALSE, TRUE, F},
{ "CNU", c_add, ChanHelper, 0, FALSE, TRUE, T},
{ "ADDUSER", c_add, ChanHelper, 0, FALSE, TRUE, T},
! { "CNH", c_addhost, All, 0, FALSE, TRUE, T},
! { "ADDHOST", c_addhost, All, 0, FALSE, TRUE, T},
{ "DELHOST", c_delhost, Peon, 0, FALSE, TRUE, T},
{ "SETHANDLE",c_sethandle, Peon, 0, FALSE, TRUE, T},
--- 235,242 ----
{ "NICK", c_nick, BotCoOwner, 0, FALSE, TRUE, F},
{ "CNU", c_add, ChanHelper, 0, FALSE, TRUE, T},
+ { "ADD", c_add, ChanHelper, 0, FALSE, TRUE, T},
{ "ADDUSER", c_add, ChanHelper, 0, FALSE, TRUE, T},
! { "ADDHOST", c_addhost, Peon, 0, FALSE, TRUE, T},
! { "ADDMASK", c_addhost, Peon, 0, FALSE, TRUE, T},
{ "DELHOST", c_delhost, Peon, 0, FALSE, TRUE, T},
{ "SETHANDLE",c_sethandle, Peon, 0, FALSE, TRUE, T},
***************
*** 247,250 ****
--- 248,253 ----
{ "CNC", c_newchan, BotOwner, 0, FALSE, TRUE, F},
{ "REM", c_userdel, ChanHelper, 0, FALSE, TRUE, T},
+ { "DEL", c_userdel, ChanHelper, 0, FALSE, TRUE, T},
+ { "DELUSER", c_userdel, ChanHelper, 0, FALSE, TRUE, T},
{ "SHIT", c_shit, ChanHelper, 0, FALSE, TRUE, T},
{ "RSHIT", c_rshit, ChanHelper, 0, FALSE, TRUE, T},
***************
*** 2666,2669 ****
--- 2669,2674 ----
send_to_user(from, "Joined %s and marked it active", chan);
}
+ SaveDatFile(ChanPtr);
+ SaveDatFile(Globals);
}
***************
*** 2738,2742 ****
{
sendpart(thechan);
! send_to_user(from, "I've parted %s and marked it inactive.", thechan);
}
else
--- 2743,2749 ----
{
sendpart(thechan);
! send_to_user(from, "I've parted %s.", thechan);
! /* TODO : Make a flag or something so if we quit the fact
! * that the bot is not in this channel is saved. */
}
else
***************
*** 2876,2879 ****
--- 2883,2888 ----
char *chan;
+ send_to_user(from, "\002Please use JOIN to create channels.\002");
+ return;
chan = strtok(rest, " ");
if(chan && chan[0] == '#')
***************
*** 3121,3153 ****
handle = strtok(rest, " ");
- pass = strtok(NULL, " ");
userhost = strtok(NULL, " ");
! if(!handle || !pass)
{
! send_to_user(from, "\002Syntax: ADDHOST <YourHandle> <YourPassword> [*!*new@*hostmask]\002");
return;
}
if(!userhost)
! {
! userhost = cluster(from);
! }
! OpPtr = FindOpByHandle(ChanPtr, handle);
! if(!OpPtr)
! {
! send_to_user(from, "\002No user with handle %s in channel %s\002", handle, ChanPtr->name);
! return;
! }
! if(!strcmp(OpPtr->password, "*"))
! {
! send_to_user(from, "\002You MUST have a password set to use this command. see HELP PASSWD\002");
! return;
}
! if(strcmp(OpPtr->password, pass))
{
! send_to_user(from, "\002Incorrect Password\002");
! return;
}
AddChanListAdditionalHost(ChanPtr, OpPtr, userhost, SECURE);
! send_to_user(from, "\002Added %s to your %s account.\002", userhost, ChanPtr->name);
SaveDatFile(ChanPtr);
}
--- 3130,3174 ----
handle = strtok(rest, " ");
userhost = strtok(NULL, " ");
! if(!handle)
{
! send_to_user(from, "\002Syntax: ADDHOST [Handle] [*!*new@*hostmask]\002");
! send_to_user(from, "\002If no handle is provided, the host will be added to your own account.\002");
return;
}
if(!userhost)
! { /* No handle spesified, so add this mask to our own account */
! userhost = handle;
! OpPtr = find_user(from, ChanPtr);
! if(!OpPtr)
! {
! send_to_user(from, "\002Sorry, you don't seem to have a %s account.", ChanPtr->name);
! return;
! }
! handle = OpPtr->handle;
}
! else
{
! /* They want to add a mask to someone else. Check permissions. */
! if(userlevel(from, ChanPtr) < ChanHelper)
! {
! send_to_user(from, "\002Sorry, only ChanHelper and above can add hosts for others.\002");
! return;
! }
! OpPtr = FindOpByHandle(ChanPtr, handle);
! if(!OpPtr)
! {
! send_to_user(from, "\002No handle %s in %s userlist\002", handle, ChanPtr->name);
! return;
! }
! if(OpPtr->level >= userlevel(from, ChanPtr))
! {
! send_to_user(from, "\002You cannot modify %s's account, because their level is equal to or higher than yours.\002", OpPtr->handle);
! return;
! }
}
+
AddChanListAdditionalHost(ChanPtr, OpPtr, userhost, SECURE);
! send_to_user(from, "\002Added %s to %s' %s account.\002", userhost, OpPtr->handle, ChanPtr->name);
SaveDatFile(ChanPtr);
}
***************
*** 5474,5477 ****
--- 5495,5501 ----
void c_spy(char *from, char *channel, char *rest, char *to, CHAN_list * ChanPtr)
{
+
+ if(rest && *rest)
+ channel = rest;
if (!mychannel(channel))
{
***************
*** 5488,5491 ****
--- 5512,5517 ----
void c_rspy(char *from, char *channel, char *rest, char *to, CHAN_list * ChanPtr)
{
+ if(rest && *rest)
+ channel = rest;
if (!mychannel(channel))
{
Index: function.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/function.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** function.c 2001/09/04 01:48:04 1.5
--- function.c 2001/09/04 08:13:53 1.6
***************
*** 492,499 ****
void signoff(char *from, char *reason)
{
! /*
! save_files(from);
! */
sendquit(reason);
sleep(3);
exit(0);
--- 492,511 ----
void signoff(char *from, char *reason)
{
! struct timeval timer;
! fd_set wd;
! extern RockBotStruct bot;
!
sendquit(reason);
+ /* Wait just long enough that we know our send went though, and
+ * then quit. This way we dont have to wait, and also our
+ * signoff message is not lost
+ */
+ FD_ZERO(&wd);
+ FD_SET(bot.server_sock, &wd);
+ timer.tv_sec = 3;
+ timer.tv_usec = 0;
+
+ select(bot.server_sock + 1, NULL, &wd, 0, &timer);
+
sleep(3);
exit(0);
Index: main.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/main.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** main.c 2001/07/16 06:54:42 1.6
--- main.c 2001/09/04 08:13:53 1.7
***************
*** 162,165 ****
--- 162,166 ----
continue;
}
+ Debug(DBGINFO, "Reading key %s", ConfLine);
if (!strcmp(StrBuffr, "NICK"))
{
Index: userlist.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/userlist.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** userlist.c 2001/07/16 03:50:46 1.3
--- userlist.c 2001/09/04 08:13:53 1.4
***************
*** 649,655 ****
New_user->next = ChanPtr->OpList;
ChanPtr->OpList = New_user;
! /*
! // Debug(DBGINFO, "Added user %s to %s userlist.\n", New_user->userhosts->userhost, ChanPtr->name);
! */
return(New_user);
}
--- 649,655 ----
New_user->next = ChanPtr->OpList;
ChanPtr->OpList = New_user;
!
! Debug(DBGINFO, "Added user %s to %s userlist.\n", New_user->userhosts->userhost, ChanPtr->name);
!
return(New_user);
}
|
|
From: <roc...@li...> - 2001-09-04 08:13:56
|
Update of /cvsroot/rockbot/RockBot
In directory usw-pr-cvs1:/tmp/cvs-serv16063
Modified Files:
help.dat
Log Message:
Fixed addhost so it can be done to other users, and does not require a password but instead requires you be logged in. Also added addmask alias for it, and an alias of add for the cnu command. This should go a long way toward making rockbot eaisier to use.
Index: help.dat
===================================================================
RCS file: /cvsroot/rockbot/RockBot/help.dat,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** help.dat 2001/07/19 10:25:51 1.2
--- help.dat 2001/09/04 08:13:53 1.3
***************
*** 330,338 ****
The default is '*' (All Channels)
! ADDHOST, format: addhost <handle> [password] [userhost]
-------------------------------------------------------
Adds another host to your userlist
! account "handle". If you are currently
! unrecignized by the bot, password is required.
B, format: b [channel] <nick or user@host>
--- 330,339 ----
The default is '*' (All Channels)
! ADDHOST, format: addhost [handle] <userhost>
-------------------------------------------------------
Adds another host to your userlist
! account. If no handle is provided,
! the user issuing the command will
! be used.
B, format: b [channel] <nick or user@host>
|
|
From: <roc...@li...> - 2001-09-04 01:48:06
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv19387
Modified Files:
channel.c channel.h commands.c function.c
Log Message:
Fixed the CYCLE command
Index: channel.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/channel.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** channel.c 2001/09/04 01:20:12 1.8
--- channel.c 2001/09/04 01:48:04 1.9
***************
*** 833,840 ****
}
! void cycle_channel(char *channel)
{
- CHAN_list *ChanPtr;
-
if(!ChanPtr)
{
--- 833,838 ----
}
! void cycle_channel(CHAN_list *ChanPtr)
{
if(!ChanPtr)
{
***************
*** 842,847 ****
return;
}
! sendpart(channel);
! sendjoin(channel, ChanPtr->CurrentKey);
}
--- 840,845 ----
return;
}
! sendpart(ChanPtr->name);
! sendjoin(ChanPtr->name, ChanPtr->CurrentKey);
}
Index: channel.h
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/channel.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** channel.h 2001/04/17 12:08:28 1.2
--- channel.h 2001/09/04 01:48:04 1.3
***************
*** 32,36 ****
int num_on_channel(char *channel, char *uh);
int tot_num_on_channel(char *channel);
! void cycle_channel(char *channel);
void idle_kick(void);
int show_users_on_channel(char *from, char *channel);
--- 32,36 ----
int num_on_channel(char *channel, char *uh);
int tot_num_on_channel(char *channel);
! void cycle_channel(CHAN_list *ChanPtr);
void idle_kick(void);
int show_users_on_channel(char *from, char *channel);
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** commands.c 2001/09/04 01:20:12 1.19
--- commands.c 2001/09/04 01:48:04 1.20
***************
*** 5391,5395 ****
{
send_to_user(from, "%cCycling channel %s\x2", '\x2', channel);
! cycle_channel(channel);
}
--- 5391,5395 ----
{
send_to_user(from, "%cCycling channel %s\x2", '\x2', channel);
! cycle_channel(ChanPtr);
}
Index: function.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/function.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** function.c 2001/09/04 01:20:12 1.4
--- function.c 2001/09/04 01:48:04 1.5
***************
*** 683,687 ****
{
if (tot_num_on_channel(temp->name) == 1)
! cycle_channel(temp->name);
}
}
--- 683,689 ----
{
if (tot_num_on_channel(temp->name) == 1)
! {
! cycle_channel(search_chan(temp->name));
! }
}
}
|
|
From: <roc...@li...> - 2001-09-04 01:20:17
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv13116/source
Modified Files:
channel.c commands.c config.h function.c
Log Message:
Fixed the steal and rsteal commands.
Index: channel.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/channel.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** channel.c 2001/07/18 04:55:52 1.7
--- channel.c 2001/09/04 01:20:12 1.8
***************
*** 209,212 ****
--- 209,238 ----
}
+ void partspamcheck(char *from, char *channel, char *rest)
+ {
+ char *strptr;
+ char *nuh;
+ CHAN_list *ChanPtr;
+
+ ChanPtr = search_chan(channel);
+ if(!ChanPtr)
+ return;
+ /*
+ if(ChanPtr->Settings[NOPARTSPAM])
+ */
+
+ strptr = (char *) strsep(&rest, " ");
+ while (strptr)
+ {
+ if(is_url(strptr))
+ {
+ ban_user(channel, from);
+ break;
+ }
+
+ strptr = (char *) strsep(&rest, " ");
+ }
+ }
+
char *ConvertChanMode(char *StrModes, unsigned char Modes)
{
***************
*** 457,460 ****
--- 483,488 ----
if(!ChanPtr) /* New channel */
{
+ /* TODO : Put the new chan stuff into a function instead of c_join()
+ * so we can call it here. */
return(FALSE);
}
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** commands.c 2001/08/15 08:53:02 1.18
--- commands.c 2001/09/04 01:20:12 1.19
***************
*** 346,349 ****
--- 346,354 ----
"after 4 hours idle.",
"after 12 hours idle."}},
+ { "NOSPAM", NOSPAM, 0, 1, 1, ChanCoOwner, "If bans are set on user@host who part with URL",
+ "Anti-spam measures are: ",
+ {"Enabled",
+ "Disabled",
+ "", "", "", ""}},
{ "CLONEKICK", CLONEKICK, 0, 5, 0, ChanCoOwner, "Kicking of clones (max users with same host)",
"I will kick if i detect: ",
***************
*** 1720,1729 ****
--- 1725,1741 ----
{
char buffer[MAXLEN];
+ char *rest;
+
+ channel = (char *) strtok(channel, " ");
+ rest = strtok(NULL, "");
sprintf(buffer, "\x2%s has left channel %s\x2", from, channel);
+ if(rest)
+ strcat(buffer, rest);
send_spy_chan(channel, buffer);
sprintf(buffer, "%s has left channel %s", from, channel);
if (is_in_list(LogChatList, channel))
logchat(channel, buffer);
+ partspamcheck(from, channel, rest);
}
***************
*** 3419,3423 ****
--- 3431,3438 ----
nuh = find_person(from, nuh);
if (!*nuh)
+ {
+ send_to_user(from, "\002No information for %s\002", nuh);
return;
+ }
if ((protlevel(nuh, ChanPtr) || (userlevel(nuh, ChanPtr) >= PROTLEVEL)) &&
***************
*** 5338,5346 ****
return;
}
if (add_to_list(&StealList, rest))
{
send_to_user(from, "\x2Now trying to steal %s\x2", rest);
! if (!mychannel(rest))
! join_channel(rest, 1);
}
else
--- 5353,5365 ----
return;
}
+ if(!mychannel(rest))
+ {
+ send_to_user(from, "\002I'm not in %s\002", rest);
+ return;
+ }
if (add_to_list(&StealList, rest))
{
send_to_user(from, "\x2Now trying to steal %s\x2", rest);
! // join_channel(rest, 1);
}
else
***************
*** 5365,5369 ****
else
send_to_user(from, "\x2Problem deleting the channel\x2");
! leave_channel(rest);
return;
}
--- 5384,5388 ----
else
send_to_user(from, "\x2Problem deleting the channel\x2");
! //leave_channel(rest);
return;
}
Index: config.h
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/config.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** config.h 2001/07/16 06:54:42 1.7
--- config.h 2001/09/04 01:20:12 1.8
***************
*** 352,355 ****
--- 352,356 ----
#define CCREQ 17
#define PMLOG 18
+ #define NOSPAM 19
#define MODE_CHANOP CHFL_CHANOP
Index: function.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/function.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** function.c 2001/07/16 03:50:46 1.3
--- function.c 2001/09/04 01:20:12 1.4
***************
*** 665,669 ****
if (!*temp2)
{
! send_to_user(from, "\x2No information for %s\x2", nick);
return "";
}
--- 665,669 ----
if (!*temp2)
{
! /* send_to_user(from, "\x2No information for %s\x2", nick); */
return "";
}
***************
*** 1003,1006 ****
--- 1003,1031 ----
else
send_to_user(to, buffer);
+ }
+ }
+
+ int is_url(char *urlstring)
+ {
+
+ char buff[MAXLEN];
+ int i,p;
+
+ /* Strip out control chars */
+ i = p = 0;
+ for(i= 0;i < strlen(urlstring);i++)
+ {
+ if(isprint(urlstring[i]))
+ {
+ buff[p++] = toupper(urlstring[i]);
+ }
+
+ }
+
+ if(strstr(buff, "HTTP://"))
+ return(true);
+ if(strstr(buff, "www."))
+ {
+ return(true);
}
}
|
|
From: <roc...@li...> - 2001-08-15 10:52:15
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv18974
Modified Files:
commands.c commands.h
Log Message:
Made the kick-say's less annoying, and more to the point.
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** commands.c 2001/07/19 10:25:52 1.17
--- commands.c 2001/08/15 08:53:02 1.18
***************
*** 206,209 ****
--- 206,210 ----
{ "TEST", c_test, BotOwner, 0, FALSE, TRUE, F},
{ "TEST1", c_test1, BotOwner, 0, FALSE, TRUE, F},
+ { "ASCII", c_ascii, All, 0, FALSE, TRUE, F},
{ "AOP", c_aop, ChanHelper, 100, FALSE, TRUE, T},
{ "RAOP", c_naop, ChanHelper, 100, FALSE, TRUE, T},
***************
*** 1671,1687 ****
if(!BannedWordOk(ChanPtr->Settings[KSLEVEL], userlevel(from, ChanPtr)))
{
! sprintf(buf, "ACTION overhears %s say %s", getnick(from),
Dummy->name);
send_ctcp(to, buf);
sprintf(buf, "ACTION sticks a sock in %s's mouth and...", getnick(from));
send_ctcp(to, buf);
! sendkick(to, getnick(from), "\002You're outta here\002");
! sendprivmsg(to, "\002%s shouldn't have said that!!!\002", getnick(from));
send_to_user(from, "%cCareful, %s is banned!!!\002", '\002', Dummy->name);
}
else
{
! sprintf(buf, "ACTION overhears %s say a banned word, but overlooks it", getnick(from));
! send_ctcp(to, buf);
}
}
--- 1672,1690 ----
if(!BannedWordOk(ChanPtr->Settings[KSLEVEL], userlevel(from, ChanPtr)))
{
! /* sprintf(buf, "ACTION overhears %s say %s", getnick(from),
Dummy->name);
send_ctcp(to, buf);
sprintf(buf, "ACTION sticks a sock in %s's mouth and...", getnick(from));
send_ctcp(to, buf);
! */
! sprintf(buf, "\002Do NOT say %s in here!!!\002", Dummy->name);
! sendkick(to, getnick(from), buf);
! /* sendprivmsg(to, "\002%s shouldn't have said that!!!\002", getnick(from)); */
send_to_user(from, "%cCareful, %s is banned!!!\002", '\002', Dummy->name);
}
else
{
! /* sprintf(buf, "ACTION overhears %s say a banned word, but overlooks it", getnick(from));
! send_ctcp(to, buf); */
}
}
***************
*** 4244,4247 ****
--- 4247,4275 ----
send_to_user(from, "\x2Topic changed on %s\x2", channel);
return;
+ }
+
+ void c_ascii(char *from, char *channel, char *rest, char *to, CHAN_list* ChanPtr)
+ {
+ int i;
+ int width=0, line=0;
+ char buff[MAXLEN];
+ int maxwidth = 10;
+
+
+ send_to_user(from, "=---- ASCII Table ----=");
+ for(i=32;i<=255;i++)
+ {
+ buff[width++] = i;
+ if(width >= maxwidth)
+ {
+ buff[width] = '\0';
+ send_to_user(from, "%d-%d:%s", line, i-1, buff);
+ width = 0;
+ line = i;
+ }
+ }
+ buff[width] = '\0';
+ send_to_user(from, "%d-%d:%s", line, i-1, buff);
+ send_to_user(from, "=------ End of Ascii -----=");
}
Index: commands.h
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** commands.h 2001/07/19 10:25:52 1.9
--- commands.h 2001/08/15 08:53:02 1.10
***************
*** 105,108 ****
--- 105,109 ----
void c_listdcc(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
void c_topic(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
+ void c_ascii(char *from, char *channel, char *rest, char *to, CHAN_list* ChanPtr);
void c_test(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
void c_test1(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
|
|
From: <roc...@li...> - 2001-07-19 10:25:56
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv12917/source
Modified Files:
commands.c commands.h
Log Message:
Added a RESETPASS command in case someone forgets a password.
added that and PASS to the help file.
Some misc Demo/ data file changes in here too.. unimportant.
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** commands.c 2001/07/19 02:04:53 1.16
--- commands.c 2001/07/19 10:25:52 1.17
***************
*** 243,246 ****
--- 243,247 ----
{ "PASSWORD", c_passwd, Peon, 0, FALSE, TRUE, T},
{ "PASS", c_passwd, Peon, 0, FALSE, TRUE, T},
+ { "RESETPASS",c_resetpass, ChanHelper, 0, FALSE, TRUE, T},
{ "CNC", c_newchan, BotOwner, 0, FALSE, TRUE, F},
{ "REM", c_userdel, ChanHelper, 0, FALSE, TRUE, T},
***************
*** 2949,2952 ****
--- 2950,2995 ----
send_to_user(from, "\002%s handle for %s changed to %s\002", ChanPtr->name, rplold, newhandle);
SaveDatFile(ChanPtr);
+ }
+
+ /* Check if we have a higher level then the target, and if so
+ * change there password.
+ */
+ void c_resetpass(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr)
+ {
+ char* handle;
+ char* newpass;
+ UserStruct *UserPtr;
+ UserStruct *Target;
+
+ handle = strtok(rest, " ");
+ newpass = strtok(NULL, " ");
+
+ if(!newpass)
+ {
+ send_to_user(from, "Usage: RESETPASS <handle> <newpass>");
+ return;
+ }
+ if(!(UserPtr = find_user(from, ChanPtr)))
+ {
+ if(!(UserPtr = find_user(from, Globals)))
+ {
+ Debug(DBGERROR, "Can't find user in resetpass()!");
+ return;
+ }
+ }
+ if(!(Target = FindOpByHandle(ChanPtr, handle)))
+ {
+ send_to_user(from, "No \"%s\" found in %s userlist.", handle, ChanPtr->name);
+ return;
+ }
+ if(UserPtr->level <= Target->level)
+ {
+ send_to_user(from, "Your access level (%d) is not above %s (%d)", UserPtr->level, Target->handle, Target->level);
+ return;
+ }
+ strcpy(Target->password, newpass);
+ send_to_user(from, "Changed %s/%s password to \"%s\".", ChanPtr->name, Target->handle, Target->password);
+ SaveDatFile(ChanPtr);
+
}
Index: commands.h
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** commands.h 2001/07/16 06:54:42 1.8
--- commands.h 2001/07/19 10:25:52 1.9
***************
*** 60,63 ****
--- 60,64 ----
void c_setinfo(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
void c_sethandle(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
+ void c_resetpass(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
void c_passwd(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
void c_delhost(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
|
|
From: <roc...@li...> - 2001-07-19 10:25:55
|
Update of /cvsroot/rockbot/RockBot/Demo In directory usw-pr-cvs1:/tmp/cvs-serv12917/Demo Modified Files: userhost.dat Log Message: Added a RESETPASS command in case someone forgets a password. added that and PASS to the help file. Some misc Demo/ data file changes in here too.. unimportant. Index: userhost.dat =================================================================== RCS file: /cvsroot/rockbot/RockBot/Demo/userhost.dat,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** userhost.dat 2000/10/14 08:59:43 1.1.1.1 --- userhost.dat 2001/07/19 10:25:52 1.2 *************** *** 1,883 **** ! 0á@0á@ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! X2!X2...@X2... #love 971249766 971050932 971249757 971249757 0 0 0 1 0 0 228 13 6 8 0 ! X2dev!X2...@X2... #AfterNET 971249766 971220706 971249765 971249765 0 0 0 1 0 0 259 8 8 5 0 ! Ender!ru...@sh... #AfterNET 971249766 971050728 971190785 971190785 0 0 0 1 0 0 10 4 2 2 0 ! WereLion!~Sav...@28... #afternet 970956879 970871271 970871271 970871271 0 0 0 0 0 0 0 0 0 0 0 ! Amon-Ra!da...@cx... #AfterNET 971249766 970871271 970871271 970871271 0 0 0 0 0 0 0 0 0 0 0 ! Chaz!ch...@ho... #AfterNET 971237957 970871271 971031912 971031912 0 0 0 0 0 0 0 0 0 0 0 ! Athlon!At...@dh... #operations 971213851 970871273 970871273 970871273 0 0 0 0 0 0 0 0 0 0 0 ! relnev!re...@cs... #operations 971229347 970871273 970871273 970871273 0 0 0 0 0 0 0 0 0 0 0 ! DaMac!Da...@pa... #AfterNET 971249766 971078260 971083404 971083404 0 0 0 1 0 0 1 0 1 2 0 [...1737 lines suppressed...] ! Admiral_Starr!adm...@pp... #AfterNET 971245316 970871555 970871555 970871555 0 0 0 0 0 0 0 0 0 0 0 ! m18!DIDI_ALF@195.39.142.23 #afternet 970877312 970871555 970871555 970871555 0 0 0 0 0 0 0 0 0 0 0 ! DeCiNoS!metalteam@212.29.114.43 #afternet 970879295 970871555 970871555 970871555 0 0 0 0 0 0 0 0 0 0 0 ! sssssss!XX...@AC... #operations 970871363 970871346 970871346 970871346 0 0 0 0 0 0 0 0 0 0 0 ! Rubin!Rubin!ru...@sh... #AfterNET 971246302 970871297 970871297 970871297 970872196 0 0 0 0 0 0 0 0 0 2 ! Rubin!ru...@sh... #AfterNET 971249771 970871273 970871273 970871273 0 0 0 0 0 0 0 0 0 0 0 ! Antilles!ant...@ad... #AfterNET 971249766 970871273 970871273 970871273 0 0 0 0 0 0 0 0 0 0 0 ! HotSxyKim!~la...@ca... #afternet 971035968 970871273 970871273 970871273 0 0 0 0 0 0 0 0 0 0 0 ! EvilWulfie!~wu...@28... #afternet 970878639 971062333 971190219 971190219 0 0 0 1 0 0 6 2 0 4 0 ! BompaNapping!Da...@cm... #operations 970871273 970871273 970871273 970871273 0 0 0 0 0 0 0 0 0 0 0 ! DaMac!Da...@pa... #AfterNET 971249766 971078260 971083404 971083404 0 0 0 1 0 0 1 0 1 2 0 ! relnev!re...@cs... #operations 971229347 970871273 970871273 970871273 0 0 0 0 0 0 0 0 0 0 0 ! Athlon!At...@dh... #operations 971213851 970871273 970871273 970871273 0 0 0 0 0 0 0 0 0 0 0 ! Chaz!ch...@ho... #AfterNET 971237957 970871271 971031912 971031912 0 0 0 0 0 0 0 0 0 0 0 ! Amon-Ra!da...@cx... #AfterNET 971249766 970871271 970871271 970871271 0 0 0 0 0 0 0 0 0 0 0 ! WereLion!~Sav...@28... #afternet 970956879 970871271 970871271 970871271 0 0 0 0 0 0 0 0 0 0 0 ! Ender!ru...@sh... #AfterNET 971249766 971050728 971190785 971190785 0 0 0 1 0 0 10 4 2 2 0 ! X2dev!X2...@X2... #AfterNET 971249766 971220706 971249765 971249765 0 0 0 1 0 0 259 8 8 5 0 ! X2!X2...@X2... #love 971249766 971050932 971249757 971249757 0 0 0 1 0 0 228 13 6 8 0 ! 0á@0á@ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |
|
From: <roc...@li...> - 2001-07-19 10:25:55
|
Update of /cvsroot/rockbot/RockBot
In directory usw-pr-cvs1:/tmp/cvs-serv12917
Modified Files:
help.dat
Log Message:
Added a RESETPASS command in case someone forgets a password.
added that and PASS to the help file.
Some misc Demo/ data file changes in here too.. unimportant.
Index: help.dat
===================================================================
RCS file: /cvsroot/rockbot/RockBot/help.dat,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** help.dat 2000/10/14 08:59:30 1.1.1.1
--- help.dat 2001/07/19 10:25:51 1.2
***************
*** 291,297 ****
AUTH, format: auth <handle> <password>
--------------------------------------
! Authenticates you to the bot, in case your host
is marked as insecure.
see also: PASS, SETSECURITY
SETHANDLE, format: sethandle <nick> <newhandle>
--- 291,314 ----
AUTH, format: auth <handle> <password>
--------------------------------------
! Authenticates you to the bot, in case you
! do not match any hosts, or your host
is marked as insecure.
see also: PASS, SETSECURITY
+
+ PASS, format: pass <oldpassword> <newpassword>
+ ----------------------------------------------
+ Changes your password. Must be done in
+ private message. Don't forget to prepend
+ the correct channel in front, or command
+ charactor for the global context.
+ see also: AUTH, RESETPASS
+
+ RESETPASS, format: resetpass <handle> <password>
+ ------------------------------------------------
+ This provides a way for bot users to set
+ the password of other bot users provided
+ they outrank them. Intended to solve fogotten
+ passwords.
+ see also: AUTH, PASS
SETHANDLE, format: sethandle <nick> <newhandle>
|
|
From: <roc...@li...> - 2001-07-19 02:04:56
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv14980/source
Modified Files:
commands.c
Log Message:
Fixed a setsecurity crash when implying the current hostmask.
(EG, !!setsecurity SECURE .. without giving which hostmask to set)
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** commands.c 2001/07/18 05:02:02 1.15
--- commands.c 2001/07/19 02:04:53 1.16
***************
*** 3881,3885 ****
for(HostPtr = UsrPtr->userhosts;HostPtr;HostPtr = HostPtr->next)
{
! if(!matches(HostPtr->userhost, hostmask))
{
if(!strcasecmp(level, "SECURE"))
--- 3881,3885 ----
for(HostPtr = UsrPtr->userhosts;HostPtr;HostPtr = HostPtr->next)
{
! if(!matches(HostPtr->userhost, hostmask?hostmask:from))
{
if(!strcasecmp(level, "SECURE"))
|
|
From: <roc...@li...> - 2001-07-18 05:02:04
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv28261
Modified Files:
commands.c
Log Message:
made save require a context
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** commands.c 2001/07/16 06:54:42 1.14
--- commands.c 2001/07/18 05:02:02 1.15
***************
*** 281,286 ****
{ "RHN", c_noholdnick, BotOwner, 100, FALSE, TRUE, F},
{ "RESETUH", c_resetuhost, BotCoOwner, 100, FALSE, TRUE, F},
! { "SAVE", c_save, BotOwner, 0, FALSE, TRUE, F},
! { "DO", c_do, BotOwner, 0, FALSE, TRUE, F},
{ "OPER", c_oper, BotCoOwner, 0, FALSE, TRUE, F},
/*
--- 281,286 ----
{ "RHN", c_noholdnick, BotOwner, 100, FALSE, TRUE, F},
{ "RESETUH", c_resetuhost, BotCoOwner, 100, FALSE, TRUE, F},
! { "SAVE", c_save, BotOwner, 0, FALSE, TRUE, T},
! { "DO", c_do, BotOwner, 0, FALSE, TRUE, T},
{ "OPER", c_oper, BotCoOwner, 0, FALSE, TRUE, F},
/*
|
|
From: <roc...@li...> - 2001-07-18 04:55:56
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv27167
Modified Files:
channel.c
Log Message:
Attempting to make the GETOP paramiter backwards compatable.
Index: channel.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/channel.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** channel.c 2001/07/16 06:54:41 1.6
--- channel.c 2001/07/18 04:55:52 1.7
***************
*** 115,119 ****
fprintf(DatFile, "# The GETOP key is a string we send to get ops if we are lacking them.\n");
fprintf(DatFile, "# example: PRIVMSG $C .UP or PRIVMSG X2 $C UP\n");
! fprintf(DatFile, "GETOP %s\n", ChanPtr->getop);
fprintf(DatFile, "#\n");
fprintf(DatFile, "# The RESPONDER key is a get/send pair to automate logging in or\n");
--- 115,119 ----
fprintf(DatFile, "# The GETOP key is a string we send to get ops if we are lacking them.\n");
fprintf(DatFile, "# example: PRIVMSG $C .UP or PRIVMSG X2 $C UP\n");
! fprintf(DatFile, "GETOP %s\n", (ChanPtr->getop&& ChanPtr->getop[0])?ChanPtr->getop:"*");
fprintf(DatFile, "#\n");
fprintf(DatFile, "# The RESPONDER key is a get/send pair to automate logging in or\n");
|
|
From: <roc...@li...> - 2001-07-17 09:09:56
|
Update of /cvsroot/rockbot/RockBot/Demo In directory usw-pr-cvs1:/tmp/cvs-serv29886 Modified Files: global.dat Log Message: Added the GETOP flag so the default doesnt break the bot. Index: global.dat =================================================================== RCS file: /cvsroot/rockbot/RockBot/Demo/global.dat,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** global.dat 2000/10/14 08:59:38 1.1.1.1 --- global.dat 2001/07/17 09:09:52 1.2 *************** *** 10,14 **** # The SERVER key is a server the bot should use. Multiple SERVER keys are ok. # Syntax: SERVER <server> <port> [password] ! SERVER agora.rdrop.com 6667 # # The IRCNAME key is the 'realname' field on irc. --- 10,14 ---- # The SERVER key is a server the bot should use. Multiple SERVER keys are ok. # Syntax: SERVER <server> <port> [password] ! SERVER ic5.afternet.org 6667 # # The IRCNAME key is the 'realname' field on irc. *************** *** 29,33 **** # The CHANNEL key tells the bot to read in a channel data file and join a channel # CHANNEL <name> ! # CHANNEL #genealogy-native # # The TOPIC key defines the channels default topic --- 29,33 ---- # The CHANNEL key tells the bot to read in a channel data file and join a channel # CHANNEL <name> ! CHANNEL #AfterNET # # The TOPIC key defines the channels default topic *************** *** 37,40 **** --- 37,48 ---- ENFMODES +nt-spimkl # + # The GETOP key is a string we send to get ops if we are lacking them. + # example: PRIVMSG $C .UP or PRIVMSG X2 $C UP + GETOP * + # + # The RESPONDER key is a get/send pair to automate logging in or + # really anything you can think of. Sort of rudimentry script support. + # RESPONDER <Name> <expect>:<send> + # # The USER key Defines the channel's(or global) users. # hostmask = nick!user@host with standard * and ? as wild cards. *************** *** 59,72 **** # autoop = 0:dont auto-op # 1:auto-op # info = The bot will say this in the chan when you join # ! # Syntax: USER <hostmask> <handle> <pass> <userlevel> <protectlevel> <autoop> <announce info line> # HOST <additional hostmask> ! USER *!*rubin@*.rdrop.com Rubin defaultpass 100 5 1 0 Thine Creator! ! HOST *!*rubin@*.afternet.org 1 ! HOST *!*rubin@*.teleport.com 1 ! HOST *!*rubin@*.europa.com 1 ! HOST *!*rubin@*.ORST.EDU 0 HOST *!*rubin@128.193.* 0 # # BAN defines bans for either a channel or over all global. --- 67,83 ---- # autoop = 0:dont auto-op # 1:auto-op + # security = 0:secure hostmask. No pass required + # 1:insecure hostmask. Require AUTH command before granting privlidges. # info = The bot will say this in the chan when you join # ! # Syntax: USER <hostmask> <handle> <pass> <userlevel> <protectlevel> <autoop> <security> <announce info line> # HOST <additional hostmask> ! USER *!*rubin@*.loxxin.net Rubin defaultpass 100 5 1 1 Thine Creator! HOST *!*rubin@128.193.* 0 + HOST *!*rubin@*.ORST.EDU 0 + HOST *!*rubin@*.europa.com 1 + HOST *!*rubin@*.teleport.com 1 + HOST *!*rubin@*.afternet.org 1 + HOST *!*rubin@*.rdrop.com 0 # # BAN defines bans for either a channel or over all global. *************** *** 102,106 **** SETTING PMLOG 1 # ! # End of Globals config file ./Ender/global.dat. ! ! --- 113,115 ---- SETTING PMLOG 1 # ! # End of Globals config file ./Toran/global.dat. |
|
From: <roc...@li...> - 2001-07-16 07:24:31
|
Update of /cvsroot/rockbot/RockBot In directory usw-pr-cvs1:/tmp/cvs-serv6767 Modified Files: INSTALL Log Message: updated install file Index: INSTALL =================================================================== RCS file: /cvsroot/rockbot/RockBot/INSTALL,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** INSTALL 2001/04/17 12:53:24 1.3 --- INSTALL 2001/07/16 07:24:28 1.4 *************** *** 28,34 **** --- 28,48 ---- included with the distribution. + Quick install Directions + ------------------------ + cd RockBot + ./configure + make + cp -r Demo MyBot + pico MyBot/global.dat + ./RockBot MyBot + + Basic Install Instructions -------------------------- Untar the archive (it will make a dir, RockBot/) + $ tar -xzf RockBot.tgz #(or whatever your file is called) + + Change to the directory RockBot/ + $ cd RockBot run the configure script (./configure) *************** *** 37,58 **** see ./configure --help when you run the configure script, it will examine your system and build appropreate makefiles for you (hopefully..) ! cd into the RockBot/source directory. Look over Makefile and config.h ! make any changes necessary. Run "make" to compile. If your machine took spesific changes to compile please write up a nice detailed description and email it to me (ru...@af...). ! Change directorys back to RockBot/ (cd ..) and rename the "Demo" directory ! to a directory describing your bot. (each "bot" gets its own directory out of the main RockBot/ directory) Anything works, as long as its ! diferentiable from other bots you run off the same binary. (Mybot) for ! example.. (Its not a good idea to use punctuation though.). Change into your bots data directory and modify global.dat to reflect your information. Be carefull not to break the syntax. See documentation in that file for help. some day i hope to build a script to do this for you. Change back to the main RockBot/ directory and execute the bot. The syntax is "RockBot <dirname>" where <dirname> is the directory the data files are in (relitive to the RockBot binary). Example:> ./RockBot Ender With any luck it will start.. if not you'll have to try to figure it out --- 51,79 ---- see ./configure --help when you run the configure script, it will examine your system and build appropreate makefiles for you (hopefully..) + $ ./configure ! Look over source/Makefile and source/config.h make any changes necessary. ! Run "make" to compile. If your machine took spesific changes to compile please write up a nice detailed description and email it to me (ru...@af...). + $ make ! Rename the "Demo" directory to a directory describing your bot. (each ! "bot" gets its own directory out of the main RockBot/ directory) Anything ! works, as long as its diferentiable from other bots you run off the same ! binary. (MyBot) for example.. (Its not a good idea to use punctuation though.). ! $ cp -r Demo MyBot Change into your bots data directory and modify global.dat to reflect your information. Be carefull not to break the syntax. See documentation in that file for help. some day i hope to build a script to do this for you. + $ cd MyBot + $ pico MyBot/global.dat Change back to the main RockBot/ directory and execute the bot. The syntax is "RockBot <dirname>" where <dirname> is the directory the data files are in (relitive to the RockBot binary). Example:> ./RockBot Ender + $ cd .. + $ RockBot MyBot With any luck it will start.. if not you'll have to try to figure it out *************** *** 62,70 **** Things not yet done (that i remember) ------------------------------------- * There are still bugs in the ban system...still. * The kick-say kicks arnt working. * Help is still badly out of date (although updated somewhat) ! * Python is not yet implimented (nor may it ever be) ! * Several commands are not yet working Update 4/17/01 --- 83,110 ---- Things not yet done (that i remember) ------------------------------------- + * Need to write a nice friendly first time build-a-new-bot + thing, like version 5 had. * There are still bugs in the ban system...still. * The kick-say kicks arnt working. * Help is still badly out of date (although updated somewhat) ! * Several commands are not yet working. I keep working down the list, ! but theres a lot, and I'm not even necessarily aware of it all. If ! you find a bug let me know. ! * The bot likes to undo peoples bans. It seems to think a ban like *foo*@* matches ! a users hostmask of *rubin@*.loxxin.net because I could be rubin!foo...@sh.... ! While this is true, the bot needs to only undo bans that actually spesifically match ! someones hostmask. Not quite sure how to solve this. The matching code claims to solve ! this problem but apparently not.. ! * The nickname code is not quite right. In some cases the bot won't get its wanted ! nick when it becomes free. ! ! Update 7/16/01 ! -------------- ! * I've streamlined the login procedures a bit. If you have the password, ! the AUTH command will now get you access regarless if you match a host ! in the bot or not. If not, one will be added that matches you (but marked ! as insecure, so you'll still need to login for access next time) ! * Added the base of "RESPONDERS" that will let the bot do script-like things, ! such as login to another bot or service. They arnt functional yet though. Update 4/17/01 |
|
From: <roc...@li...> - 2001-07-16 06:54:46
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv937/source
Modified Files:
channel.c commands.c commands.h config.h main.c
Log Message:
Added storage and datafile for a new thing called a "RESPONDER". Its like a
very primitive script. Each responder entry has a name, a string to expect, and a string
to send. Can be used to do anything, but mainly important for logging into
things like channel services, other bots, and nickserv.
Also completed adding a GETOP string in the channel list, which is what the bot will do
when it wants to get ops, (eg .UP or /msg x2 #channel UP).
Implimentation of thes is not complete yet, only that you can store them and view them.
Index: channel.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/channel.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** channel.c 2001/07/16 03:50:46 1.5
--- channel.c 2001/07/16 06:54:41 1.6
***************
*** 43,46 ****
--- 43,47 ----
UserStruct *OpPtr;
ShitStruct *BanPtr;
+ RESPONDER_list *rptr;
int i;
char ModeString[200];
***************
*** 112,115 ****
--- 113,128 ----
fprintf(DatFile, "ENFMODES %s\n", *ModeString?ModeString:"*" );
fprintf(DatFile, "#\n");
+ fprintf(DatFile, "# The GETOP key is a string we send to get ops if we are lacking them.\n");
+ fprintf(DatFile, "# example: PRIVMSG $C .UP or PRIVMSG X2 $C UP\n");
+ fprintf(DatFile, "GETOP %s\n", ChanPtr->getop);
+ fprintf(DatFile, "#\n");
+ fprintf(DatFile, "# The RESPONDER key is a get/send pair to automate logging in or\n");
+ fprintf(DatFile, "# really anything you can think of. Sort of rudimentry script support.\n");
+ fprintf(DatFile, "# RESPONDER <Name> <expect>:<send>\n");
+ for(rptr=ChanPtr->Responder;rptr;rptr = rptr->next)
+ {
+ fprintf(DatFile, "RESPONDER %s %s:%s\n", rptr->name, rptr->expect, rptr->send);
+ }
+ fprintf(DatFile, "#\n");
/* USER */
fprintf(DatFile, "# The USER key Defines the channel's(or global) users.\n");
***************
*** 135,138 ****
--- 148,153 ----
fprintf(DatFile, "# autoop = 0:dont auto-op\n");
fprintf(DatFile, "# 1:auto-op\n");
+ fprintf(DatFile, "# security = 0:secure hostmask. No pass required\n");
+ fprintf(DatFile, "# 1:insecure hostmask. Require AUTH command before granting privlidges.\n");
fprintf(DatFile, "# info = The bot will say this in the chan when you join\n");
fprintf(DatFile, "#\n");
***************
*** 342,345 ****
--- 357,381 ----
}
+ void AddChanResponder(CHAN_list *ChanPtr, char *name, char *expect, char *send)
+ {
+ RESPONDER_list *rptr;
+
+ rptr = malloc(sizeof(*rptr));
+ if(!rptr)
+ {
+ Debug(DBGERROR, "Out of ram adding responder");
+ return;
+ }
+ rptr->name = malloc(sizeof(name) + 1);
+ rptr->expect = malloc(sizeof(expect) + 1);
+ rptr->send = malloc(sizeof(send) + 1);
+ strcpy(rptr->name, name);
+ strcpy(rptr->expect, expect);
+ strcpy(rptr->send, send);
+
+ rptr->next = ChanPtr->Responder;
+ ChanPtr->Responder = rptr;
+ }
+
void AddRegChan(char *name)
{
***************
*** 364,367 ****
--- 400,405 ----
ChanPtr->OpList = NULL;
ChanPtr->ShitList = NULL;
+ ChanPtr->Responder = NULL;
+ strcpy(ChanPtr->getop, "*");
for (i = 0; i < NUMOFCHANSETTINGS; i++)
ChanPtr->Settings[i] = Globals->Settings[i];
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** commands.c 2001/07/16 03:50:46 1.13
--- commands.c 2001/07/16 06:54:42 1.14
***************
*** 150,153 ****
--- 150,155 ----
{ "ACCESS", c_access, All, 100, FALSE, TRUE, F},
{ "SET", c_set, ChanCoOwner, 0, FALSE, TRUE, T},
+ { "ADDRESP", c_addresp, ChanCoOwner, 0, FALSE, TRUE, T},
+ { "LISTRESP", c_listresp, ChanCoOwner, 0, FALSE, TRUE, T},
{ "HELP", c_help, All, 100, TRUE, TRUE, F},
{ "8BALL", c_8ball, Peon, 100, FALSE, TRUE, F},
***************
*** 214,218 ****
{ "CLVL", c_clvl, ChanHelper, 0, FALSE, TRUE, F},
/* Command function userlvl shitlvl forcedcc cmdch NeedChan*/
! { "SETSECURITY", c_setsecurity, Peon, 0, FALSE, TRUE, F},
{ "CKSC", c_clrksc, BotCoOwner, 0, FALSE, TRUE, F},
{ "AKSC", c_addksc, BotCoOwner, 0, FALSE, TRUE, F},
--- 216,220 ----
{ "CLVL", c_clvl, ChanHelper, 0, FALSE, TRUE, F},
/* Command function userlvl shitlvl forcedcc cmdch NeedChan*/
! { "SETSECURITY", c_setsecurity, Peon, 0, FALSE, TRUE, T},
{ "CKSC", c_clrksc, BotCoOwner, 0, FALSE, TRUE, F},
{ "AKSC", c_addksc, BotCoOwner, 0, FALSE, TRUE, F},
***************
*** 1827,1830 ****
--- 1829,1877 ----
prot_action(from, username(nick), channel);
}
+ }
+
+ // show the responder list for givin chan.
+ void c_listresp(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr)
+ {
+ char *name;
+ RESPONDER_list *rptr;
+
+ name = strtok(rest, " ");
+ send_to_user(from, "=--\002Name\002---=-----Expect/Send---------=");
+ for(rptr=ChanPtr->Responder;rptr;rptr = rptr->next)
+ {
+ if(name)
+ {
+ if(matches(rptr->name, name))
+ {
+ continue; /* Skip */
+ }
+ }
+ send_to_user(from, "%10s - Expect: %s", rptr->name, rptr->expect);
+ send_to_user(from, "%10s - Send: %s", rptr->name, rptr->send);
+ }
+ send_to_user(from, "=------- End of Responder list ---------=");
+ }
+
+ // Adds a responder to the list.
+ void c_addresp(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr)
+ {
+ char *name;
+ char *expect;
+ char *send;
+
+ name = strtok(rest, " ");
+ expect = strtok(NULL, ":");
+ send = strtok(NULL, "\0");
+
+ if(!(name && expect && send))
+ {
+ send_to_user(from, "Syntax: ADDRESP <name> <expect>:<send>");
+ send_to_user(from, "Special strings: $C=Channel $N=nick");
+ return;
+ }
+ AddChanResponder(ChanPtr, name, expect, send);
+ send_to_user(from, "Added Responder %s as: Expect[%s] Send[%s].", name, expect, send);
+ SaveDatFile(ChanPtr);
}
Index: commands.h
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** commands.h 2001/05/09 21:17:38 1.7
--- commands.h 2001/07/16 06:54:42 1.8
***************
*** 12,15 ****
--- 12,17 ----
void on_quit(char *from);
void on_kick(char *from, char *channel, char *nick, char *reason);
+ void c_addresp(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
+ void c_listresp(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
void c_set(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
void c_levels(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr);
Index: config.h
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/config.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** config.h 2001/07/16 03:50:46 1.6
--- config.h 2001/07/16 06:54:42 1.7
***************
*** 316,323 ****
int Settings[NUMOFCHANSETTINGS]; /* Integer settings. Defined below */
struct ListType *spylist; /* Who's spying on this channel */
struct CHAN_struct *next; /* ptr to next channel */
} CHAN_list;
! CHAN_list *Globals;
/* These are all the settings the rockbot can do... */
--- 316,333 ----
int Settings[NUMOFCHANSETTINGS]; /* Integer settings. Defined below */
struct ListType *spylist; /* Who's spying on this channel */
+ struct RESPONDER_struct *Responder; /* List of expect/send pairs */
struct CHAN_struct *next; /* ptr to next channel */
} CHAN_list;
! typedef struct RESPONDER_struct
! {
! char *name; /* Some short identifier */
! char *expect; /* The match() string to look for */
! char *send; /* The string to send. */
! struct RESPONDER_struct *next;
! } RESPONDER_list;
!
!
! extern CHAN_list *Globals;
/* These are all the settings the rockbot can do... */
Index: main.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/main.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** main.c 2001/04/17 12:08:28 1.5
--- main.c 2001/07/16 06:54:42 1.6
***************
*** 57,60 ****
--- 57,63 ----
struct FloodStruct *FloodList;
+ RESPONDER_list *ResponderList;
+ CHAN_list *Globals;
+
char cmdchar = '!';
char nickname[255] = "Default";
***************
*** 211,239 ****
continue;
}
- /*
- ***
- * We get this from cmdline now dont we?
- ***
- * else if (!strcmp(StrBuffr, "BOTDIR"))
- * {
- * sscanf(ConfLine, "BOTDIR %s", StrBuffr);
- * strcpy(bot_dir, StrBuffr);
- * printf("Home Directory: %s\n", bot_dir);
- * continue;
- * }
- */
- /*
- else if (!strcmp(StrBuffr, "UPDIR"))
- {
- sscanf(ConfLine, "UPDIR %s", StrBuffr);
- strcpy(upload_dir, StrBuffr);
- continue;
- }
- */
else if (!strcmp(StrBuffr, "DOWNDIR"))
{
sscanf(ConfLine, "DOWNDIR %s", StrBuffr);
strcpy(download_dir, StrBuffr);
- // strcat(download_dir, "/");
sprintf(filelistfile, "%s/%s", download_dir, FILELISTFILE);
continue;
--- 214,221 ----
***************
*** 313,316 ****
--- 295,309 ----
strcpy(ChanPtr->getop, StrBuffr);
}
+ else if (!strcmp(StrBuffr, "RESPONDER"))
+ {
+ char rname[MAXLEN], rexpect[MAXLEN], rsend[MAXLEN];
+ s = sscanf(ConfLine, "RESPONDER %s %[^:]:%[^\n]", rname, rexpect, rsend);
+ if(s < 3)
+ {
+ printf("Syntax error in %s line %d. Only %d words read.\n", ChanPtr->datfile, linenum, s);
+ exit(1);
+ }
+ AddChanResponder(ChanPtr, rname, rexpect, rsend);
+ }
else if (!strcmp(StrBuffr, "ENFMODES"))
{
***************
*** 457,460 ****
--- 450,456 ----
AuthList = NULL;
+
+ ResponderList = NULL;
+
}
|
|
From: <roc...@li...> - 2001-07-16 03:50:52
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv8062/source
Modified Files:
channel.c commands.c config.h function.c userlist.c
Log Message:
Modified AUTH to be usable even if your host doesnt match, and in that case it adds your current host (as insecure) to your list of hosts. Added alias "Login"
to do the same as auth (for compatability with x2).
Made it so that if a command requires a channel but is done in private message, the Globals channel is assumed (rather than making you /msg the bot with a command charactor, as before. In channel commands can still refernce teh global list by using two command charactors.
Index: channel.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/channel.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** channel.c 2001/05/11 23:04:40 1.4
--- channel.c 2001/07/16 03:50:46 1.5
***************
*** 137,141 ****
fprintf(DatFile, "# info = The bot will say this in the chan when you join\n");
fprintf(DatFile, "#\n");
! fprintf(DatFile, "# Syntax: USER <hostmask> <handle> <pass> <userlevel> <protectlevel> <autoop> <announce info line>\n");
fprintf(DatFile, "# HOST <additional hostmask>\n");
for(OpPtr=ChanPtr->OpList;OpPtr;OpPtr=OpPtr->next)
--- 137,141 ----
fprintf(DatFile, "# info = The bot will say this in the chan when you join\n");
fprintf(DatFile, "#\n");
! fprintf(DatFile, "# Syntax: USER <hostmask> <handle> <pass> <userlevel> <protectlevel> <autoop> <security> <announce info line>\n");
fprintf(DatFile, "# HOST <additional hostmask>\n");
for(OpPtr=ChanPtr->OpList;OpPtr;OpPtr=OpPtr->next)
***************
*** 143,147 ****
fprintf(DatFile, "USER %s %s %s %d %d %d %d %s\n",
OpPtr->userhosts->userhost, OpPtr->handle, OpPtr->password, OpPtr->level, OpPtr->protlevel,
! OpPtr->isaop, OpPtr->security, OpPtr->info);
if(OpPtr->userhosts->next)
{
--- 143,147 ----
fprintf(DatFile, "USER %s %s %s %d %d %d %d %s\n",
OpPtr->userhosts->userhost, OpPtr->handle, OpPtr->password, OpPtr->level, OpPtr->protlevel,
! OpPtr->isaop, OpPtr->userhosts->security, OpPtr->info);
if(OpPtr->userhosts->next)
{
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** commands.c 2001/07/15 08:11:34 1.12
--- commands.c 2001/07/16 03:50:46 1.13
***************
*** 144,147 ****
--- 144,148 ----
{
{ "AUTH", c_auth, All, 0, FALSE, TRUE, T},
+ { "LOGIN", c_auth, All, 0, FALSE, TRUE, T},
{ "AUTHLIST", c_authlist, BotOwner, 0, TRUE, TRUE, F},
{ "HELLO", c_noop, All, 0, FALSE, TRUE, F},
***************
*** 1443,1447 ****
if (locked == TRUE)
! { /* If the bot is locked, and the command is NOT 'unlock', return without doing anything. */
if ((strcasecmp(command, "unlock") != 0) && (strcasecmp(command + 1, "unlock") != 0))
return;
--- 1444,1448 ----
if (locked == TRUE)
! { /* If the bot is locked, and the command is NOT 'unlock', return without doing anything. */
if ((strcasecmp(command, "unlock") != 0) && (strcasecmp(command + 1, "unlock") != 0))
return;
***************
*** 1479,1484 ****
if (!channel || !(*channel))
{
! send_to_user(from, "\002What channel?\002");
! return;
}
if (!ChanPtr)
--- 1480,1487 ----
if (!channel || !(*channel))
{
! // send_to_user(from, "\002What channel?\002");
! // return;
! ChanPtr = Globals;
! channel = "Globals";
}
if (!ChanPtr)
***************
*** 1542,1545 ****
--- 1545,1550 ----
else /* Use channel provided */
{
+ if(!isalnum(msg[1]))
+ return; // ignore ppls ramblings not intended for us
channel = to;
command = strtok(&msg[1], " ");
***************
*** 1986,2007 ****
return;
}
! UsrPtr = find_user(from, ChanPtr);
! if(!UsrPtr)
! UsrPtr = find_user(from, Globals);
if(!UsrPtr)
{
! send_to_user(from, "You don't seem to have %s access, sir. Password authorization failed.",
! ChanPtr->name);
return;
}
if(strcmp(UsrPtr->password, password))
{
! send_to_user(from, "Password for %s does NOT match sir. Password authorization failed.", ChanPtr->name);
return;
}
! else /* Add to the authlist */
{
AuthStruct AuthPtr;
extern AuthStruct AuthList;
send_to_user(from, "Access granted. Hello %s.", UsrPtr->handle);
--- 1991,2017 ----
return;
}
! UsrPtr = FindOpByHandle(ChanPtr, handle);
if(!UsrPtr)
{
! send_to_user(from, "%s Login incorrect: Username not found.", ChanPtr->name);
return;
}
if(strcmp(UsrPtr->password, password))
{
! send_to_user(from, "%s Login incorrect: Wrong password.", ChanPtr->name);
return;
}
! else /* Add to the authlist & add host if missing */
{
AuthStruct AuthPtr;
extern AuthStruct AuthList;
+ char *userhost;
+ if(!find_user(from, ChanPtr))
+ {
+ userhost = cluster(from);
+ AddChanListAdditionalHost(ChanPtr, UsrPtr, userhost, INSECURE);
+ send_to_user(from, "\002Added hostmask %s to your %s account as insecure.\002", userhost, ChanPtr->name);
+ SaveDatFile(ChanPtr);
+ }
send_to_user(from, "Access granted. Hello %s.", UsrPtr->handle);
***************
*** 3066,3070 ****
if(level < 1 || level > 100)
{
! send_to_user(from, "\002Incorrect <level> paramiter. Must be a number between 1 and 100 inclusive.\002");
return;
}
--- 3076,3080 ----
if(level < 1 || level > 100)
{
! send_to_user(from, "\002Incorrect <level> paramiter. Must be a number between 1 and 100 inclusive, Or one of the following: BotOwner, BotCoOwner, ChanOwner, ChanCoOwner, ChanHelper, ChanOp or Peon\002");
return;
}
***************
*** 3775,3778 ****
--- 3785,3789 ----
send_to_user(from, "No level spesified.");
send_to_user(from, "\002Usage: SETSECURITY [hostmask] <SECURE/INSECURE>\002");
+ return;
}
if(!level)
Index: config.h
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/config.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** config.h 2001/04/18 07:34:48 1.5
--- config.h 2001/07/16 03:50:46 1.6
***************
*** 9,13 ****
#define VERSION "PIRCH:MS Windows/WIN95:Beta Version 0.76: 96.04.05 c191452"
*/
! #define VERSION "RockBot 6 (Dev version) [build 203]"
/* Some basic data file names */
--- 9,13 ----
#define VERSION "PIRCH:MS Windows/WIN95:Beta Version 0.76: 96.04.05 c191452"
*/
! #define VERSION "RockBot 6 (Dev version) [build 204]"
/* Some basic data file names */
***************
*** 243,246 ****
--- 243,247 ----
*/
#define SECURE 0
+ #define INSECURE 1
#define AUTHORIZED 1
#define UNAUTHORIZED 2
Index: function.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/function.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** function.c 2001/04/17 12:08:28 1.2
--- function.c 2001/07/16 03:50:46 1.3
***************
*** 176,189 ****
--- 176,205 ----
else if(!strcasecmp("BotCoOwner", s))
return(BotCoOwner);
+
else if(!strcasecmp("ChanOwner", s))
return(ChanOwner);
+ else if(!strcasecmp("Owner", s))
+ return(ChanOwner);
+
else if(!strcasecmp("ChanCoOwner", s))
return(ChanCoOwner);
+ else if(!strcasecmp("CoOwner", s))
+ return(ChanCoOwner);
+
else if(!strcasecmp("ChanHelper", s))
return(ChanHelper);
+ else if(!strcasecmp("Helper", s))
+ return(ChanHelper);
+
else if(!strcasecmp("ChanOp", s))
return(ChanOp);
+ else if(!strcasecmp("OP", s))
+ return(ChanOp);
+
+ else if(!strcasecmp("ChanPeon", s))
+ return(Peon);
else if(!strcasecmp("Peon", s))
return(Peon);
+
else return(-1);
}
Index: userlist.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/userlist.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** userlist.c 2001/04/17 12:08:28 1.2
--- userlist.c 2001/07/16 03:50:46 1.3
***************
*** 418,424 ****
}
dummy->num++;
! if (dummy->num >= 9)
{
! if (dummy->num == 10)
{
if(userlevel(userhost, Globals) < BotCoOwner)
--- 418,424 ----
}
dummy->num++;
! if (dummy->num >= 15)
{
! if (dummy->num == 20)
{
if(userlevel(userhost, Globals) < BotCoOwner)
|
|
From: <roc...@li...> - 2001-07-15 08:11:39
|
Update of /cvsroot/rockbot/RockBot In directory usw-pr-cvs1:/tmp/cvs-serv32577 Modified Files: configure configure.in Log Message: heh.. not sure.. dont remember making changes.. Index: configure =================================================================== RCS file: /cvsroot/rockbot/RockBot/configure,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** configure 2001/04/17 12:36:06 1.1 --- configure 2001/07/15 08:11:34 1.2 *************** *** 12,16 **** ac_default_prefix=/usr/local # Any additions from configure.in: ! ac_default_prefix=. # Initialize some variables set by options. --- 12,16 ---- ac_default_prefix=/usr/local # Any additions from configure.in: ! ac_default_prefix=.. # Initialize some variables set by options. Index: configure.in =================================================================== RCS file: /cvsroot/rockbot/RockBot/configure.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** configure.in 2001/04/17 12:36:06 1.1 --- configure.in 2001/07/15 08:11:34 1.2 *************** *** 2,6 **** AC_INIT(source/rockbot.c) AC_CONFIG_HEADER(source/setup.h) ! AC_PREFIX_DEFAULT(.) dnl Checks for programs. --- 2,6 ---- AC_INIT(source/rockbot.c) AC_CONFIG_HEADER(source/setup.h) ! AC_PREFIX_DEFAULT(..) dnl Checks for programs. |
|
From: <roc...@li...> - 2001-07-15 08:11:38
|
Update of /cvsroot/rockbot/RockBot/source
In directory usw-pr-cvs1:/tmp/cvs-serv32577/source
Modified Files:
commands.c match.c
Log Message:
heh.. not sure.. dont remember making changes..
Index: commands.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/commands.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** commands.c 2001/05/11 23:04:40 1.11
--- commands.c 2001/07/15 08:11:34 1.12
***************
*** 4175,4189 ****
void c_test1(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr)
{
! send_command(40, "PRIVMSG %s :40", getnick(from));
! send_command(30, "PRIVMSG %s :30", getnick(from));
! send_command(10, "PRIVMSG %s :10", getnick(from));
! send_command(90, "PRIVMSG %s :90", getnick(from));
! send_command(40, "PRIVMSG %s :40", getnick(from));
! send_command(41, "PRIVMSG %s :40", getnick(from));
! send_command(32, "PRIVMSG %s :30", getnick(from));
! send_command(13, "PRIVMSG %s :10", getnick(from));
! send_command(94, "PRIVMSG %s :90", getnick(from));
! send_command(45, "PRIVMSG %s :40", getnick(from));
}
--- 4175,4196 ----
void c_test1(char *from, char *channel, char *rest, char *to, CHAN_list *ChanPtr)
{
! char *ban1, *ban2;
+ ban1 = (char *) strtok(rest, " ");
+ ban2 = (char *) strtok(rest, " ");
+
+ if(!ban2)
+ {
+ send_to_user(from, "USAGE: test1 ban1 ban2");
+ return;
+ }
+ if(bancmp(ban1, ban2))
+ {
+ send_to_user(from, "%s does not match %s.", ban1, ban2);
+ }
+ else
+ {
+ send_to_user(from, "%s matches %s.", ban1, ban2);
+ }
}
Index: match.c
===================================================================
RCS file: /cvsroot/rockbot/RockBot/source/match.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** match.c 2001/04/17 12:08:28 1.2
--- match.c 2001/07/15 08:11:34 1.3
***************
*** 195,199 ****
int bancmp(char *temp, char *temp2)
{
! return bancmp2(temp, temp2);
}
--- 195,199 ----
int bancmp(char *temp, char *temp2)
{
! return bancmp3(temp, temp2);
}
|
|
From: <roc...@li...> - 2001-07-10 01:44:40
|
Update of /cvsroot/rockbot/RockBot/source In directory usw-pr-cvs1:/tmp/cvs-serv29918/source Modified Files: Makefile.in Log Message: Fixed bug in source/Makefile.in that was breaking make when run without a prefix setup in ./configure Index: Makefile.in =================================================================== RCS file: /cvsroot/rockbot/RockBot/source/Makefile.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Makefile.in 2001/05/11 23:04:40 1.3 --- Makefile.in 2001/07/10 01:44:35 1.4 *************** *** 22,26 **** DEFINES = ! INSTALL_DIR = $(prefix) INSTALL_NAME = RockBot --- 22,26 ---- DEFINES = ! INSTALL_DIR = .. INSTALL_NAME = RockBot |