tmi2_fluffos_v2/
tmi2_fluffos_v2/bin/
tmi2_fluffos_v2/etc/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/ChangeLog.old/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/Win32/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/compat/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/compat/simuls/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/include/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/clone/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/command/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/data/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/etc/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/include/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/inherit/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/inherit/master/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/log/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/compiler/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/efuns/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/single/tests/operators/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/testsuite/u/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/tmp/
tmi2_fluffos_v2/fluffos-2.7-ds2.018/windows/
tmi2_fluffos_v2/lib/
tmi2_fluffos_v2/lib/adm/
tmi2_fluffos_v2/lib/adm/daemons/languages/
tmi2_fluffos_v2/lib/adm/daemons/network/I3/
tmi2_fluffos_v2/lib/adm/daemons/virtual/
tmi2_fluffos_v2/lib/adm/daemons/virtual/template/
tmi2_fluffos_v2/lib/adm/news/
tmi2_fluffos_v2/lib/adm/obj/
tmi2_fluffos_v2/lib/adm/obj/master/
tmi2_fluffos_v2/lib/adm/priv/
tmi2_fluffos_v2/lib/adm/shell/
tmi2_fluffos_v2/lib/adm/tmp/
tmi2_fluffos_v2/lib/cmds/
tmi2_fluffos_v2/lib/d/
tmi2_fluffos_v2/lib/d/Conf/
tmi2_fluffos_v2/lib/d/Conf/adm/
tmi2_fluffos_v2/lib/d/Conf/boards/
tmi2_fluffos_v2/lib/d/Conf/cmds/
tmi2_fluffos_v2/lib/d/Conf/data/
tmi2_fluffos_v2/lib/d/Conf/logs/
tmi2_fluffos_v2/lib/d/Conf/obj/
tmi2_fluffos_v2/lib/d/Conf/text/help/
tmi2_fluffos_v2/lib/d/Fooland/adm/
tmi2_fluffos_v2/lib/d/Fooland/data/
tmi2_fluffos_v2/lib/d/Fooland/data/attic/
tmi2_fluffos_v2/lib/d/Fooland/items/
tmi2_fluffos_v2/lib/d/TMI/
tmi2_fluffos_v2/lib/d/TMI/adm/
tmi2_fluffos_v2/lib/d/TMI/boards/
tmi2_fluffos_v2/lib/d/TMI/data/
tmi2_fluffos_v2/lib/d/TMI/rooms/
tmi2_fluffos_v2/lib/d/grid/
tmi2_fluffos_v2/lib/d/grid/adm/
tmi2_fluffos_v2/lib/d/grid/data/
tmi2_fluffos_v2/lib/d/std/
tmi2_fluffos_v2/lib/d/std/adm/
tmi2_fluffos_v2/lib/data/adm/
tmi2_fluffos_v2/lib/data/adm/daemons/
tmi2_fluffos_v2/lib/data/adm/daemons/doc_d/
tmi2_fluffos_v2/lib/data/adm/daemons/emoted/
tmi2_fluffos_v2/lib/data/adm/daemons/network/http/
tmi2_fluffos_v2/lib/data/adm/daemons/network/services/mail_q/
tmi2_fluffos_v2/lib/data/adm/daemons/network/smtp/
tmi2_fluffos_v2/lib/data/adm/daemons/news/archives/
tmi2_fluffos_v2/lib/data/attic/connection/
tmi2_fluffos_v2/lib/data/attic/user/
tmi2_fluffos_v2/lib/data/std/connection/b/
tmi2_fluffos_v2/lib/data/std/connection/l/
tmi2_fluffos_v2/lib/data/std/user/a/
tmi2_fluffos_v2/lib/data/std/user/b/
tmi2_fluffos_v2/lib/data/std/user/d/
tmi2_fluffos_v2/lib/data/std/user/f/
tmi2_fluffos_v2/lib/data/std/user/l/
tmi2_fluffos_v2/lib/data/std/user/x/
tmi2_fluffos_v2/lib/data/u/d/dm/working/doc_d/
tmi2_fluffos_v2/lib/data/u/l/leto/doc_d/
tmi2_fluffos_v2/lib/data/u/l/leto/smtp/
tmi2_fluffos_v2/lib/doc/
tmi2_fluffos_v2/lib/doc/driverdoc/applies/
tmi2_fluffos_v2/lib/doc/driverdoc/applies/interactive/
tmi2_fluffos_v2/lib/doc/driverdoc/concepts/
tmi2_fluffos_v2/lib/doc/driverdoc/driver/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/arrays/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/buffers/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/compile/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/ed/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/filesystem/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/floats/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/functions/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/general/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/mappings/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/numbers/
tmi2_fluffos_v2/lib/doc/driverdoc/efuns/parsing/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/constructs/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/preprocessor/
tmi2_fluffos_v2/lib/doc/driverdoc/lpc/types/
tmi2_fluffos_v2/lib/doc/driverdoc/platforms/
tmi2_fluffos_v2/lib/doc/mudlib/
tmi2_fluffos_v2/lib/ftp/
tmi2_fluffos_v2/lib/include/driver/
tmi2_fluffos_v2/lib/log/
tmi2_fluffos_v2/lib/log/driver/
tmi2_fluffos_v2/lib/obj/net/
tmi2_fluffos_v2/lib/obj/shells/
tmi2_fluffos_v2/lib/obj/tools/
tmi2_fluffos_v2/lib/std/adt/
tmi2_fluffos_v2/lib/std/board/
tmi2_fluffos_v2/lib/std/body/
tmi2_fluffos_v2/lib/std/fun/
tmi2_fluffos_v2/lib/std/living/
tmi2_fluffos_v2/lib/std/object/
tmi2_fluffos_v2/lib/std/shop/
tmi2_fluffos_v2/lib/std/socket/
tmi2_fluffos_v2/lib/std/user/
tmi2_fluffos_v2/lib/std/virtual/
tmi2_fluffos_v2/lib/student/
tmi2_fluffos_v2/lib/student/kalypso/
tmi2_fluffos_v2/lib/student/kalypso/armor/
tmi2_fluffos_v2/lib/student/kalypso/rooms/
tmi2_fluffos_v2/lib/student/kalypso/weapons/
tmi2_fluffos_v2/lib/u/l/leto/
tmi2_fluffos_v2/lib/u/l/leto/cmds/
tmi2_fluffos_v2/lib/www/errors/
tmi2_fluffos_v2/lib/www/gateways/
tmi2_fluffos_v2/lib/www/images/
tmi2_fluffos_v2/old/
tmi2_fluffos_v2/win32/
 
