Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ issues with pager

issues with pager

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Tzaro   USA  (41 posts)  Bio
Date Wed 12 Jul 2006 10:32 AM (UTC)
Message
Has anyone ever run across something like this:

if PCFLAG_PAGERON returns true, anything that uses "send_to_pager()" is displayed first, followed by everything that uses "send_to_char()".

if PCFLAG_PAGERON returns false, anything that uses "send_to_char()" is displayed first, followed by everything that uses "send_to_pager()".

I'm baffled. The only thing 'unique' about my version of color.c is that I condensed send_to_pager_color and colorize together. below is a copy of what the code looks like in send_to_pager_color()... least the part of interest (I think).

      if( IS_NPC( ch ) || !IS_SET( ch->pcdata->flags, PCFLAG_PAGERON ) )
      {
         send_to_char_color( txt, d->character );
         return;
      }

      while( ( colstr = strpbrk( prevstr, "&{}" ) ) != NULL )
      {
         if( colstr > prevstr )
            write_to_pager( ch->desc, prevstr, ( colstr - prevstr ) );

         ln = colorcode( colstr, colbuf, ch, FALSE );
         if( ln < 0 )
         {
            prevstr = colstr + 1;
            break;
         }
         else if( ln > 0 )
            write_to_pager( ch->desc, colbuf, ln );
         prevstr = colstr + 2;
      }

      if( *prevstr )
         write_to_pager( ch->desc, prevstr, 0 );
   }
   return;
}

Any clues?

-Tz

Implementer of Lost Prophecy,
Tzaro
Top

Posted by Tzaro   USA  (41 posts)  Bio
Date Reply #1 on Wed 12 Jul 2006 10:34 AM (UTC)
Message
Incase it brings up question... my colorcode function reads:

int colorcode( const char *col, char *code, CHAR_DATA * ch, bool override )

-Tz

Implementer of Lost Prophecy,
Tzaro
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #2 on Wed 12 Jul 2006 03:25 PM (UTC)
Message
Just to make sure I understand the problem: are you saying that the text is arriving out of order, of sorts, with each chunk (sent to pager or directly to char) arriving separately?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Tzaro   USA  (41 posts)  Bio
Date Reply #3 on Thu 13 Jul 2006 01:50 PM (UTC)

Amended on Thu 13 Jul 2006 01:52 PM (UTC) by Tzaro

Message
This is what's displayed when I exam a guard with pager "on".

<used as light>     a torch
<worn on finger>    (Magical) (Glowing) a ring of the city guard
<worn on body>      a crested breastplate
<worn on head>      an iron helm
<worn on legs>      mail leggings
<worn on feet>      black boots
<worn on hands>     iron gauntlets
<worn on arms>      chain sleeves
<wielded>           a longsword
You see nothing special about him.
The guard is in perfect health.
the guard is using:

Mobile #21037 'guard man' is a level 16 human warrior.

You peek at his inventory:
     Nothing.

-----------------------------------------------------------

This is pager "off":

You see nothing special about him.
The guard is in perfect health.

the guard is using:
<used as light>     a torch
<worn on finger>    (Magical) (Glowing) a ring of the city guard
<worn on body>      a crested breastplate
<worn on head>      an iron helm
<worn on legs>      mail leggings
<worn on feet>      black boots
<worn on hands>     iron gauntlets
<worn on arms>      chain sleeves
<wielded>           a longsword

Mobile #21037 'guard man' is a level 16 human warrior.

You peek at his inventory:
     Nothing.

Sorry I didn't explain this better the first time though :X

Tz

Implementer of Lost Prophecy,
Tzaro
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #4 on Thu 13 Jul 2006 02:47 PM (UTC)
Message
Hmm... I can't see offhand why that would be happening from the code you're showing. Can you maybe show what you changed, like a before/after of the comm functions?

What seems to be happening is that the MUD outputs the pager's contents before the other buffer (the normal, main one). Normally, when the pager is on, everything sent to the normal buffer (using send_to_char) is supposed to be redirected to the pager's buffer. You could check your send_to_char_color function and make sure that's what's happening.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Tzaro   USA  (41 posts)  Bio
Date Reply #5 on Sun 16 Jul 2006 10:22 AM (UTC)
Message
yep, I found the problem. The issue wasn't with anything changed in color.c at all. The issue was someone had changed nearly all of our calls from send_to_char to send_to_pager. Apparently, there had been an issue with send_to_char that was causing jarbled data to be returned to the character when mass-amounts of data would be sent.

The problem with send_to_char was with flush_buffer. It was putting a 'pause' in the data sent to the char for every 512 bytes of data sent.... but the player could choose to have more than that sent to them. I changed it to reflect how much data the player wanted to have sent and changed all the send_to_pager calls back to send_to_char and everything was resolved.

Ksilyan, if you ever happen to see me strolling by, feel free to thwap me for wasting your time. I'll be sure to check the function calls first instead of just assuming they are how they're supposed to be from now on.

Implementer of Lost Prophecy,
Tzaro
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Sun 16 Jul 2006 09:45 PM (UTC)
Message
Hey, no problem. :) This is the kind of annoyance you see in SMAUG a lot. Things, that really shouldn't, can have far-reaching consequences and seriously muck things up in ways that are hard to foresee. When I replaced the SMAUG network code with my own I had a fair number of headaches, a lot relating to the pager. But, it's good that you fixed it!

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


20,938 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.