[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Increasing Line lengths on an SWR codebase.

Increasing Line lengths on an SWR codebase.

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


Posted by RAlen   (5 posts)  [Biography] bio
Date Sun 07 Jan 2007 01:55 PM (UTC)
Message
This may be a rather simple question, but i'm pretty new to coding, so please bear with me.

What i'm looking to do is expand the line lengths for most channels on an SWR codebase...for instance, a long 'emote' or 'say' will return 'line too long.' and cut it off at a certain point, and i'm looking to prevent that.

Any suggestions?
[Go to top] top

Posted by Conner   USA  (381 posts)  [Biography] bio
Date Reply #1 on Sun 07 Jan 2007 07:46 PM (UTC)
Message
You can try increasing the size of MAX_STRING_LENGTH.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #2 on Sun 07 Jan 2007 08:04 PM (UTC)
Message
I think there's also a variable MAX_INPUT_LENGTH that you can set as well, which controls how long an input line can be.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Conner   USA  (381 posts)  [Biography] bio
Date Reply #3 on Sun 07 Jan 2007 10:20 PM (UTC)
Message
Yup, there is that one as well.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
[Go to top] top

Posted by RAlen   (5 posts)  [Biography] bio
Date Reply #4 on Mon 08 Jan 2007 09:41 PM (UTC)
Message
Thanks, one or two others I'd asked had suggested that. However, changing that value in mud.h where it's defined appears to have no effect. Any other ideas?
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #5 on Mon 08 Jan 2007 09:43 PM (UTC)
Message
You make sure to do a clean compile?

I know I changed this in the past, but I can't remember how. Maybe try finding the max # of chars and grepping for that.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by RAlen   (5 posts)  [Biography] bio
Date Reply #6 on Mon 08 Jan 2007 10:15 PM (UTC)
Message
Yep, compiled each time after trying various suggestions, still no luck. But i'll try the grep and see what I can find, thanks.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #7 on Mon 08 Jan 2007 10:19 PM (UTC)
Message
It's not just a compile that you need. You need to type "make clean", then "make". (That's what a 'clean' compile refers to.)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by RAlen   (5 posts)  [Biography] bio
Date Reply #8 on Tue 09 Jan 2007 02:46 PM (UTC)
Message
Yes, I know, that's what I meant. And thanks for all the help, but I found and extended the limit itself in the end in canonical input processing.


[Go to top] top

Posted by Conner   USA  (381 posts)  [Biography] bio
Date Reply #9 on Tue 09 Jan 2007 06:11 PM (UTC)
Message
Care to post how you ended up doing it for the benefit of the next person who runs into this issue?

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
[Go to top] top

Posted by RAlen   (5 posts)  [Biography] bio
Date Reply #10 on Wed 10 Jan 2007 03:35 AM (UTC)
Message
Certainly.
    /*
     * Canonical input processing.
     */
    for ( i = 0, k = 0; d->inbuf != '\n' && d->inbuf != '\r'; i++ )
    {
	if ( k >= 254 )
	{
	    write_to_descriptor( d->descriptor, "Line too long.\n\r", 0 );


is the actual part we ended up needing to change, in our comm.c file at around line 1052. if ( k >= 254 ) means that anything after 254 characters is ignored. I've heard some people simply change the 254 to MAX_STRING_LENGTH and have done with it, we decided to change it to 650 characters, and see how it worked out.

Thanks again.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #11 on Wed 10 Jan 2007 03:55 AM (UTC)
Message
The 254 was hard-coded in? That's pretty silly... I thought the whole point of MAX_INPUT_LENGTH was to control ... the maximum input length.

Changing it to MSL probably isn't safe, though. I think parts of the code assume that the input buffer is smaller than MSL.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Samson   USA  (683 posts)  [Biography] bio
Date Reply #12 on Wed 10 Jan 2007 03:45 PM (UTC)
Message
Actually I think what you need is the MAX_INBUF_SIZE value instead. d->inbuf[] uses MAX_INBUF_SIZE as it's size limit, so MAX_INPUT_LENGTH may not be safe either as it could be of a larger size than d->inbuf[] is expecting.
[Go to top] 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.


26,862 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]