MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: $do_command()



>From the MOO Programmer's Manual:

	The server next gives code in the database a chance to handle
	the command.  If the verb $do_command() exists, it is called
	with the words of the command passed as its arguments and
	argstr set to the raw command typed by the user. If
	$do_command() does not exist, or if that verb-call completes
	normally (i.e., without suspending or aborting) and returns a
	false value, then the built-in command parser is invoked to
	handle the command as described below. Otherwise, it is assumed
	that the database code handled the command completely and no
	further action is taken by the server for that command. 

In other words, if $do_command has a chance to intercept all commands.  If
it returns a true value, then the command is finished and the server
doesn't try to parse it.  If it returns a false value, the server
continues parsing the command normally.

So, yes, go ahead and hack away, and just make sure it returns 0.  If you
break it, remember, you can always reprogram it to "return 0;" using
.program #0:do_command.

Phantom

On Thu, 20 Feb 1997, Antonio Martos wrote:

> Err...
> What happens if I program a #0:do_command() ?
> I mean... if I start to play with it, which could be a "transparent"
> code to keep moo working?
> If I do not program it, it returns 0, so the moo should work as before?
> I am a bit confused with manual's explanation about it.
> Anyone can give a sample?, please.
> What I plan to do is a "command counter" to see how players manage with
> the moo their first time.
> Am I wrong at something?
> Can anyone tell me: "Sure, go ahead, just take care that do_command
> returns 0" ? 
> Thanks.
> 
> 



References:

Home | Subject Index | Thread Index