Login
User Name:

Password:



Register

Forgot your password?
Hi - Clean SmaugFuss map/description issue..
Dec 15, 2024 7:29 pm
By Samson
AFKMud 2.2.4
Dec 10, 2024 4:09 pm
By Samson
I3 and IMC
Dec 8, 2024 6:35 pm
By Remcon
Ubuntu 22.04.5 LTS
Dec 5, 2024 5:10 pm
By Remcon
SmaugFUSS 1.8/1.9
Nov 29, 2024 11:46 am
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
LOP 1.5
Author: Remcon
Submitted by: Remcon
Users Online
AhrefsBot, Google, Majestic-12, DotBot

Members: 0
Guests: 32
Stats
Files
Topics
Posts
Members
Newest Member
494
3,808
19,707
588
Mortrex

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Codebases » SmaugFUSS » talk_channel - Input lengths ...
Forum Rules | Mark all | Recent Posts

talk_channel - Input lengths capped to 305 characters..no idea..
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Oct 26, 2023 6:09 am   
Go to the top of the page
Go to the bottom of the page

Seventeen

GroupMembers
Posts10
JoinedOct 26, 2023

 
Hey guys, I'm running into a small problem with buffers. I honestly am at my wits end. I cannot for the life of me find out why buffers for channels is capped at 305 characters (this is for all channels btw) everything is set to MAX_INPUT_LENGTH and that is set to 4096 characters.. I've checked color codes I've checked all the buffer definitions, and I just cant figure it out. I've even checked all the input handling in handler.c everything has MSL or MIL for the for character caps...please if you know anything at all...please tell me what I'm missing..

Post is unread #2 Oct 26, 2023 6:20 pm   Last edited Oct 26, 2023 6:22 pm by Vladaar
Go to the top of the page
Go to the bottom of the page

Vladaar

GroupMembers
Posts57
JoinedNov 24, 2016

 
[Sooc] 'thisisatesttoseehowmanycharacterscanbeinthisbuffer.Hopefullyalotmorethan305because305seemslikesuchatinyamountformaxinputlinebufferiguessiwillsoonseeif305istheactualnumberorifsomecrackpotisjustmakingupstuffonsmaugmuds.eitherwayitisinterestingtotest.hopefullywewillsee305isn'tthenumberthatmaxesoutthecharacerchannel.thisisatesttoseehowmanycharacterscanbeinthisbuffer.Hopefullyalotmorethan305because305seemslikesuchatinyamountformaxinputlinebufferiguessiwillsoonseeif305istheactualnumberorifsomecrackpotisjustmakingupstuffonsmaugmuds.eitherwayitisinterestingtotest.hopefullywewillsee305isn'tthenumberthatmaxesoutthecharacerchannel.'

https://wordcounter.net/
628 characters when I tested and didn't even max it. Although I am not using smaugfuss. We are heavily modified version of smaug which followed smaugfuss bug fixes and changes for quite a while. I have a really old version of 6Dragons codebase here. You could look at 6Dragons codebase for channel code maybe.


Post is unread #3 Oct 29, 2023 5:06 am   
Go to the top of the page
Go to the bottom of the page

Seventeen

GroupMembers
Posts10
JoinedOct 26, 2023

 
I'm using Smaug 1.4 - So I don't think I have all the SmaugFUSS fixes and such..I've been using this codebase for almost 20 years I'm sure I've fixed a lot of things because it's not even smaug anymore at this point..

Where would I find this code?

SMAUG 1.4 (C) 1994, 1995, 1996, 1998 by Derek Snider

Post is unread #4 Oct 29, 2023 10:15 am   
Go to the top of the page
Go to the bottom of the page

Vladaar

GroupMembers
Posts57
JoinedNov 24, 2016

 
Well I don't have talk_channel anymore I use channels.c and channels.h

I don't see a problem with channels limited to 305 characters though, who needs more than that? Maybe smaugfuss did that to limit buffer overflows? Anyway this the link to the old codebase I used where you can find channels.c and channels.h

https://smaugmuds.afkmods.com/files/6dragons-44-496/

Post is unread #5 Nov 2, 2023 8:37 am   
Go to the top of the page
Go to the bottom of the page

Seventeen

GroupMembers
Posts10
JoinedOct 26, 2023

 
The reason for needing more than that is because I want people to be able to post paragraphs for my custom RP system. Instead of two sentence chunks.

Post is unread #6 Nov 2, 2023 8:38 am   Last edited Nov 2, 2023 8:46 am by Seventeen
Go to the top of the page
Go to the bottom of the page

Seventeen

GroupMembers
Posts10
JoinedOct 26, 2023

 
I don't want your channel code, thanks though. I just want to know where it is I can modify it on Smaug. I do believe that is what I asked originally too. I just wanna use the existing system, I don't feel like adding a whole new channel system just to extend buffers.

Post is unread #7 Nov 2, 2023 3:40 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,697
JoinedJan 1, 2002

 
Text that gets sent to talk_channel is ultimately dumped into the lbuf[] array. That array has been stupidly set to MAX_INPUT_LENGTH when it's ultimately the value that gets carried forward into the act() function which actually distributed the message to the channel.

The big problem with this is that stock Smaug, even on the 1.8b update, is trying to strcat() the contents of buf[] which is using MAX_STRING_LENGTH. With a sufficiently long message this will result in the game crashing due to a buffer overrun.

This was mitigated in the FUSS forks by replacing all the unsafe uses of strcat() with a derivative of strlcat() which truncates content that would otherwise overflow the buffer. Unfortunately even in FUSS it was not noticed that lbuf[] is smaller so technically the contents of a super large message will get truncated due to the size mismatch.

In your case you're lucky all that's happening is that it's cutting you off at 305. That number is oddly specific and doesn't jive with what the code shows. You're still overrunning the buffer but for some reason your MUD doesn't seem to care? Either way that's a bad way to fly.

For the record, SmaugFUSS has not incorporated an alternate channel system even though doing so would be a good thing. So it's still using the same talk_channel function as always, just with all the bug fixes found over the years.

Post is unread #8 Nov 3, 2023 6:06 pm   Last edited Nov 3, 2023 6:12 pm by Seventeen
Go to the top of the page
Go to the bottom of the page

Seventeen

GroupMembers
Posts10
JoinedOct 26, 2023

 
Since the last post...

before I answer and before this suggestion.. Thank you for making it clearer. I had already went through all that prior to reading this last comment. I was able to figure it out and rewrote the channel codes to better fit what was needed(about 6000 Characters). Thank you both for your suggestions. Sorry If I sounded like a jerk, i was stressing just trying to find answers without doing a major rework. But i just ended up doing just that to save myself the hassle.

https://game-scry.online/game/fighter%20adventure <-- please come see what I've done with smaug over the years.

Post is unread #9 Nov 3, 2023 6:11 pm   
Go to the top of the page
Go to the bottom of the page

Seventeen

GroupMembers
Posts10
JoinedOct 26, 2023

 
I've even written my own client because of smaug. because of this codebase being around I was able to learn C and become the coder I am today.. thank you so much!

Pages:<< prev 1 next >>