Re: A motd/imotd online editor

From: Hans H. Hjort (hjort@S-96-226.RESNET.OHIO-STATE.EDU)
Date: 12/15/97


On Mon, 15 Dec 1997, Chuck Reed wrote:

> Ok, this command code doesn't even get to the send_to_char call to send the
> text to the player(like you didnt know what that did!).  Anyone have any
> idea why?
>
[ snip ]

>   f = fopen(motd,"w");
>   send_to_char("Enter a new MOTD below:\r\n", ch);
>     while(i != FALSE) {
>        send_to_char("] ", ch);
>        fgets(buf2);
         ^^^^^^^^^^^
>    if(buf2 == "/s")
>       i = FALSE;
>    else
>       fprintf(f, "%s\r\n", buf2);
>   }
>  fclose(f);

According to the man page on my linux system, fgets takes three arguments.
In any case, it needs an input stream, where exactly will this input come
from?  All input via telnet connections is handled elsewhere, you can't
access it directly from here.

While fgets is waiting for input, the progam will be stuck at this point.
That means other characters can't fight, look or do anything else.  The
whole mud will pause until this routine finishes and control returns to
the game loop.  I don't think that is what you want.

Look at the code for writing to boards for an example of what you want to
do.

                                                                -Hans


     +------------------------------------------------------------+
     | 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