Re: Problems with Intermud

From: Michael Scott (scottm@dns.workcomm.net)
Date: 05/05/96


On Sun, 5 May 1996, Ron Hensley wrote:
> As is, Intermud simply core dumped on startup every time
> logs showed an attempted connection to the two muds on it at the time, 
> then an error recieving bitmap form one mud, and an abort() call of intermud
> 
> Hades over at Tempus suggested intializing j to 0 in decode_services and 
> also to change the while loop fron
>   while (j != 8)
> to 
>   ((while j < 8)
> 
> To no avail however, always decode serices recieves an invalid message 
> and aborts()
> 

Yeah I had this same problem, when I went to install in on my system.
I'm using NetBSD 1.1 and what cleared it up was a re-write of that procedure
decode_services() in the intermud.c file.

replace the current procedure with the following: (I dont remember all the
changes i made .. but they weren't very major)  Just cleaned up a little.
------------------------------------------------------------
void decode_services(char *bitmap, struct dns_record *remote_mud) {
  int i, j;
  char tmpbuf[32];
  char *bufptr, *bytes;

  strcpy(tmpbuf, "00000000000000000000000000000000");

  bufptr = tmpbuf;

   j = 0;
   while (j < 8) {
      switch (bitmap[j]) {
       case 'F' : bytes = "1111"; break;
       case 'E' : bytes = "1110"; break;
       case 'D' : bytes = "1101"; break;
       case 'C' : bytes = "1100"; break;
       case 'B' : bytes = "1011"; break;
       case 'A' : bytes = "1010"; break;
       case '9' : bytes = "1001"; break;
       case '8' : bytes = "1000"; break;
       case '7' : bytes = "0111"; break;
       case '6' : bytes = "0110"; break;
       case '5' : bytes = "0101"; break;
       case '4' : bytes = "0100"; break;
       case '3' : bytes = "0011"; break;
       case '2' : bytes = "0010"; break;
       case '1' : bytes = "0001"; break;
       case '0' : bytes = "0000"; break;
       default  :
	 sprintf(mybuf, "ERROR: Invalid bitmap from %s - [%c]\n",
		 remote_mud->mud_name,
		 bitmap[j]);
	 DEBUG(mybuf);
	 abort();
	 break;
      }
      for (i = 0; i <= 3; i++) {
	 *bufptr = *bytes;
	 bytes++;
	 bufptr++;
      }
      
      /*
       while ((*bufptr = *(bytes++)))
       	 bufptr++;
       */
      
      j++;
   }
   
   bufptr = tmpbuf;
  
   for (i = 0; i <= 4; i++, bufptr++) {
      if (i == 0 && *bufptr == '1')
      	SET_BIT(remote_mud->services, ST_INTERWIZ);
      else if (i == 1 && *bufptr == '1')
      	SET_BIT(remote_mud->services, ST_INTERTELL);
      else if (i == 2 && *bufptr == '1')
      	SET_BIT(remote_mud->services, ST_INTERPAGE);
      else if (i == 3 && *bufptr == '1')
      	SET_BIT(remote_mud->services, ST_INTERWHO);
      else if (i == 4 && *bufptr == '1')
      	SET_BIT(remote_mud->services, ST_INTERBOARD);
   }
}
---------------------------------------------

I think thats what solved the prob for me.


                                          Michael Scott
			     Aka. the Wayfarer - scottm@workcomm.net



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