1. Hi,
    I'm a Java coder and I got the Java PublicAPI of Hypixel from GitHub and I noticed that there'is a missing dependency: netty-http-client - com.mastfrog.*
    - It is used in HypixelAPI.java
    Code:
    import com.mastfrog.netty.http.client.HttpClient;
    import com.mastfrog.netty.http.client.ResponseFuture;
    import com.mastfrog.netty.http.client.ResponseHandler;
    I don't know where I can find the missing dependency, could somone help ?
     
    #1
  2. LEGENDFF

    LEGENDFF Well-Known Member

    Messages:
    800
    yea was also one of the problems i had...
    couldnt find anything really useful
    think its that one though https://github.com/timboudreau/netty-http-client
    anyways if you get a working build, would be nice if you would share. I think no one could do that so far lol
     
    #2
    • Like Like x 1
  3. I started to find all the dependencies required with the netty-http-client API. :p
    And don't worry, if I can do a build without errors or missing things, I'll post a download link ;)
     
    #3
  4. It's almost done ! I just can't find the classes :
    • com.mastfrog.guicy.annotations.Namespace
    • com.mastfrog.guicy.annotations.Defaults
    • com.mastfrog.guicy.annotations.Value
    Could someone help ?

    EDIT: nvm, it's an error in the package name: it was writen "com.mastfrog.giulius.annotations" instead of "com.mastfrog.guicy.annotations"
     
    #4
  5. Should I do the Build in JavaSE 7 or JavaSE 8 ? because I found some dependencies in 7 and other in 8. But both works. There's just 1 error I don't understand how to solve in the file com.mastfrog.parameters.KeysValues.java
    Code:
    Iterator<Map.Entry<String, ? extends Object>> it = (Iterator<Map.Entry<String, ? extends Object>>) map.entrySet().iterator();
     
    // and the "iterator()" method return a variable of type Iterator<Map.Entry<String, ? extends Object>>
    It shows me a Cast Error.
     
    #5
  6. #6
  7. LEGENDFF

    LEGENDFF Well-Known Member

    Messages:
    800
    Will check out when i am home^^
     
    #7
    • Like Like x 1
  8. LEGENDFF

    LEGENDFF Well-Known Member

    Messages:
    800
    okay,
    tried the getPlayerExample
    I get
    Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: com/mastfrog/netty/http/client/ResponseHandler
        at testing.test.main(test.java:10)
    Caused by: java.lang.ClassNotFoundException: com.mastfrog.netty.http.client.ResponseHandler
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 1 more
    
    for

    Code:
    HypixelAPI.getInstance().setApiKey(UUID.fromString("MYKEY"));
     
    #8
  9. Thank you. I'm working on that, but the ResponseHandler.class file is in the good folder. I don't understand why it can't reach it. I'll see that this evening.

    EDIT : There is the link to the sources of the package which contains the "missing" (it isn't missing) class : http://informat.juplo.com/autres/mastfrog_source.jar
    if someone could help ...
     
    #9
  10. I think I found it, it's just because you have to import all the jar files in the jar/ directory in PublicAPI.jar into your plugin.
     
    #10
  11. the_super_koala

    the_super_koala Well-Known Member

    Koalafam
    VIP+
    Messages:
    303
    I tried it and it says it can't find any of the reply classes
     
    #11
  12. holy mother of god I have no idea what you are talking about.
    Props tho
     
    #12
    • Like Like x 2
  13. Mhhhhm had the same Problem
    Code:
    Caused by: java.lang.ClassNotFoundException: com.mastfrog.netty.http.client.ResponseHandler
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 1 more
    
    You have to add the jars 1 by 1 or add some code to the meta ( I think ).
    Well now I'm missing some net-beans stuff....
    EDIT:
    Okay I got all the jars working in eclipse.
    But .... something is not working smooth between the apis:
    Code:
    Exception in thread "main" java.lang.ExceptionInInitializerError
        at com.mastfrog.netty.http.client.RequestBuilder.build(RequestBuilder.java:199)
        at com.mastfrog.netty.http.client.HttpClient$RB.execute(HttpClient.java:471)
        at net.hypixel.api.HypixelAPI.get(HypixelAPI.java:509)
        at net.hypixel.api.HypixelAPI.getFriends(HypixelAPI.java:325)
        at main.runmain.main(runmain.java:14)
    Caused by: java.lang.ClassCastException: io.netty.handler.codec.http.HttpHeaderEntity cannot be cast to java.lang.String
        at com.mastfrog.acteur.headers.MediaTypeHeader.<init>(MediaTypeHeader.java:40)
        at com.mastfrog.acteur.headers.Headers.<clinit>(Headers.java:73)
        ... 5 more
    
    
    I don't even know why they are casting it to a String.....
     
    #13
    Last edited: Nov 21, 2014
  14. LEGENDFF

    LEGENDFF Well-Known Member

    Messages:
    800
    Yea, its actually easier to just get the data directly^^
    thats for example what I am using to get the booster data, its messy but working :p

    Code:
    public static void getBoosters() {
         try {
           URL url = new URL(BASE_URL + "boosters?key=" + API_KEY);
           System.out.println(url);
           HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
           connection.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36");
           BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
           while ((input = br.readLine()) != null){content = content + input;} br.close();
           System.out.println(content);
         } catch (Exception e) {
           e.printStackTrace();
         }
       }
    
    public static void readBoosters() {
         while (i < content.length() - 21) {
           time[j] = "";
           owner[j] = "";
           if (content.charAt(i) == ':' ) {
             i++;
           }
           while (content.charAt(i) != ',') {
             time[j] += Character.toString(content.charAt(i));
             i++;
           }
         
           i += 36;
         
           while (content.charAt(i) != '"') {
             owner[j] += Character.toString(content.charAt(i));
             i++;
           }
           System.out.println(owner[j] + "'s Booster läuft noch " + time[j] + " Sekunden");
           i += 67;
           j++;
         }
         owner[j] = null;
      }
    
     
    #14
  15. Ich schreibe das einfach mal in deutsch xD
    Ja das scheint zu klappen, ist aber wie schon erwähnt nicht sonderlich schön.
    Ich würde gerne eine runable Api-Jar zusammen stellen, die aber auch in Eclipse funktioniert.
    Am Wochenende dürfte ich ein wenig Zeit finden.....
    Zudem frag ich mal ein paar die in den Uni-Vorlesungen, mit mir rumhängen, die dürften helfen ^^
    Zu Ihrem/deinem Code:
    Es besteht immer die Möglichkeit so Objekte auszulesen ABER:
    Vorallem wenn mit einem Stream, der sich Http bezieht arbeitet, kann es passieren, dass
    einige Verbindung nicht "real" über DNS aufgelöst werden. Das Problem ist von System zu System unterschiedlich, weshalb
    eine zentrale API nicht schlecht wäre. Zudem könnte man ein halbes-Framework mitgeben, was Probleme mit
    JFrames und Swing etc. löst.
     
    #15
  16. LEGENDFF

    LEGENDFF Well-Known Member

    Messages:
    800
    Besser wär das aufjedenfall, leider hat das bis jetzt noch keiner so wirklich geschafft. ^^
     
    #16
  17. Ja das stimmt wohl! Ich glaube es liegt an Versions-Problemen unter den APIs...
    Werde mal sehen ob ich das hinbekomme....
    EDIT:
    Wir sollten eine eigene API zusammen schrauben.
    Idee:
    Stream mit playername und der base-adresse (<- schauen, dass der Stream zu ist)
    Abspeichern (temp) als einfache json-file (<- dafür habe ich ne eigene Api)
    Auslesen mit ner simplen api
     
    #17
    Last edited: Nov 21, 2014
  18. I'll create a new API.
    Github: https://github.com/CiD-WestBrooklyn/Statview
    An LEGENDEFF:
    Ich hoff es ist in Ordnung, wenn ich Ihre/deine eine Funktion als Grundlage für den
    HTTP-Accsess nehme. Falls nicht bitte mich anschreiben ich werde das dann beheben.
    Wenn Sie/du Lust haben/hast können wir ja zusammen ein wenig was zusammen-schrauben.
    Ich selber werde wohl nur an Wochenenden viel schaffen können.

    -CiD
     
    #18
  19. P0ke

    P0ke Well-Known Member

    P0ke
    MVP+
    Plup Club PLUP
    Member
    Messages:
    6,043
    Sorry for bumping an old thread but does this still work? And if so, would it be possible to post new download links? These don't seem to work any more...

    Thanks.
     
    #19
  20. I'm now working on a complete translation of the HypixelPHP API by @Plancke to a Java version. I'm not doing that in full time because I am studying and it's hard to make codes when you have many exams. But when I have a complete version usable and stable, I'll update my links.

    I stopped my old project which was to find all the dependencies, simply because it's a Maven project. So, normally, all the dependencies are imported when we build the project. But I still have problem with that. So, as I am also a PHP programer (like it's the 2nd language I prefer, after javascript), I wanted to translate the API of @Plancke, which is an easier and a better way to do, because it use directly HTTP requests to https://api.hypixel.net/ and, it use a very good cache system (in my opinion). That's why I am doing switching to this method.

    Now, the Request system is pretty stable, players are fully usable, guilds too, and I'm working on the rest of the @Plancke 's API.
    I'll give you news when there will have some.

    P.S.: The links aren't broken, it's just my web host which have a lot of issues. I just have a free hosting. I don't have the budget for a pro hosting ... So yeah, retry the links and maybe you'll be in a moment the host is on. I'm sorry.

    EDIT: P.S.: I think I'll just post a new thread for this new thing. I'll put the link in the first message of this thread. Thanks to all of you for helping me :p and I think I'll maybe use Github for the file sharing. That would be easier for everyone.
     
    #20
    Last edited: Feb 10, 2015
    • Like Like x 1
    • Agree Agree x 1

Share This Page