Author Topic: Feature: Customizable word/swear filter  (Read 13147 times)

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Feature: Customizable word/swear filter
« on: January 06, 2008, 12:15:10 PM »
Customizable word/swear filter

coLa

  • Autococker
  • Posts: 1178
Re: Feature: Customizable word/swear filter
« Reply #1 on: January 06, 2008, 12:32:38 PM »
hm... this would be good for the older members that are trying to keep a clean environment for their children.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Feature: Customizable word/swear filter
« Reply #2 on: January 06, 2008, 09: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).

Garrett

  • Autococker
  • Posts: 1372
Re: Feature: Customizable word/swear filter
« Reply #3 on: January 06, 2008, 09: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.

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Feature: Customizable word/swear filter
« Reply #4 on: January 08, 2008, 01:51:45 PM »
I was hoping for the server-side one :/

Cobo

  • Autococker
  • Posts: 1362
Re: Feature: Customizable word/swear filter
« Reply #5 on: January 08, 2008, 03:44:48 PM »
I dont see a reason to not make this client and server side.

DaRkNeSS

  • Autococker
  • Posts: 622
Re: Feature: Customizable word/swear filter
« Reply #6 on: January 08, 2008, 04:15:46 PM »
Yeah, make it so someone can setup a personal word filter or server admins can control their server better.

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Feature: Customizable word/swear filter
« Reply #7 on: January 08, 2008, 04: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.

Zorchenhimer

  • Autococker
  • Posts: 2614
Re: Feature: Customizable word/swear filter
« Reply #8 on: January 08, 2008, 05:24:17 PM »
Have it on by default?

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Feature: Customizable word/swear filter
« Reply #9 on: January 08, 2008, 05:45:22 PM »
Is that a good idea? :3

DaRkNeSS

  • Autococker
  • Posts: 622
Re: Feature: Customizable word/swear filter
« Reply #10 on: January 08, 2008, 06:17:15 PM »
No don't turn it on by default.

Zorchenhimer

  • Autococker
  • Posts: 2614
Re: Feature: Customizable word/swear filter
« Reply #11 on: January 09, 2008, 01:56:12 AM »
What about a 'first run configuration' type thing where it asks if you wan the filter on or off?

KiLo

  • Autococker
  • Posts: 2086
Re: Feature: Customizable word/swear filter
« Reply #12 on: January 09, 2008, 02:11:37 AM »
Stop trying to take all the fun out of the game.

coLa

  • Autococker
  • Posts: 1178
Re: Feature: Customizable word/swear filter
« Reply #13 on: January 09, 2008, 04: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.

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Feature: Customizable word/swear filter
« Reply #14 on: January 21, 2008, 12: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.

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Feature: Customizable word/swear filter
« Reply #15 on: January 21, 2008, 01:06:10 AM »
Server side! Server side! :<

jitspoe

  • Administrator
  • Autococker
  • Posts: 18802
Re: Feature: Customizable word/swear filter
« Reply #16 on: January 21, 2008, 01:12:01 AM »
Server side! Server side! :<
Do a new request for server side.  You need to make your requests less ambiguous.

Eiii

  • Autococker
  • Posts: 4595
Re: Feature: Customizable word/swear filter
« Reply #17 on: January 21, 2008, 01:44:36 AM »
Do a new request for server side.  You need to make your requests less ambiguous.
i.e 'more than four words'.

sk89q

  • Global Moderator
  • Autococker
  • Posts: 1049
Re: Feature: Customizable word/swear filter
« Reply #18 on: January 21, 2008, 03:00:04 AM »
I can be specific in four words :P "Customizable server swear filter"

Cobo

  • Autococker
  • Posts: 1362
Re: Feature: Customizable word/swear filter
« Reply #19 on: January 21, 2008, 02: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...