[DGD] Aliases & Stacked commands

Steve Wooster swooster at xprt.net
Wed Mar 24 00:49:25 CET 2004


At 06:19 PM 3/23/2004 -0500, you wrote:
>I'm in the process of completing an aliasd.c an alias command and the
>inheritable into the user file, and have come across what is a potential
>problem, wherein an alias can do multiple actions
>[...]

     If you're designing all/most of the mudlib, maybe you could make some 
kind of replacement for this_user() that maybe uses thread-local storage 
(TLS) to store who the current user is. When a connection object receives 
some input, it sets a value in TLS to the connection's user-body (assuming 
this is a mud) before executing the command. Likewise, you could make a 
force_me(str) function in a user-body that does something like:

void force_me(string str)
{
     object previous_user;

     security checks;

     previous_user = this_user();
     set_this_user( this_object() );

     execute code for the command 'str';

     set_this_user( previous_user );
}

In any case, I hope this sparks some ideas that suit the lib you're working 
with. :)

-Steve Wooster

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list