Page 1 of 1

problem|| BadWordsFilter

Posted: 19 Jul 2022, 23:07
by ransaymour
Hello smart Fox team,

SFSPRO_V :1.6.20
OS: linux ubuntu 20.04.



This error occurs when someone curses:

Code: Select all

jvm 1    | 02:00:27.816 - [ WARNING ] > User: ran (Censored) is being kicked. Reason: swearing.
jvm 1    | 02:00:27.816 - [ WARNING ] > Unexpected Exception: java.lang.NullPointerException
jvm 1    | java.lang.NullPointerException
jvm 1    |      at it.gotoandplay.smartfoxserver.SmartFoxServer.addBannedUser(SmartFoxServer.java:2741)
jvm 1    |      at it.gotoandplay.smartfoxserver.SmartFoxServer.addKickedUser(SmartFoxServer.java:2942)
jvm 1    |      at it.gotoandplay.smartfoxserver.controllers.SystemHandler.applyBadWordFilter(SystemHandler.java:3980)
jvm 1    |      at it.gotoandplay.smartfoxserver.controllers.SystemHandler.handlePublicMessage(SystemHandler.java:1365                                       )
jvm 1    |      at it.gotoandplay.smartfoxserver.controllers.SystemHandler.processEvent(SystemHandler.java:275)
jvm 1    |      at it.gotoandplay.smartfoxserver.controllers.SystemHandler.run(SystemHandler.java:168)
jvm 1    |      at java.lang.Thread.run(Unknown Source)
jvm 1    | 02:01:32.848 - [ FINER ] > Removed badwords kick for ip-adr: "Censored"


The censorship of the curses works, but the part of the disconnection and blocking does not. :shock:

This is my setting on the server:

Code: Select all

<BadWordsFilter active="true">
<FilterMode>filter</FilterMode>
<StripCharacters><![CDATA[,.;:_!$%&/#*-+]]></StripCharacters>
<Warnings>true</Warnings>
<FilterRoomNames>true</FilterRoomNames>
<FilterUserNames>true</FilterUserNames>
<WarningsBeforeKick>1</WarningsBeforeKick>
<WarningMessage><![CDATA[No swearing!)]]></WarningMessage>
<KickMessage><![CDATA[You've been warned! No Swearing! Now you're kicked]]></KickMessage>
<BanMessage><![CDATA[YOU_BEEN_KICKED]]></BanMessage>
<BanAfter timeSpan="1">1</BanAfter>
         <BadWordsList>
               <!-- And the list of curses starts here -->
         </BadWordsList>
               </BadWordsFilter>
     


The messages are managed through the internal event of the extension (pubMsg)

Re: problem|| BadWordsFilter

Posted: 20 Jul 2022, 10:50
by Lapo
Hi,
is this something that can be reproduced at will? If so can you provide repro case?

Thanks

Re: problem|| BadWordsFilter

Posted: 20 Jul 2022, 19:38
by ransaymour
Hi, I did not understand the answer :?

What do you mean by something that can be reproduced ?

Re: problem|| BadWordsFilter

Posted: 21 Jul 2022, 07:30
by Lapo
Is it a problem that happens every time or only occasionally?
Can you explain the steps that cause this issue?

Thanks

Re: problem|| BadWordsFilter

Posted: 21 Jul 2022, 11:36
by ransaymour
It happens every time a user tries to swear.
I am aware of the filtering and blockin/kicking system, and this is the first time I have encountered such an error.


The user logs in through the loginRequest event,When the user swears in the room the message sent by the user does not appear in the room, but the user does not get disconnected from the server as a warning, and even if the user continues to swear he is not blocked.
It looks like the code inside the system is broken and unable to disconnect the user or block him.



The messages are managed through the internal event of the extension (pubMsg) so I canceled the event to see if it was related to a problem.

Code: Select all

      var zone = _server.getCurrentZone()
      zone.setPubMsgInternalEvent(false)
         zone.setPrivMsgInternalEvent(false)
         


and again the same error appears in the console log :

Code: Select all

vm 1    | 14:30:15.197 - [ WARNING ] > User: ran (Some IP address) is being kicked. Reason: swearing.
jvm 1    | 14:30:15.199 - [ WARNING ] > Unexpected Exception: java.lang.NullPointerException
jvm 1    | java.lang.NullPointerException
jvm 1    |      at it.gotoandplay.smartfoxserver.SmartFoxServer.addBannedUser(SmartFoxServer.java:2741)
jvm 1    |      at it.gotoandplay.smartfoxserver.SmartFoxServer.addKickedUser(SmartFoxServer.java:2942)
jvm 1    |      at it.gotoandplay.smartfoxserver.controllers.SystemHandler.applyBadWordFilter(SystemHandler.java:3980)
jvm 1    |      at it.gotoandplay.smartfoxserver.controllers.SystemHandler.handlePublicMessage(SystemHandler.java:1365)
jvm 1    |      at it.gotoandplay.smartfoxserver.controllers.SystemHandler.processEvent(SystemHandler.java:275)
jvm 1    |      at it.gotoandplay.smartfoxserver.controllers.SystemHandler.run(SystemHandler.java:168)
jvm 1    |      at java.lang.Thread.run(Unknown Source)
jvm 1    | 14:30:18.001 - [ FINE ] > Buddy Lists Autosave done in 1ms.
jvm 1    | 14:31:06.507 - [ FINE ] > User [ shoko ] logged in
jvm 1    | 14:31:17.996 - [ FINE ] > Buddy Lists Autosave done in 0ms.
jvm 1    | 14:32:12.607 - [ FINER ] > Removed badwords kick for ip-adr: "Some IP address"

Re: problem|| BadWordsFilter

Posted: 21 Jul 2022, 12:40
by ransaymour
Ok, after reinstalling the SFS everything works as usual.
A little weird but as long as it does not repeat itself I'm fine.

Re: problem|| BadWordsFilter

Posted: 22 Jul 2022, 07:29
by Lapo
Thanks for the update. Weird indeed.