# Prompts

Kipp the Kidd (mcmudge@mailbox.syr.edu)
Tue, 5 Mar 1996 06:26:34 PST

- Messages sorted by:[ date ][ thread ][ subject ][ author ]

    >All it really does is, inside server.c, in the main program loop, after
    >decoding AND executing the line of text typed by the player, it calls
    >the verb #0:do_prompt() IF the verb exists.  I found the best thing to
    >do inside there is to just call player:do_prompt() which handled things
    >like prompt enabling, disabling, customizing, etc.

    Another reason why Pavel should get rid of :do_login_command() and
    :do_command().  The DB may run :do_command(), then parse the command, and
    then display a prompt, without the need for a fork(0), which is what my MOO
    currently uses.  The fork is still fast though, since it is at the beginning
    of the verb, there are no variables that need to be copied.

    I put a suspend(0) after the fork(0) and before the rest of the prompt code,
    so if the command just issued does a suspend(0), the player doesn't get
    spammed with extra prompts... It works faster than a fork(1), which is much
    too long.  ...is this the best way to do it?

    >The nice part about it is that the prompt will display even if the verb
    >you are calling suspends for any reason, as well as when the player
    >just presses ENTER, something no in-db verb can do.

    This is incorrect.  #0:do_command() is called when someone hits enter.  I
    decided against doing this for prompts, because for some reason, 1.8.0 will
    incorrectly think that clients send 2 CR's, thus making 2 prompts appear.
    Yucko.

    - Kipp
    -----BEGIN GEEK CODE BLOCK-----
    GCS/CC d- s+:- a16 C++ UL++++ P+ L++ E-? W+ !N--@ !o-- K->K++++++
    w++(--) O- M-- V--? PS++(+) PE(--) Y+ PGP-? t+ 5(+) X++ R+++(*)
    !tv b+ DI++++ D++++ G e* h!()(*) r+ !y+
    ------END GEEK CODE BLOCK------
    -----BEGIN NOT SO GEEKY BLOCK-----
    MOO projects:
      RPG Minimal.db:  paradigm.microwave.com 5000
      MOO2000:         moo.microwave.com 2000
      MundoHispano:    europa.syr.edu 8888
    ------END NOT SO GEEKY BLOCK------