06 Mar, 2009, boblinski wrote in the 1st comment:
Votes: 0
Lately.. when i compile it's been saying:

Quote
Thu Mar 5 19:36:41 2009 :: Loaded 0 mobprogs.
Thu Mar 5 19:36:41 :: Loaded 0 mobprogs.
Thu Mar 5 19:36:41 :: Loaded 0 mobprogs.
Thu Mar 5 19:36:41 :: Loaded 0 mobprogs.
Thu Mar 5 19:36:41 :: Loaded 0 mobprogs.


lots and lots, but then it has been compiling alright so I've just left it and carried on as usual.


Today however, I tried removing some areas, and this time I got a bug error and it wouldn't continue to compile.
This is what it said:
Quote
$ ../src/rom 9999
Fri Mar 6 20:41:02 2009 :: Loading configuration settings from ../area/qmconfig
.rc.
Fri Mar 6 20:41:02 2009 :: Set IP address to 0.0.0.0
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: Loaded 0 mobprogs.
Fri Mar 6 20:41:02 2009 :: [*****] BUG: Fread_word: word too long.


please help.

I have completely stock rom areas except for the immort.are which I haven't removed.
06 Mar, 2009, boblinski wrote in the 2nd comment:
Votes: 0
Does anyone have some help? I can't get my mud to boot up :cry:
06 Mar, 2009, David Haley wrote in the 3rd comment:
Votes: 0
I would suggest reverting to a backup of immort.are; investigating why it's failing would be kind of complicated. Did you edit it by hand? If so, at least you know where to look. It looks like a string isn't terminated correctly somewhere.
06 Mar, 2009, boblinski wrote in the 4th comment:
Votes: 0
I've got back to -all- original areas now. Can you help me on what areas I can remove and how?
06 Mar, 2009, David Haley wrote in the 5th comment:
Votes: 0
I don't know the answer to that question, unfortunately, as I'm not familiar with how ROM handles this stuff. That said, simply removing an area shouldn't cause the above error. You'd have to edit an area file for it to file to read a string.
06 Mar, 2009, Skol wrote in the 6th comment:
Votes: 0
You'll want to add 'exlist' code, (Care of Erwin: http://www.andreasen.org/snip.shtml) which shows area exits outside to other areas.
Then, when you want to remove an area, exlist, from inside that area. And remove those exits so the area is no longer trying to be connected to. Then remove the filename from area.lst. Copyover.

limbo.are, immort.are, and a few others are required for some things. midgard etc has like the recall points.
In stock code there's a lot of places the mud will bomb if it doesn't find these things. Check in merc.h for OBJ_VNUM_stuffhere, then make sure you either redefine those into one area, or alter the code that calls them.
06 Mar, 2009, boblinski wrote in the 7th comment:
Votes: 0
- Snippet from Erwin -

How do I just add that to my code?

Do I just save it as a ".c" file and put it in src?
07 Mar, 2009, Skol wrote in the 8th comment:
Votes: 0
It should have detailed instructions on how to install, just make sure to backup your old code first (and areas). As you should whenever making a change like that.
07 Mar, 2009, boblinski wrote in the 9th comment:
Votes: 0
I can't find any details for implementing the snippet anywhere on the website.

Sorry to annoy.
07 Mar, 2009, Skol wrote in the 10th comment:
Votes: 0
Ok, this should get you warm ;).

In interp.c add this into the section with immortal commands:
{"exlist",		do_exlist,	POS_DEAD, L4, LOG_ALWAYS, 1},


In interp.h add this (keep in alphabetical order):
DECLARE_DO_FUN(	do_exlist		); /* Erwin Anderson's Area exit display utility */


In act_wiz.c add this:
/* opposite directions */
const sh_int opposite_dir [6] = { DIR_SOUTH, DIR_WEST, DIR_NORTH, DIR_EAST, DIR_DOWN, DIR_UP };


