Re: Logging Immortal Gives

From: Sammy (
Date: 12/26/95

On Sun, 24 Dec 1995, Brian Christopher Guilbault wrote:

> Hey Guys-
> I'm adding many immortal commands to my syslogs and mudlogs (for imp's 
> eyes anyway) and have come across this seg fault that has me beating my 
> head against the wall. Here is the code and the error from act.obj.c:
> /* Snipped from about line 615 */
>         perform_give(ch, vict, obj);
> /* My code starts here */
>         if(GET_LEVEL(ch) >= LVL_IMMORT){
>             sprintf(buf, "(GIVE) %s gave %s to %s.",
>               GET_NAME(ch), (read_object(r_num, REAL))->short_description,
---->           GET_NAME(ch), obj->short_description,
>                 GET_NAME(vict));
>             mudlog(buf, CMP, LVL_IMPL, TRUE);   /* Log the immortal give */
>	      }

If I remember right, read_object creates a new object, which isn't 
something you'd want.  The above change should work just fine.  You may 
want to add a check to make sure the vict's level is < LVL_IMMORT to cut 
down on the log spam.

Keep in mind there are a couple of ways around the logging.  Coins gives 
aren't logged by the above code.  Imms can also drop eq on the ground and 
let morts pick it up.  You can fix this by adding a long variable to 
objects, and stamp objects with the imm's idnum when they drop eq.  Then 
in perform_get or somewere around there, if the object is stamped, log 
who picked it up, who dropped it, and what it was.  On my mud I even went 
so far as to add the variable to mobs, so if an imm did any damage to a 
mob, it would tag the mob and all its eq.

Looking back, it seems pretty silly that I've done so much security 
coding for a game.  *shrug*


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