Login
User Name:

Password:



Register

Forgot your password?
 copy_buffer
Jan 6, 2025 7:05 pm
By Remcon
 num_skills possible issue.
Jan 6, 2025 5:38 pm
By Remcon
 log file
Jan 6, 2025 3:38 pm
By Samson
 Hotboot issue
Jan 6, 2025 2:29 pm
By Samson
 Compiling AFKmud 2.2.3
Jan 6, 2025 12:59 pm
By Samson
LOP 1.6
Author: Remcon
Submitted by: Remcon
SWFOTEFUSS 1.5.1
Author: Various
Submitted by: Samson
SWRFUSS 1.4.1
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.5
Author: Various
Submitted by: Samson
AFKMud 2.2.4
Author: AFKMud Team
Submitted by: Samson
Users Online
Anthropic, Bytespider, Remcon, Bing, DotBot, Google

Members: 1
Guests: 6
Stats
Files
Topics
Posts
Members
Newest Member
494
3,815
19,749
590
BreannaWal

» SmaugMuds » Codebases » AFKMud Support & Development » display_practice issue
Forum Rules | Mark all | Recent Posts

display_practice issue
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jan 4, 2025 9:28 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,982
JoinedJul 26, 2005

 
So maybe you have a clue on this one Samson.
display_practice shows very different based on if using pager or not using pager.
I'm going to shorten it to compare the two and the problems should be noticed easier than full display.
Pager on display
        crystal blades (     Superb)        cure blindness (     Superb)
         cure critical (     Superb)            cure light (     Superb)
           cure poison (     Superb)          cure serious (     Superb)
        ghoulish touch (     Superb)             goodberry (     Superb)
             grounding (     Superb)           group armor (     Superb)
           group float (     Superb)             group fly (     Superb)
              recharge (     Superb)               refresh (     Superb)
            rejuvenate (     Superb)          remove curse (     Superb)
          remove invis (     Superb)      remove paralysis (     Superb)
             wizardeye (     Superb)        word of recall (     Superb)
            wraithform (     Superb)
---------------------------------[ Skills  ]-----------------------------------
             deathsong (     Superb)              detonate (     Superb)
         discern scent (     Superb)             drow fire (     Superb)
     elemental synergy (     Superb)             elvensong (     Superb)
---------------------------------[ Tongues ]-----------------------------------
               centaur (     Superb)                common (     Superb)
               dwarven (     Superb)                elvish (     Superb)
                  gith (     Superb)               gnomish (     Superb)

Without pager on
        crystal blades (     Superb)        cure blindness (     Superb)
         cure critical (     Superb)            cure light[0;32m(     Superb)
           cure poison (     Superb)          cure serious (     Superb)
        ghoulish touch (     Superb)             goodberry (     Superb)
             grounding(     Superb)           group armor (     Superb)
           group float (     Superb)             group fly (     Superb)
              recharge (     Superb)               refresh (     Superb)
            rejuvenate (     Superb)          remove curse ;32m(     Superb)
          remove invis (     Superb)      remove paralysis (     Superb)
             wizardeye (     Superb)        word of recall (     Superb)
            wraithform ;32m(     Superb)
---------------------------------[ Skills  ]-----------------------------------
             deathsong (     Superb)              detonate (     Superb)
         discern scent (     Superb)             dro fire (     Superb)
     elemental synergy (     Superb)             elvensong (     Superb)
---------------------------------[ Tongues ]-----------------------------------
               centaur (     Superb)                common (     Superb)
              dwarven (     Superb)                elvish (     Superb)
                  gith (     Superb)               gnomish (     Superb)

My guess is it is something when sending the output to the character on large strings when pager is off.

Post is unread #2 Jan 4, 2025 10:26 pm   
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,982
JoinedJul 26, 2005

 
ok this seems to fix it
/*
 * Low level output function.
 */
bool descriptor_data::flush_buffer( bool fPrompt )
{
   /*
    * If buffer has more than 4K inside, spit out .5K at a time   -Thoric
    *
    * Samson says: Lets do 4K chunks!
    */
   if( !mud_down && this->outbuf.length(  ) > 4095 )
   {
      char buf[4096];

      memcpy( buf, this->outbuf.c_str(  ), sizeof( buf ) );
      this->outbuf = this->outbuf.substr( sizeof( buf ), this->outbuf.length(  ) - strlen( buf ) );
      if( snoop_by )
      {
         buf[4095] = '\0'; // Holds the record for the longest standing bug that never got spotted. Because GCC should have had ways to see this sooner!
         if( character && character->name )
         {
            if( original && original->name )
               snoop_by->buffer_printf( "%s (%s)", character->name, original->name );
            else
               snoop_by->write_to_buffer( character->name );
         }
         snoop_by->write_to_buffer( "% " );
         snoop_by->write_to_buffer( buf );
      }
      if( !this->write( buf ) )
         return false;
      return true;
   }

   /*
    * Bust a prompt.
    */
   if( fPrompt && !mud_down && connected == CON_PLAYING )
   {
      char_data *ch;

      ch = original ? original : character;
      if( ch->has_pcflag( PCFLAG_BLANK ) )
         write_to_buffer( "\r\n" );

      if( !ch->isnpc(  ) )
         prompt(  );
      else
         write_to_buffer( ANSI_RESET );

      if( ch->has_pcflag( PCFLAG_TELNET_GA ) )
         write_to_buffer( (const char*)go_ahead_str );
   }

   /*
    * Short-circuit if nothing to write.
    */
   if( this->outbuf.empty(  ) )
      return true;

   /*
    * Snoop-o-rama.
    */
   if( snoop_by )
   {
      /*
       * without check, 'force mortal quit' while snooped caused crash, -h 
       */
      if( character && character->name )
      {
         /*
          * Show original snooped names. -- Altrag 
          */
         if( original && original->name )
            snoop_by->buffer_printf( "%s (%s)", character->name, original->name );
         else
            snoop_by->write_to_buffer( character->name );
      }
      snoop_by->write_to_buffer( "% " );
      snoop_by->write_to_buffer( outbuf );
   }

   /*
    * OS-dependent output.
    */
   if( !this->write( this->outbuf.c_str(  ) ) )
   {
      this->outbuf.erase(  );
      return false;
   }
   this->outbuf.erase(  );
   return true;
}

Pages:<< prev 1 next >>