Word Filter Isn't Active?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Word Filter Isn't Active?

Postby coolboy714cp » 19 Mar 2012, 21:33

Hey everyone,

I don't know if this is a bug, or if it's something I'm doing wrong, but this is the coding I have in my extension:

Code: Select all

SFSBannedUserManager bannedUM = new SFSBannedUserManager();
IWordFilter wF = new SFSWordFilter(bannedUM);
trace("Is it active? - " + wF.isActive());


The above coding traces this statement:

Is it active? - false


And this is what I currently have in my zone config file:

Code: Select all

<wordsFilter active="true">
<useWarnings>false</useWarnings>
<warningsBeforeKick>1</warningsBeforeKick>
<kicksBeforeBan>1</kicksBeforeBan>
<banDuration>1440</banDuration>
<maxBadWordsPerMessage>1</maxBadWordsPerMessage>
<kicksBeforeBanMinutes>5</kicksBeforeBanMinutes>
<secondsBeforeBanOrKick>0</secondsBeforeBanOrKick>
<warningMessage>Stop swearing or you will be banned</warningMessage>
<kickMessage>Swearing not allowed: you are being kicked</kickMessage>
<banMessage>Too much swearing: you are banned</banMessage>
<wordsFile>config/wordsFile.txt</wordsFile><filterMode>BLACKLIST</filterMode>
<banMode>NAME</banMode>
<hideBadWordWithCharacter>*</hideBadWordWithCharacter>
</wordsFilter>


In addition to this config, I have also tried changing some of the options, such as trying the <filterMode> as "WHITELIST" without the quotes.

Is there something I am doing wrong so that the word filter isn't being activated? I don't get any errors on the server.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Word Filter Isn't Active?

Postby rjgtav » 19 Mar 2012, 22:56

Hi.
Well, of course that code will return false, as you're creating a new instance of both the BannedUserManager and the WordsFilter, and not accessing the ones that the server is using... Now I don't understand what are you trying to achieve... Could you please explain better what are you trying to do?
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Re: Word Filter Isn't Active?

Postby coolboy714cp » 20 Mar 2012, 17:09

I'm trying to get the word filter working. With those settings above, after I login to the game, I type a word that is in the filter, but SFS doesn't filter the word. The word shows up in the chat message not blocked out or anything. The word filter just isn't working.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Word Filter Isn't Active?

Postby rjgtav » 20 Mar 2012, 19:56

Well, have you checked the AdminTool? When you're configuring a Zone (on the Zone Configurator Module), one of the tabs is the Words Filter, where you can activate it or not, set which messages to filter, which words to filter, etc...
For more information regarding how to configure the Words Filter, I suggest you to read this chapter of the docs.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Re: Word Filter Isn't Active?

Postby coolboy714cp » 20 Mar 2012, 23:03

Yes, I checked the admin tool. It says the word filter is active, but in all my tests, it appears to be inactive.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Word Filter Isn't Active?

Postby rjgtav » 21 Mar 2012, 00:03

Sorry but you can't test that way. The only way to test is by saying a swear word and see it getting filtered. Don't forget that you have also to enable the wordfilter to the public messages so you can see your words filtered.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Re: Word Filter Isn't Active?

Postby coolboy714cp » 21 Mar 2012, 00:26

That is one of the ways I've been testing. How do I enable the word filter in public messages?
itsmylifesoham
Posts: 186
Joined: 16 Oct 2011, 14:33

Re: Word Filter Isn't Active?

Postby itsmylifesoham » 21 Mar 2012, 06:04

hi,

please try this as i had the same problem :

go to the zone configurator -> words filter tab

set the filter mode = BLACKLIST. it is by default WHITELIST.

set the correct text file where you have written all the bad words, a default file is already there in the config/wordsFile.txt in you
sfs2x installation dir. you can edit this to add or remove words.

hope it helps.

Soham
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Word Filter Isn't Active?

Postby rjgtav » 21 Mar 2012, 18:42

Hi. Well, I just realized now that on the zone configurator you can only enable the Words Filter for buddy messages, private messages, room names and user names. For enabling the Words Filter in Rooms, you have to configure your room (via the Zone Configurator Module) and enable the Words Filter by setting green where it says "Use bad words filter", under the General tab.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
mreams
Posts: 3
Joined: 08 Feb 2013, 01:15

Re: Word Filter Isn't Active?

Postby mreams » 15 May 2013, 00:30

Thank you rjgtav! I spent so long trying to figure out why the words filter wasn't working. It turns out I just needed to set roomCfg.setUseWordsFilter(true); when I create rooms in code. It finally works!
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Word Filter Isn't Active?

Postby rjgtav » 15 May 2013, 13:31

Great :) I'm also always missing to turn that on... :P
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 86 guests