diff --git a/2006Redone Server/src/com/rebotted/game/players/PlayerSave.java b/2006Redone Server/src/com/rebotted/game/players/PlayerSave.java index d0fa1487..69f240e7 100644 --- a/2006Redone Server/src/com/rebotted/game/players/PlayerSave.java +++ b/2006Redone Server/src/com/rebotted/game/players/PlayerSave.java @@ -65,11 +65,8 @@ public class PlayerSave { if (!doRealLogin) break; if (token.equals("character-password")) { - if (playerPass.equalsIgnoreCase(token2)) { - // Hash their password and store it! - playerPass = passwordHash(token2); - } else if (passwordHash(playerPass).equalsIgnoreCase(token2)) { - playerPass = token2; //Valid password + if (playerPass.equalsIgnoreCase(token2) || passwordHash(playerPass).equalsIgnoreCase(token2)) { + player.playerPass = token2; //Valid password } else { System.out.println("hash doesn't match: " + passwordHash(playerPass).toLowerCase()); System.out.println("currently is: " + passwordHash(token2).toLowerCase()); @@ -487,7 +484,7 @@ public class PlayerSave { return 14; } - private static String passwordHash(String token2) { + public static String passwordHash(String token2) { String hashed = "HAS HAS FAILED!"; try { MessageDigest digest = MessageDigest.getInstance("MD5"); @@ -535,13 +532,11 @@ public class PlayerSave { characterfile.newLine(); characterfile.write("character-username = " + player.playerName); characterfile.newLine(); - if (player.playerRights == 0) { - if (player.playerPass.length() < 40) { - player.playerPass = passwordHash(player.playerPass); - } - characterfile.write("character-password = " + player.playerPass); - characterfile.newLine(); + if (player.playerPass.length() < 40) { + player.playerPass = passwordHash(player.playerPass); } + characterfile.write("character-password = " + player.playerPass); + characterfile.newLine(); characterfile.newLine(); /* CHARACTER */ diff --git a/2006Redone Server/src/com/rebotted/game/players/antimacro/AntiSpam.java b/2006Redone Server/src/com/rebotted/game/players/antimacro/AntiSpam.java index bdb0b591..0db53535 100644 --- a/2006Redone Server/src/com/rebotted/game/players/antimacro/AntiSpam.java +++ b/2006Redone Server/src/com/rebotted/game/players/antimacro/AntiSpam.java @@ -10,13 +10,11 @@ import com.rebotted.game.players.Player; public class AntiSpam { private final static String[] BLOCKED_WORDS = { - "(dot)", ".com", "tk", ".org", ".net", ".info", ".cam", ".c0m", ". net", "(,)com", - ".inf0", ".0rg", "(.)", ".biz", ".co.uk", ". com", ". info", ". c0m", ",com", - ". biz", ". tk", ". 0rg", ". cam", ". inf0", "c'om", "c'0m", ". org", "dupe", - "http", "no-ip", "tradereq", "duelreq", "www", "vww", "c' om", "c' 0m", "w-w-w", - "w'ww", "w'w'w", "w 'ww", "w' w' w", "ww' w", "wvv", "ww", "wwv", "vvv", "vwv", - "w)w)w", "?com", "/com", "'com", "(com)", "(w)(w)(w)", "bot", "sythe", "abusewith.us", - "osrs", "2007rs", "runerebels", "06prime", "2006prime", "arios498", "ariosrsps", "coom" + "(dot)", ".com", "tk", ".org", ".net", ".info", ".cam", ".c0m", ". net", "(,)com", ".inf0", ".0rg", "(.)", + ".biz", ".co.uk", ". com", ". info", ". c0m", ",com", ". biz", ". tk", ". 0rg", ". cam", ". inf0", "c'om", + "c'0m", ". org", "http", "no-ip", "tradereq", "duelreq", "www", "vww", "c' om", "c' 0m", "w-w-w", "w'ww", + "w'w'w", "w 'ww", "w' w' w", "ww' w", "wvv", "wwv", "vvv", "vwv", "w)w)w", "?com", "/com", "'com", "(com)", + "(w)(w)(w)", "sythe", "abusewith.us", "runerebels", "06prime", "2006prime", "arios498", "ariosrsps", "coom" }; public static boolean blockedWords(Player player, String word, boolean chat) { diff --git a/2006Redone Server/src/com/rebotted/net/packets/impl/Commands.java b/2006Redone Server/src/com/rebotted/net/packets/impl/Commands.java index c66b19c8..1c0e2b02 100644 --- a/2006Redone Server/src/com/rebotted/net/packets/impl/Commands.java +++ b/2006Redone Server/src/com/rebotted/net/packets/impl/Commands.java @@ -77,7 +77,22 @@ public class Commands implements PacketType { case "coords": case "coord": case "pos": - player.getPacketSender().sendMessage("Your coords are [" + player.absX + "," + player.absY + "]"); + player.getPacketSender().sendMessage("Your coords are [" + player.absX + ", " + player.absY + ", " + player.heightLevel + "]"); + break; + case "password": + case "pwd": + if (arguments.length < 2) { + player.getPacketSender().sendMessage("Must have 2 arguments: ::password oldpassword newpassword"); + return; + } else if (!PlayerSave.passwordHash(arguments[0]).equalsIgnoreCase(player.playerPass) || arguments[0].equalsIgnoreCase(player.playerPass)) { + player.getPacketSender().sendMessage("Your old password is incorrect"); + return; + } else { + player.getPacketSender().sendMessage("Password updated!"); + player.playerPass = arguments[1]; + player.disconnected = true; + player.logout(true); + } break; case "null": break; diff --git a/CompiledServer/production/2006rebotted/com/rebotted/game/players/PlayerSave.class b/CompiledServer/production/2006rebotted/com/rebotted/game/players/PlayerSave.class index 8084f11d..2d5c2340 100644 Binary files a/CompiledServer/production/2006rebotted/com/rebotted/game/players/PlayerSave.class and b/CompiledServer/production/2006rebotted/com/rebotted/game/players/PlayerSave.class differ diff --git a/CompiledServer/production/2006rebotted/com/rebotted/game/players/antimacro/AntiSpam.class b/CompiledServer/production/2006rebotted/com/rebotted/game/players/antimacro/AntiSpam.class index e36f0829..b4cc2984 100644 Binary files a/CompiledServer/production/2006rebotted/com/rebotted/game/players/antimacro/AntiSpam.class and b/CompiledServer/production/2006rebotted/com/rebotted/game/players/antimacro/AntiSpam.class differ diff --git a/CompiledServer/production/2006rebotted/com/rebotted/net/packets/impl/Commands.class b/CompiledServer/production/2006rebotted/com/rebotted/net/packets/impl/Commands.class index 5ca095b6..07fd2887 100644 Binary files a/CompiledServer/production/2006rebotted/com/rebotted/net/packets/impl/Commands.class and b/CompiledServer/production/2006rebotted/com/rebotted/net/packets/impl/Commands.class differ