Package com.gvaneyck.rtmp.encoding

Examples of com.gvaneyck.rtmp.encoding.ObjectMap


        if (response == null) {
            ipAddress = "127.0.0.1";
            return;
        }

        ObjectMap result = (ObjectMap)JSON.parse(response);
        ipAddress = result.getString("ip_address");
    }
View Full Code Here


        output.writeBytes(query);
        output.close();

        // Read the response
        String response;
        ObjectMap result;
        try {
            response = readAll(connection.getInputStream());
            result = (ObjectMap)JSON.parse(response);
        }
        catch (IOException e) {
            System.err.println("Incorrect username or password");
            throw e;
        }

        // Check for banned or other failures
        // {"rate":0,"reason":"account_banned","status":"FAILED","delay":10000,"banned":7647952951000}
        if (result.get("status").equals("FAILED"))
            throw new IOException("Error logging in: " + result.get("reason"));

        // Handle login queue
        if (!result.containsKey("token")) {
            int node = result.getInt("node"); // Our login queue ID
            String nodeStr = "" + node;
            String champ = result.getString("champ"); // The name of our login
                                                      // queue
            int rate = result.getInt("rate"); // How many tickets are processed
                                              // every queue update
            int delay = result.getInt("delay"); // How often the queue status
                                                // updates

            int id = 0;
            int cur = 0;
            Object[] tickers = result.getArray("tickers");
            for (Object o : tickers) {
                ObjectMap to = (ObjectMap)o;

                // Find our queue
                int tnode = to.getInt("node");
                if (tnode != node)
                    continue;

                id = to.getInt("id"); // Our ticket in line
                cur = to.getInt("current"); // The current ticket being
                                            // processed
                break;
            }

            // Let the user know
View Full Code Here

TOP

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

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.