Account ban & Not Ip

Joined
Apr 29, 2008
Messages
1,297
Reaction score
509
Hmm, i got this idea from Roamer from this thread http://forum.ragezone.com/showthread.php?p=3757381

So i just made this out of boredom

Add this to your MapleCharacter.java
Code:
        public void Ban(String reason) {
		if (lastmonthfameids == null) {
			throw new RuntimeException("Trying to ban a non-loaded character (testhack)");
		}
		try {
			Connection con = DatabaseConnection.getConnection();
			PreparedStatement ps = con.prepareStatement("UPDATE accounts SET banned = ?, banreason = ? WHERE id = ?");
			ps.setInt(1, 1);
			ps.setString(2, reason);
			ps.setInt(3, accountid);
			ps.executeUpdate();
			ps.close();
		} catch (SQLException ex) {
			log.error("Error while banning", ex);
		}
		client.getSession().close();
	}

And this to your CommandProcessor.java
Btw, you can either change !ban to this one
or just change this to something else like !banacc
Code:
			} else if (splitted[0].equals("!ban")) {
				if (splitted.length < 3) {
					new ServernoticeMapleClientMessageCallback(2, c).dropMessage("Syntaxhelper : Syntax: !ban charname reason");
					return true;
				}
				String originalReason = StringUtil.joinStringFrom(splitted, 2);
				String reason = c.getPlayer().getName() + " banned " + splitted[1] + ": " +
				originalReason;
				MapleCharacter target = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
                                if (target != null) {
					String readableTargetName = MapleCharacterUtil.makeMapleReadable(target.getName());
					target.Ban(reason);
					mc.dropMessage("Banned " + readableTargetName + " reason: " + originalReason);
				} else {
					if (MapleCharacter.ban(splitted[1], reason, false)) {
						mc.dropMessage("Offline Banned " + splitted[1]);
					} else {
						mc.dropMessage("Failed to ban " + splitted[1]);
					}
                                }

Btw, didnt test this.
If it doesnt work tell me please.
Ty
 
Re: [Release]Account ban & Not Ip

1ST POST :)

Nice Release Going to test it I have been waiting for a release like this because some fagg in my server keeps changing her ip and Hacking more and more and more which is really pissing me off :(

Edit:Wait a sec if you ban account not ip dosent it mean they can make more accounts?
 
Re: [Release]Account ban & Not Ip

Why would you want to ban the Account only?
That means that they can make more accounts and hack even more. -.-
 
Back