Re: [CODE] [NEWBIE] (CON state processing and olc)

From: Gary Barnett (gbarnett@POLARNET.COM)
Date: 11/29/97


On Saturday, November 29, 1997 3:00 PM, Chuck Reed [SMTP:creed@I-55.COM]
wrote:
> Two things:
>
>
> 1)  I am having a big problem with my medit file.  IT WON'T ACCEPT
ANYTHING!
>
> In this, I mean that after you select any menu choice, it tells you to
> enter
> the appropriate argument, but then freezes when you do.  If anyone is
> willing to hlep me by taking a looksy at this, mail me back so I can send
> you my medit.c file (I don't want to spam everyone's mailbox with it)

Freezes? I assume you can reconnect and continue? If you can reconnect but
not continue then see the following as well. If the game crashes, instead,
then
you need to find out where it's crashing. There is no substitue for a
debugger.
The ability to find, if nothing else, the line that the code crashed on is
your
first, best clue. The values of relevant global and local vars are also very
useful.

If you can reconnect, then you have a problem in the logic used with the
STATE(d)
code.  See #2 for more info there.

>
> 2)  This is quite the newbie question.  How would I go about making a new
> log file for players to put their email addresses in.  Like right after it
> asks for your class, i want to prompt for a email addy and then log their
> respone to a file called like pmail (no log if nothing is entered).  Is
> this
> easy to do?

Look for the nanny function (interpreter.c.) This function deals with players
that aren't "playing"

What happens is that MEDIT does a STATE(d) = CON_MEDIT (d being your
socket descriptor,) then sends you the medit main menu. When you type a
command the nanny function gets the command and a chance to act upon it.
Look there for the logic to fix your first problem. Trace the code and you
should
be able to find it. If not then you could set breakpoints and see how far it
gets in
the medit routines before leaving the nanny function.

As for the second, add a new CON_ state (structs.h) and add the case to
handle the
input. You'll notice in nanny, that the rest of the code for handling the
login process
is there too.. Just make a new entry and modify the path so that yours is
called and
they go in sequence printing the proper questions.

Hope that helps.

--Mallory

Neither sweat, nor blood, nor frustration, nor lousy manuals
nor missing parts, nor wrong parts shall keep me from my task.
  --Christopher Hicks


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



This archive was generated by hypermail 2b30 : 12/08/00 PST