Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ who name
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Ithildin
USA (262 posts) Bio
|
| Date
| Wed 19 May 2004 02:40 AM (UTC) |
| Message
| ok, so i'm droppin the note thing for a little bit and starting on something else. i just won't be writing notes for awhile...heh.
ok, what i have done now is this:
i have put color into my name on the who list. i made an extra line for my saved file to include color. the problem is when i save it overrides the actual name to have the color. example:
Name Ithildin~
Namewho &cIthildin~
before i save.
Name &cIthildin~
Namewho &cIthildin~
after i save.
i know what i'm doing wrong, i just don't know how to fix it. here's the code.
in fwrite:
fprintf( fp, "Name %s~\n", ch->name );
fprintf( fp, "Namewho %s~\n", ch->name );
in fread:
KEY ("Name", ch->name, fread_string( fp ) );
KEY ("Namewho", ch->name, fread_string( fp ) );
now i know the ch->name is what i'm wanting to fix. i don't know how to add a ch->namewho. i'm just having a brain fart right now. anyone know what to do?
| | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #1 on Wed 19 May 2004 03:38 AM (UTC) |
| Message
| | What's wrong with just adding a char * namewho to the char_data struct? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| Ithildin
USA (262 posts) Bio
|
| Date
| Reply #2 on Wed 19 May 2004 05:23 AM (UTC) |
| Message
| well i did that...and it crashes my mud.
Wed May 19 00:20:56 2004 :: [*****] FILE: ../player/i/Ithildin LINE: 325
Wed May 19 00:20:56 2004 :: [*****] BUG: Fread_char: no match: i3perm
Wed May 19 00:20:56 2004 :: [*****] FILE: ../player/i/Ithildin LINE: 325
Wed May 19 00:20:56 2004 :: [*****] BUG: Fread_char: no match: 5
Wed May 19 00:20:56 2004 :: [*****] FILE: ../player/i/Ithildin LINE: 326
Wed May 19 00:20:56 2004 :: [*****] BUG: Fread_char: no match: i3flags
Wed May 19 00:20:56 2004 :: [*****] FILE: ../player/i/Ithildin LINE: 326
Wed May 19 00:20:56 2004 :: [*****] BUG: Fread_char: no match: 256
Wed May 19 00:20:56 2004 :: Ithildin@63.140.119.19(Exception) has connected.
Segmentation fault (core dumped)
i put
char * namewho; in char_data struct
and had the code that i listed above. and what it did was completely take out color and evertyhign was green like smaug with no ansi.
so i don't know what to do. | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #3 on Wed 19 May 2004 06:23 AM (UTC) |
| Message
| You must have had something else. The code you posted wouldn't crash the MUD when you add a namewho.
Did you remember to make clean and recompile after modifying the header file? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
| Posted by
| Ithildin
USA (262 posts) Bio
|
| Date
| Reply #4 on Wed 19 May 2004 06:31 AM (UTC) |
| Message
| | i didn't rm *.o i just did the make. i'm cleanin it up right now... | | Top |
|
| Posted by
| Ithildin
USA (262 posts) Bio
|
| Date
| Reply #5 on Wed 19 May 2004 06:36 AM (UTC) |
| Message
| it made clean and worked, but it isn't showing the color. heres what i have.
in do_who
char char_name[MAX_INPUT_LENGTH];
char char_namewho[MAX_INPUT_LENGTH];\
further down...
if ( fShowHomepage
&& wch->pcdata->homepage
&& wch->pcdata->homepage[0] != '\0' )
sprintf( char_name, "<A HREF=\"%s\">%s</A>",
show_tilde( wch->pcdata->homepage ), wch->name );
else
strcpy( char_namewho, wch->name );
further down...
if ( xIS_SET(wch->act, PLR_WIZINVIS) )
sprintf( invis_str, "(%d) ", wch->pcdata->wizinvis );
else
invis_str[0] = '\0';
sprintf( buf, "\n\r&w[&W%*s%-18s&w] %s%s%s%s%s%s%s %s%s%s%s &w(&W%s&w)",
(fGroup ? whogr->indent : 0), "",
class,
invis_str,
(wch->desc && wch->desc->connected) ? "" : "",
xIS_SET(wch->act, PLR_AFK) ? "" : "",
xIS_SET(wch->act, PLR_ATTACKER) ? "" : "",
xIS_SET(wch->act, PLR_KILLER) ? "" : "",
xIS_SET(wch->act, PLR_THIEF) ? "" : "",
char_namewho,
wch->pcdata->title,
extra_title,
clan_name,
council_name,
get_race_name_color(wch));
then, in mud.h
char * name;
char * namewho;
along with all the other code i showed you. | | Top |
|
| Posted by
| Ithildin
USA (262 posts) Bio
|
| Date
| Reply #6 on Thu 20 May 2004 03:44 AM (UTC) |
| Message
| i'm an idiot. here's what i was doing wrong.
strcpy( char_namewho, wch->name );
should have been
strcpy( char_namewho, wch->namewho );
it works now. | | Top |
|
| Posted by
| David Haley
USA (3,881 posts) Bio
|
| Date
| Reply #7 on Thu 20 May 2004 07:09 AM (UTC) |
| Message
| I saw that, but I figured you were doing it on purpose. To be honest your whole ifcheck seems a little weird to me, but I think that is the default SMAUG code.
Anyways, glad you figured out your problem. :) |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
23,516 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top