Examples of TypedObject


Examples of com.gvaneyck.rtmp.encoding.TypedObject

        return StartupClass.Client.getResult(id);
      }

      protected void done() {
        try {
          TypedObject result = this.get();
          if (result.get("result").equals("_error")) {
            TypedObject error = result.getTO("data").getTO(
                "rootCause");
            if (error.getString("rootCauseClassname")
                .equals("com.riotgames.platform.game.UserBannedException")) {
              CustomGameLobbyController.this.HandleException("You're banned from this game.","The game creator has banned you from this game.\r\n" + error.toString());
              System.out.println("You're banned from this game.");
            } else {
              System.out.println(error.getString("message"));
            }
          }
          System.out.println(result);
        } catch (InterruptedException | ExecutionException e) {
          e.printStackTrace();
View Full Code Here

Examples of com.gvaneyck.rtmp.encoding.TypedObject

    if (e.getClickCount() == 1) {
      ChampionBox box = (ChampionBox) e.getSource();
      try {
        int id = StartupClass.Client.invoke("gameService",
            "selectChampion", new Object[] { box.getChampion().getID() });
        TypedObject result = StartupClass.Client.getResult(id).getTO("data");
        System.out.println(result);
      } catch (IOException e1) {
        e1.printStackTrace();
      }
    }
View Full Code Here

Examples of com.gvaneyck.rtmp.encoding.TypedObject

            .getTO("body");
      }

      public void done() {
        try {
          TypedObject summoner = this.get();
          LoggedInSummoner.populateData(summoner);
          MainController.this.view.RPBalance
              .setText(String.valueOf(LoggedInSummoner.RPBalance));
          MainController.this.view.IPBalance
              .setText(String.valueOf(LoggedInSummoner.IPBalance));
View Full Code Here

Examples of com.gvaneyck.rtmp.encoding.TypedObject

  public void initializeWorkers() {
    this.gameListWorker = new SwingWorker<TypedObject, Void>() {
      protected TypedObject doInBackground() throws Exception {
        int id = StartupClass.Client.invoke("gameService",
            "listAllPracticeGames", new Object[] {});
        TypedObject gamesList = StartupClass.Client.getResult(id)
            .getTO("data").getTO("body");
        return gamesList;
      }

      protected void done() {
        try {
          TypedObject gamesList = this.get();
          if (CustomGameListController.this.gamesModel == null) {
            CustomGameListController.this.gamesModel = new CustomGameTableModel(gamesList);
            CustomGameListController.this.view.gamesListTable.setModel(CustomGameListController.this.gamesModel);
          }
          else {
View Full Code Here

Examples of com.gvaneyck.rtmp.encoding.TypedObject

      CustomGameListController.this.view.refreshButton.setText("Loading...");
      initializeWorkers();
      this.gamesModel.removeAll();
      gameListWorker.execute();
        } else if (e.getSource() == this.view.createButton) {
            TypedObject practiceGameConfig = new TypedObject("com.riotgames.platform.game.PracticeGameConfig");
            TypedObject map = new TypedObject("com.riotgames.platform.game.map.GameMap");
            map.put("totalPlayers", 10);
            map.put("minCustomPlayers", 1);
            map.put("mapId", 1);
            map.put("displayName", "Summoner's Rift");
            map.put("name", "SummonersRift");
            map.put("description", "The oldest and most venerated Field of Justice is known as Summoner's Rift.  This battleground is known for the constant conflicts fought between two opposing groups of Summoners.  Traverse down one of three different paths in order to attack your enemy at their weakest point.  Work with your allies to siege the enemy base and destroy their Headquarters!");
            map.put("dataVersion", null);
            map.put("futureData", null);

            practiceGameConfig.put("gamePassword", "");
            practiceGameConfig.put("allowSpectators", "NONE");
            practiceGameConfig.put("region", "");
            practiceGameConfig.put("gameName", "my game");
            practiceGameConfig.put("maxNumPlayers", 10);
            practiceGameConfig.put("gameTypeConfig", 1);
            practiceGameConfig.put("gameMap", map);
            practiceGameConfig.put("passbackDataPacket", null);
            practiceGameConfig.put("passbackUrl", null);
            practiceGameConfig.put("gameMode", "CLASSIC");
            try{
                int id = StartupClass.Client.invoke("gameService", "createPracticeGame", new Object[] { practiceGameConfig });
                TypedObject result = StartupClass.Client.getResult(id);
                System.out.println(result.toPrettyString());
                StartupClass.customGameLobbyController = new CustomGameLobbyController(
                        result.getTO("data").getTO("body")
                );
            }catch(Exception ex){
                ex.printStackTrace();
            }
    } else {
View Full Code Here

Examples of com.gvaneyck.rtmp.encoding.TypedObject

            getGarenaToken();

        getIPAddress();
        getAuthToken();

        TypedObject result, body;

        // Login 1
        body = new TypedObject("com.riotgames.platform.login.AuthenticationCredentials");
        if (useGarena)
            body.put("username", userID);
        else
            body.put("username", user);
        body.put("password", pass); // Garena doesn't actually care about
                                    // password here
        body.put("authToken", authToken);
        body.put("clientVersion", clientVersion);
        body.put("ipAddress", ipAddress);
        body.put("locale", locale);
        body.put("domain", "lolclient.lol.riotgames.com");
        body.put("operatingSystem", "LoLRTMPSClient");
        body.put("securityAnswer", null);
        body.put("oldPassword", null);
        if (useGarena)
            body.put("partnerCredentials", "8393 " + garenaToken);
        else
            body.put("partnerCredentials", null);
        int id = invoke("loginService", "login", new Object[] { body });

        // Read relevant data
        result = getResult(id);
        if (result.get("result").equals("_error"))
            throw new IOException(getErrorMessage(result));

        body = result.getTO("data").getTO("body");
        sessionToken = body.getString("token");
        accountID = body.getTO("accountSummary").getInt("accountId");

        // Login 2
        byte[] encbuff = null;
        if (useGarena)
            encbuff = (userID + ":" + sessionToken).getBytes("UTF-8");
        else
            encbuff = (user.toLowerCase() + ":" + sessionToken).getBytes("UTF-8");

        body = wrapBody(Base64.encodeBytes(encbuff), "auth", 8);
        body.type = "flex.messaging.messages.CommandMessage";

        id = invoke(body);
        result = getResult(id); // Read result (and discard)

        // Subscribe to the necessary items
        body = wrapBody(new Object[] { new TypedObject() }, "messagingDestination", 0);
        body.type = "flex.messaging.messages.CommandMessage";
        TypedObject headers = body.getTO("headers");
        // headers.put("DSRemoteCredentialsCharset", null); // unneeded
        // headers.put("DSRemoteCredentials", "");

        // bc
        headers.put("DSSubtopic", "bc");
        body.put("clientId", "bc-" + accountID);
        id = invoke(body);
        result = getResult(id); // Read result and discard

        // cn
        headers.put("DSSubtopic", "cn-" + accountID);
        body.put("clientId", "cn-" + accountID);
        id = invoke(body);
        result = getResult(id); // Read result and discard

        // gn
        headers.put("DSSubtopic", "gn-" + accountID);
        body.put("clientId", "gn-" + accountID);
        id = invoke(body);
        result = getResult(id); // Read result and discard

        // Start the heartbeat
View Full Code Here

Examples of com.gvaneyck.rtmp.encoding.TypedObject

      disallowFreeChampions = getBool("disallowFreeChampions");
      mapSelectionAlgorithm = getString("mapSelectionAlgorithm");
      minimumQueueDodgeDelayTime = getInt("minimumQueueDodgeDelayTime");
     
      supportedMapIDs = new ArrayList<Integer>();
      TypedObject temporarySupportedMapIDs = getTO("supportedMapIds");
      Object[] mapIDs = temporarySupportedMapIDs.getArray("array");
      for (Object to : mapIDs) {
        supportedMapIDs.add((Integer) to);
      }
      checkFields();
    }
View Full Code Here

Examples of com.gvaneyck.rtmp.encoding.TypedObject

  public void populateChampions() {
    new SwingWorker<Void, Champion>() {
      public Void doInBackground() throws Exception {
        int id = StartupClass.Client.invoke("inventoryService",
            "getAvailableChampions", new Object[] {});
        TypedObject championData = StartupClass.Client.getResult(id)
            .getTO("data");
        for (TypedObject champion : TOUtils.ArrayToTOArray(championData.getArray("body"))) {
          Champion fromDatabase = Champion.getChampionFromID(champion.getInt("championId"));
          fromDatabase.setOwned(champion.getBool("owned")); // TODO: model all champion fields
          fromDatabase.setFreeToPlay(champion.getBool("freeToPlay"));
          this.publish(fromDatabase);
        }
View Full Code Here

Examples of com.gvaneyck.rtmp.encoding.TypedObject

        return StartupClass.Client.getResult(id);
      }
     
      protected void done() {
        try {
          TypedObject result = get();
          for (Object rune : result.getTO("data").getTO("body").getArray("summonerRunes")) {
            InventoryRune iRune = new InventoryRune((TypedObject) rune);
            ProfileController.this.runeInventoryModel.add(iRune);
          }
          view.setColumnSizes();
        } catch (InterruptedException | ExecutionException e) {
View Full Code Here

Examples of com.gvaneyck.rtmp.encoding.TypedObject

        int id = StartupClass.Client.invoke("summonerService", "getSummonerByName", new Object[] { searchString });
        return StartupClass.Client.getResult(id);
      }
      protected void done() {
        try {
          TypedObject result = get().getTO("data");
          if (result.containsKey("body")) getSummonerData(result.getTO("body").getDouble("acctId"));
          else throw new Exception(String.format("A summoner by the name of %s was not found.", searchString));
        } catch (Exception e) {
          ProfileController.this.HandleException(e);
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.