Login
User Name:

Password:



Register

Forgot your password?
 Ubuntu 22.04.5 LTS
Dec 4, 2024 4:44 am
By Remcon
 the 8 bit mud. My new mud
Dec 4, 2024 2:09 am
By bevybacteria
SmaugFUSS 1.8/1.9
Nov 29, 2024 11:46 am
By Remcon
Hi - Clean SmaugFuss map/description issue..
Nov 26, 2024 6:53 pm
By Remcon
Any Smaug muds running?
Nov 11, 2024 8:28 pm
By eldhamud
Discord Websocket Server
Author: Khonsu
Submitted by: Khonsu
Mapout Fix
Author: Khonsu
Submitted by: Khonsu
Progfind command
Author: Khonsu
Submitted by: Khonsu
do_owhere recursive
Author: Khonsu
Submitted by: Khonsu
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
Users Online
Bing, AhrefsBot

Members: 0
Guests: 25
Stats
Files
Topics
Posts
Members
Newest Member
492
3,806
19,693
590
bevybacteria

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Codebases » SmaugFUSS » Hi - Clean SmaugFuss map/desc...
Forum Rules | Mark all | Recent Posts

Hi - Clean SmaugFuss map/description issue..
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Nov 25, 2024 1:35 pm   Last edited Nov 25, 2024 2:45 pm by dexio
Go to the top of the page
Go to the bottom of the page

dexio
Fledgling
GroupMembers
Posts4
JoinedNov 25, 2024

 
Hello! I have the config +automap on. So it shows a small map with the description on SmaugFuss. I had to turn off AddressSanitizer as my host has a debugger(as weather kept bugging and d/c players). However, it only shows the first and last line of the description. Again, this is a fresh install - curious how I can resolve this. Thanks for any info - I am not truly knowledgeable with C++, just a 20 year vet to web design and modding.
If I config -automap -then the full room description shows proper.
https://i.imgur.com/b2MoaiY.png
https://i.imgur.com/WcVdQee.png

Post is unread #2 Nov 25, 2024 3:32 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,938
JoinedJul 26, 2005

 
ok so first thing i would do is take a good look at the screen when its doing it and see if you highlight the screen it shows the characters you couldn't see before. Could be as simple as a color display issue. No point in chasing the wrong issue :). If it doesn't show up then you will want to take a look at the code in mapper.c draw_room_map function and all the stuff it calls.

Post is unread #3 Nov 25, 2024 4:01 pm   
Go to the top of the page
Go to the bottom of the page

dexio
Fledgling
GroupMembers
Posts4
JoinedNov 25, 2024

 
highlighting the screen shows nothing, it just ends at the map... as to say, it's not filled with black text, or spaces.. it just does not show, like it's not printing out from the code to begin with.
https://i.imgur.com/oRXLoFd.png
https://i.imgur.com/pERXX6A.png

Post is unread #4 Nov 25, 2024 4:27 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,938
JoinedJul 26, 2005

 
odd that it is skipping it all then lets see.

id say start in mapper.c show_map function at the parts for !alldesc The object is of course to do the part of the map (which all seems fine with the map) then add in some of the text on each line as well.

Post is unread #5 Nov 25, 2024 8:04 pm   Last edited Nov 25, 2024 11:20 pm by dexio
Go to the top of the page
Go to the bottom of the page

dexio
Fledgling
GroupMembers
Posts4
JoinedNov 25, 2024

 
I was looking at that before i posted here. I'll just go back to rom sadly thanks anyways though!

https://i.imgur.com/wnVLwdc.png

Post is unread #6 Nov 26, 2024 4:49 am   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,938
JoinedJul 26, 2005

 
You will always have things like this to chase down regardless of the base you start with sadly. It looks like the first is doing what it should without any issues and the second part of sending text has issues and only adds the last line of text into the map part. id start there if I was having the issue and add in logs to see where it is going crazy. does it have the text in question (my guess is yes since it seems to be giving the correct space between the first line of text and the last line of text).

Post is unread #7 Nov 26, 2024 12:00 pm   
Go to the top of the page
Go to the bottom of the page

