Package com.l2client.model.network

Examples of com.l2client.model.network.ClientFacade


    }
    //open username pwd entry
    final String user = "ghoust";
    char[] pwd = {'g','h','o','u','s','t'};
    host="localhost";
    final ClientFacade clientInfo = ClientFacade.get();
    clientInfo.init(user);
    //try connection to login server
        LoginHandler loginSocket = new LoginHandler(port,host){
            @Override
            public void onDisconnect(boolean todoOk,String host, int port){
                if(todoOk){
                   clientInfo.connectToGameServer(host,port,
                       loginOK1, loginOK2, playOK1, playOK2);
                }
            }
            @Override
            public void onServerListReceived(GameServerInfo[] servers){
              //game server selection
              //present gameserver to connect to (if only one use that one
              if(servers != null && servers.length>0)
                requestServerLogin(0);
              else
                fail("Loginserver returned no gameservers to login to");
            }
        };
        //just idle around then logout
        try {
          loginSocket.setLoginInfo(user,pwd);
          Thread.sleep(2000);
          if(!loginSocket.connected)
            fail("Login to loginserver failed");
       

      Thread.sleep(4000);
      clientInfo.getCharHandler().setSelected(0);
      Thread.sleep(2000);
      clientInfo.getCharHandler().onCharSelected();
      Thread.sleep(20000);
    } catch (InterruptedException e) {
      //just finish
    }
    clientInfo.cleanup();
  }
View Full Code Here


  @Override
  public void onAction(String name, boolean isPressed, float tpf) {
//    // only execute on button/key release
    if (!isPressed) {
      ClientFacade f = Singleton.get().getClientFacade();
      TargetComponent com = (TargetComponent) Singleton.get().getEntityManager().getComponent(f.getCharHandler().getSelectedObjectId(), TargetComponent.class);
      if(com != null){
        GameClientPacket p = new AttackRequest(com.getCurrentTarget(), com.pos.x, com.pos.y, com.pos.z, false, false);
        f.sendGamePacket(p);   
      }
    }
  }
View Full Code Here

  @Override
  public void onAction(String name, boolean isPressed, float tpf) {
    // only execute on button/key release
//    if (!isPressed) {
      ClientFacade f = Singleton.get().getClientFacade();
      TargetComponent com = (TargetComponent) Singleton.get().getEntityManager().getComponent(f.getCharHandler().getSelectedObjectId(), TargetComponent.class);
      if(com != null){
        //TODO shift click and ctrl click recognition
        GameClientPacket p = new RequestMagicSkillUse(id, false, false);
        f.sendGamePacket(p);   
      }
//    }
  }
View Full Code Here

TOP

Related Classes of com.l2client.model.network.ClientFacade

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.