Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
Google, AhrefsBot

Members: 0
Guests: 27
Stats
Files
Topics
Posts
Members
Newest Member
488
3,788
19,631
595
Khonsu

Today's Birthdays
There are no member birthdays today.
Files
Upload Rules | File Index | Search | Recent Uploads
» Root » SmaugFUSS » Smaug Snippets
Bio Auth
Author Submitted by Version D/L File Size Date Added Last Updated

Conner Conner 603 24.26 KB Nov 25, 2007

Description
This snippet allows you to require immortal authorization of player biographies before they're displayed to other mortals by the whois command, it optionally also lets you restrict an in-character channel to those who have had their bio approved. Additionally, it lets you restrict bio writing/editing with a nobio command like the stock notell command.

This has been tested on my own mud which is running SmaugFUSS 1.6 under Fedora Core 3 and seems to work just fine with only two known limitations:

1> If someone types 'bio ready' without having edited their bio first (so that their bio gets copied to tempbio and they get the PLR_BIO2 flag) executing an 'abio accept' command on them will wipe out their existing bio (replace it with a blank string).

2> The abio command will only work on a player who is actually logged in, not loadup'd because they don't have a descriptor that way.

I've tried to make this snippet as easy and complete as I could, even including the help entries for both of the new immortal commands, but this is not a real .c file that should just be tossed into your source directory but rather a code snippet that contains code which can be cut/paste into your code where indicated before recompiling.

Beyond that, what can I say, if you decide to not use this snippet in your code, you are released from all 'license' requirements of this snippet until such time as you change your mind and put it into your code. ;)

Remcon had pointed out the following 'fixes' to this snippet, but I hadn't gotten around to adding them in to the released snippet itself yet.

Remcon said:

In the snippet find:

 set_char_color( AT_IMMORT, victim );

 if ( arg2[0]=='\0' || !str_cmp( arg2, "accept" ) || !str_cmp( arg2, "yes" ) || !str_cmp( arg2, "a" ) || !str_cmp( arg2, "y" ) || !str_cmp( arg2, "approve") )
 {
   xSET_BIT( victim->act, PLR_BIO );
   xREMOVE_BIT( victim->act, PLR_BIO2 );
   if ( victim->pcdata->authbio ) STRFREE( victim->pcdata->authbio );
   victim->pcdata->authbio = QUICKLINK( ch->name );

   if ( victim->pcdata->bio ) STRFREE( victim->pcdata->bio );
   victim->pcdata->bio = QUICKLINK( victim->pcdata->tempbio );

   STRFREE( victim->pcdata->tempbio );
   victim->pcdata->tempbio = STRALLOC("");


You can stop the problem with it wipeing out the current one and putting in an empty string if before the xSET_BIT( victim->act, PLR_BIO ); you check to make sure that tempbio is valid another words by making it something like this.

 set_char_color( AT_IMMORT, victim );

 if ( arg2[0]=='\0' || !str_cmp( arg2, "accept" ) || !str_cmp( arg2, "yes" ) || !str_cmp( arg2, "a" ) || !str_cmp( arg2, "y" ) || !str_cmp( arg2, "approve") )
 {
   if( !victim->pcdata->tempbio || victim->pcdata->tempbio[0] == '\0' )
   {
       ch_printf( ch, "%s's tempbio is empty.\r\n", victim->name);
       return;
   }
   xSET_BIT( victim->act, PLR_BIO );
   xREMOVE_BIT( victim->act, PLR_BIO2 );
   if ( victim->pcdata->authbio ) STRFREE( victim->pcdata->authbio );
   victim->pcdata->authbio = QUICKLINK( ch->name );

   if ( victim->pcdata->bio ) STRFREE( victim->pcdata->bio );
   victim->pcdata->bio = QUICKLINK( victim->pcdata->tempbio );
   STRFREE( victim->pcdata->tempbio );
   victim->pcdata->tempbio = STRALLOC("");


You can also stop allowing them to do bio ready if they dont have a tempbio the same way lol change

 if( !str_cmp( argument, "ready" ) )
 {
   xSET_BIT( ch->act, PLR_BIO2 );
   send_to_char( "The immortals have been made aware that your bio is ready for approval.\n\r", ch );
   sprintf( buf, "%s: has edited/created a bio that is now awaiting authorization.\n\r", ch->name );
   to_channel( buf, CHANNEL_AUTH, "Auth", LEVEL_NEOPHYTE );
   return;
 }


to this

 if( !str_cmp( argument, "ready" ) )
 {
   if( !ch->pcdata || !ch->pcdata->tempbio || ch->pcdata->tempbio[0] == '\0' )
   {
       send_to_char( "You havent edited your bio to need it approved again.\r\n", ch );
       return;
   }
   xSET_BIT( ch->act, PLR_BIO2 );
   send_to_char( "The immortals have been made aware that your bio is ready for approval.\n\r", ch );
   sprintf( buf, "%s: has edited/created a bio that is now awaiting authorization.\n\r", ch->name );
   to_channel( buf, CHANNEL_AUTH, "Auth", LEVEL_NEOPHYTE );
   return;
 }


Revisions: 0
Rating: | Download | Comments(0)