Thread: unipban not working

Results 1 to 10 of 10
  1. #1 unipban not working 
    Registered Member
    Join Date
    Jan 2015
    Posts
    89
    Thanks given
    1
    Thanks received
    3
    Rep Power
    12
    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;
    		}
    Reply With Quote  
     

  2. #2  
    48 0x69

    Pax M's Avatar
    Join Date
    Oct 2013
    Posts
    2,008
    Thanks given
    36
    Thanks received
    488
    Rep Power
    2270
    His IP is probably unbanned, but his account is still banned.
    Add unban account method, that will solve it.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jan 2015
    Posts
    89
    Thanks given
    1
    Thanks received
    3
    Rep Power
    12
    Quote Originally Posted by Pax M View Post
    His IP is probably unbanned, but his account is still banned.
    Add unban account method, that will solve it.
    Unban command:

    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;
    		}
    Unban method in IPBanL.java:

    Code:
    	public static void unban(Player player) {
    		player.setPermBanned(false);
    		player.setBanned(0);
    		ipList.remove(player.getLastIP());
    		edited = true;
    		save();
    	}
    Reply With Quote  
     

  4. #4  
    Registered Member
    Stratified's Avatar
    Join Date
    Nov 2012
    Age
    25
    Posts
    1,197
    Thanks given
    1,539
    Thanks received
    223
    Rep Power
    524
    Quote Originally Posted by LegionMaster View Post
    Unban command:

    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;
            }
    Unban method in IPBanL.java:

    Code:
        public static void unban(Player player) {
            player.setPermBanned(false);
            player.setBanned(0);
            ipList.remove(player.getLastIP());
            edited = true;
            save();
        }
    Just go into his character file and it should say "ban = true" or something like that. Just change it to false.
    Attached image
    Attached image
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jan 2015
    Posts
    89
    Thanks given
    1
    Thanks received
    3
    Rep Power
    12
    Quote Originally Posted by Bagrov View Post
    Just go into his character file and it should say "ban = true" or something like that. Just change it to false.
    This is for 718+....

    (facepalm)
    Reply With Quote  
     

  6. #6  
    Registered Member
    Stratified's Avatar
    Join Date
    Nov 2012
    Age
    25
    Posts
    1,197
    Thanks given
    1,539
    Thanks received
    223
    Rep Power
    524
    Quote Originally Posted by LegionMaster View Post
    This is for 718+....

    (facepalm)
    You don't have to be a cunt, mate, I'm just trying to help. I've never owned a 718 so how am I supposed to know that editing the character files won't solve the problem?
    Attached image
    Attached image
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jan 2015
    Posts
    89
    Thanks given
    1
    Thanks received
    3
    Rep Power
    12
    Quote Originally Posted by Bagrov View Post
    You don't have to be a cunt, mate, I'm just trying to help. I've never owned a 718 so how am I supposed to know that editing the character files won't solve the problem?
    You're right, that was childish of me
    My apologies.

    I should be thankful people are even trying to help.
    Reply With Quote  
     

  8. Thankful user:


  9. #8  
    Donator

    Join Date
    Jun 2012
    Posts
    637
    Thanks given
    129
    Thanks received
    87
    Rep Power
    57
    target = world.findPlayer(name);

    It probably is looking for a player with that name who is online
    Reply With Quote  
     

  10. #9  
    Registered Member
    Join Date
    Jan 2015
    Posts
    89
    Thanks given
    1
    Thanks received
    3
    Rep Power
    12
    Quote Originally Posted by NoChildSupport View Post
    target = world.findPlayer(name);

    It probably is looking for a player with that name who is online
    No because it gave me a successful message.
    Reply With Quote  
     

  11. #10  
    Registered Member
    Join Date
    Jan 2015
    Posts
    89
    Thanks given
    1
    Thanks received
    3
    Rep Power
    12
    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;
    		}
    Reply With Quote  
     

  12. Thankful user:



Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Client not working for You? READ!
    By Edge in forum Tutorials
    Replies: 59
    Last Post: 02-06-2020, 09:27 AM
  2. Atk Ani not working
    By `Lubricant in forum RS 503+ Client & Server
    Replies: 32
    Last Post: 09-14-2008, 08:48 PM
  3. NPCs not working.
    By FateJiki in forum Configuration
    Replies: 2
    Last Post: 02-17-2008, 02:40 PM
  4. Kevins floor editor not working.. 2 errors :(
    By newservermaker in forum RS2 Client
    Replies: 0
    Last Post: 01-03-2008, 06:47 AM
  5. Replies: 17
    Last Post: 11-30-2007, 04:15 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •