Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Google, Yandex, Yahoo!

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » extract_char and outtop (outb...
Forum Rules | Mark all | Recent Posts

extract_char and outtop (outbuf)
< Newer Topic :: Older Topic > Truncate outbuf closing socket

Pages:<< prev 1 next >>
Post is unread #1 Aug 12, 2013, 12:13 am   Last edited Aug 12, 2013, 12:29 am by Matteo2303
Go to the top of the page
Go to the bottom of the page

Matteo2303
Apprentice
GroupMembers
Posts57
JoinedAug 25, 2003

Hello,

type: sset self all 100
type: "practice" and "quit" immediatly after.
The practice-list will truncate and player quit without normal ch-leaving message.
This is only an example (...the same with "who" and players > 40-50).
Any ideas how to fix?

Bye!
       
Post is unread #2 Aug 12, 2013, 1:30 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

hmm with pager on
prac
quit
 .~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~[  Spells]~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.
       acetum primus 100%          acid breath 100%             acid fog 100% 
            acidball 100%             acidmist 100%             acidshot 100% 
           alertness 100%         animate dead 100%      antimagic shell 100% 
         aqua breath 100%                armor 100%          astral walk 100% 
            beautify 100%          benediction 100%      black lightning 100% 
           blazebane 100%            blazeward 100%                bless 100% 
           blindness 100%       call lightning 100%         cancellation 100% 
      cause critical 100%          cause light 100%        cause serious 100% 
      charged beacon 100%         charm person 100%      continual light 100% 
     control weather 100%          create fire 100%          create food 100% 
       create spring 100%         create water 100%       cure blindness 100% 
       cure critical 100%           cure light 100%          cure poison 100% 
        cure serious 100%                curse 100%            demonskin 100% 
         detect evil 100%        detect hidden 100%         detect invis 100% 
        detect magic 100%        detect poison 100%         detect traps 100% 
          disenchant 100%          dispel evil 100%         dispel magic 100% 
          dragon wit 100%           dragonskin 100%                dream 100% 
          earthquake 100%      eldritch sphere 100%         elven beauty 100% 
             enchant 100%         energy drain 100%      ethereal funnel 100% 
     ethereal shield 100% extradimensional por 100%          faerie fire 100% 
          faerie fog 100%             farsight 100%              fatigue 100% 
         fire breath 100%             fireball 100%           fireshield 100% 
(C)ontinue, (N)on-stop, (R)efresh, (B)ack, (Q)uit: © 
<30000hp 30000m 30000mv>[45,201,214Gold][RVnum 3]

so no issue there.
without pager
prac
quit
 .~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~[  Spells]~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.
       acetum primus 100%          acid breath 100%             acid fog 100% 
            acidball 100%             acidmist 100%             acidshot 100% 
           alertness 100%         animate dead 100%      antimagic shell 100% 
         aqua breath 100%                armor 100%          astral walk 100% 
            beautify 100%          benediction 100%      black lightning 100% 
           blazebane 100%            blazeward 100%                bless 100% 
           blindness 100%       call lightning 100%         cancellation 100% 
      cause critical 100%          cause light 100%        cause serious 100% 
      charged beacon 100%         charm person 100%      continual light 100% 
     control weather 100%          create fire 100%          create food 100% 
       create spring 100%         create water 100%       cure blindness 100% 
       cure critical 100%           cure light 100%          cure poison 100% 
        cure serious 100%                curse 100%            demonskin 100% 
         detect evil 100%        detect hidden 100%         detect invis 100% 
        detect magic 100%        detect poison 100%         detect traps 100% 
          disenchant 100%          dispel evil 100%         dispel magic 100% 
          dragon wit 100%           dragonskin 100%                dream 100% 
          earthquake 100%      eldritch sphere 100%         elven beauty 100% 
             enchant 100%         energy drain 100%      ethereal funnel 100% 
     ethereal shield 100% extradimensional por 100%          faerie fire 100% 
          faerie fog 100%             farsight 100%              fatigue 100% 
         fire breath 100%             fireball 100%           fireshield 100% 
               flare 100%               fletch 100%                float 100% 
                 fly 100%              fortify 100%         frost breath 100% 
          gas breath 100%                 gate 100%            grounding 100% 
                heal 100%             iceshard 100%            iceshield 100% 
            identify 100%          indignation 100%          infravision 100% 
        inner warmth 100%            invisible 100%     kindred strength 100% 
               knock 100%       know alignment 100%             lethargy 100% 
      lightning bolt 100%     lightning breath 100%     major invocation 100% 
          mass invis 100%          midas touch 100%     minor invocation 100% 
             nostrum 100%            pass door 100%               poison 100% 
           polymorph 100%               portal 100%           protection 100% 
          quickening 100%            razorbait 100%             recharge 100% 
        remove curse 100%         remove invis 100%          remove trap 100% 
          resilience 100%         restore mana 100%             sagacity 100% 
           sanctuary 100%                 scry 100%           shadowform 100% 
              shield 100%          shockshield 100%                sleep 100% 
               slink 100%           stone skin 100%               summon 100% 
           swordbait 100%             teleport 100%              torrent 100% 
           transport 100%       trollish vigor 100%           true sight 100% 
     unravel defense 100%               uplift 100%             valiance 100% 
         venomshield 100%            venomshot 100%               weaken 100% 
         winter mist 100%       word of recall 100% 
 .~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~[  Skills]~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.
    aggressive style 100%                  aid 100%             backstab 100% 
                bash 100%              berserk 100%        berserk style 100% 
                bite 100%                blitz 100%                block 100% 
            bloodlet 100%                 brew 100%                carve 100% 
                chop 100%               circle 100%                 claw 100% 
               climb 100%              concoct 100%                 cook 100% 
             counter 100%                 cuff 100%      defensive style 100% 
              detrap 100%                  dig 100%               disarm 100% 
               dodge 100%             dominate 100%             doorbash 100% 
                duck 100%                elbow 100%      enhanced damage 100% 
       evasive style 100%                 feed 100%                gouge 100% 
                grip 100%             headbutt 100%                 hide 100% 
               imbue 100%                  jab 100%                 kick 100% 
                knee 100%                 leap 100%                lunge 100% 
            makefire 100%             meditate 100%                  mix 100% 
               mount 100%      occulutus visum 100%                parry 100% 
                peek 100%                 pelt 100%            pick lock 100% 
       poison weapon 100%               pummel 100%                punch 100% 
                punt 100%               rescue 100%           roundhouse 100% 
                scan 100%               scribe 100%               search 100% 
         shieldblock 100%             shoulder 100%               shriek 100% 
               slice 100%                smell

so I assume it is the fact it doesn't finish before closing it you dont like?
       
Post is unread #3 Aug 12, 2013, 1:40 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

ok
prac
quit
 .~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~[  Spells]~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.
       acetum primus 100%          acid breath 100%             acid fog 100% 
            acidball 100%             acidmist 100%             acidshot 100% 
           alertness 100%         animate dead 100%      antimagic shell 100% 
         aqua breath 100%                armor 100%          astral walk 100% 
            beautify 100%          benediction 100%      black lightning 100% 
           blazebane 100%            blazeward 100%                bless 100% 
           blindness 100%       call lightning 100%         cancellation 100% 
      cause critical 100%          cause light 100%        cause serious 100% 
      charged beacon 100%         charm person 100%      continual light 100% 
     control weather 100%          create fire 100%          create food 100% 
       create spring 100%         create water 100%       cure blindness 100% 
       cure critical 100%           cure light 100%          cure poison 100% 
        cure serious 100%                curse 100%            demonskin 100% 
         detect evil 100%        detect hidden 100%         detect invis 100% 
        detect magic 100%        detect poison 100%         detect traps 100% 
          disenchant 100%          dispel evil 100%         dispel magic 100% 
          dragon wit 100%           dragonskin 100%                dream 100% 
          earthquake 100%      eldritch sphere 100%         elven beauty 100% 
             enchant 100%         energy drain 100%      ethereal funnel 100% 
     ethereal shield 100% extradimensional por 100%          faerie fire 100% 
          faerie fog 100%             farsight 100%              fatigue 100% 
         fire breath 100%             fireball 100%           fireshield 100% 
               flare 100%               fletch 100%                float 100% 
                 fly 100%              fortify 100%         frost breath 100% 
          gas breath 100%                 gate 100%            grounding 100% 
                heal 100%             iceshard 100%            iceshield 100% 
            identify 100%          indignation 100%          infravision 100% 
        inner warmth 100%            invisible 100%     kindred strength 100% 
               knock 100%       know alignment 100%             lethargy 100% 
      lightning bolt 100%     lightning breath 100%     major invocation 100% 
          mass invis 100%          midas touch 100%     minor invocation 100% 
             nostrum 100%            pass door 100%               poison 100% 
           polymorph 100%               portal 100%           protection 100% 
          quickening 100%            razorbait 100%             recharge 100% 
        remove curse 100%         remove invis 100%          remove trap 100% 
          resilience 100%         restore mana 100%             sagacity 100% 
           sanctuary 100%                 scry 100%           shadowform 100% 
              shield 100%          shockshield 100%                sleep 100% 
               slink 100%           stone skin 100%               summon 100% 
           swordbait 100%             teleport 100%              torrent 100% 
           transport 100%       trollish vigor 100%           true sight 100% 
     unravel defense 100%               uplift 100%             valiance 100% 
         venomshield 100%            venomshot 100%               weaken 100% 
         winter mist 100%       word of recall 100% 
 .~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~[  Skills]~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.
    aggressive style 100%                  aid 100%             backstab 100% 
                bash 100%              berserk 100%        berserk style 100% 
                bite 100%                blitz 100%                block 100% 
            bloodlet 100%                 brew 100%                carve 100% 
                chop 100%               circle 100%                 claw 100% 
               climb 100%              concoct 100%                 cook 100% 
             counter 100%                 cuff 100%      defensive style 100% 
              detrap 100%                  dig 100%               disarm 100% 
               dodge 100%             dominate 100%             doorbash 100% 
                duck 100%                elbow 100%      enhanced damage 100% 
       evasive style 100%                 feed 100%                gouge 100% 
                grip 100%             headbutt 100%                 hide 100% 
               imbue 100%                  jab 100%                 kick 100% 
                knee 100%                 leap 100%                lunge 100% 
            makefire 100%             meditate 100%                  mix 100% 
               mount 100%      occulutus visum 100%                parry 100% 
                peek 100%                 pelt 100%            pick lock 100% 
       poison weapon 100%               pummel 100%                punch 100% 
                punt 100%               rescue 100%           roundhouse 100% 
                scan 100%               scribe 100%               search 100% 
         shieldblock 100%             shoulder 100%               shriek 100% 
               slice 100%                smell 100%                sneak 100% 
            spinkick 100%                spurn 100%       standard style 100% 
               steal 100%               strike 100%                 stun 100% 
                swat 100%                swipe 100%                 tail 100% 
               taste 100%                 tend 100%                track 100% 
              trance 100%              trapset 100%               tumble 100% 
            uppercut 100%                vault 100% 
 .~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~[ Weapons]~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.
          barehanded 100%            bludgeons 100%        flexible arms 100% 
         long blades 100%      missile weapons 100%             pugilism 100% 
        short blades 100%        talonous arms 100% 
 .~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~[ Tongues]~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.~`~.
              common 100%              dwarven 100%               elvish 100% 
                gith 100%                gnome 100%             halfling 100% 
                ogre 100%               orcish 100%                pixie 100% 
            trollish 100% 
You have 98 practice sessions left.
Your surroundings begin to fade as a mystical swirling vortex of colors
envelops your body... When you come to, things aren't as they were.

A strange voice says, 'We await your return, Remcon...'

In do_quit right before the
   extract_char( ch, true );

adding in
   flush_buffer( ch->desc, false );

seems to fix the issue.
       
Post is unread #4 Aug 12, 2013, 1:58 pm
Go to the top of the page
Go to the bottom of the page

Matteo2303
Apprentice
GroupMembers
Posts57
JoinedAug 25, 2003

Thank you. I had noticed flush_buffer before but I haven't try nothing. I'll try. In any case I think that this "fix" apply also in do_rent and other functions where there is an extract_char fpull (true). Grep moment
       
Post is unread #5 Aug 12, 2013, 2:56 pm   Last edited Aug 12, 2013, 3:00 pm by Matteo2303
Go to the top of the page
Go to the bottom of the page

Matteo2303
Apprentice
GroupMembers
Posts57
JoinedAug 25, 2003

Matteo2303 said:

Thank you. I had noticed flush_buffer before but I haven't try nothing. I'll try. In any case I think that this "fix" apply also in do_rent and other functions where there is an extract_char fpull (true). Grep moment


In my case this fix doesn't work (not afkmud but smaug code)... probably because my output is more length than 4096? Mmmm ... if I increase in flush_buffer
if ( !mud_down && d->outtop > 4096 )
with
if ( !mud_down && d->outtop > 32768 )

and in write_to_descriptor

nBlock = UMIN( length - iStart, 4096 );
with
nBlock = UMIN( length - iStart, 32768 );

bad idea?
       
Post is unread #6 Aug 12, 2013, 3:41 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

well if you increased buffer size, yea you probably should up that to. it worked fine when I tested it on LoP lol
       
Post is unread #7 Aug 14, 2013, 1:01 am
Go to the top of the page
Go to the bottom of the page

Matteo2303
Apprentice
GroupMembers
Posts57
JoinedAug 25, 2003

I get a good explanation of problem in mudbytes forum:

SHARMAIR:
Though just marking the connection for deletion, and having the normal game loop
finish sending output is probably a better design for how to do the quit, I think the
problem here stems from how SMAUG handles flush_buffer() when there is a lot of
data to send. Close_socket() does call flush_buffer(), but if there is more then so
much data to send (4k in stock), it will send just part of it (.5k in stock). In the
normal quit, you don't send enough data for this to be a problem, but you are
sending quite a lot more and are probably going over the limit to trigger sending
only part of the output, causing the rest to not ever be sent as the connection
closes. You could just change the limits in flush_buffer(), or have it detect if
this is a closing connection and send all data (like it does now if the mud is going
down). You could do the later by setting a flag on the descriptor, passing a new
bool argument to flush_buffer(), or even using the quitting_char global. But I
would look at flush_buffer() and up the numbers there to at least see if that is
the root problem, even if you do a different final fix.


DAVID HALEY:
You probably don't want to hang the MUD while trying to flush the buffer on a quitting connection. If you don't leave the function, until the buffer is flushed, your MUD will keep trying to send until all data is sent. That's why it doesn't force the sending of the entire buffer (although it shouldn't just discard the rest).

.

I cant' undetstand the the david haley note. What the risk about sending all data to a quitting/renting char?
       
Post is unread #8 Aug 14, 2013, 12:37 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,866
JoinedJul 26, 2005

he means that if you keep it in that single loop while sending all the data it will hang up the mud if it just has massive amounts of data to send.
       
Pages:<< prev 1 next >>