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/std/_hibernate.c
//	Creator	:  Watcher@TMI-2  (4/29/93)
//
//	This command allows a user to place their character into 
//	hiberation for a designated number of days. During this time,
//	the user will be unable to login. This is useful for self-imposed
//	exile from mudding during exam times, etc.
 
#include <logs.h>
#include <mudlib.h>
#include <daemons.h>

inherit DAEMON;

#define SYNTAX	"Syntax: hibernate [name] [number of days]\n"
 
int cmd_hibernate(string str) {
   int when;
 
  string user,time;
  object victim,link;

  if( !str )  {
     notify_fail( SYNTAX );
     return 0;
  }
	// Evil Admin purposes
  if(sscanf(str,"%s %s",user,time)) when = to_int(time);
  else when = to_int(str);
 
   notify_fail( SYNTAX );
 
   if(when < 1)  return 0;
 
   seteuid(getuid(this_object()));
 
   if(when > 90) {
   notify_fail("You cannot hibernate for longer than 90 days.\n");
   return 0; }
 
  // Admin check, see if we want to hibernate someone else.

  if(user) 
	{
          if(!adminp(geteuid(previous_object())) ||
             adminp(user)) 
						 {
                    notify_fail("hibernate: permission denied\n");
                    return 0;
             }
          if(!user_exists(user))
						 {
										 notify_fail("hibernate: no such user\n");
										 return 0;
             }
					 
          else {

       victim = find_player(user);
       if(victim) link = (object)victim->query_link();
			 else link = (object)FINGER_D->restore_data(user);
       link->set("hibernate", (time() + when*86400));
	     if(victim) {
			   tell_object(victim, capitalize(this_player()->query("name"))+
                 " has put you in hibernation for "+when+ " days.\n");
			   victim->quit();
				 write("Hibernated "+user+" for "+when+" days.\n");
#ifdef HIBERNATE
				 log_file(HIBERNATE, capitalize(this_player()->query("name")) + 
				 " has hibernated "+ capitalize(user) +" from " +
				 extract(ctime(time()), 4, 15) + " to " +
				 extract(ctime(time() + (when * 86400)), 4 ,15) + " [" +
					query_ip_number(this_player()) + "]\n");
#endif
			            }
                }
  return 1;
	} 


   input_to("pass_check", 1, when);
   write("\nAre you SURE you wish to place your character in hiberation for " +
	 when + " day" + (when == 1 ? "" : "s") + "?\nYou will not be able "+
	 "to login as that character until " + ctime(time() + (when*86400)) +
	 ".\n\nPlease confirm by entering your password: ");
 
return 1; }
 
static int pass_check(string pass, int when) {
   string name, password;
 
   //   Get player's name for logging purposes

   name = (string)this_player()->link_data("name");

   //   Get the user's password from the linked connection object

   password = (string)this_player()->link_data("password");

   //   Check to see the inputed password matches the actual password

   if(password != crypt(pass, password)) {
   write("\nInvalid password. Hibernation request aborted.\n");
   return 1; }

   write("\n\nFare thee well, adventurer. You may return on " + 
	 ctime(time() + when*86400) + ".\nEverything slowly fades away " +
	 "as you fall into a deep, peaceful slumber.\n\n");

   tell_room(environment(this_player()),
	capitalize(name) + " decides to hibernate until " +
	ctime(time() + when*86400) + ".\n", ({ this_player() }));

   //	Set the user's connection hibernation time length.
 
   this_player()->query_link()->set("hibernate", (time() + when*86400));

   //   Save the players attributes before file transfer

   this_player()->query_link()->save_data();

   //	IF HIBERNATE is defined, write the particulars to a log file

#ifdef HIBERNATE
   log_file(HIBERNATE, capitalize(name) + " has hibernated from " +
	    extract(ctime(time()), 4, 15) + " to " +
	    extract(ctime(time() + (when * 86400)), 4 ,15) + " [" +
	    query_ip_number(this_player()) + "]\n");
#endif
 
   this_player()->quit();
 
return 1; }
 
string help() {
 
   return( SYNTAX + "\n" +
    "This command allows you to place your character in hibernation. It will\n"+
    "disconnect your character and prevent you from logging back in until\n"+
    "the requested number of days have passed. This is useful for those who\n"+
    "wish to exile themselves temporarily from the mud during exam time.\n"+
                "Admins may supply a name to hibernate someone else.\n");

}