/* get the 'short' name of an area (e.g. MIDGAARD, MIRROR etc. */
/* assumes that the filename saved in the AREA_DATA struct is something like midgaard.are */
char * area_name (AREA_DATA *pArea)
{
static char buffer[64]; /* short filename */
char *period;

assert (pArea != NULL);

strncpy (buffer, pArea->filename, 64); /* copy the filename */
period = strchr (buffer, '.'); /* find the period (midgaard.are) */
if (period) /* if there was one */
*period = '\0'; /* terminate the string there (midgaard) */

return buffer;
}

typedef enum {exit_from, exit_to, exit_both} exit_status;

/* depending on status print > or < or <> between the 2 rooms */
void room_pair (ROOM_INDEX_DATA* left, ROOM_INDEX_DATA* right, exit_status ex, char *buffer)
{
char *sExit;

switch (ex)
{
default:
sExit = "??"; break; /* invalid usage */
case exit_from:
sExit = "< "; break;
case exit_to:
sExit = " >"; break;
case exit_both:
sExit = "<>"; break;
}

sprintf (buffer, "%5d %-26.26s %s%5d %-26.26s(%-8.8s)\n\r",
left->vnum, left->name,
sExit,
right->vnum, right->name,
area_name(right->area)
);
}

/* for every exit in 'room' which leads to or from pArea but NOT both, print it */
void checkexits (ROOM_INDEX_DATA *room, AREA_DATA *pArea, char* buffer)
{
char buf[MAX_STRING_LENGTH];
int i;
EXIT_DATA *exit;
ROOM_INDEX_DATA *to_room;

strcpy (buffer, "");
for (i = 0; i < 6; i++)
{
exit = room->exit[i];
if (!exit)
continue;
else
to_room = exit->to_room;

if (to_room) /* there is something on the other side */

if ( (room->area == pArea) && (to_room->area != pArea) )
{ /* an exit from our area to another area */
/* check first if it is a two-way exit */

if ( to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->to_room == room )
room_pair (room,to_room,exit_both,buf); /* <> */
else
room_pair (room,to_room,exit_to,buf); /* > */

strcat (buffer, buf);
}
else
if ( (room->area != pArea) && (exit->to_room->area == pArea) )
{ /* an exit from another area to our area */

if (!
(to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->to_room == room )
)
/* two-way exits are handled in the other if */
{
room_pair (to_room,room,exit_from,buf);
strcat (buffer, buf);
}

} /* if room->area */

} /* for */

}

/* for now, no arguments, just list the current area */
void do_exlist (CHAR_DATA *ch, char * argument)
{
AREA_DATA* pArea;
ROOM_INDEX_DATA* room;
int i;
char buffer[MAX_STRING_LENGTH];

pArea = ch->in_room->area; /* this is the area we want info on */
for (i = 0; i < MAX_KEY_HASH; i++) /* room index hash table */
for (room = room_index_hash[i]; room != NULL; room = room->next)
/* run through all the rooms on the MUD */

{
checkexits (room, pArea, buffer);
send_to_char (buffer, ch);
}
}


