Advanced Immortal Host
======================
http://www.crimsonblade.org/snippets/

Disclaimer
==========

This code has been tested on a heavily modified version
of SMAUG 1.4a, there is no guarentee that it will work
on your copy, and I retain no responcibilty if this code
does anything to your code, your game, or the system it's
running on.

Terms of Use
============

(1) All comments and headers must be left in place.
(2) If you find a bug in the code, please report it to the
    SMAUG MAILING LIST (smaug@realms.game.org) and/or directly
    to myself: noplex@crimsonblade.org
(3) This code may only be re-distributed with the author's concent.
(4) I would like an email telling me that your using the code. This
    tells me actually how many people are using it, and if I should
    produce further snippets and code updates.
(5) If you are not abiding by the Diku, Merc, and Smaug codebase
    licenses, you may not use this code. (considering that your
    using SMAUG).

Overview
========

This code is a almost total rewrite of the Immortal host code that came
stock with Smaug 1.4a (and others?). It is basically the same design as
the original code, except Immortal hosts can now have up to a set limit
of domains that they can connect from (instead of one).

And all hosts that attempt to gain access to the character from an invaild
domain will be logged.

Future versions of this code will be adapted to my new ban code that I
hope to be bringing out in the near future, which will allow the code
to temp-ban someone if they try to gain access to an immortal, further
banning them for every attempt they make.

Instructions
============

(1) Mud.h

    (A) After:
      #define LEVEL_AVATAR		 (MAX_LEVEL - 15)
     Add:
      #include "imm_host.h" /* Advanced Immortal Host - 12/16/01 -Nopey */

    (B) Find the immortal_host structure and remove it.
    (C) Find DECLARE_DO_FUN( do_add_imm_host ); and remove it.
    (D) Remove
	/* imm_host.c */
	bool check_immortal_domain args ( ( CHAR_DATA *ch, char *host ) );
	int  load_imm_host args ( ( void ) );
	int  fread_imm_host args ( ( FILE *fp, IMMORTAL_HOST *data ) );
	void do_write_imm_host args (( void ));
	void do_add_imm_host args (( CHAR_DATA *ch, char *argument ));

(2) db.c

    (A) Remove or comment out:
       immortal_host_start = NULL;
       immortal_host_end = NULL;

(3) comm.c
    (A) Remove or Comment out (respectively to what you did above)
	IMMORTAL_HOST * immortal_host_start;	 /* Start of Immortal legal domains */
	IMMORTAL_HOST * immortal_host_end;    /* End of Immortal legal domains */

    (B) After:
	&& !check_immortal_domain( ch , d->host) )
	{
	Remove the two lines that log the 'hacking' attempt, this is now done in check_immortal_domain.
	It should look like this:
	if ( IS_IMMORTAL(ch) && sysdata.check_imm_host
	   && !check_immortal_domain( ch , d->host) )
	{
	close_socket (d, FALSE);
	return;
	}

(4) 
    (A) Replace your imm_host.c file with the one from the snippet.

    (B) Backup your existing immortal.host file (in the system directory) if your currently using any
    time of the original protection. Replace it with the -blank- immortal.host file included with the
    snippet.

(5) If your not using the BFD code found on Samson's website (http://www.alsherok.net/snippets/)
    add do_immhost to BOTH proper places in tables.c
    (A) If your _NOT_ using the BFD code, you will need to remove both entries for do_add_imm_host

(6) Add imm_host.h to your Makefile.

(7) Make clean, re-compile.

NOTES
=====

If your using the original immortal host, you will need to re-enter the data. Make sure you upload the
BLANK file "immortal.host" into the /system/ directory.

This code has been tested ALOT (and when I mean by alot, I mean ALOT =P) thanks to Samson and myself,
hopefully we've busted all of the bugs in the connection checking, and the wildcards.

If anyone doesn't know what wildcards are, they are * that can be used in the domain host string for
example:
  If your on 56k or any time of dynamic IP address, normally only the last digit of the IP address
changes.
   IP: 55.55.55.56

   If your on dialup, normally this would change from 55.55.55.2 and to between 55.55.55.255 (it could
be different, maybe less numbers depending on your ISP). Instead of putting in 253 entries, you could
just use a wildcard, 55.55.55.*, get the idea?

I'm just using IP addresses at example because that's how my MUD reads hosts, if you have host namelookups
enabled (I think it's default by SMAUG) it would be something like this.

   Host: domain.isp.com
  
   The domain might flux, it might not. You should observe your host in the logs before using this [if your
   using name lookups]. It should would like this:

	 *.isp.com
 
Credit
======

This was really a joint effort between myself, Samson and Senir in bringing this to you.
Samson helping with with the original version of the code, connection checking based mostly
on the original code, and Senir error-checking and going through fixing various bugs and things
that could have been optimized by myself. Thanks again guys =).

Also would like to thank Druid for showing me a bug I had no idea of, ;).

Bugs
====

If you find any bugs, please report them to either my email (below) or the
Smaug Mailing List (smaug@realms.game.org)

Noplex, Implementor of Crimson Blade
http://www.crimsonblade.org
noplex@crimsonblade.org
