Core was generated by `../src/rom 9000'.
Program terminated with signal 11, Segmentation fault.
[New process 5345]
#0 0x08049926 in show_options (dsock=0xb7c2babc) at account.c:264
264 if (help_menu_1[0] == '.')
void show_options(DESCRIPTOR_DATA *dsock)
{
char buf[MAX_STRING_LENGTH];
extern char *help_menu_1;
send_to_desc("\x1B;
extern char *help_menu_1;
send_to_desc("\x1B[H\x1B[J",dsock);
if (help_menu_1[0] == '.')
send_to_desc (help_menu_1 + 1, dsock);
else
send_to_desc (help_menu_1, dsock);
sprintf(buf, "\n\rWelcome %s, whats your choice today.", dsock->account->owner);
send_to_desc(buf, dsock);
}
[/code]
So basically thats help_menu_1 as a table or whatever its called in english and a check if its empty?
extern char *help_menu_1;
char *help_menu_1;
help_menu_1 = pHelp->text;
/*
* Snarf a help section.
*/
void load_helps (FILE * fp, char *fname)
{
HELP_DATA *pHelp;
int level;
char *keyword;
for (;;)
{
HELP_AREA *had;
level = fread_number (fp);
keyword = fread_string (fp);
if (keyword[0] == '$')
break;
if (!had_list)
{
had = new_had ();
had->filename = str_dup (fname);
had->area = current_area;
if (current_area)
current_area->helps = had;
had_list = had;
}
else if (str_cmp (fname, had_list->filename))
{
had = new_had ();
had->filename = str_dup (fname);
had->area = current_area;
if (current_area)
current_area->helps = had;
had->next = had_list;
had_list = had;
}
else
had = had_list;
pHelp = new_help ();
pHelp->level = level;
pHelp->keyword = keyword;
pHelp->text = fread_string (fp);
if (!str_cmp (pHelp->keyword, "greeting"))
help_greeting = pHelp->text;
if (!str_cmp (pHelp->keyword, "menu_1"))
help_menu_1 = pHelp->text;
if (help_first == NULL)
help_first = pHelp;
if (help_last != NULL)
help_last->next = pHelp;
help_last = pHelp;
pHelp->next = NULL;
if (!had->first)
had->first = pHelp;
if (!had->last)
had->last = pHelp;
had->last->next_area = pHelp;
had->last = pHelp;
pHelp->next_area = NULL;
top_help++;
}
return;
}
if (!str_cmp (pHelp->keyword, "menu_1"))
help_menu_1 = pHelp->text;
Program terminated with signal 11, Segmentation fault.
[New process 28418]
#0 0xb7dcfabd in fclose () from /lib/libc.so.6
#0 0xb7df5abd in fclose () from /lib/libc.so.6
#1 0x080c7744 in save_char_obj (ch=0xb7c2ef94) at save.c:171
#2 0x08053c18 in do_save (ch=0xb7c2ef94, argument=0xb7c2d005 "")
at act_comm.c:1529
#3 0x080a0c57 in interpret (ch=0xb7c2ef94, argument=0xb7c2d005 "")
at interp.c:554
#4 0x0806fe7e in substitute_alias (d=0xb7c2cbe0, argument=0xb7c2d001 "save")
at alias.c:67
#5 0x08077cb4 in game_loop_unix (control=5) at comm.c:842
#6 0x0807820b in main (argc=Cannot access memory at address 0xffffffff
) at comm.c:459
void account_new_player(ACCOUNT_DATA *account, CHAR_DATA *dMob)
{
char buf[MAX_STRING_LENGTH];
sprintf(buf, "%s%s%s %d",
account->players, (account->players[0] == '\0') ? "" : " ",
dMob->name, dMob->played/3600);
free_string(account->players);
account->players = str_dup(buf);
save_account(account);
}
void account_update(ACCOUNT_DATA *account, CHAR_DATA *dMob)
{
char buf[MAX_STRING_LENGTH], name[MAX_STRING_LENGTH];
char *ptr, *list;
int i = 0, j = 0;
buf[0] = '\0';
ptr = buf;
list = account->players;
/* first we error check */
if (!is_full_name(dMob->name, account->players))
{
sprintf(buf, "Account_update: %s not in %s's playerlist", dMob->name, account->owner);
bug(buf, 0);
return;
}
/* then we parse */
while (1)
{
one_argument(list + i, name);
if (!str_cmp(name, dMob->name))
{
/* scan past name */
while ((buf[i + j] = *(list+i)) != ' ')
i++;
i++;
/* scan past race */
while ((buf[i + j] = *(list+i)) != ' ')
i++;
i++;
/* parse correct time */
{
char tempbuf[MAX_STRING_LENGTH];
int count = 0;
sprintf(tempbuf, "%d",
(dMob->played + (int) (current_time - dMob->logon))/3600);
while ((buf[i + j] = tempbuf[count++]) != '\0')
j++;
/* change that to a space */
buf[i + j] = ' ';
/* skip past the old time entry */
while (*(list+i) != '\0' && *(list+i) != ' ')
i++, j–;
if (*(list + (i++)) == '\0')
{
buf[i + j - 1] = '\0';
break;
}
}
}
else // scan forward one entry
{
/* scan past name */
while ((buf[i + j] = *(list+i)) != ' ')
i++;
i++;
/* scan past race */
while ((buf[i + j] = *(list+i)) != ' ')
i++;
i++;
/* scan past hours */
while ((buf[i + j] = *(list+i)) != '\0' && *(list+i) != ' ')
i++;
/* found the end */
if (*(list + (i++)) == '\0')
break;
}
}
/* then we copy */
free_string(account->players);
account->players = str_dup(buf);
/* and finally we save */
save_account(account);
}
I quess this has been asked a few times, but I just couldnt find a answer that pleases me so I start a new topic about it. Okay the case is that I merged the account management system to the fresh QuickMud files. Okay it compiles fine and seems to work fine, okay, I connect to it and start creating account, I finish writing the confirm password and at that same moment it should create the .dat file for the account. Doesn't happen and I get a segmention fault. So, where do I start or does someone happen to have working code for it?
Or the best of all if someone could slip the code in a fresh QuickMud files.
Thanks,
Tumeski