Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- Server.conGameData = DriverManager.getConnection(
- "jdbc:mysql://srv.zarpor.org/zarpordb?charSet=ISO8859-1&autoReconnect=true&failOverReadOnly=false&maxReconnects=10", Server.MySQLUser,
- Server.MySQLPassword);
- Server.stmGameData = Server.conGameData.createStatement();
- String query = "SELECT * FROM user WHERE username = '" +playerName+ "'";
- ResultSet results = Server.stmGameData.executeQuery(query);
- if(results.next()) {
- if(results.getString("username").equals(playerName) || results.getString("username").equalsIgnoreCase(playerName)) {
- String Pass = new String(results.getString("playerPass").getBytes("ISO-8859-1"), "ISO-8859-1");
- p.playerPass = Pass;
- Boolean updated = false;
- if (updated || Hash.stringToSHA1(playerPass).equals(Pass)) {
- playerPass = Pass;
- p.dbId = results.getInt("id");
- } else {
- return 3;
- }
- p.playerGroup = results.getInt("usergroupid");
- } else {
- return 12;
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- System.out.println("Failed to load player: " + playerName);
- return 13;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement