Digital Paint Discussion Board

Development => Bugs, Feature Requests, and Feedback => Official Feature Votes => Topic started by: sk89q on January 06, 2008, 01:15:10 PM

Title: Feature: Customizable word/swear filter
Post by: sk89q on January 06, 2008, 01:15:10 PM
Customizable word/swear filter
Title: Re: Feature: Customizable word/swear filter
Post by: coLa on January 06, 2008, 01:32:38 PM
hm... this would be good for the older members that are trying to keep a clean environment for their children.
Title: Re: Feature: Customizable word/swear filter
Post by: jitspoe on January 06, 2008, 10:47:58 PM
http://dplogin.com/dplogin/featurevote/feature.php?id=10046

I assume you're referring to the client-side filter that has been discussed in the past (perhaps somebody could locate that thread and link it for more details).
Title: Re: Feature: Customizable word/swear filter
Post by: Garrett on January 06, 2008, 10:50:13 PM
I like this idea because I really hate seeing people using racist language and then getting into a swearing match with someone because they told them to stop.  If you don't see the words, you can't get mad.
Title: Re: Feature: Customizable word/swear filter
Post by: sk89q on January 08, 2008, 02:51:45 PM
I was hoping for the server-side one :/
Title: Re: Feature: Customizable word/swear filter
Post by: Cobo on January 08, 2008, 04:44:48 PM
I dont see a reason to not make this client and server side.
Title: Re: Feature: Customizable word/swear filter
Post by: DaRkNeSS on January 08, 2008, 05:15:46 PM
Yeah, make it so someone can setup a personal word filter or server admins can control their server better.
Title: Re: Feature: Customizable word/swear filter
Post by: sk89q on January 08, 2008, 05:33:52 PM
I don't think many people would give a crap (enough) to turn on word filtering for themselves. However, on servers, admins can reduce fights themselves for everyone.
Title: Re: Feature: Customizable word/swear filter
Post by: Zorchenhimer on January 08, 2008, 06:24:17 PM
Have it on by default?
Title: Re: Feature: Customizable word/swear filter
Post by: sk89q on January 08, 2008, 06:45:22 PM
Is that a good idea? :3
Title: Re: Feature: Customizable word/swear filter
Post by: DaRkNeSS on January 08, 2008, 07:17:15 PM
No don't turn it on by default.
Title: Re: Feature: Customizable word/swear filter
Post by: Zorchenhimer on January 09, 2008, 02:56:12 AM
What about a 'first run configuration' type thing where it asks if you wan the filter on or off?
Title: Re: Feature: Customizable word/swear filter
Post by: KiLo on January 09, 2008, 03:11:37 AM
Stop trying to take all the fun out of the game.
Title: Re: Feature: Customizable word/swear filter
Post by: coLa on January 09, 2008, 05:57:12 AM
I don't think many people would give a crap (enough) to turn on word filtering for themselves. However, on servers, admins can reduce fights themselves for everyone.

like i said, this would mainly benefit the older members with children that they wish to protect.
Title: Re: Feature: Customizable word/swear filter
Post by: jitspoe on January 21, 2008, 01:05:55 AM
+1 for this.  I was playing today while my dad was watching.  Other players were calling each other synonyms for homosexual and other things that made me feel a bit awkward.
Title: Re: Feature: Customizable word/swear filter
Post by: sk89q on January 21, 2008, 02:06:10 AM
Server side! Server side! :<
Title: Re: Feature: Customizable word/swear filter
Post by: jitspoe on January 21, 2008, 02:12:01 AM
Server side! Server side! :<
Do a new request for server side.  You need to make your requests less ambiguous.
Title: Re: Feature: Customizable word/swear filter
Post by: Eiii on January 21, 2008, 02:44:36 AM
Do a new request for server side.  You need to make your requests less ambiguous.
i.e 'more than four words'.
Title: Re: Feature: Customizable word/swear filter
Post by: sk89q on January 21, 2008, 04:00:04 AM
I can be specific in four words :P "Customizable server swear filter"
Title: Re: Feature: Customizable word/swear filter
Post by: Cobo on January 21, 2008, 03:37:08 PM
Well, I dont know if this helps, but I made this a long time ago: Customisable server side word filter.
I just changed in sv_user.c at the bottom this:
Code: [Select]
case clc_stringcmd:
s = MSG_ReadString(&net_message);

// malicious users may try using too many string commands
if (++stringCmdCount < MAX_STRINGCMDS)
SV_ExecuteUserCommand(s);

if (cl->state == cs_zombie)
return; // disconnect command
break;
With this:
Code: [Select]
case clc_stringcmd:
s = MSG_ReadString(&net_message);

// malicious users may try using too many string commands
if (++stringCmdCount < MAX_STRINGCMDS)
{
if(strstr(s, "say"))
{
char filter_filename[MAX_QPATH];
char *buf;
int file_len;

sprintf(filter_filename, "%s", Cvar_Get("filter_file", "configs/filter.txt", CVAR_ARCHIVE)->string);
file_len = FS_LoadFile(filter_filename, (void **)&buf);

//if (file_len < 0)
// return;

if (file_len != -1)
{
qboolean keeplooking = true;
char *token;
char *buf2;

// put null terminator at end:
buf2 = Z_Malloc(sizeof(char)*(file_len+1));
memcpy(buf2, buf, file_len);
buf2[file_len] = '\0';
FS_FreeFile(buf);
buf = buf2;

token = text_copy(COM_Parse(&buf));
while(*token)
{
if(keeplooking)
{
if(strstr(s, token))
{
strrep(s, &s, token, "*****");
keeplooking = false;
}
}
token = text_copy(COM_Parse(&buf));
}
}

}

SV_ExecuteUserCommand(s);
}

