Page 1 of 1

Badword interceptor

Posted: 17 Oct 2008, 11:35
by thomers1
hello,

is it possible to "intercept" chat messages (to log each message into a DB for example), and to know if the SFS-badword filter kicked in?

do i have to registerForEvents?
http://www.smartfoxserver.com/docs/docP ... rForEvents

best,
thomas

Posted: 20 Oct 2008, 09:14
by Lapo
Yes, you can intercept those messages but no the word filter works transparently. If you want to implement your own solution you can simply switch the default bad-words filter off.

Posted: 20 Oct 2008, 09:18
by Lapo
do i have to registerForEvents?
No, check the "pubMsg" and "privMsg" events from the InternalEventObject class. By default those events are not fired by the server.
You can activate them by calling the following methods on the Zone (at init time):

Code: Select all

zone.setPubMsgInternalEvent(true)
zone.setPrivMsgInternalEvent(true)

Posted: 20 Oct 2008, 14:15
by thomers1
thanks lapo, got it, works perfectly.