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, DotBot, Yahoo!

Members: 0
Guests: 16
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Introduce for SmaugFUSS?
Forum Rules | Mark all | Recent Posts

Introduce for SmaugFUSS?
< Newer Topic :: Older Topic >

Pages:<< prev 1, 2 next >>
Post is unread #21 Sep 1, 2008, 6:10 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

I'd need you to run it through gdb for me to see where the crash is occurring. It could be at any number of places given that several things were changed.
       
Post is unread #22 Sep 1, 2008, 6:56 pm   Last edited Sep 1, 2008, 6:58 pm by Trevlyn13
Go to the top of the page
Go to the bottom of the page

Trevlyn13
Apprentice
GroupMembers
Posts64
JoinedNov 30, 2007

I'm read through that thread and got a core which I opened in gdb, just not sure what I'm looking for here... Anything I can give you to help me?

Program terminated with signal 11, Segmentation fault.
#0 0xb7d72c8b in strlen () from /lib/libc.so.6
       
Post is unread #23 Sep 1, 2008, 7:27 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

The best thing to do at this point is to figure out how you got into that. Chances are you called strlen on a null string. So, at the gdb prompt, get a backtrace by typing "bt" and then go up (by typing "up";) the stack frame until you reach MUD code. That will show you the line of code that caused the crash.
       
Post is unread #24 Sep 2, 2008, 1:52 am
Go to the top of the page
Go to the bottom of the page

Trevlyn13
Apprentice
GroupMembers
Posts64
JoinedNov 30, 2007

Okay, I finally got it debugged (problem with height/build in pfiles) and everything is working. Unintroduced see descriptors, and introduce/remember is saving properly.

New problem.

When you use any command with a victim (give, introduce, etc), it doesn't find them unless you use their name. Anyone familiar enough with the SWRFotE intro code to tell me how it identifies people by name OR descriptor? If you see a short, obese human male in the room, you should be able to do <command> obese/short/human/male and have it pick up. Any ideas on how this would work?
       
Post is unread #25 Sep 2, 2008, 7:34 am
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Quick terminology clarification: usually the term 'descriptor' is used to represent the network connection; maybe just 'description' would be better for the appearance characteristics? I was a little confused as to why we were talking about networking all of a sudden... :wink: (I guess that 'description' isn't perfect either, since it's used elsewhere too...)

Anyhow -- this is actually kind of tricky because of how it appears all over the code... there might be some unintended consequences to modifying this. I don't know how the SWR version does things, but here's an overview of what SMAUG typically does.

You have two functions that are most relevant: get_char_world and get_char_room. These take a string argument and try to return a character matching the arguments. The functions try to be clever enough to first try by vnum (for imms), then by exact name, then by prefix match. They also allow for the n.x syntax to get the n^th character.

If you added a new lookup pattern to that function, you would be adding a new way to find characters (for functions that use this API, at least, which is actually most of them IIRC). So, if name lookup failed, you could try matching the supplied arguments against the descriptions of characters. I'm not sure what the best way to do this is; you might want to try it as a string literal, or as a list of characteristics for which you match as many as possible, etc.

The problem is that these functions are pretty fundamental and used all over the place. Changing them to suddenly find lots more stuff could have unintended consequences. For example, imms might start finding players where they meant to find mobs. If you do something like "cmd short" and there's a short mob in the room, but somehow you don't find it, you might end up finding a player who happens to have the term 'short' in their description. This isn't the end of the world, but it would mean you have to be careful. It might be worth only changing get_char_room and not get_char_world for this reason.
       
Post is unread #26 Sep 2, 2008, 8:06 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

When I wrote my introduction system for my base I modified the two functions David mentioned to check for real name, introduced name, or recognized name. At the time I didn't feel there was a safe way to change it to scan against the players unintroduced description without causing a multitude of problems like David mentioned. But if you can interact that way with things in SWFotE, I might ahve to have a gander and see how KeB and his gang handled that.
       
Post is unread #27 Sep 3, 2008, 1:09 pm
Go to the top of the page
Go to the bottom of the page

Trevlyn13
Apprentice
GroupMembers
Posts64
JoinedNov 30, 2007

I started looking into the get_char_room stuff, it looks like it uses sort of an inverted version of the PERS. I haven't had enough time to see about exactly how they did it, but I know it work. I have a test copy of FotE running and you can definitely address people by their characteristics. I think the key to preventing preventing would be 1) make it so that imm commands require a name, and 2) limit it to the get_char_room. I can't think of any situation where you would use a command with a player target across rooms, except maybe tells which we've already redone anyway. Thanks for all the input guys, I'll get back to you when I have time to sit down and sort this mess out.
       
Post is unread #28 Sep 3, 2008, 1:36 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Just out of curiosity, are you using SWFotEFUSS or SWFotE from KeB's Sourceforge page?
       
Post is unread #29 Sep 3, 2008, 10:05 pm
Go to the top of the page
Go to the bottom of the page

Trevlyn13
Apprentice
GroupMembers
Posts64
JoinedNov 30, 2007

SWFotEFUSS
       
Post is unread #30 Sep 3, 2008, 10:15 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Awesome, Now I know which one to pry into myself.
       
Post is unread #31 Sep 4, 2008, 9:03 pm
Go to the top of the page
Go to the bottom of the page

Trevlyn13
Apprentice
GroupMembers
Posts64
JoinedNov 30, 2007

Okay, final step completed!

The easiest and most efficient way I found to address people by their descriptions was to use SWRFotEFUSS's if-statements in the get_char_room block.

Turned
   for( rch = ch->in_room->first_person; rch; rch = rch->next_in_room )
      if( can_see( ch, rch ) && ( nifty_is_name( arg, rch->name ) || ( IS_NPC( rch ) && vnum == rch->pIndexData->vnum ) ) )




Into

 for( rch = ch->in_room->first_person; rch; rch = rch->next_in_room )
   {
      if( ch == rch )
         continue;
      sprintf( fix, "__%s", rch->name );
      if( ( can_see( ch, rch ) && ( nifty_is_name( arg, PERS( rch, ch ) ) || !str_cmp( arg, fix ) ) )
          || ( IS_NPC( rch ) && vnum == rch->pIndexData->vnum ) || ( IS_NPC( ch ) && ( nifty_is_name( arg, rch->name ) ) )
          || ( IS_NPC( rch ) && nifty_is_name( arg, rch->name ) ) )


Also, you'll need to make a similar change to the second part of get_char_room, the prefix part. Same cut and paste can be made from the FotE handler.c. No problems so far, just tweaking things here and there to make sure global type commands can't be targetted at the wrong things.
       
Post is unread #32 Sep 4, 2008, 9:23 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

I'd have to twist and tweak that for my own system, but yeah, that looks like it'd do the trick.
       
Pages:<< prev 1, 2 next >>