if (cl->state == cs_zombie)
return; // disconnect command
break;
It's probably not be the best way (and its probably buggy) since I made it a long time ago.


Edit: I just remembered strrep was a function I made but I cant remember where it is...
Title: Re: Feature: Customizable word/swear filter
Post by: ViciouZ on November 29, 2008, 10:20:33 AM
I just had a go at making a client side filter: it is enabled/disabled with cl_swearfilter 0/1 and the words are stored in cl_blockedwords, seperated by commas. Strtok makes me want to kill myself.

Here's the patch:
http://www.viciouz.co.uk/other/miscfiles/paintball2_swearfilter.patch

The current list is quite small, and only has a few common words, but I thought I'd leave it like that so people could add their own.
Title: Re: Feature: Customizable word/swear filter
Post by: Zorchenhimer on November 29, 2008, 12:18:43 PM
I'm assuming that the list in cl_parse.c takes priority when the two lists are different (the cl_blockedwords declaration doesn't match in both).


Edit:

I'm not familiar with the DP source (or C for that matter), but do you need to declare the variable twice in two different places?
Title: Re: Feature: Customizable word/swear filter
Post by: ViciouZ on November 29, 2008, 12:54:37 PM
It helps to define it in those 2 places, yes. (I think.) The unmatching lists were an accident :o

Updated, now cl_swearfilter 2 drops the chat line.

Might have to change to external files for the swear list, apparently cvars may be limited to 64 characters. Seems alright for most use though.
Title: Re: Feature: Customizable word/swear filter
Post by: T3RR0R15T on November 29, 2008, 05:01:25 PM
Sounds great :)
Title: Re: Feature: Customizable word/swear filter
Post by: jitspoe on January 21, 2009, 11:17:39 AM
Did you submit this to the CVS?
Title: Re: Feature: Customizable word/swear filter
Post by: ViciouZ on January 21, 2009, 12:19:32 PM
Looking back, it seems cervisia has been lying to me about what it has and hasn't uploaded, but this is definitely in the CVS.
Title: Re: Feature: Customizable word/swear filter
Post by: Clipz on January 21, 2009, 12:41:15 PM
Why? who cares what people say if its a word its meant to be said.
Title: Re: Feature: Customizable word/swear filter
Post by: Zorchenhimer on January 21, 2009, 12:43:51 PM
Because we don't want to hear (or in this case, read) it.
Title: Re: Feature: Customizable word/swear filter
Post by: Clipz on January 21, 2009, 07:00:44 PM
Maybe it should be a choice to use it or not? I would be pissed if my dp was filtered.. you should be able to choose if yours is or not.
Title: Re: Feature: Customizable word/swear filter
Post by: Zorchenhimer on January 21, 2009, 11:44:26 PM
it is enabled/disabled with cl_swearfilter 0/1
Title: Re: Feature: Customizable word/swear filter
Post by: jitspoe on January 22, 2009, 06:08:53 PM
Maybe it should be a choice to use it or not? I would be pissed if my dp was filtered.. you should be able to choose if yours is or not.
That's the whole point of making it client side.
Title: Re: Feature: Customizable word/swear filter
Post by: Justinph5 on January 29, 2009, 09:26:25 AM
I noticed that it takes out the whole line that a player said if it has a blockedword. can it eventually be updated to just block the single word and show the rest of the text?
Title: Re: Feature: Customizable word/swear filter
Post by: ViciouZ on January 29, 2009, 01:05:41 PM
That should just be a setting... What is your cl_swearfilter set to?

Edit: cl_swearfilter 2 will do it.

jits: shouldn't it be disabled by default? Or there could be a setup menu when the game starts for the first time... But I don't think people would be too pleased with a default swear filter, especially current players who are used to the "banter".
Title: Re: Feature: Customizable word/swear filter
Post by: Justinph5 on January 29, 2009, 02:27:04 PM
k thx, yeah, it was set to 1

edit: and yes it is defaulted to cl_swearfilter 1, which blocks the whole sentence. I say defaulting it off is best, then Zorch could put in a menu for all the new players.
Title: Re: Feature: Customizable word/swear filter
Post by: T3RR0R15T on January 29, 2009, 03:33:00 PM
k thx, yeah, it was set to 1

edit: and yes it is defaulted to cl_swearfilter 1, which blocks the whole sentence. I say defaulting it off is best, then Zorch could put in a menu for all the new players.

I vote for default 2.
Title: Re: Feature: Customizable word/swear filter
Post by: i_am_a_pirate on February 19, 2009, 08:56:24 AM
sorry to revive a fairly old thread, but could you have a 1st time setup when you start the program for the first time, setting up (in a wizard style) all the basic stuff, like a swear filter. You could also have it in the setup file (that gets downloaded with the build).
just a thought, maybe it's not really that relevant to this topic
Title: Re: Feature: Customizable word/swear filter
Post by: jitspoe on February 19, 2009, 12:09:05 PM
sorry to revive a fairly old thread, but could you have a 1st time setup when you start the program for the first time, setting up (in a wizard style) all the basic stuff, like a swear filter. You could also have it in the setup file (that gets downloaded with the build).
just a thought, maybe it's not really that relevant to this topic
You might want to start a new feature vote for a first-time setup guide/wizard.