dexio
Fledgling
GroupMembers
Posts4
JoinedNov 25, 2024

 
Hey thanks, no stress! It's the first issue anyone sees when logging in with smaugfuss, so I just had hoped there was public documentation for it, but seems anyone fixing it isn't discussing the resolution. Regardless, with my level of knowledge, I can't repair experienced coders errors haha. I'll check in the future perhaps though, I gave it another 3-4 hours moving stuff around on mapper.c though, literally can not get any room description to print past the first or last line of description, 100% baffled as to why. I am of no help to fix this sorry, but cheers for the responses! :biggrin:

Post is unread #8 Nov 26, 2024 3:36 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,938
JoinedJul 26, 2005

 
what are you running it on and all? i can try to help but just messing with it i can tell ill have to update a copy to even run in cygwin lol.

Post is unread #9 Nov 26, 2024 5:16 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,938
JoinedJul 26, 2005

 
well now that i took some time to get it to compile i can verify the copy i have also has this issue im guessing lots never turn it on lol ill try to see what i can figure out give me a few

Post is unread #10 Nov 26, 2024 6:50 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,938
JoinedJul 26, 2005

 
ok so it took a bit of testing to see what the issue was but it seems like it is in a few spots like this in show_map
            mudstrlcat( buf, p, pos );


instead make it look like this
            mudstrlcat( buf, p, ( strlen( buf ) + pos ) );

It is always cutting it off make sure you get all the spots with it doing that ( I think there were 3 )

