From the NannyMUD documentation

LAST CHANGE

2000-12-12

NAME

        line_inherit - The player's interface to a stdline control.

INHERITS

	/std/basic_thing
	/std/line/control_interface

INCLUDES

	/std/line/line.h

FUNCTIONS

SETUP FUNCTIONS

	set_line_control
	QUERY FUNCTIONS

QUERY FUNCTIONS

	query_line_control
	is_line_inherit

OTHER FUNCTIONS

	apply_line_control
	init_arg

DESCRIPTION

	This file is a player's interface to a line set up using the
	line_control facility of stdline.
	Even though this object has no actual query or setup
	functions, the control_interface does, and for brevity those
	methods will be included here instead of in a separate file.

NOTE

	This object inherits /std/basic_thing.c.  If you inherit some
	other object in your line inherit such as simple_armour, you
	need to observe a few things:
	* The inherit of simple_armour (or whatever) must come AFTER
	  the inherit of the line_inherit.  This is essential so
	  that things like add_property are reflected in the other
	  portion of the object instead of in the line_inherit.
        * Otherwise, if you prefer, you can inherit the object called
	  line_inherit_nonstd, which is exactly like this one only it
	  doesn't inherit basic_thing.c.  Regardless though, read on:
	* You will need an init() function that looks like this:
		void init()
		{
		  simple_armour::init();
		  line_inherit::init();
		  // the rest of your setup here
		}
        * In the example above, it will actually be:
		line_inherit_nonstd::init();
	  if you are using the nonstd line_inherit.

	  Otherwise the player will not be connected to the line, nor
	  able to access any of its commands.

NOTE

	Additionally, your query_auto_load() function needs to give
	an argument to the autoload string, in addition to just the
	filename, for the login reports to work-- thus:
		string query_auto_load()
		{
		  return "/players/beldin/club/club_mark:X";
		}
	Instead of:
		string query_auto_load()
		{
		  return "/players/beldin/club/club_mark:";
		}
	Otherwise the init_arg() function is not executed on login,
	and the player's login is not reported on the line, if that
	feature is enabled.

NOTE

	One last note: If you define your own init_arg(x) function,
	don't forget to call ::init_arg(x); or the login reports will
	not work!

FUNCTION


NAME

        set_line_control - Set this object's line controller.

SYNTAX

void set_line_control(object controller)

SYNTAX

void set_line_control(string filename)

DESCRIPTION

	This function links the line control object to the line; this
	allows the add_command() function in the line controller to
	work as though every player on the line were carrying it in
	his/her inventory.
	Providing a filename instead of an object as an argument to
	this function is preferred, as it simplifies the process of
	updating the line controller.

NOTE

	Calling this function attempts to load the line_control,
	giving the potential for a runtime error in your reset()
	function.  Either call this function inside a catch(), or
	after any code which is essential to reset(0) in your object.

NOTE

	This function is defined in control_interface.c.

EXAMPLE

	set_line_control("/std/rfc/beldin/line/demo/demo_control");

EXAMPLE

	set_line_control(load_object(expand_file_name("demo_control"))); 

FUNCTION


NAME

        query_line_control - Return the object's line controller.

SYNTAX

object query_line_control()

DESCRIPTION

	This function returns the line's line controller in object
	form.  If no line control exists or is loaded, 0 can be
	returned.  Be aware of this in your code!

NOTE

	This is defined in control_interface.c.

FUNCTION


NAME

        is_line_inherit - The line_inherit identity function.

SYNTAX

int is_line_inherit()

DESCRIPTION

	The identity function for the line_inherit.
	This is mostly an internal function, but it might be useful
	for you to know it's there.

FUNCTION


NAME

        apply_line_control - Call a function in the line controller.

SYNTAX

	static mixed apply_line_control(string function,mixed arg1,
	                                mixed arg2,mixed arg3)

DESCRIPTION

	Call a function in the line controller if the line controller
	exists-- if so, return the result of the function.  Otherwise
	return 0.  This is mostly used for abstraction.  You will
	probably not need it very often at all-- the most likely
	reason for you to use this would be in some function from
	line_inherit that you need to redefine, for example to
	provide signal_init or signal_destruct with more arguments.

NOTE

	This function is defined in control_interface.c.

EXAMPLE

	write(sprintf("%O\n",
	  apply_line_control("query_entry",this_player()));
	(prints some debug info about your entry on the line)

FUNCTION


NAME

        init_arg - Used as a hook when the player logs in.

SYNTAX

void init_arg(string s)

DESCRIPTION

	The actual usage of the init_arg function is described
	elsewhere in the help system.  Simply suffice it to say that
	it is utilized in the stdline for login reports.
	If you have your own init_arg function, and are using login
	reports, or have your own signal_login function in the line
	controller, you need to call ::init_arg(s); from that
	function.

NOTE

	See the NOTES section before the function descriptions in
	this file.  There are a few things you need to observe with
	init_arg and query_auto_load.