Re: Ascii Player Files

From: Peter Ajamian (peter@pajamian.dhs.org)
Date: 10/18/00


Lord Kyu wrote:
>
>    It would be great is someone, wishing to give back to the community,
> would take the ascii player files suggested by your link, and update it
> for stock bpl17, or form it into a hand patch file that was more
> detailed.  Alas, I have not the knowledge for such.
>
If you can get it to work then you can easily make a patch or write out
instructions for everyone else to use.  If you want to write
instructions then simply write out what you did to make it work.  If you
want to make a patch then there are instructions for doing so in the
CircleMUD FAQ
(http://developer.circlemud.org/documentation/faq/FAQ-2.html#ss2.7).
>
>    Maybe I should have been more clear with my question here.  I know
> why they are setup that way, though is having them with partial name
> sub-commands really the best way to avoid this type of problem?  Doing
> things this way makes two commands on the commands list that are
> useless.

No, not useless, they have a perfectly good use, thier use is to prevent
the accidental execution of potentially harmfull commands.

> Thinking maybe a better way would be a check inside of the
> commands themselves to see if it is not the command name in it's
> entirety, and to send a message to inform them they need to type the
> whole thing out, thus avoiding extra, unneeded commands.

I don't think that would be any better than adding another two or three
commands, but if you really want to try to make the virtually negligible
difference that it causes even less negligible then one of the following
suggestions might work out better than what you are proposing...

 - Make a new ACMD as follows...

ACMD(do_huh) {send_to_char("Huh?!?\r\n", ch);}

Then change all the partial commands to point to that and get rid of all
the extra code that each of these commands uses to individually output
the message, you'll be saving a little bit of RAM by doing this because
you won't be duplicating code and you'll be using the same message for
all the partial commands.

 - add a flags field to the command structure, then make one of the
flags a strict name flag.  Have the command interpreter itself check for
the strict flag and if it exists enforce that the typed command be the
full command.  Note that this may actually cause more overhead becuase
you will be adding an extra check for each command that loops through
the command interpreter, but it's a better solution if you plan on
enforcing full length commands for a lot more commands.

Regards, Peter


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT