Package l2p.loginserver

Examples of l2p.loginserver.L2LoginClient


  }

  @Override
  public boolean readImpl()
  {
    L2LoginClient client = getClient();
    if(getAvaliableBytes() >= 128)
    {
      readB(_raw);
      try
      {
View Full Code Here


  }

  @Override
  public void runImpl()
  {
    L2LoginClient client = getClient();
    byte[] decrypted;
    try
    {
      Cipher rsaCipher = Cipher.getInstance("RSA/ECB/nopadding");
      rsaCipher.init(Cipher.DECRYPT_MODE, client.getRSAPrivateKey());
      decrypted = rsaCipher.doFinal(_raw, 0x00, 0x80);
    }
    catch(GeneralSecurityException e)
    {
      e.printStackTrace();
      return;
    }
    _user = new String(decrypted, 0x5E, 14).trim();
    _user = _user.toLowerCase();
    _password = new String(decrypted, 0x6C, 16).trim();
    _ncotp = decrypted[0x7c];
    _ncotp |= decrypted[0x7d] << 8;
    _ncotp |= decrypted[0x7e] << 16;
    _ncotp |= decrypted[0x7f] << 24;
    LoginController lc = LoginController.getInstance();
    Status status = lc.tryAuthLogin(_user, _password, client);
    if(status.state == State.IN_USE)
    {
      L2LoginClient oldClient = lc.getAuthedClient(_user);
      // кикаем другого клиента, подключенного к логину
      if(oldClient != null)
      {
        oldClient.close(LoginFailReason.REASON_ACCOUNT_IN_USE);
      }
      if(lc.isAccountInLoginServer(_user))
      {
        lc.removeAuthedLoginClient(_user).close(LoginFailReason.REASON_ACCOUNT_IN_USE);
      }
View Full Code Here

        {
          statement = con.prepareStatement("UPDATE accounts SET password = ? WHERE login = ?");
          statement.setString(1, LoginController.DEFAULT_CRYPT.encrypt(newPass));
          statement.setString(2, accname);
          int result = statement.executeUpdate();
          L2LoginClient client = LoginController.getInstance().getAuthedClient(accname);
          if(result != 0)
          {
            Log.add("<acc=\"" + accname + "\" old=\"" + oldPass + "\" new=\"" + newPass + "\" ip=\"" + (client != null ? client.getIpAddress() : "0.0.0.0") + "\" />", "passwords");
          }
          ChangePasswordResponse cp1;
          cp1 = new ChangePasswordResponse(accname, result != 0);
          sendPacket(cp1);
        }
View Full Code Here

        {
          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)
View Full Code Here

    String account = readS();
    int playOkId1 = readD();
    int playOkId2 = readD();
    int loginOkId1 = readD();
    int loginOkId2 = readD();
    L2LoginClient client = LoginController.getInstance().getAuthedClient(account);
    if(client == null)
    {
      System.out.println("Client is null for account " + account);
      sendPacket(new PlayerAuthResponse(account));
      return;
    }
    SessionKey key = client.getSessionKey();
    int lPlayOk1 = key.playOkID1;
    int lPlayOk2 = key.playOkID2;
    int lLoginOk1 = key.loginOkID1;
    int lLoginOk2 = key.loginOkID2;
    boolean isAuthedOnLs;
View Full Code Here

TOP

Related Classes of l2p.loginserver.L2LoginClient

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.