Post is unread #11 Nov 26, 2024 6:53 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,938
JoinedJul 26, 2005

 
so change
/* Display the map to the player */
void show_map( CHAR_DATA * ch, char *text )
{
   char buf[MAX_STRING_LENGTH * 2];
   int x, y, pos;
   char *p;
   bool alldesc = FALSE;   /* Has desc been fully displayed? */

   if( !text )
      alldesc = TRUE;

   pos = 0;
   p = text;
   buf[0] = '\0';

   /*
    * Show exits 
    */
   if( xIS_SET( ch->act, PLR_AUTOEXIT ) )
      snprintf( buf, MAX_STRING_LENGTH * 2, "%s%s", color_str( AT_EXITS, ch ), get_exits( ch ) );
   else
      mudstrlcpy( buf, "", MAX_STRING_LENGTH * 2 );

   /*
    * Top of map frame 
    */
   mudstrlcat( buf, "&z+-----------+&w ", MAX_STRING_LENGTH * 2 );
   if( !alldesc )
   {
      pos = get_line( p, 63 );
      if( pos > 0 )
      {
         mudstrlcat( buf, color_str( AT_RMDESC, ch ), MAX_STRING_LENGTH * 2 );
         strncat( buf, p, pos );
         p += pos;
      }
      else
      {
         mudstrlcat( buf, color_str( AT_RMDESC, ch ), MAX_STRING_LENGTH * 2 );
         mudstrlcat( buf, p, MAX_STRING_LENGTH * 2 );
         alldesc = TRUE;
      }
   }
   mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH * 2 );

   /*
    * Write out the main map area with text 
    */
   for( y = 0; y <= MAPY; ++y )
   {
      mudstrlcat( buf, "&z|&D", MAX_STRING_LENGTH * 2 );

      for( x = 0; x <= MAPX; ++x )
      {
         switch ( dmap[x][y].tegn )
         {
            case '-':
            case '|':
            case '\\':
            case '/':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&O%c&d", dmap[x][y].tegn );
               break;

            case '@':  // Character is standing here
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&R%c&d", dmap[x][y].tegn );
               break;

            case 'O':  // Indoors
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&w%c&d", dmap[x][y].tegn );
               break;

            case '=':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&B%c&d", dmap[x][y].tegn );
               break;

            case '~':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&C%c&d", dmap[x][y].tegn );
               break;

            case '+':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&Y%c&d", dmap[x][y].tegn );
               break;

            case '*':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&g%c&d", dmap[x][y].tegn );
               break;

            case 'X':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&R%c&d", dmap[x][y].tegn );
               break;

            case ':':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&Y%c&d", dmap[x][y].tegn );
               break;

            default:   // Empty space
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "%c", dmap[x][y].tegn );
               break;
         }
      }
      mudstrlcat( buf, "&z|&D ", MAX_STRING_LENGTH * 2 );

      /*
       * Add the text, if necessary 
       */
      if( !alldesc )
      {
         pos = get_line( p, 63 );
         char col[10], c[2];

         mudstrlcpy( c, whatColor( text, p ), 2 );
         if( c[0] == '\0' )
            mudstrlcpy( col, color_str( AT_RMDESC, ch ), 10 );
         else
            snprintf( col, 10, "%s", c );

         if( pos > 0 )
         {
            mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
            mudstrlcat( buf, p, pos );
            p += pos;
         }
         else
         {
            mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
            mudstrlcat( buf, p, MAX_STRING_LENGTH * 2 );
            alldesc = TRUE;
         }
      }
      mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH * 2 );
   }

   /*
    * Finish off map area 
    */
   mudstrlcat( buf, "&z+-----------+&D ", MAX_STRING_LENGTH * 2 );
   if( !alldesc )
   {
      char col[10], c[2];
      pos = get_line( p, 63 );

      mudstrlcpy( c, whatColor( text, p ), 2 );
      if( c[0] == '\0' )
         mudstrlcpy( col, color_str( AT_RMDESC, ch ), 10 );
      else
         snprintf( col, 10, "%s", c );

      if( pos > 0 )
      {
         mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
         mudstrlcat( buf, p, pos );
         p += pos;
         mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH * 2 );
      }
      else
      {
         mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
         mudstrlcat( buf, p, MAX_STRING_LENGTH * 2 );
         alldesc = TRUE;
      }
   }

   /*
    * Deal with any leftover text 
    */
   if( !alldesc )
   {
      char col[10], c[2];

      do
      {
         /*
          * Note the number - no map to detract from width 
          */
         pos = get_line( p, 78 );

         mudstrlcpy( c, whatColor( text, p ), 2 );
         if( c[0] == '\0' )
            mudstrlcpy( col, color_str( AT_RMDESC, ch ), 10 );
         else
            snprintf( col, 10, "%s", c );

         if( pos > 0 )
         {
            mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
            mudstrlcat( buf, p, pos );
            p += pos;
            mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH * 2 );
         }
         else
         {
            mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
            mudstrlcat( buf, p, MAX_STRING_LENGTH * 2 );
            alldesc = TRUE;
         }
      }
      while( !alldesc );
   }
   mudstrlcat( buf, "&D\r\n", MAX_STRING_LENGTH * 2 );
   send_to_char( buf, ch );
}

