/* save this new player */
account_new_player(d->account, d->character);
save_char_obj(d->character);
p/code]
under..
[code]
case CON_PICK_WEAPON:
[/code]
above
[code]
do_function (ch, &do_help, "motd");
d->connected = CON_READ_MOTD;
break;
[/code]
I did this because the account.dat file was showing number of players as 0 and not having my players name in the file under players.
When nanny gets to this code in the charachter creation process i get a seg fault..
[code]
Sat Jul 18 14:27:02 2009 :: Xrakisis@AC81E61C.ipt.aol.com new player.
Program received signal SIGSEGV, Segmentation fault.
0x08049ccc in account_update (account=0x0, dMob=0x0) at account.c:472
472 while ((buf[i] = *(list + j)) != ' ')
(gdb) bt
#0 0x08049ccc in account_update (account=0x0, dMob=0x0) at account.c:472
#1 0x00000000 in ?? ()
(gdb)
Thats in
+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 */
472 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);
+}
[/code]
Im not sure whats going wrong, any help would be greatly appreciated.-Xrak
Denied 0
Level 1
Owner Ianshirm~
Password XXX
PCount 1
Players Xrakisis 0~
EOF
/* save this new player */
account_new_player(d->account, d->character);
save_char_obj(d->character); (i commented this line out and it went through)
Program received signal SIGSEGV, Segmentation fault.
parse_player_list (list=0x4066c5d1 "") at account.c:347
347 *ptr2++ = *list++;
(gdb) bt
#0 parse_player_list (list=0x4066c5d1 "") at account.c:347
#1 0x00000000 in ?? ()
(gdb)
@@ -1420,9 +1422,9 @@
UMIN (ch->level, sizeof (pose_table) / sizeof (pose_table[0]) - 1);
pose = number_range (0, level);
- act (pose_table[pose].message[2 * ch->class + 0], ch, NULL, NULL,
+ act (pose_table[pose].message[2 * ch->race + 0], ch, NULL, NULL,TO_CHAR);
- act (pose_table[pose].message[2 * ch->class + 1], ch, NULL, NULL,
+ act (pose_table[pose].message[2 * ch->race + 1], ch, NULL, NULL, TO_ROOM);
* All the posing stuff.
*/
struct pose_table_type {
- char *message[2 * MAX_CLASS];
+ char *message[2 * MAX_PC_RACE];
};
diff -NaurBdw QuickMUD/src/act_move.c rom/src/act_move.c
— QuickMUD/src/act_move.c Fri Dec 1 03:48:32 2000
+++ rom/src/act_move.c Mon Apr 8 02:38:26 2002
@@ -39,15 +39,25 @@
#include "merc.h"
#include "interp.h"
-char *const dir_name[] = {
- "north", "east", "south", "west", "up", "down"
+char *const dir_name[] =
+{
+ "north", "east", "south", "west", "up", "down",
+ "northwest", "northeast", "southwest", "southeast"
};
-const sh_int rev_dir[] = {
- 2, 3, 0, 1, 5, 4
+char * const dir_rev [] =
+{
+ "the south", "the west", "the north", "the east", "below", "above",
+ "the southeast", "the southwest", "the northeast", "the northwest"
};
-const sh_int movement_loss[SECT_MAX] = {
+const sh_int rev_dir[] =
+{
+ 2, 3, 0, 1, 5, 4, 6, 7, 8, 9
+};
+
+const sh_int movement_loss[SECT_MAX] =
+{
1, 2, 2, 3, 4, 6, 4, 1, 6, 10, 6
};
Program received signal SIGSEGV, Segmentation fault.
parse_player_list (list=0x4066c5d1 "") at account.c:347
347 *ptr2++ = *list++;
(gdb) bt
#0 parse_player_list (list=0x4066c5d1 "") at account.c:347
#1 0x00000000 in ?? ()
(gdb)
struct plist *parse_player_list(char *list)
{
CHAR_DATA *dMob;
struct plist *p_list;
char tempbuf[MAX_STRING_LENGTH];
bool first = TRUE;
int total_time = 0;
if ((p_list = malloc(sizeof(*p_list))) == NULL)
{
bug("Parse_player_list: Cannot allocate memory", 0);
abort();
}
p_list->count = 0;
while (*list != '\0')
{
char name[20];
char race[20];
char *ptr1, *ptr2;
int played = 0;
bool in_game = FALSE;
name[0] = '\0'; ptr1 = name;
race[0] = '\0'; ptr2 = race;
/* get the name */
while (*list != ' ')
*ptr1++ = *list++;
*ptr1 = '\0'; list++;
/* is that player already logged on ?? */
for (dMob = char_list; dMob; dMob = dMob->next)
{
if (IS_NPC(dMob)) continue;
if (!str_cmp(dMob->name, name))
in_game = TRUE;
}
/* get the race */
while (*list != ' ')
*ptr2++ = *list++;
*ptr2 = '\0'; list++;
/* get the hours */
while (*list != ' ' && *list != '\0')
{
played *= 10;
played += *list++ - '0';
}
if (*list == ' ') list++;
p_list->count++;
sprintf(tempbuf, " [%d] %-12s %-12s %5d hour%s%s\n\r",
p_list->count, name, race, played, (played == 1) ? "" : "s",
(in_game) ? " (active)" : "");
/* add up */
total_time += played;
if (first)
{
first = FALSE;
sprintf(p_list->text, "%s", tempbuf);
}
else strcat(p_list->text, tempbuf);
}
/* should we add a line with the total time ? */
if (!first)
{
sprintf(tempbuf, "%34s %5d hour%s total\n\r", " ", total_time, (total_time == 1) ? "" : "s");
strcat(p_list->text, tempbuf);
}
return p_list;
}
while (*list && *list != ' ')
Program received signal SIGSEGV, Segmentation fault.
parse_player_list (list=0x4066744c "Xrakisis 0") at account.c:321
321 list = account->players;
(gdb) p *list
$1 = 88 'X'
(gdb) p *ptr2
No symbol "ptr2" in current context.
(gdb)
im interested in installing the account system under rom->snippits. The Description says "I'd suggest manually patching this in and expect a few bugs. It works mostly bug free but it's lacking a few features."
Does anyone know what its 'lacking'?
-Xrakisis