Re: BSOD (with the command)

From: George (greerga@CIRCLEMUD.ORG)
Date: 06/05/98


On Fri, 5 Jun 1998, Christopher Avans wrote:

>On Fri, 5 Jun 1998, Fafhrd wrote:
>
>> And to think I hired on as one of my coders, a member of the MS NT
>> development team :)
>>
>Hurm does your mud make peoples boxes use to much ram and lock up in a
>blue screen? or he just do that to non mud programs

void print_blue_line(struct char_data *ch, int width)
{
  char *line;
  int i;

  send_to_char("\E[44m", ch);
  CREATE(line, char, width + 1);
  for (i = 0; i < width; i++)
    line[width] = ' ';
  send_to_char(line, ch);
  free(line);
  send_to_char("\E[0;0m", ch);
}

ACMD(do_BSOD)
{
  int screen_size = 25;

  if (IS_NPC(ch))
    return;

  while (screen_size--)
    print_blue_line(ch, 80);    /* TODO: Use char* argument for message. */

  ch->desc->output = NULL;      /* Receive no more output. */
}

And add to write_to_output:

  int size;

+ if (t->output == NULL)
+   return;

  size = strlen(txt);

And change the line in game_loop() that says:

      if (*(d->output) && FD_ISSET(d->descriptor, &output_set)) {

to:

      if (d->output && *(d->output) && FD_ISSET(d->descriptor, &output_set)) {

Untested of course.

--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://patches.van.ml.org/          | stupidity is not thus handicapped.
http://www.van.ml.org/CircleMUD/    |                  -- Elbert Hubbard


     +------------------------------------------------------------+
     | 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/15/00 PST