Re: [DG Scripts] bug in alias variable 1998 at 02:09:32PM +0100

From: Eric Green (thrytis@IMAXX.NET)
Date: 01/23/98


On Fri, Jan 23, 1998 at 02:09:32PM +0100, Andy Hubbard wrote:
> Here's a quick fix for the alias variable.  Due to the way the
> GET_NAME macro works it will return the short description for
> mobiles.  Not good for mkill %actor.alias% if actor is a mob! All
> you'll probably see will be,

You should never refer to a player in a command with %player.alias% or
%player.name% or like, unless it is in a text portion (such as saying
the name).  If you do, it allows holes for cheating.  You simply buy
a dog with the same name as you, go into the room with the big nastly
dragon, and take its treasure.  The dragon would then mkill %actor.name%,
which of course is your dog since he entered the room after you did.
This was the primary reason for having UIDs for all mobs/items/rooms.

The other reason for not using the .name or .alias is for effiency.
I haven't looked at the patch out there, but the original (at least
in one implimentation i did) could look up the UIDs in a hash table,
saving a ton of string compares.  It also knows exactly what type it
is, so it doesn't have to search through all the objects in the room
to figure out "fred" is the guy standing next to you.

Eric


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST