Package l2p.loginserver.gameservercon.lspackets

Examples of l2p.loginserver.gameservercon.lspackets.MoveCharToAccResponse


        statement = con.prepareStatement("SELECT * FROM accounts WHERE login = ?");
        statement.setString(1, newacc);
        rs = statement.executeQuery();
        if(!rs.next())
        {
          sendPacket(new MoveCharToAccResponse(player, 1));
          return;
        }
      }
      catch(Exception e)
      {
        log.warning("Can't recive password for account " + oldacc + ", exciption :" + e);
      }
      finally
      {
        DatabaseUtils.closeDatabaseSR(statement, rs);
      }
      //Encode old password and compare it to sended one, send packet to determine changed or not.
      try
      {
        if(!LoginController.DEFAULT_CRYPT.compare(pass, dbPassword))
        {
          sendPacket(new MoveCharToAccResponse(player, 0));
        }
        else
        {
          statement = con.prepareStatement("UPDATE accounts SET login = ? WHERE login = ?");
          statement.setString(1, newacc);
          statement.setString(2, oldacc);
          int result = statement.executeUpdate();
          L2LoginClient client = LoginController.getInstance().getAuthedClient(oldacc);
          if(result != 0)
          {
            Log.add("<old=\"" + oldacc + "\" new=\"" + newacc + "\" ip=\"" + (client != null ? client.getIpAddress() : "0.0.0.0") + "\" />", "accounts");
          }
          sendPacket(new MoveCharToAccResponse(player, 2));
        }
      }
      catch(Exception e1)
      {
        e1.printStackTrace();
View Full Code Here

TOP

Related Classes of l2p.loginserver.gameservercon.lspackets.MoveCharToAccResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.