home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
PRE412.ZIP
/
ELRIC3.MOD
< prev
next >
Wrap
Text File
|
1990-04-21
|
22KB
|
636 lines
The new and improved FROM mod collection.
by
Lord Elric 1@8251
With code borrowed from
MrBill 1@7300
The Black Dragon 1@2380
Well, this is a rather extensive modification here. Before you start, let me
warn you that it will take a while. It will also involve changing the format
of your user list. To simplify this, there is a program written by The Black
Dragon for which I am forever in debt. No way did I want to re-enter the
whole bloody user list. Well, anyway, let's get right down to it.
INFORMATION: I did this with Turbo C 2.0 and WWIV v4.10. I don't know if it
works on earlier versions, because I don't have them. I have no idea if it
will work on later version, because I haven't seen them yet. All I do know is
that it works with what I have.
============================================================================
0. (step 0 beacuse I added this later.....)
Before you do anything else, this is such a great idea whenver you mod...
get in the directory where you keep your source, and do this...
PKZIP source *.c *.h
(or LHARC, or PKARC, or PAK, or whatever. but put all your current source
code in an archive so if you get halway done here, and then decide to
quit, you can just unarc/unzip it, and be right back where you started....
it really helps if you put in a mod that for some reason just won't quite
work, and then you have to take it back out one piece at a time......
============================================================================
1. First, copy VARDEC.H to a file called OLD.H. Rename the user record
structure (the first one in the file) to olduserrec. Delete everything
that comes after it. For example, here's what mine looks like now.
/* DATA FOR EVERY USER */
typedef struct {
char name[31], /* user's name */
realname[21], /* user's real name */
callsign[7], /* user's amateur callsign */
phone[13], /* user's phone number */
pw[9], /* user's password */
laston[9], /* last date on */
firston[9], /* first date on */
note[41], /* sysop's note about user */
macros[3][81], /* macro keys */
sex; /* user's sex */
unsigned char age, /* user's age */
inact, /* if deleted or inactive */
comp_type, /* computer type */
/* a bunch more stuff in here.........*/
unsigned int emailnet, /* email sent into net */
postnet; /* posts sent into net */
unsigned short fsenttoday1; /* feedbacks today */
unsigned char num_extended; /* num lines of ext desc */
char res[34]; /* reserved bytes */
} olduserrec;
Right there at the end is where you make the change, and then nuke
everything below it. You can keep the copywrite stuff in at the top, I just
took it out to make this file shorter.....
/** note, the number of reserved bytes will change in 4.11 **/
===========================================================================
2. You should still have an unmodified version of Vardec.H. Load this up now,
and make the following changes...
(This is a part of MrBill's original mod)
/* search for this */ macros[3][81], /* macro keys */
street[31], /* add this */
citystate[31], /* add this */
zip[6], /* add this */
sex; /* user's sex */
Make sure you put this in the first section, the char section. If not, you
will be screwed.
===========================================================================
3. Load up FCNS.H
add these procedures where ever you like, here's how I did it...
void input_name(); /* search for */
void input_realname();
void input_street(); /* add this */
void input_citystate(); /* add this */
void input_zip(); /* add this */
void input_callsign();
void input_phone();
==========================================================================
4. Now load up NewUser.C
(more from MrBill)
Add these procedures somewhere near the top, in the section of void
input_blah...() procedures. I put it right after void input_name myself.
void input_street()
{
do {
nl();
pl("Enter your street address.");
outstr(":");
inputl(thisuser.street,30);
if (thisuser.street[0]==0) {
nl();
pl("I'm sorry, you must enter your street address.");
}
} while ((thisuser.street[0]==0) && (!hangup));
}
void input_citystate()
{
do {
nl();
pl("Enter your city and state (i.e Manassas, Va)");
outstr(":");
inputl(thisuser.citystate,30);
if (thisuser.citystate[0]==0) {
nl();
pl("I'm sorry, you must enter your city and state in the correct form.")
}
} while ((thisuser.citystate[0]==0) && (!hangup));
}
void input_zip()
{
do {
nl();
pl("Enter you 5 digit zipcode.");
outstr(":");
inputl(thisuser.zip,5);
if (thisuser.zip[0]==0) {
nl();
pl("I'm sorry, you must enter your zipcode.");
}
} while ((thisuser.zip[0]==0) && (!hangup));
}
============================================================================
5. Still in Newuser.C, scan down to the procedure void newuser.
Go down a page or two, and add these lines....
(MrBill's stuff here too...)
input_name();
input_realname();
input_street(); /* add */
input_citystate(); /* add */
input_zip(); /* add */
input_phone();
input_pw(); /* add this to get rid of the random pw */
input_sex();
input_age(&thisuser);
input_comptype();
input_screensize();
============================================================================
6. Still in Newuser.C, still in Newuser, go down a little further and
add this so they can edit these if they make a mistake.
(still MrBill)
print("9. Password : ",thisuser.pw,""); /* search for this */
nl(); /* add */
prt(0,"------> Please use UPPER and lower case <-----"); /* add */
nl(); nl(); /* add */
print("A. Address : ",thisuser.street,""); /* add */
print("B. City, State : ",thisuser.citystate,""); /* add */
print("C. Zipcode : ",thisuser.zip,"");
pl("Q. No changes.");
nl();
nl();
prt(2,"Which (1-9,A,B,C,Q) : "); /* change */
ch=onek("QABC123456789"); /* change */
ok=0;
switch(ch) {
case 'Q': ok=1; break;
case '1': input_name(); break;
case '2': input_realname(); break;
case '3': input_callsign(); break;
case '4': input_phone(); break;
case '5': input_sex(); break;
case '6': input_age(&thisuser); break;
case '7': input_comptype(); break;
case '8': input_screensize(); break;
case '9': input_pw(); break;
case 'A': input_street(); break; /* add */
case 'B': input_citystate(); break; /* add */
case 'C': input_zip(); break; /* add */
}
} while ((!ok) && (!hangup));
=============================================================================
7. Now, save NEWUSER.C. Load up SYSOPF.C, and make these changes to the
end of void print_data() so you can see the new stuff from UEDIT.
(an oversight by MrBill...I'm sure he meant to put this in....)
print("Rest: ",&s2,""); /* search for this */
print("Address : ",(u->street),""); /* add */
print("City/State : ",(u->citystate),""); /* add */
print("Zipcode : ",(u->zip),""); /* add */
}
=============================================================================
8. Now, drop down a few lines, and make these changes to the end of
void print_short() so you can see the new stuff in UEDIT.
(more by MrBill)
print("Rest: ",&s2,""); /* search for this */
print("Address : ",(u->street),""); /* add */
print("City/State : ",(u->citystate),""); /* add */
print("Zipcode : ",(u->zip),""); /* add */
}
==============================================================================
9. It gets even more fun now kiddies.....some of my stuff finally
Still in SYSOPF.C, search down to void uedit(). Now we get to make a bunch of
changes.....
First, in the char declarations, add the char variable ch2, so you should have
something that looks like this......
void uedit(int usern, int other)
{
char s[81],s1[81],s2[81],ch,ch1,ch2;
int i,i1,i2,i3,un,done,nu,done1,full,temp_full,tempu;
userrec u;
============================================================================
10. Now, we stay in void subedit for quite some time now.
drop down a few lines, and make a few more changes here......
(more by some unknown soul by way of MrBill)
prt(2,"Uedit : ");
if ((realsl==255) || (wfc))
ch=onek("%Q[]{}/,.?UDRNLCPOGMSTEYZAI~:"); /* add the % */
else
ch=onek("%Q[]{}/,.?UDRNLCPOGMSTEYZAI"); /* add the % */
switch(ch) {
case '%': /*add this thing so you can edit */
nl();
prt(2,"New Street Adress? ");
inputl(s,30);
if (s[0]) {
dsr(u.street);
strcpy(u.street,s);
isr(un,u.street);
write_user(un,&u);
}
prt(2,"New City, State? ");
inputl(s1,30);
if (s1[0]) {
dsr(u.citystate);
strcpy(u.citystate,s1);
isr(un,u.citystate);
write_user(un,&u);
}
prt(2,"New Zip? ");
inputl(s2,5);
if (s2[0]) {
dsr(u.zip);
strcpy(u.zip,s2);
isr(un,u.zip);
write_user(un,&u);
}
break; /* add down to here */
case 'Q': /* original code */
done=1;
done1=1;
break;
=========================================================================
11. We aren't out of the woods, or this procedure, yet. One more change to
make to it.
(and it's all mine!)
Down near the bottom...look for case ':'.....
Erase what it has, and make it look like this....(I erased it before I thought
to cut it out and save it so I could show you exactly what to take out, but
hey, you got this far, can't quit now....He He :)
Just make sure all the braces are in the right place at the bottom when you
are done......
What this does is give you a way to zero out things, so they have to re-enter
it at logon. The birthday one was already there. Also, I added one so I
could get them to enter their full real name,
not just their first real name....
If you have already added this mod from the file ELRIC2.ZIP/ELRIC2.MOD, then
your have a good headstart here.....
u.ass_pts=0;
write_user(un,&u);
break;
case ':': /* replace this whole case...*/
do {
nl();
pl("Zap info....");
pl("1. Realname"); /* I had this in from a previous mod */
pl("2. Birthday"); /* you can take it out if you want,and */
pl("3. Street address"); /* re-number all of it 1,2,3,4....*/
pl("4. City and State");
pl("5. Zip Code");
pl("Q. quit");
ch2=onek("Q12345");
switch(ch2) {
case '1':u.realname[0]=0; /* once again, from the previous */
write_user(un,&u); /* mod I did in Elric2.ZIP */
break;
case '2':u.year=0;
write_user(un,&u);
break;
case '3':u.street[0]=0;
write_user(un,&u);
break;
case '4':u.citystate[0]=0;
write_user(un,&u);
break;
case '5':u.zip[0]=0;
write_user(un,&u);
break;
}
}while ((!hangup) && (ch2!='Q'));
} /* replace down to here somewhere...*/
} while ((!done1) && (!hangup));
} while ((!done) && (!hangup));
close_user();
==============================================================================
12. Go grab a beer, and take a break. Then, come back here and finish this
up, only a few more steps to go...
Now you need to load up BBSUTL.C, and scan down to void logon....
Add these lines to add the city and state to the log of the day....
(MrBill's)
sprintf(s,"%ld: %s %s %s %s - %d",
status.callernum1,
nam(&thisuser,usernum),
times(),
date(),
curspeed,
thisuser.ontoday);
strcat(s," ["); /* add me...*/
strcat(s,thisuser.citystate); /* add me too....*/
strcat(s,"] "); /* and me */
strcpy(s2,syscfg.gfilesdir);
strcat(s2,"LASTON.TXT");
and down just a few more lines, to get it in both log files....
sl1(1,"");
sprintf(s,"%ld: %s %s - %d",
status.callernum1,
nam(&thisuser,usernum),
curspeed,
thisuser.ontoday);
strcat(s," ["); /* add me...*/
strcat(s,thisuser.citystate); /* add me too....*/
strcat(s,"] "); /* and me */
strcpy(s1,syscfg.gfilesdir);
strcat(s1,"USER.LOG");
f=open(s1,O_RDWR | O_BINARY | O_CREAT, S_IREAD | S_IWRITE);
lseek(f,0L,SEEK_END);
=======================================================================
13. Now, still in void logon, add these lines so they have to re-enter what
you have zapped out, or, if they are an old user, the file conversion
routine will take care of zapping them for you. Either way, this lets them
enter it if they don't have an address. I have included the routine to get
their name, so if you added that in back up in step 11, you need to keep it
in here. If you alread added my ELRIC2.MOD, then you already have it there....
(all mine, by the way....)
pl("Please enter the following information:"); /* Here is where they*/
do { /* get to enter a new birthday...*/
nl();
input_age(&thisuser);
sprintf(s,"%02d/%02d/%02d",(int) thisuser.month,
(int) thisuser.day,
(int) thisuser.year);
nl();
prompt("Birthdate: ",s,". Correct? ","");
if (!yn())
thisuser.year=0;
} while ((!hangup) && (thisuser.year==0));
topscreen();
nl();
}
/* Add from here down till I tell you to stop............*/
if (thisuser.street[0]==0){
do {
nl();
pl("I seem to have lost part of your address.....");
input_street();
nl();
pl("Did you get that entered correctly? (Y/N)");
if (!yn())
thisuser.street[0]=0;
} while ((!hangup) && (thisuser.street[0]==0));
pl("Thank you for doing that for me");
}
if (thisuser.citystate[0]==0){
do {
nl();
pl("I seem to have lost part of your address.....");
input_citystate();
nl();
pl("Did you get that entered correctly? (Y/N)");
if (!yn())
thisuser.citystate[0]=0;
} while ((!hangup) && (thisuser.citystate[0]==0));
pl("Thank you for doing that for me");
}
if (thisuser.zip[0]==0){
do {
nl();
pl("I seem to have lost part of your address.....");
input_zip();
nl();
pl("Did you get that entered correctly? (Y/N)");
if (!yn())
thisuser.zip[0]=0;
} while ((!hangup) && (thisuser.zip[0]==0));
pl("Thank you for doing that for me");
}
/* If you already added the ELRIC2 real name mod, you don't need this. If
you added the zap real name from step 11, you do need this part.....*/
if (thisuser.realname[0]==0){
do {
nl();
pl("I seem to have lost part of your file.....");
input_realname();
nl();
pl("Did you get that entered correctly? (Y/N)");
if (!yn())
thisuser.realname[0]=0;
} while ((!hangup) && (thisuser.realname[0]==0));
pl("Thank you for telling me that!");
}
/* original code follows here........ */
rsm(usernum,&thisuser);
if (thisuser.waiting) {
prt(5,"Read your mail now? ");
if (yn())
readmail();
}
==========================================================================
13. The end is in sight now....but don't you hate the thought of getting the
next version.......
Load up BBSUTL1. This is just another optional step, you may skip it if you
like....
In void list_users, add this, so when they do a user list it tells
where they are from....
if ((s.ar!=0) && ((u.ar & s.ar)==0))
ok=0;
if (ok) {
ansic(2); /* add this line */
pla(nam(&u,smallist[i].number),&abort); /* search for this.. */
ansic(3); /* add me */
pla(u.citystate,&abort); /* add me */
++num;
}
}
=========================================================================
14. Now, save all this, and compile your BBS. Go make a bunch of sandwiches,
you are going to be waiting for a long time, because everything get's to
recompile......
When you get all the bugs worked out, and I know you made a typo somewhere,
copy this BBS.EXE to your main BBS dir, but
DO NOT RUN IT YET!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=========================================================================
15. You have to convert over all the user records to the new format.
Fortunatly, The Black Dragon wrote a little program to do that for us, so why
don't you use it. It is in this package, called CONVERT.C
Compile it to an executable program (you will probably have to remove BBS.PRJ
from the project file option, to get it to compile easily.)
(While you are compiling convert.c, why dont you go ahead and compile
return.c, just nuke the project file, load convert, compile it, then
load return, and compile it.)
===========================================================================
16. Now that CONVERT.C is compiled, Load up DISPLAY.C.
Compile it and run it (Ctrl-F9). It will display three numbers, the user
record size, the mail waiting offset, and the inactive offset. Write those
down right here on the printout...
User Record Size ____________
Mail Waiting ____________
Inactive ____________
=============================================================================
17. Now drop back to DOS.
Change to your data dir. Make a backup copy of your user list somewhere, just
in case you decide to screw it all and go back.
Then, do this.
RENAME USER.LST USER2.LST /* change name of user list */
CONVERT USER2.LST USER.LST
Now it will scan through the user list and change it to the new format.
18. Almost there. If you are not in the network, you may skip this step,
provided that if you ever do join, you promise to come back and do it.
Otherwise, WWIVNet WILL SCREW your files beyond your wildest dreams...
You should have received a program with the network files called NETINIT.
Run this program. You will be prompted for the numbers you wrote down back in
step 16. Please enter them here.
=============================================================================
That's it, you are indeed done. Test it out, make sure it works...
Possible problem sources.
-------------------------------
1. It seems obvious, but go back step by step, making sure you did
everything exactly as it is written.
2. Make sure you ran DISPLAY.C and NETINIT. Run NETINIT again, to make sure
the numbers have changed.
3. If you have any other mods which modified the user record, make sure you
copy those values over in CONVERT.C.
For example, if you had added an integer, longint, or real, then do this...
new.addition=old.addition;
If you added a string, say newstring[40], then you have to use strcpy....
strcpy(new.newstring,old.newstring);
If you added an array, you have to do a loop...
for (i=0;i<sizeofarray;i++)
new.stuff[i]=old.stuff[i];
4. Please, Please, Please, Please, Back up everything before you start
changing it. If you are in doubt, back it up. A good place to start is
just to back up the whole drive.
If not, at least back up all the .C files, all the .H files, the file
USER.LST in your data dir, the file SUBS.DAT in your data dir, and
CONFIG.DAT in your main BBS dir.
These files will be changed, so if you have to start over, you can at least
start from where you started, and at least be able to go on like nothing ever
happened.
5. If you are having problems shrinking out, then you probably did not
re-compile shrink.c and return.c. The BEST way to insure this happens
(and to get consistant code quality, I always turn on/off some option I
should not have messed with...) is to use the make file. Its really the only
way to go. shrink.c will only be compiled to an .obj file, but return MUST
be compiled and linked, and return.exe must be moved to the main BBS dir.
/** hey, it's the form info file **/
As usual, I take no responsibility for hard drive crashes, death in the
family, or end of the world as we know it resulting from this mod.
It's your fault if you didn't back up the files before you made the mod.
It's your fault if you don't back up your ENTIRE hard drive AT LEAST once
a month.
It works on my system with Turbo C 2.0, WWIV 4.1, V20/8088, 640K/640EMS.
If you use this, the only payment I ask is that you send me a note through
WWIVLink to 1@18251 saying you are using it...not too much to ask is it?
The Kingdom of Melnibone(LINK/NET)
812-877-3488 24 Hrs a day
3/12/2400/4800/9600/12,000/14,400 baud HST MNP5
Auto-validation of WWIV sysops on first call
Xmodem, Ymodem, DSZ Zmodem with retry, Ymodem-G
WWIV Link 1@18251
WWIV Net 1@8251