wileymud-1.187b/
wileymud-1.187b/attic/
wileymud-1.187b/attic/bin/
wileymud-1.187b/attic/lib/
wileymud-1.187b/attic/lib/adm/
wileymud-1.187b/attic/lib/man/
wileymud-1.187b/attic/lib/new-wld/
wileymud-1.187b/attic/lib/new-wld/default/
wileymud-1.187b/attic/lib/old/
wileymud-1.187b/attic/lib/wld/
wileymud-1.187b/attic/public_html/
wileymud-1.187b/attic/public_html/gfx/
wileymud-1.187b/attic/src/bin/
wileymud-1.187b/attic/src/etc/
wileymud-1.187b/attic/src/libauth-4.0-p5/
wileymud-1.187b/attic/src/sedna/
wileymud-1.187b/backups/
wileymud-1.187b/bin/
wileymud-1.187b/docs/
wileymud-1.187b/etc/
wileymud-1.187b/lib/
wileymud-1.187b/lib/adm/
wileymud-1.187b/lib/boards/
wileymud-1.187b/lib/log/
wileymud-1.187b/lib/man/
wileymud-1.187b/lib/ply/
wileymud-1.187b/lib/ply/a/
wileymud-1.187b/lib/ply/b/
wileymud-1.187b/lib/ply/c/
wileymud-1.187b/lib/ply/d/
wileymud-1.187b/lib/ply/g/
wileymud-1.187b/lib/ply/k/
wileymud-1.187b/lib/ply/m/
wileymud-1.187b/lib/ply/s/
wileymud-1.187b/lib/ply/t/
wileymud-1.187b/public_html/gfx/
wileymud-1.187b/src/bin/
wileymud-1.187b/src/convert/attic/
wileymud-1.187b/src/convert/obj/
wileymud-1.187b/src/convert/perl/
wileymud-1.187b/src/convert/perl/MudConvert/
wileymud-1.187b/src/convert/perl/MudConvert/DUMP/
wileymud-1.187b/src/convert/perl/MudConvert/Report/
wileymud-1.187b/src/convert/perl/MudConvert/WileyMUD/
wileymud-1.187b/src/convert/perl/output/
wileymud-1.187b/src/convert/perl/output/DUMP/
wileymud-1.187b/src/convert/perl/output/Report/
wileymud-1.187b/src/convert/perl/output/WileyMUD/
wileymud-1.187b/src/etc/
wileymud-1.187b/src/etc/init.d/
wileymud-1.187b/src/etc/rc.d/
wileymud-1.187b/src/etc/rc.d/init.d/
wileymud-1.187b/src/lib/
wileymud-1.187b/src/lib/adm/
wileymud-1.187b/src/lib/boards/
wileymud-1.187b/src/lib/log/
wileymud-1.187b/src/lib/man/
wileymud-1.187b/src/lib/ply/
wileymud-1.187b/src/lib/ply/a/
wileymud-1.187b/src/lib/ply/b/
wileymud-1.187b/src/lib/ply/c/
wileymud-1.187b/src/lib/ply/d/
wileymud-1.187b/src/lib/ply/e/
wileymud-1.187b/src/lib/ply/f/
wileymud-1.187b/src/lib/ply/g/
wileymud-1.187b/src/lib/ply/h/
wileymud-1.187b/src/lib/ply/i/
wileymud-1.187b/src/lib/ply/j/
wileymud-1.187b/src/lib/ply/k/
wileymud-1.187b/src/lib/ply/l/
wileymud-1.187b/src/lib/ply/m/
wileymud-1.187b/src/lib/ply/n/
wileymud-1.187b/src/lib/ply/o/
wileymud-1.187b/src/lib/ply/p/
wileymud-1.187b/src/lib/ply/q/
wileymud-1.187b/src/lib/ply/r/
wileymud-1.187b/src/lib/ply/s/
wileymud-1.187b/src/lib/ply/t/
wileymud-1.187b/src/lib/ply/u/
wileymud-1.187b/src/lib/ply/v/
wileymud-1.187b/src/lib/ply/w/
wileymud-1.187b/src/lib/ply/x/
wileymud-1.187b/src/lib/ply/y/
wileymud-1.187b/src/lib/ply/z/
wileymud-1.187b/src/obj/
wileymud-1.187b/src/utils/
wileymud-1.187b/src/utils/mobmaker/
Installation for Merc
---------------------

1. In your Makefile, above the list of O_FILES,
   include the following:

#I3 - Comment out to disable I3 support
I3 = 1

   Then directly below the list of O_FILES, add the following:
   [Note: BSD users - put a period in front of the word ifdef, and in front of the word endif]

ifdef I3
   O_FILES := i3.o $(O_FILES)
   C_FLAGS := $(C_FLAGS) -DI3 -DI3MERC
endif

2. Open merc.h and locate the following code:

#define PULSE_PER_SECOND	    4
#define PULSE_VIOLENCE		  ( 3 * PULSE_PER_SECOND)
#define PULSE_MOBILE		  ( 4 * PULSE_PER_SECOND)
#define PULSE_TICK		  (30 * PULSE_PER_SECOND)
#define PULSE_AREA		  (60 * PULSE_PER_SECOND)

   Directly below that, add the following:

#ifdef I3
   #include "i3.h"
#endif

3. Locate your pc_data struct, which should be in one of your main *.h files.

   Add the following to the end of it:

#ifdef I3
    I3_CHARDATA *i3chardata;
#endif

4. Open interp.c and locate the following section:

