nickname.c

skylib_fluffos_v3/mudlib/global/player/nickname.c · 680 B

From the archive skylib_fluffos_v3.zip

Download the archive   « Back to the archive contents

/*
 * The great and wonderful alias driver by me ;)
 * pinkfish.
 */
mapping map_nicknames;

void nickname_commands() {
}

mapping query_nicknames() { return map_nicknames; }
void set_nicknames(mapping map) { map_nicknames = map; }
     
string expand_nickname( string phrase ) {
   int i;
   string new_n, *words;
   if ( stringp( phrase ) )
      words = explode( phrase, " " );
   else
      return phrase;
   if ( !map_nicknames )
      map_nicknames = ([ ]);
   for ( i = 0; i < sizeof( words ); i++ ) {
      new_n = map_nicknames[ lower_case( words[ i ] ) ];
      if ( new_n )
         words[ i ] = new_n;
   }
   return implode( words, " " );
} /* expand_nickname() */
 

Site Stats

Snippets: 1791
Codebases: 571