Just joined

Anything About Anything...
User avatar
Paradox
On Lightcycle Grid
Posts: 13
Joined: Sat Jan 24, 2009 2:16 pm
Contact:

Post by Paradox »

For the spam_maxlen fix create a local file in your config folder called fix.cfg containing the following two lines.
say /login your-password-here
say /admin spam_maxlen 80


In the game press console and type include fix.cfg to reset the settings.

For this to work I added || message.StartsWith("/") to the message test in se_AppendChat of ePlayer.cpp so that text starting with commands are not truncated.

Code: Select all

// appends chat message to something
template< class TARGET >
void se_AppendChat( TARGET & out, tString const & message )
{
	if ( message.Len() <= se_SpamMaxLen*2 || message.StartsWith("/"))
		out << message;
	else
	{
		tString cut( message );
		cut.SetLen( se_SpamMaxLen*2 );
		out << cut;
	}
}
This works fine but theres probably a cleaner and/or better way to do it, I leave that up to you.
User avatar
Z-Man
God & Project Admin
Posts: 11587
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

That patch would open the server to spam, I'm afraid. "/me /REALLYLONGLINE" would no longer get culled at any stage (apart from editing, but the SAY console command works around that).

An easier solution is to just elevate SPAM_MAXLEN to owner so remote admins can't change it (why should they?). Of course, it'll only work with armathentication enabled. Or put up a hardcoded limit to the setting, after all, the other spam settings already weight long lines stronger.
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Post by epsy »

Z-Man wrote:The only patches you definitely should not post publicly are fixes for security problems, those should be first sent via PM.
Or post a security vulnerability bug. Those bugs are automatically private.
User avatar
Paradox
On Lightcycle Grid
Posts: 13
Joined: Sat Jan 24, 2009 2:16 pm
Contact:

Post by Paradox »

Z-Man wrote:That patch would open the server to spam, I'm afraid. "/me /REALLYLONGLINE" would no longer get culled at any stage (apart from editing, but the SAY console command works around that).

An easier solution is to just elevate SPAM_MAXLEN to owner so remote admins can't change it (why should they?). Of course, it'll only work with armathentication enabled. Or put up a hardcoded limit to the setting, after all, the other spam settings already weight long lines stronger.
Yeah I did say that there was prob a better way to do it :D

As long as my code gives people ideas then im happy with that :D
Post Reply