Banning a user issue

You think you've found a bug? Please report it here.

Moderators: Lapo, Bax

Post Reply
User avatar
marsoups
Posts: 167
Joined: 14 Apr 2008, 03:30

Banning a user issue

Post by marsoups »

I discovered a bug in smartfox server 1.6.9 release

If you ban a user, and that particular user either logs out, navigates to another page in between the time allocated for the message to display and the actual ban to take place, the user can escape without ban.

For example:
_server.banUser(usertoban, 5, "You are banned", _server.BAN_BY_NAME);

When the server initially executes the command, the ban message is sent. However, if the user logs out before the 5 seconds are over, there is an error on the server side:

Code: Select all

INFO   | jvm 1    | 2011/04/12 00:25:05 | Error: java.lang.NullPointerException
INFO   | jvm 1    | 2011/04/12 00:25:05 | Handler: it.gotoandplay.smartfoxserver.tasks.BanUserTaskHandler@36858c07
INFO   | jvm 1    | 2011/04/12 00:25:05 | java.lang.NullPointerException
INFO   | jvm 1    | 2011/04/12 00:25:05 |       at it.gotoandplay.smartfoxserver.tasks.BanUserTaskHandler.doTask(BanUserTaskHandler.java:24)
INFO   | jvm 1    | 2011/04/12 00:25:05 |       at it.gotoandplay.smartfoxserver.util.scheduling.Scheduler.executeTasks(Scheduler.java:314)
INFO   | jvm 1    | 2011/04/12 00:25:05 |       at it.gotoandplay.smartfoxserver.util.scheduling.Scheduler.run(Scheduler.java:223)
INFO   | jvm 1    | 2011/04/12 00:25:05 |       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
INFO   | jvm 1    | 2011/04/12 00:25:05 |       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
INFO   | jvm 1    | 2011/04/12 00:25:05 |       at java.lang.Thread.run(Thread.java:619)
The user is then not offline banned or banned. Can we get a fix for this ?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

The User must be connected to be banned. If he goes away it works as if he autokicked himself and the system cannot ban people that is offline.
If you want you can simply store its user name in a DB and use that as an extra layer of protection at login time.
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
marsoups
Posts: 167
Joined: 14 Apr 2008, 03:30

Post by marsoups »

Lapo wrote:The User must be connected to be banned. If he goes away it works as if he autokicked himself and the system cannot ban people that is offline.
If you want you can simply store its user name in a DB and use that as an extra layer of protection at login time.
Lapo this is not the case, we have tested the IP ban feature on a user active on the site (such as my own user) and the same error appears.
Post Reply