BanByName
BanByName
Hi, I have written an ActionScript extension, which bans by name/ip.
When I try to ban by name, the user is kicked, but when try to login again he relogs without a problem. They are shown as banned into the admin tool. Same happens when try to ban from there - they are being kicked, but relog again freely.
This does not happen with ban by ip.
My questions is if is possible all that to happens because I am using custom login extension, and eventually how to check if user is banned, or get all currently banned users...
When I try to ban by name, the user is kicked, but when try to login again he relogs without a problem. They are shown as banned into the admin tool. Same happens when try to ban from there - they are being kicked, but relog again freely.
This does not happen with ban by ip.
My questions is if is possible all that to happens because I am using custom login extension, and eventually how to check if user is banned, or get all currently banned users...
Are you using this code to ban by name:
Code: Select all
var object = _server.banUser("USERNAME", 5, "You have been banned by: "+user.getName(), _server.BAN_BY_NAME);
var object = _server.banUser("USERNAME", 5, "You have been banned by: "+user.getName(), _server.BAN_BY_IP);
When I try to ban by name, the user is kicked, but when try to login again he relogs without a problem.
This might depend on how quickly the banishment is removed. You can configure this.
However if the User is banned (you can check from AdminTool) there's no way that they can re-enter with the same name. Maybe they use another one.
They are shown as banned into the admin tool. Same happens when try to ban from there - they are being kicked, but relog again freely.
Of course, kicking is another thing.
When you get kicked, you are simply disconnected, not banned, so you can re-enter.
Kicking simply serves as a method to remind the user to behave properly. Eventually the can get banned if they continue to spam. After that their login will denied.
No, I am not trying to kick the user from the admin tool, but to ban him.
When ban him even from the admin tool, he is shown at the banned list, but after the initial kick, he is able to login again, and he is even shown both in the banned users list and as logged in room.
The banishment removal time is as default - 1800 seconds (30 minutes) - when that period expires he is removed from the banned user list in the admin tool, but that does not concern me, as he is able to login even before that.
I am logging using the java canLogin method, and looks he is accepted into the server even if he is in the ban names list..
When ban him even from the admin tool, he is shown at the banned list, but after the initial kick, he is able to login again, and he is even shown both in the banned users list and as logged in room.
The banishment removal time is as default - 1800 seconds (30 minutes) - when that period expires he is removed from the banned user list in the admin tool, but that does not concern me, as he is able to login even before that.
I am logging using the java canLogin method, and looks he is accepted into the server even if he is in the ban names list..
Yes, I am absolutely sure.
I am just refreshing the page with the same username after being banned and for the test i am using everywhere lower case usernames with no special characters.
Here is my code with some noise around it:
I am just refreshing the page with the same username after being banned and for the test i am using everywhere lower case usernames with no special characters.
Here is my code with some noise around it:
Code: Select all
if (md5(secretPhrase.toString()).equals(passedMd5)) {
try {
// Attempt to login the user in the system
newUser = helper.canLogin(username, pass, chan, currentZone.getName());
response.put("_cmd", "loginSuccess");
trace("login success");
Integer userId = newUser.getUserId();
response.put("userId", userId.doubleValue());
response.put("isModerator", moderator.equals("1") ? "1" : "");
loginSuccess = true;
} catch (LoginException le) {
trace("login failed: " + nick + " Reason: " + le.getMessage());
response.put("_cmd", "loginError");
response.put("err", le.getMessage());
}
} else {
trace("Md5 check not successful");
// Send login response
}
sendResponse(response, -1, null, recipients);
// Send room list
if (loginSuccess) {
helper.sendRoomList(chan);
}
Lapo, I wonder what will happen if a several consequent banUser commands with the same User will be called?
Will the first command be executed, and the subsequent ones ignored?
or
Will the banishment time be updated each time a next command is executed?
Also, I wanted to confirm if there is still a problem with ban by name? Does ban by IP work properly though?
Thanks!
Will the first command be executed, and the subsequent ones ignored?
or
Will the banishment time be updated each time a next command is executed?
Also, I wanted to confirm if there is still a problem with ban by name? Does ban by IP work properly though?
Thanks!
Kirsten:
We tested under 1.6.8, using banning by name and everything works as expected. You should provide more details on how to exactly reproduce this issue.
marina
Yes the banishment time is updated.
At least in 1.6.8 there is no known problem with any of the ban modes.
We tested under 1.6.8, using banning by name and everything works as expected. You should provide more details on how to exactly reproduce this issue.
marina
Yes the banishment time is updated.
Also, I wanted to confirm if there is still a problem with ban by name? Does ban by IP work properly though?
At least in 1.6.8 there is no known problem with any of the ban modes.
I have the same problem with server version 1.6.9. I try to ban by name from client side with the follow code:
I have a record in ban manager section of admin tool but user can login.
Then I try to ban by name directly from admin tool and I have the same result. If I ban by ip it works fine. Why?
Thanks.
Code: Select all
param.put("id", player.getId());
param.put("msg", "");
param.put("mode", "0");
frame.getGestore().getSfs().sendXtMessage("$dmn", "ban", param);
I have a record in ban manager section of admin tool but user can login.
Then I try to ban by name directly from admin tool and I have the same result. If I ban by ip it works fine. Why?
Thanks.
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 83 guests