to this
/* Display the map to the player */
void show_map( CHAR_DATA * ch, char *text )
{
   char buf[MAX_STRING_LENGTH * 2];
   int x, y, pos;
   char *p;
   bool alldesc = FALSE;   /* Has desc been fully displayed? */

   if( !text )
      alldesc = TRUE;

   pos = 0;
   p = text;
   buf[0] = '\0';

   /*
    * Show exits 
    */
   if( xIS_SET( ch->act, PLR_AUTOEXIT ) )
      snprintf( buf, MAX_STRING_LENGTH * 2, "%s%s", color_str( AT_EXITS, ch ), get_exits( ch ) );
   else
      mudstrlcpy( buf, "", MAX_STRING_LENGTH * 2 );

   /*
    * Top of map frame 
    */
   mudstrlcat( buf, "&z+-----------+&w ", MAX_STRING_LENGTH * 2 );
   if( !alldesc )
   {
      pos = get_line( p, 63 );
      if( pos > 0 )
      {
         mudstrlcat( buf, color_str( AT_RMDESC, ch ), MAX_STRING_LENGTH * 2 );
         strncat( buf, p, pos );
         p += pos;
      }
      else
      {
         mudstrlcat( buf, color_str( AT_RMDESC, ch ), MAX_STRING_LENGTH * 2 );
         mudstrlcat( buf, p, MAX_STRING_LENGTH * 2 );
         alldesc = TRUE;
      }
   }
   mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH * 2 );

   /*
    * Write out the main map area with text 
    */
   for( y = 0; y <= MAPY; ++y )
   {
      mudstrlcat( buf, "&z|&D", MAX_STRING_LENGTH * 2 );

      for( x = 0; x <= MAPX; ++x )
      {
         switch ( dmap[x][y].tegn )
         {
            case '-':
            case '|':
            case '\\':
            case '/':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&O%c&d", dmap[x][y].tegn );
               break;

            case '@':  // Character is standing here
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&R%c&d", dmap[x][y].tegn );
               break;

            case 'O':  // Indoors
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&w%c&d", dmap[x][y].tegn );
               break;

            case '=':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&B%c&d", dmap[x][y].tegn );
               break;

            case '~':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&C%c&d", dmap[x][y].tegn );
               break;

            case '+':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&Y%c&d", dmap[x][y].tegn );
               break;

            case '*':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&g%c&d", dmap[x][y].tegn );
               break;

            case 'X':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&R%c&d", dmap[x][y].tegn );
               break;

            case ':':
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "&Y%c&d", dmap[x][y].tegn );
               break;

            default:   // Empty space
               snprintf( buf + strlen( buf ), ( MAX_STRING_LENGTH * 2 ) - strlen( buf ), "%c", dmap[x][y].tegn );
               break;
         }
      }
      mudstrlcat( buf, "&z|&D ", MAX_STRING_LENGTH * 2 );

      /*
       * Add the text, if necessary 
       */
      if( !alldesc )
      {
         pos = get_line( p, 63 );
         char col[10], c[2];

         mudstrlcpy( c, whatColor( text, p ), 2 );
         if( c[0] == '\0' )
            mudstrlcpy( col, color_str( AT_RMDESC, ch ), 10 );
         else
            snprintf( col, 10, "%s", c );

         if( pos > 0 )
         {
            mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
            mudstrlcat( buf, p, ( strlen( buf ) + pos ) );
            p += pos;
         }
         else
         {
            mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
            mudstrlcat( buf, p, MAX_STRING_LENGTH * 2 );
            alldesc = TRUE;
         }
      }
      mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH * 2 );
   }

   /*
    * Finish off map area 
    */
   mudstrlcat( buf, "&z+-----------+&D ", MAX_STRING_LENGTH * 2 );
   if( !alldesc )
   {
      char col[10], c[2];
      pos = get_line( p, 63 );

      mudstrlcpy( c, whatColor( text, p ), 2 );
      if( c[0] == '\0' )
         mudstrlcpy( col, color_str( AT_RMDESC, ch ), 10 );
      else
         snprintf( col, 10, "%s", c );

      if( pos > 0 )
      {
         mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
         mudstrlcat( buf, p, ( strlen( buf ) + pos ) );
         p += pos;
         mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH * 2 );
      }
      else
      {
         mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
         mudstrlcat( buf, p, MAX_STRING_LENGTH * 2 );
         alldesc = TRUE;
      }
   }

   /*
    * Deal with any leftover text 
    */
   if( !alldesc )
   {
      char col[10], c[2];

      do
      {
         /*
          * Note the number - no map to detract from width 
          */
         pos = get_line( p, 78 );

         mudstrlcpy( c, whatColor( text, p ), 2 );
         if( c[0] == '\0' )
            mudstrlcpy( col, color_str( AT_RMDESC, ch ), 10 );
         else
            snprintf( col, 10, "%s", c );

         if( pos > 0 )
         {
            mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
            mudstrlcat( buf, p, ( strlen( buf ) + pos ) );
            p += pos;
            mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH * 2 );
         }
         else
         {
            mudstrlcat( buf, col, MAX_STRING_LENGTH * 2 );
            mudstrlcat( buf, p, MAX_STRING_LENGTH * 2 );
            alldesc = TRUE;
         }
      }
      while( !alldesc );
   }
   mudstrlcat( buf, "&D\r\n", MAX_STRING_LENGTH * 2 );
   send_to_char( buf, ch );
}

Pages:<< prev 1 next >>