tasha Posted September 30, 2009 Posted September 30, 2009 everyone has thought about it ... and i did it while waiting for complie http://mysticdragon.ulmb.com/acm.patch.txt Index: java/net/sf/l2j/accountmanager/SQLAccountManager.java =================================================================== --- java/net/sf/l2j/accountmanager/SQLAccountManager.java (revision 1247) +++ java/net/sf/l2j/accountmanager/SQLAccountManager.java (working copy) @@ -40,6 +40,7 @@ { private static String _uname = ""; private static String _pass = ""; + private static String _email = ""; private static String _level = ""; private static String _mode = ""; @@ -47,6 +48,9 @@ { Server.serverMode = Server.MODE_LOGINSERVER; Config.load(); + System.out.println(""); + System.out.println("Edited By Sikken@Hotmail.com"); + System.out.println(""); System.out.println("Please choose an option:"); System.out.println(""); System.out.println("1 - Create new account or update existing one (change pass and access level)."); @@ -83,6 +87,13 @@ System.out.print("Password: "); _pass = _in.readLine(); } + + if (_mode.equals("1")) + while (_email.length() == 0) + { + System.out.print("Email: "); + _email = _in.readLine(); + } if (_mode.equals("1") || _mode.equals("2")) while (_level.length() == 0) @@ -95,7 +106,7 @@ if (_mode.equals("1")) // Add or Update - addOrUpdateAccount(_uname,_pass,_level); + addOrUpdateAccount(_uname,_pass,_email,_level); else if(_mode.equals("2")) // Change Level changeAccountLevel(_uname,_level); @@ -155,7 +166,7 @@ System.out.println("Displayed accounts: " + count + "."); } - private static void addOrUpdateAccount(String account,String password, String level) throws IOException, SQLException, NoSuchAlgorithmException + private static void addOrUpdateAccount(String account, String password, String email, String level) throws IOException, SQLException, NoSuchAlgorithmException { // Encode Password MessageDigest md = MessageDigest.getInstance("SHA"); @@ -166,10 +177,11 @@ // Add to Base Connection con = null; con = L2DatabaseFactory.getInstance().getConnection(); - PreparedStatement statement = con.prepareStatement("REPLACE accounts (login, password, accessLevel) VALUES (?,?,?)"); + PreparedStatement statement = con.prepareStatement("REPLACE accounts (login, password, email, accessLevel) VALUES (?,?,?,?)"); statement.setString(1, account); + statement.setString(3, email); statement.setString(2, Base64.encodeBytes(newpass)); - statement.setString(3, level); + statement.setString(4, level); statement.executeUpdate(); statement.close(); con.close();
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now