Category : BBS Programs+Doors
Archive   : GREEN10.ZIP
Filename : GREEN10.MOD

 
Output of file : GREEN10.MOD contained in archive : GREEN10.ZIP
Agent Green #68 @5800
Thu Aug 20 00:25:21 1992
Mod Name: GREEN10.MOD
Author: Agent Green
Description: Local Regions Modification!
Files: MSGBASE.C, FCNS.H
Version: WWIV 4.20 (It may work on earlier versions)
Difficulty: (scale 1-10: easy-difficult) 3/4 brain required
2 - A kid could do it.
6 - If you haven't learned block-reading yet.

ÍÍ[ Description ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

DISCLAIMER: No promises, no guarantees.

I wrote this mod to make the REGIONS a little more intresting. If you
don't already have MERLIN2.MOD in, then do so. It looks good! This mod
DOES NOT require MERLIN2 to work though. Fortunately, you only have to
modify MSGBASE.C & FCNS.H (isn't life sweet?). An explanation of how to
use this mod follows.

This mod is about a year old now, but in the past, I had some problems
with the mod allocating memory, without de-allocating it. I tried a few
things, one being to add farfree(ss); statements everywhere. Until last
week, I had no clue what to do. Now that I've started programming in C++
again, I can assure you this mod will work. (See disclaimer)

I would like to take the time to thank the following people for their
support now and when the mod first hit the street:

(_)rsan - for calling me and telling me I should work on this mod
after a year of letting it sit.
Leppa - for telling me about the bugs in the first place.
Stardriver - for telling me the bugs kept happening!

ÍÍ[ Modification ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

--- GREEN'S LEGEND ---
/*==*/ Existing Line
/*++*/ Add Line
/*--*/ Remove Line
/*CC*/ Change Line
----------------------


Directions:

1.) Backup your source code. ( A source is a terrible thing to waste. )

2.) Open up MSGBASE.C and comment out or delete void describe_area_code;

3.) Block read the following code into where describe_area code used to be:

/*****[ Block read start ]*************************/

void describe_area_code(int areacode, int towncode, char *description)
{
int f,done=0,i;
char s[81],*ss,*ss1,s1[3];

description[0]=0;
sprintf(s,"%sREGIONS.%d",syscfg.datadir,areacode);
f=open(s,O_RDWR | O_TEXT);
if (f<1) {
sprintf(s,"%sREGIONS.DAT",syscfg.datadir);
f=open(s,O_RDWR | O_TEXT);
if (f<1) {
return;
}
ss=malloca(filelength(f));
i=read(f,ss,filelength(f));
ss[i]=0;
close(f);
ss1=strtok(ss,"\n");
while (ss1 && (!done)) {
i=atoi(ss1);
if (i) {
if (i==areacode)
done=1;
} else
strcpy(description,ss1);
ss1=strtok(NULL,"\n");
}
farfree(ss);
} else {
ss=malloca(filelength(f));
i=read(f,ss,filelength(f));
ss[i]=0;
close(f);
ss1=strtok(ss,"\n");
while (ss1 && (!done)) {
i=atoi(ss1);
if (i) {
if (i==towncode)
done=1;
} else
strcpy(description,ss1);
ss1=strtok(NULL,"\n");
}
farfree(ss);
}

if (!description[0]) {
sprintf(s,"%sREGIONS.DAT",syscfg.datadir);
f=open(s,O_RDWR | O_TEXT);
if (f<1) {
return;
}
ss=malloca(filelength(f));
i=read(f,ss,filelength(f));
ss[i]=0;
close(f);
ss1=strtok(ss,"\n");
while (ss1 && (!done)) {
i=atoi(ss1);
if (i) {
if (i==areacode)
done=1;
} else
strcpy(description,ss1);
ss1=strtok(NULL,"\n");
}
farfree(ss);
}
}
/*****[ Block read finish ]************************/


4.) Goto void setorigin(); and make the following change:

/*==*/ void setorigin(int sysnum, int usernum) /* int usernum 4.20 change */
/*==*/ {
/*CC*/ int i,exc; /* Add exc */
/*CC*/ char s[81],ch,exchange[4]; /* Add exchange[4] */
/*==*/ net_system_list_rec *csne;


5.) Further down in the same void, make the following changes:

/*==*/ else if (csne->other & other_coordinator)
/*==*/ ch='^';
/*==*/ }
/*++*/ exchange[0]=csne->phone[4];
/*++*/ exchange[1]=csne->phone[5];
/*++*/ exchange[2]=csne->phone[6];
/*++*/ exc=atoi(exchange);
/*CC*/ describe_area_code(atoi(csne->phone),exc,s);


6.) Save MSGBASE.C and open up FCNS.H and make the following change:

/*CC*/ void describe_area_code(int areacode, int towncode, char *description);


7.) Recompile the WHOLE bbs!

ÍÍ[ Helpful hints by the jolly Agent Green ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

1.) You really should get off your keyster now and make up a local regions
file. A example is below:

/*****[ Example Start ]****************************/
Leicester, MA
892
Shrewsbury, MA
841
842
845
/*****[ Example finish ]***************************/

ÍÍ[ Conclusion ]ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

This mod is a relatively easy one to use. What it does is it uses the
same format as REGIONS.DAT, except it's for your local exchange number. What
it does is it searches REGIONS.508 (508 may be replaced with your area code)
for your town prefix and if it finds it, it's put into the description. If
no REGIONS file exists for a specific area code, or if the town prefix was
not found, it automatically scans REGIONS.DAT for the area code prefix. This
is a mod that can be used on networked board who want a more specific region
listing the town the BBS is originated (e.g. Local Nets).

As usual, if you hit a trouble spot, I can be located at any of the
following locations:

IceNET: #16@5802 WWIVWeb: #2@15 Prodigy: TJCP62B
PowerGRID: #1@1 WWIVnet: #68@5800

GREEN11.MOD coming when I recieve inspiration!

Agent Green



  3 Responses to “Category : BBS Programs+Doors
Archive   : GREEN10.ZIP
Filename : GREEN10.MOD

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/