Page 1 of 1

NullPointerException when user is banned

Posted: 08 May 2011, 16:51
by elmo
SFS PRO Licence 100 users

I dont understand why I get the following error from the server when I use the antiflood system. It happens when the first user is banned, then the antiflood system is simply inactive(crashed?).
jvm 1 | 17:26:08.345 - [ WARNING ] > User: hellouser (78.xxx.xxx.xxx) is being kicked. Reason: flooding.
jvm 1 | 17:26:08.345 - [ WARNING ] > Unexpected Exception: java.lang.NullPointerException
jvm 1 | java.lang.NullPointerException
jvm 1 | at it.gotoandplay.smartfoxserver.SmartFoxServer.addBannedUser(SmartFoxServer.java:2683)
jvm 1 | at it.gotoandplay.smartfoxserver.SmartFoxServer.addKickedUser(SmartFoxServer.java:2884)
jvm 1 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.applyFloodFilter(SystemHandler.java:3897)
jvm 1 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.handlePublicMessage(SystemHandler.java:1346)
jvm 1 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.processEvent(SystemHandler.java:263)
jvm 1 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.run(SystemHandler.java:168)
jvm 1 | at java.lang.Thread.run(Thread.java:619)
config.xml

Code: Select all

		<AntiFlood active="true">
			<MinMsgTime tolerance="2">1500</MinMsgTime>
			<MaxRepeatedMessages>2</MaxRepeatedMessages>
			<WarningsBeforeKick>2</WarningsBeforeKick>
			<WarningMessage><![CDATA[WARNING_FLOOD]]></WarningMessage>
			<KickMessage><![CDATA[KICKED_FLOOD]]></KickMessage>
			<BanMessage><![CDATA[BANNED_FLOOD]]></BanMessage>
			<BanAfter timeSpan="60">2</BanAfter>
		</AntiFlood>
		
		<BadWordsFilter active="true">
			<FilterMode>REMOVE</FilterMode> <!-- REMOVE or FILTER -->
			<StripCharacters><![CDATA[,.;:_!$%&/#*-+]]></StripCharacters>
			<Warnings>true</Warnings>
			<FilterRoomNames>true</FilterRoomNames>
			<FilterUserNames>false</FilterUserNames>
			<WarningsBeforeKick>2</WarningsBeforeKick>
			<WarningMessage><![CDATA[WARNING_SWEARING]]></WarningMessage>
			<KickMessage><![CDATA[KICKED_SWEARING]]></KickMessage>
			<BanMessage><![CDATA[BANNED_SWEARING]]></BanMessage>
			<BanAfter timeSpan="60">2</BanAfter>
			
			<BadWordsList>				
				<badWord>dickhead</badWord>
				<badWord>asshole</badWord>
				<badWord>shithead</badWord>
				<badWord>shit</badWord>
				<badWord>fucking</badWord>
				<badWord>fuck</badWord>
			</BadWordsList>
		</BadWordsFilter>
		
		<BanCleaning>auto</BanCleaning>
		<BanDuration>1800</BanDuration> <!-- 30 min -->
		<BannedLoginMessage>You have been banned!</BannedLoginMessage>

Posted: 09 May 2011, 00:00
by BigFIsh
It seems to be that your XML isn't invalid. You have a ending --> with no starting <!-- tag after </BadWordsList>

Posted: 09 May 2011, 09:10
by elmo
sorry
it was a mistake I made when copy pasting to this forum
On the server the xml is OK but I still get the Exception.

Posted: 12 May 2011, 10:16
by elmo
So do you have any idea why the SFS ban system crashes every time it adds its first user?

Posted: 12 May 2011, 22:20
by BigFIsh
I'll have a go at reproducing this issue then I'll let you know how it went.