if ( !check_social( ch, command, argument )

   Add the following condition to whatever series of ifchecks exist there:

#ifdef I3
	&&   !I3_command_hook( ch, command, argument )
#endif

5. Open comm.c and locate main():

   A. If your mud uses copyover/hotboot, find this section( it may not look EXACTLY like this, adjust as needed ):
	If your mud does NOT use copyover/hotboot, move to B.

      if( argv[2] && argv[2][0] )
      {
         fCopyOver = TRUE;
         control = atoi( argv[3] );
      }
      else
         fCopyOver = FALSE;

   Change it to read as( while adjusting as needed ):

      if( argv[2] && argv[2][0] )
      {
         fCopyOver = TRUE;
         control = atoi( argv[3] );
#ifdef I3
	   I3_socket = atoi( argv[4] );
#endif
      }
      else
         fCopyOver = FALSE;

   This next part is somewhat tricky. If copyover_recover is called in db.c as is the usual case in
   most default installs, you need to place the following BEFORE the boot_db call. If it is listed
   somewhere here in comm.c, the following needs to be placed ABOVE it. Either way, I3_main needs
   to be called BEFORE copyover_recover or your mud WILL crash every time you do a copyover.

#ifdef I3
   /* Initialize and connect to Intermud-3 */
   I3_main( FALSE, port, fCopyOver );
#endif

   B. If your mud is NOT using copyover/hotboot:

      Locate the following:

#if defined(unix)
    control = init_socket( port );
    boot_db( );
    sprintf( log_buf, "Merc is ready to rock on port %d.", port );
    log_string( log_buf );

   Add the following beneath that:

#ifdef I3
   /* Initialize and connect to Intermud-3 */
   I3_main( FALSE, port, FALSE );
#endif

   C. ALL MUDS CONTINUE HERE:

   Then further down in main(), locate the following:

    while ( descriptor_list )
	close_socket( descriptor_list );

   Add the following beneath that:

#ifdef I3
   I3_shutdown( 0 );
#endif

   Then in game_loop_unix(), locate the following:

	/*
	 * Autonomous game motion.
	 */
	update_handler( );

   Directly ABOVE that, add the following:

#ifdef I3
	I3_loop();
#endif

   Then locate function act, and find the following code:

      switch ( *str )
      {
      default:  log_error( "Act: bad code %c.", *str );
		log_error( "Act: Bad code came from %s", ch->name );
		i = " <@@@> ";						break;

   Directly below that, add the following:

#ifdef I3
	case '$': 
	    i = "$";
	    break;
#endif

6. Open save.c and locate fread_char:

   Find:

	case 'L':
	    KEY( "Level",	ch->level,		fread_number( fp ) );
	    KEY( "LongDescr",	ch->long_descr,		fread_string( fp ) );
	    break;

   *ABOVE* that, add:

      case 'I':
#ifdef I3
	 if( ( fMatch = i3_loadchar( ch, fp, word ) ) )
            break;
#endif
         break;

   Then in fwrite_char, locate:

    fprintf( fp, "End\n\n" );

   Directly ABOVE that, add:

#ifdef I3
    i3save_char( ch, fp );
#endif

   Then in load_char_obj(), locate the following:

    found = FALSE;
    fclose( fpReserve );

    /* parsed player file directories by Yaz of 4th Realm */
    /* decompress if .gz file exists - Thx Alander */

   Directly ABOVE that, add the following:

#ifdef I3
    i3init_char( ch );
#endif

7. Open db.c

   Locate free_char:

   Under the following block of code:

	free_string( ch->pcdata->pwd		);
	free_string( ch->pcdata->bamfin		);
	free_string( ch->pcdata->bamfout	);
	free_string( ch->pcdata->title		);

   Add:

#ifdef I3
	free_i3chardata( ch );
#endif

8. For users of copyover only - Target code may not be exact:

   In function do_copyover, locate the following code:

    DESCRIPTOR_DATA *d, *de_next;
    char buf [100], buf2[100], buf3[100], buf4[100], buf5[100];

   Directly below that, add:

    char buf6[100];

   Then further down, find the following:

    /* exec - descriptors are inherited */
    sprintf( buf,  "%d", port );
    sprintf( buf2, "%d", control );
    sprintf( buf3, "%d", control2 );
    sprintf( buf4, "%d", conclient );
    sprintf( buf5, "%d", conjava );
  
    execl( EXE_FILE, "merc", buf, "hotboot",  buf2, buf3, buf4, buf5, (char *)NULL );

   Change that to read as follows:

#ifdef I3
   if( I3_is_connected() )
   {
	I3_savechanlist();
	I3_savemudlist();
	I3_savehistory();
   }
#endif

    /* exec - descriptors are inherited */
    sprintf( buf,  "%d", port );
    sprintf( buf2, "%d", control );
    sprintf( buf3, "%d", control2 );
    sprintf( buf4, "%d", conclient );
    sprintf( buf5, "%d", conjava );
#ifdef I3
    snprintf( buf6, 100, "%d", I3_socket );
#else
    strncpy( buf6, "-1", 100 );
#endif

    execl( EXE_FILE, "merc", buf, "hotboot",  buf2, buf3, buf4, buf5, buf6, (char *)NULL );

8b. Envy 2.2 ONLY:

Go back to save.c, and locate the following in fread_char:

        else
        {
            sprintf( buf, "fread_char: Unknown key '%s' in pfile.", word );
            log_error( buf, 0 );
            fread_to_eol( fp );
        }

   Directly ABOVE that, add:

#ifdef I3
      else if( i3_loadchar( ch, fp, word ) )
	   ;
#endif

8c. NiMud 4 ONLY:

For the db.c section, apply the changes to free_char in mem.c

In i3.c, under the #ifdef I3MERC section near the top, change:

#include "merc.h"

To:

#include "mud.h"

8d. EOS2 ONLY:

In i3.c, function i3log, find:

   log_string( buf );

Replace with:

   log_string( buf, CHANNEL_LOG, -1 );

Return to the main I3.txt file and continue where you left off.