His IP is probably unbanned, but his account is still banned.
Add unban account method, that will solve it.
|
I wanted to test my IPBan command, which worked.
But now my brother can't log in.
It's still saying his account is disabled even though I unipbanned him.
I tried normally banning him and it banned him, then I unbanned him and yet he's still disabled.
Any ideas?
unipban command:
Code:if (cmd[0].equals("unipban")) { name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); target = World.findPlayer(name); if (target.isOwner()) { return true; } IPBanL.unban(target); player.getPackets().sendGameMessage("You've un-banned " + (loggedIn ? target.getDisplayName() : name) + "."); return true; }
His IP is probably unbanned, but his account is still banned.
Add unban account method, that will solve it.
Unban command:
Unban method in IPBanL.java:Code:if (cmd[0].equals("unban")) { name = ""; for (int i = 1; i < cmd.length; i++) { name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); } target = World.findPlayer(name); if (target == null) return true; if (target.getBanned() < Utils.currentTimeMillis()) { player.sendMessage(""+target.getDisplayName()+" is not banned."); return true; } target.setBanned(0); player.getPackets().sendGameMessage("You have successfully unbanned "+Utils.formatString(name)+"."); SerializableFilesManager.savePlayer(target); return true; }
Code:public static void unban(Player player) { player.setPermBanned(false); player.setBanned(0); ipList.remove(player.getLastIP()); edited = true; save(); }
Fixed.
Found a working command.
If anyone else needs it:
Code:if (cmd[0].equalsIgnoreCase("unban")) { name = ""; for (int i = 1; i < cmd.length; i++) name += cmd[i] + ((i == cmd.length - 1) ? "" : " "); target = World.getPlayerByDisplayName(name); boolean loggedIn = false; if (target == null) { target = SerializableFilesManager.loadPlayer(Utils .formatPlayerNameForProtocol(name)); if (target != null) target.setUsername(Utils .formatPlayerNameForProtocol(name)); loggedIn = false; } if (target != null) { target.setPermBanned(false); target.setBanned(0); if (loggedIn) target.getSession().getChannel().close(); else SerializableFilesManager.savePlayer(target); player.getPackets().sendGameMessage( "You've unbanned " + (loggedIn ? target.getDisplayName() : name) + "."); } else { player.getPackets().sendGameMessage( "Couldn't find player " + name + "."); } return true; }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |