Package com.l2jfrozen.loginserver

Examples of com.l2jfrozen.loginserver.L2LoginClient


    _ncotp |= decrypted[0x7d] << 8;
    _ncotp |= decrypted[0x7e] << 16;
    _ncotp |= decrypted[0x7f] << 24;

    LoginController lc = LoginController.getInstance();
    L2LoginClient client = getClient();
    InetAddress address = getClient().getConnection().getInetAddress();
    if(address == null) {
      _log.warning("Socket is not connected: " + client.getAccount());
      client.close(LoginFailReason.REASON_SYSTEM_ERROR);
      return;
    }
    String addhost = address.getHostAddress();
    AuthLoginResult result = lc.tryAuthLogin(_user, _password, getClient());

    switch(result)
    {
      case AUTH_SUCCESS:
        client.setAccount(_user);
        client.setState(LoginClientState.AUTHED_LOGIN);
        client.setSessionKey(lc.assignSessionKeyToClient(_user, client));
        if(Config.SHOW_LICENCE)
        {
          client.sendPacket(new LoginOk(getClient().getSessionKey()));
        }
        else
        {
          getClient().sendPacket(new ServerList(getClient()));
        }
        if(Config.ENABLE_DDOS_PROTECTION_SYSTEM) {
          String deny_comms = Config.DDOS_COMMAND_BLOCK;
          deny_comms = deny_comms.replace("$IP", addhost);
         
          try
          {
            Runtime.getRuntime().exec(deny_comms);
            if(Config.ENABLE_DEBUG_DDOS_PROTECTION_SYSTEM) {
              _log.info("Accepted IP access GS by "+addhost);
              _log.info("Command is"+deny_comms);
            }
         
          }
          catch(IOException e1)
          {
            _log.info("Accepts by ip "+addhost+" no allowed");
            _log.info("Command is"+deny_comms)
          }
         
        }
       
        break;
      case INVALID_PASSWORD:
        client.close(LoginFailReason.REASON_USER_OR_PASS_WRONG);
        break;
      case SERVER_MAINTENANCE:
              client.close(LoginFailReason.REASON_SERVER_MAINTENANCE);
              break;
      case ACCOUNT_BANNED:
        client.close(new AccountKicked(AccountKickedReason.REASON_PERMANENTLY_BANNED));
        break;
      case ALREADY_ON_LS:
        L2LoginClient oldClient;
        if((oldClient = lc.getAuthedClient(_user)) != null)
        {
          // kick the other client
          oldClient.close(LoginFailReason.REASON_ACCOUNT_IN_USE);
          lc.removeAuthedLoginClient(_user);
        }
        oldClient = null;
        break;
      case ALREADY_ON_GS:
View Full Code Here


   
    String account = "";
   
    if (client instanceof L2LoginClient)
    {     
      L2LoginClient login_cl = (L2LoginClient) client;
      account = login_cl.getAccount();     
    }
    else if (client instanceof L2GameClient)
    {     
      L2GameClient game_cl = (L2GameClient) client;
      account = game_cl.accountName;     
View Full Code Here

   */
  private static void kickPlayer(MMOClient<?> _client, int opcode)
  {
    if (_client instanceof L2LoginClient)
    {   
      L2LoginClient login_cl = (L2LoginClient) _client;
      login_cl.close(LoginFailReason.REASON_SYSTEM_ERROR);
     
      //_log.warning("Player with account " + login_cl.getAccount() + " kicked for flooding with packet " + Integer.toHexString(opcode));     
    }
    else if (_client instanceof L2GameClient)
    {   
View Full Code Here

   */
  private static void banAccount(MMOClient<?> _client, int opcode)
  {   
    if (_client instanceof L2LoginClient)
    {     
      L2LoginClient login_cl = (L2LoginClient) _client;
      LoginController.getInstance().setAccountAccessLevel(login_cl.getAccount(), -100);
      login_cl.close(LoginFailReason.REASON_SYSTEM_ERROR);
     
      //_log.warning("Player with account " + login_cl.getAccount() + " banned for flooding forever with packet " + Integer.toHexString(opcode));     
    }
    else if (_client instanceof L2GameClient)
    {     
View Full Code Here

TOP

Related Classes of com.l2jfrozen.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.