//	File	:  /cmds/xtra/_trace.c
//	Creator	:  Watcher@TMI  (03/04/93)
//	
//	This command allows you to locate any object, as well as
//	any clones of it active in the mud.  Descriptors and 
//	systematic destruction are options available.
 
#include <mudlib.h>
 
inherit DAEMON ;
 
#define SYNTAX "Syntax: trace -[d/m/v] [object/filename]\n"
#define PROTECT ({ "/std/user" , "/std/connection" })
 
int cmd_trace(string str) {
   object target;
   mixed *clones;
   string para, hold, tmp1, tmp2;
   int loop, dest, view, More, original;
 
   notify_fail( SYNTAX );
 
   if(!str || str == "")  return 0;
 
   //	Check for requested command parameters
 
   if(sscanf(str, "-%s %s", para, str) == 2) {
 
	if(sscanf(" " + para + " ", "%sd%s", tmp1, tmp2) == 2)	dest = 1;
	if(sscanf(" " + para + " ", "%sv%s", tmp1, tmp2) == 2)	view = 1;
	if(sscanf(" " + para + " ", "%sm%s", tmp1, tmp2) == 2)	More = 1;

   }
 
   //	Try to locate the requested object
 
   target = get_object( str );
 
   //	Oh well, couldn't find the object
 
   if(!target) {
   write("Trace: Could not locate requested object.\n");
   return 1; }
 
   hold = "Trace: " + identify(target);

   if(environment(target))
	hold += " in " + identify(environment(target)) + "\n";
   else hold += "\n";

   //	Try to located all copies of the object
 
   clones = children( file_name(target) );
 
   //	Its either the Master object or has no other copies around
 
   if(sizeof(clones) == 1) {

   if(base_name(clones[0]) != file_name(clones[0]))  write(hold);
   else write(hold + "There are no active copies of this object.\n");
 
   if(dest) {

	if((interactive(target) ||
	    member_array(base_name(target), PROTECT) != -1) &&
   	   !adminp(geteuid(this_player()))) {
	write("You do not have authorization to destruct that object.\n");
	return 1; }

	target->remove();
	if(target)  destruct(target);

	if(target)  write("Could not remove or destroy object.\n");
	else	    write("Object has been removed and destructed.\n");
   }
 
   return 1; }
 
   //	Remove the target object from the clone array
 
   else clones -= ({ target });
 
   //	Get original number of clones of designated object
 
   original = sizeof( clones );
 
   if(!(dest && !(More || view))) {
 
   hold += "\n   There are " + sizeof(clones) + " copies active.\n\n";
 
 
   //	Loop through the clone array to display contents
 
   for(loop=0; loop<sizeof(clones); loop++) {
 
     if(interactive(clones[loop]))  hold += " I ";  else hold += "   ";
 
     hold += identify( clones[loop] );
   
     //	If the object has an environment, display it...
 
     if(environment( clones[loop] ))
	hold += "\tin " + identify(environment(clones[loop])) + "\n";
     else hold += "\n";
 
   }
   }
 
   if(!More)  write(hold + "\n");
 
   else this_player()->more( explode(hold, "\n"), 0 ,1 );
 
 
   //	If the destruct flag is set, attempt to destruct
   //	all active copies of the requested object.
 
   if(dest) {
 
   if(More)  write("\n");
 
   //	Security check...don't want anyone just wiping out
   //	specific file objects like /std/user.c
 
   if(!adminp(geteuid(this_player())) &&
      member_array(base_name(target), PROTECT) != -1) {
   write("You do not have authorization to destruct that object group.\n");
   return 1; }

   //	Try to remove all clone copies
 
   clones->remove();
 
   clones = children( file_name(target) );
   clones -= ({ target });
 
   //	If there are any copies left...this should get rid of them
 
   for(loop=0; loop<sizeof(clones); loop++)
	destruct( clones[loop] );
 
   clones = children( file_name(target) );
   clones -= ({ target });
 
   write("All " + original + " copies of " + file_name(target) + " have " +
	 "been removed and destroyed");
 
   if(!sizeof(clones)) {  write(".\n");  return 1;  }
 
   write("except:\n");
 
   for(loop=0; loop<sizeof(clones); loop++)
	write("  " + clones[loop] + "\n");
   }
 
return 1; }
 
int help() {
 
   write( SYNTAX + "\n" +
	  "This command allows the user to locate the requested object\n" +
	  "and any active clones with their respective locations. The\n" +
	  "parameter 'd' can be used to remove and destruct every copy.\n" +
	  "When the 'd' parameter is envoked, the clones and locations\n" +
	  "will not be displayed. This can be overridden with the 'v'\n" +
	  "parameter. The 'm' parameter can be used to have the output\n" +
	  "given in a more format.\n\n" +
	  "The parameters can be given together and in any combination.\n" +
	  "For example:  trace -dm /obj/dagger  will destruct every copy\n" +
	  "of /obj/dagger and display their respective ids and locations\n" +
	  "in a more format.\n");

return 1; }