Package com.gvaneyck.rtmp.encoding

Examples of com.gvaneyck.rtmp.encoding.TypedObject


        out.write(connect, 0, connect.length);
        out.flush();

        while (!results.containsKey(1))
            sleep(10);
        TypedObject result = results.get(1);
        DSId = result.getTO("data").getString("id");

        connected = true;
    }
View Full Code Here


     * @param destination The destination
     * @param operation The operation
     * @return
     */
    protected TypedObject wrapBody(Object body, String destination, Object operation) {
        TypedObject headers = new TypedObject();
        headers.put("DSRequestTimeout", 60);
        headers.put("DSId", DSId);
        headers.put("DSEndpoint", "my-rtmps");

        TypedObject ret = new TypedObject("flex.messaging.messages.RemotingMessage");
        ret.put("destination", destination);
        ret.put("operation", operation);
        ret.put("source", null);
        ret.put("timestamp", 0);
        ret.put("messageId", AMF3Encoder.randomUID());
        ret.put("timeToLive", 0);
        ret.put("clientId", null);
        ret.put("headers", headers);
        ret.put("body", body);

        return ret;
    }
View Full Code Here

     * @param id The invoke ID
     * @return The invoke's result or null
     */
    public TypedObject peekResult(int id) {
        if (results.containsKey(id)) {
            TypedObject ret = results.remove(id);
            return ret;
        }
        return null;
    }
View Full Code Here

        }

        if (!connected)
            return null;

        TypedObject ret = results.remove(id);
        return ret;
    }
View Full Code Here

                    // Remove the read packet
                    packets.remove(channel);

                    // Decode result
                    final TypedObject result;
                    if (p.getType() == 0x14) // Connect
                        result = adc.decodeConnect(p.getData());
                    else if (p.getType() == 0x11) // Invoke
                        result = adc.decodeInvoke(p.getData());
                    else if (p.getType() == 0x06) // Set peer bandwidth
                    {
                        byte[] data = p.getData();
                        int windowSize = 0;
                        for (int i = 0; i < 4; i++)
                            windowSize = windowSize * 256 + (data[i] & 0xFF);
                        int type = data[4];
                        continue;
                    }
                    else if (p.getType() == 0x03) // Ack
                    {
                        byte[] data = p.getData();
                        int ackSize = 0;
                        for (int i = 0; i < 4; i++)
                            ackSize = ackSize * 256 + (data[i] & 0xFF);
                        continue;
                    }
                    else
                    // Skip most messages
                    {
                        System.out.println("Unrecognized message type");
                        System.out.print(String.format("%02X ", p.getType()));
                        for (byte b : p.getData())
                            System.out.print(String.format("%02X", b & 0xff));
                        System.out.println();
                        continue;
                    }

                    // Store result
                    Integer id = result.getInt("invokeId");

                    // Receive handler
                    if (id == null || id == 0) {
                        if (receiveCallback != null)
                            receiveCallback.callback(result);
View Full Code Here

        runePages.add(new RunePage(runePage));
      }
      accountID = allSummonerData.getTO("summoner").getDouble("acctId");
      summonerID = allSummonerData.getTO("summoner").getDouble("sumId");
      summonerName = allSummonerData.getTO("summoner").getString("name");
      TypedObject defaultSpellMap = getTO("summonerDefaultSpells").getTO("summonerDefaultSpellMap");
      if (defaultSpellMap.containsKey("CLASSIC")) {
        classicDefaultSpell1 = SummonerSpell.getSpell(defaultSpellMap.getTO("CLASSIC").getInt("spell1Id"));
        classicDefaultSpell2 = SummonerSpell.getSpell(defaultSpellMap.getTO("CLASSIC").getInt("spell2Id"));
      } else if (defaultSpellMap.containsKey("ODIN")) {
        dominionDefaultSpell1 = SummonerSpell.getSpell(defaultSpellMap.getTO("ODIN").getInt("spell1Id"));
        dominionDefaultSpell2 = SummonerSpell.getSpell(defaultSpellMap.getTO("ODIN").getInt("spell2Id"));
      }
      if (containsKey("masteryBook")) masteryBook = new MasteryBook(getTO("masteryBook"));
      //TODO: find out where the public mastery book info is
      //futureData = getProbablyNull("futureData"); //why is this commented out?
      //dataVersion = getInt("dataVersion");
View Full Code Here

    team = null;
    languages = null;
  }
 
  public TypedObject toTypedObject() {
    TypedObject ret = new TypedObject("com.riotgames.platform.matchmaking.MatchMakerParams");
    ret.put("botDifficulty", botDifficulty);
    ret.put("queueIds", queueIDs);
    ret.put("invitationId", invitationID);
    ret.put("lastMaestroMessage", lastMaestroMessage);
    ret.put("teamId", teamID);
    ret.put("team", team);
    ret.put("languages", languages);
    return ret;
  }
View Full Code Here

        int id = StartupClass.Client.invoke("gameService", "switchTeams", new Object[] { gameID });
        System.out.println(StartupClass.Client.getResult(id));
      } else if (event.getSource() == view.startGameButton) {
                System.out.println("gameID: " + gameID);
        int id = StartupClass.Client.invoke("gameService", "startChampionSelection", new Object[] { gameID, 1 }); //TODO: what is this 1?
        TypedObject result = StartupClass.Client.getResult(id).getTO("data");
        System.out.println(result.toPrettyString());
      }
    } catch (Exception e) { e.printStackTrace(); }
  }
View Full Code Here

        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

    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

TOP

Related Classes of com.gvaneyck.rtmp.encoding.TypedObject

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.