Again, save everything BEFORE you do this.
Then, make clean/make and copyover. Post any errors and we can fix. Perhaps re-releasing the snip here as a 'instructions added' or such.
07 Mar, 2009, boblinski wrote in the 11th comment:
Votes: 0
Quote
gcc -Wall -O -ggdb -DNOCRYPT -DQMFIXES -c -o obj/act_wiz.o act_wiz.c
act_wiz.c: In function `area_name':
act_wiz.c:4846: warning: implicit declaration of function `assert'
act_wiz.c:4848: error: structure has no member named `filename'
act_wiz.c: In function `checkexits':
act_wiz.c:4898: error: structure has no member named `to_room'
act_wiz.c:4907: error: structure has no member named `to_room'
act_wiz.c:4915: error: structure has no member named `to_room'
act_wiz.c:4920: error: structure has no member named `to_room'
act_wiz.c:4900: warning: suggest explicit braces to avoid ambiguous `else'
make: *** [obj/act_wiz.o] Error 1


4846:	assert (pArea != NULL);

4848: strncpy (buffer, pArea->filename, 64); /* copy the filename */

4898: to_room = exit->to_room;

4907: to_room->exit[opposite_dir[i]]->to_room == room )

4915: if ( (room->area != pArea) && (exit->to_room->area == pArea) )

4920: to_room->exit[opposite_dir[i]]->to_room == room )

4900: if (to_room) /* there is something on the other side */


If this is unclear I'll copy/paste over the source and /*comment the numbers in*/.
07 Mar, 2009, Skol wrote in the 12th comment:
Votes: 0
It looks like you're not including a needed header file, at the top of act_wiz.c copy/paste (in code tags) the included headers and externs.
07 Mar, 2009, boblinski wrote in the 13th comment:
Votes: 0
I'm not sure what you mean exactly.

What are code tags and where do I find them?
07 Mar, 2009, Kober wrote in the 14th comment:
Votes: 0
add #include <assert.h> at the top by the rest of the #includes

change 
to_room = exit->to_room;

to
to_room = exit->u1.to_room;

change
to_room->exit[opposite_dir[i]]->to_room == room )

to
to_room->exit[opposite_dir[i]]->u1.to_room == room )

change
if ( (room->area != pArea) && (exit->to_room->area == pArea) )

to
if ( (room->area != pArea) && (exit->u1.to_room->area == pArea) )

change
to_room->exit[opposite_dir[i]]->to_room == room )

to
to_room->exit[opposite_dir[i]]->u1.to_room == room )

updated if statement:
if (to_room) /* there is something on the other side */
{
if ( (room->area == pArea) && (to_room->area != pArea) )
{ /* an exit from our area to another area */
/* check first if it is a two-way exit */

if ( to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->to_room == room )
room_pair (room,to_room,exit_both,buf); /* <> */
else
room_pair (room,to_room,exit_to,buf); /* > */

strcat (buffer, buf);
}
else if ( (room->area != pArea) && (exit->to_room->area == pArea) )
{ /* an exit from another area to our area */
if (!
(to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->to_room == room )
)
/* two-way exits are handled in the other if */
{
room_pair (to_room,room,exit_from,buf);
strcat (buffer, buf);
}

} /* if room->area */
}/*if to_room*/
}/*for*/
07 Mar, 2009, boblinski wrote in the 15th comment:
Votes: 0
okay, I think I followed what you said right, here it is:

/* opposite directions */
const sh_int opposite_dir [6] = { DIR_SOUTH, DIR_WEST, DIR_NORTH, DIR_EAST, DIR_DOWN, DIR_UP };


/* get the 'short' name of an area (e.g. MIDGAARD, MIRROR etc. */
/* assumes that the filename saved in the AREA_DATA struct is something like midgaard.are */
char * area_name (AREA_DATA *pArea)
{
static char buffer[64]; /* short filename */
char *period;

assert (pArea != NULL);

/*4849*/ strncpy (buffer, pArea->filename, 64); /* copy the filename */
period = strchr (buffer, '.'); /* find the period (midgaard.are) */
if (period) /* if there was one */
*period = '\0'; /* terminate the string there (midgaard) */

return buffer;
}

typedef enum {exit_from, exit_to, exit_both} exit_status;

/* depending on status print > or < or <> between the 2 rooms */
void room_pair (ROOM_INDEX_DATA* left, ROOM_INDEX_DATA* right, exit_status ex, char *buffer)
{
char *sExit;

switch (ex)
{
default:
sExit = "??"; break; /* invalid usage */
case exit_from:
sExit = "< "; break;
case exit_to:
sExit = " >"; break;
case exit_both:
sExit = "<>"; break;
}

sprintf (buffer, "%5d %-26.26s %s%5d %-26.26s(%-8.8s)\n\r",
left->vnum, left->name,
sExit,
right->vnum, right->name,
area_name(right->area)
);
}

/* for every exit in 'room' which leads to or from pArea but NOT both, print it */
void checkexits (ROOM_INDEX_DATA *room, AREA_DATA *pArea, char* buffer)
{
char buf[MAX_STRING_LENGTH];
int i;
EXIT_DATA *exit;
ROOM_INDEX_DATA *to_room;

strcpy (buffer, "");
for (i = 0; i < 6; i++)
{
exit = room->exit[i];
if (!exit)
continue;
else
to_room = exit->u1.to_room;

if (to_room) /* there is something on the other side */
{
if ( (room->area == pArea) && (to_room->area != pArea) )
{ /* an exit from our area to another area */
/* check first if it is a two-way exit */

if ( to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->u1.to_room == room )
room_pair (room,to_room,exit_both,buf); /* <> */
else
room_pair (room,to_room,exit_to,buf); /* > */

strcat (buffer, buf);
}
else
if ( (room->area != pArea) && (exit->u1.to_room->area == pArea) )
{ /* an exit from another area to our area */

if (!
(to_room->exit[opposite_dir[i]] &&
to_room->exit[opposite_dir[i]]->u1.to_room == room )
)
/* two-way exits are handled in the other if */
{
room_pair (to_room,room,exit_from,buf);
strcat (buffer, buf);
}

} /* if room->area */
}
} /* for */

}

/* for now, no arguments, just list the current area */
void do_exlist (CHAR_DATA *ch, char * argument)
{
AREA_DATA* pArea;
ROOM_INDEX_DATA* room;
int i;
char buffer[MAX_STRING_LENGTH];

pArea = ch->in_room->area; /* this is the area we want info on */
for (i = 0; i < MAX_KEY_HASH; i++) /* room index hash table */
for (room = room_index_hash[i]; room != NULL; room = room->next)
/* run through all the rooms on the MUD */

{
checkexits (room, pArea, buffer);
send_to_char (buffer, ch);
}
}


Errors are:
Quote
$ make
gcc -Wall -O -ggdb -DNOCRYPT -DQMFIXES -c -o obj/act_wiz.o act_wiz.c
act_wiz.c: In function `area_name':
act_wiz.c:4849: error: structure has no member named `filename'
make: *** [obj/act_wiz.o] Error 1


EDITTED.
07 Mar, 2009, Skol wrote in the 16th comment:
Votes: 0
Closer, look for the AREA_DATA structure in merc.h, post that here.
07 Mar, 2009, boblinski wrote in the 17th comment:
Votes: 0
/*
* Area definition.
*/
struct area_data
{
AREA_DATA * next;
HELP_AREA * helps;
char * file_name;
char * name;
char * credits;
sh_int age;
sh_int nplayer;
sh_int low_range;
sh_int high_range;
sh_int min_vnum;
sh_int max_vnum;
bool empty;
char * builders; /* OLC */ /* Listing of */
int vnum; /* OLC */ /* Area vnum */
int area_flags; /* OLC */
int security; /* OLC */ /* Value 1-9 */
};

:evil:

do i just add:
char *        filename;

?
07 Mar, 2009, Kober wrote in the 18th comment:
Votes: 0
just change
strncpy (buffer, pArea->filename, 64); /* copy the filename */

to
strncpy (buffer, pArea->file_name, 64); /* copy the filename */
07 Mar, 2009, boblinski wrote in the 19th comment:
Votes: 0
I added the
char *        filename;


The mud booted up alright.

But when I logged on my IMP and tried the "exlist" command the mud crashed straight away…


Quote
Sat Mar 7 19:20:17 2009 :: Bob@localhost has connected.
Sat Mar 7 19:20:22 2009 :: Log Bob: exlist
17730 [main] rom 3896 _cygtls::handle_exceptions: Error while dumping state (p
robably corrupted stack)
Segmentation fault (core dumped)
07 Mar, 2009, boblinski wrote in the 20th comment:
Votes: 0
Kober said:
just change
strncpy (buffer, pArea->filename, 64); /* copy the filename */

to
strncpy (buffer, pArea->file_name, 64); /* copy the filename */


Oh, I went back and changed it to this…

It seems to work fine!!
0.0/41