Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
Evoru (32)
Related Links
» SmaugMuds.org » General » Smaug Snippets » Roster issues
Forum Rules | Mark all | Recent Posts

Roster issues
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 17, 2006, 7:01 am
Go to the top of the page
Go to the bottom of the page

Tranin

GroupMembers
Posts14
JoinedMar 16, 2006

Hello, I tried installing the Clan Roster snippet, and I'm running into this when I try to compile it. I'm not really sure what it means, and if it helps, the line that's giving that initial error is in the fread_memberlist function, and this is what that line is:
KEY( "Deaths", roster->deaths, fread_number( fp ) );


When I compile, this is the output I am getting:
tswl@linuxbox:~/swr/src$ make
make swr
make[1]: Entering directory `/home/tswl/swr/src'
gcc -c -g3 -Wall    clans.c
clans.c: In function `fread_memberlist':
clans.c:231: warning: implicit declaration of function `KEY'
rm -f swr
gcc  -o swr act_comm.o act_info.o act_move.o act_obj.o act_wiz.o boards.o build.o clans.o combat.o comm.o comments.o const.o db.o engineering.o fight.o handler.o hashstr.o id.o interp.o leadership.o magic.o makeobjs.o misc.o mud_comm.o mud_prog.o player.o requests.o reset.o save.o shops.o special.o tables.o track.o update.o smuggling.o space.o bounty.o commodity.o espionage.o -lm -lcrypt
clans.o(.text+0xa5a): In function `fread_memberlist':
/home/tswl/swr/src/clans.c:231: undefined reference to `KEY'
clans.o(.text+0xae1):/home/tswl/swr/src/clans.c:244: undefined reference to `KEY'
clans.o(.text+0xb08):/home/tswl/swr/src/clans.c:248: undefined reference to `KEY'
clans.o(.text+0xb2f):/home/tswl/swr/src/clans.c:252: undefined reference to `KEY'
clans.o(.text+0xb56):/home/tswl/swr/src/clans.c:256: undefined reference to `KEY'
collect2: ld returned 1 exit status
make[1]: *** [swr] Error 1
make[1]: Leaving directory `/home/tswl/swr/src'
make: *** [all] Error 2
tswl@linuxbox:~/swr/src$


I've thought about just changing all the keys to !str_cmp() functions as those ones don't seem to be causing any trouble, but I don't think that should be necessary, but I am at a loss.

Again, any help is greatly appreciated,
Tranin
       
Post is unread #2 Mar 17, 2006, 11:23 am
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

You need to move the definition of KEY from save.c to mud.h.
       
Post is unread #3 Mar 17, 2006, 11:46 am   Last edited Mar 17, 2006, 12:27 pm by Tranin
Go to the top of the page
Go to the bottom of the page

Tranin

GroupMembers
Posts14
JoinedMar 16, 2006

That fixed that problem! Unfortunately, when I copyovered, it crashed, so I killed the process, and started a fresh copy after another make clean and make again just to be sure, and it crashes when I try to login now. Shells says segmentation fault. Now, unfortunately, for reasons unknown to me, its not spitting out a core file, and I am clueless on using gdb. I know it might be tough for you to help me without any information on where its crashing, but if you can give me any pointers on how to get that information needed to determine where its crashing, that would be helpful in itself.

**EDIT**
I got GDB figured out a little, here is what I got:
Program received signal SIGSEGV, Segmentation fault.
0x080973fa in update_roster (ch=0x848f830) at clans.c:81
81         for( roster = ch->pcdata->clan->first_member; roster; roster = roster->next )

I deleted the clan entry in my pfile, and was able to log in....now to figure out what's causing the problem.
       
Post is unread #4 Mar 17, 2006, 1:09 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Print ch->pcdata, then ch->pcdata->clan for me.
       
Post is unread #5 Mar 17, 2006, 1:16 pm
Go to the top of the page
Go to the bottom of the page

Tranin

GroupMembers
Posts14
JoinedMar 16, 2006

(gdb) print ch->pcdata
$1 = (PC_DATA *) 0x84893b0
(gdb) print ch->pcdata->clan
$2 = (CLAN_DATA *) 0x0
(gdb)


At this point, I'm assumint the 0x0 is the problem.
       
Post is unread #6 Mar 17, 2006, 1:24 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Yeah, that means they aren't in a clan. It should be checking if they're in a clan or not first.
       
Post is unread #7 Mar 17, 2006, 1:37 pm
Go to the top of the page
Go to the bottom of the page

Tranin

GroupMembers
Posts14
JoinedMar 16, 2006

That doesn't make sense though, because the mud crashes when the player *IS* in a clan, and works fine when the player *IS NOT* in a clan.
       
Post is unread #8 Mar 17, 2006, 1:40 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Okay well, print ch->name and see if it's really who you think it is.
       
Post is unread #9 Mar 17, 2006, 1:46 pm
Go to the top of the page
Go to the bottom of the page

Tranin

GroupMembers
Posts14
JoinedMar 16, 2006

(gdb) print ch->name
$1 = 0x83cfef8 "Testtranin"

Thats perfect, thats who its supposed to be.
       
Post is unread #10 Mar 17, 2006, 1:53 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Okay well the code was this:
               if( ch->pcdata->clan )
                  update_roster( ch );


So I really don't see why ch->pcdata->clan is null at that point.

Double check you did everything right, I guess.
       
Post is unread #11 Mar 17, 2006, 2:11 pm
Go to the top of the page
Go to the bottom of the page

Tranin

GroupMembers
Posts14
JoinedMar 16, 2006

I know why its crashing now, I forgot all about this. In the instructions there is this part:
3. Open save.c.

   Locate fread_char, and find the following:

               /*
                * this disallows chars from being 6', 180lbs, but easier than a flag 
                */
               if( ch->height == 72 )
                  ch->height = number_range( (int)(race_table[ch->race]->height * .9), (int)(race_table[ch->race]->height * 1.1 ));
               if( ch->weight == 180 )
                  ch->weight = number_range( (int)(race_table[ch->race]->weight * .9), (int)(race_table[ch->race]->weight * 1.1 ));


   Directly below that, add:

               if( ch->pcdata->clan )
                  update_roster( ch );


I was unable to find the spot it was looking for, so dumb me just put it under the part where it found clan in the pfile(made sense to me at the time, now I see how that would be causing a problem)
Well, I tried moving it to another spot in the function, but that didnt work either, still get 0x0 when I print ch->pcdata->clan.
I have to go home now, I'll try to troubleshoot futher, but if I'm unable to find the part its telling me to put it in, do you have any suggestions as to where to put the if check and the update_roster part? Even more confusing is the fact that there is an infcheck, and it's letting it go through anyway.
       
Post is unread #12 Mar 17, 2006, 2:19 pm
Go to the top of the page
Go to the bottom of the page

Zeno
Sorcerer
GroupMembers
Posts723
JoinedMar 5, 2005

Oh, you're installing it into SWR? That may be why. It isn't meant for SWR for one. But I'm sure you could port it. I'm not familiar with SWR, so I'm not sure where it would go in save.c.
       
Post is unread #13 Mar 17, 2006, 3:31 pm
Go to the top of the page
Go to the bottom of the page

Tranin

GroupMembers
Posts14
JoinedMar 16, 2006

I got it now!! YAY!
I guess it helps to actually delete the line of code causing a problem when you decide that function should be run somewhere else. Thats why it kept crashing after I moved it! But now it doesn't actually try to get the clan until after the clan data is loaded, not while it trying to load it!! Dumb mistake on my part, thank you for all your help though :)
       
Pages:<< prev 1 next >>