Access Badwordsfilter directly

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
rewb0rn
Posts: 177
Joined: 26 Jan 2009, 12:54
Location: Berlin, Germany

Access Badwordsfilter directly

Postby rewb0rn » 18 Sep 2019, 10:16

Hello,

is the badwords filter accessible directly to check strings if they contain badwords? We are using the Smartfox API with a configured badwords filter for our public chats, but we have a custom message for private chats. We would now like to use the badwords filter so that we don't have to maintain 2 different systems. The goal is to identify if a message contained bad words. If so warn the user and ultimately kick or ban them. Same like the public chats work.

Thanks in advance
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Access Badwordsfilter directly

Postby Lapo » 18 Sep 2019, 15:42

Hi,
the message filter is placed in a specific point of the message chain, so that it can catch matching words before they get sent to other players.
I am not sure what you mean by "accessible directly to check strings".
The class that runs the filtering is not pluggable by some other external code, if that's what you're asking.

What you could do instead is filter the messages earlier, before they even reach the bad word filter. To do so you can add a SystemController Filter, as explained here: http://docs2x.smartfoxserver.com/Advanc ... er-filters

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Edithgal, Stevenor and 75 guests