Use external API in my Bukkit plugin?

Discussion in 'Plugin Development' started by FameForAim, Jan 11, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    FameForAim

    Hi everyone,
    i try to include the java-skype-api by taksan to my plugin, so that i can call the

    skype.chat("Text") in my plugin and so that i can let the plugin send a message to skype.

    But i always get a dependecy error when i add the depen: [skype-java-api-1.4] to the plugins.yml
    and when i put the jar of the skype-java api in the plugins folder bukkit trys to load it as plugin.

    In general i dont excactly know where i must paste the skype-java-api.jar and how i must reference it in my plugin or how i must include the skype-java api. Can someone help please?
    Thanks so much.
    Greetings
    FameForAim
     
  2. Offline

    BlazingBroGamer

    @FameForAim
    Erm... java-skype-api isn't a plugin in bukkit.. And, therefore, you can't use it in minecraft. It is an api for SKYPE, and not MINECRAFT/BUKKIT.
     
  3. Offline

    FameForAim

    @BlazingBroGamer
    hou? i thought the api allows java to interact with skype? why this should not be possible in a bukkit plugin?
     
  4. Offline

    BlazingBroGamer

    @FameForAim
    Done my research, well sorry for my mistake, I guess you can do it in bukkit. Anyways, you don't put it in the dependencies in plugin.yml. Just put the jar file in the plugins folder, where your plugin is as well.
     
  5. Offline

    FameForAim

    nonono defnitly not, it is not a plugin it is just an external api which i use in my plugin.
    i can not just put it in the plugins folder... @BlazingBroGamer
    Someone who knows something about api please!
     
  6. Offline

    BlazingBroGamer

    @FameForAim
    No... A Java App loads the dependencies from the same folder it is in. Well it might give errors in the console, but your plugin will have it loaded.
     
  7. Offline

    FameForAim

    well it dont work i think. i have to reference it somewhere but i dont know where
     
  8. Offline

    BlazingBroGamer

  9. Offline

    FameForAim

    i found it too but its way to complicated. i am sure the solution is easier but thanks for your search :)
    @BlazingBroGamer
     
  10. Offline

    Goblom

    That skype api only works if skype is installed on the same computer you are using that api on. It works this way because it has to hook into skypes internals as there is now "official" skype api to interact with skype outside of skype. So, in effect this will not work how you want to and you will end up being disappointed (as i was when i worked on something like that)
     
  11. Offline

    FameForAim

    yes i have installed skype too. i just want to send in a skype conference when a player joins the server. So this should work should not it?
    @Goblom
     
  12. Offline

    mythbusterma

    @FameForAim

    You're opening a giant can of worms when you reference an external API of a program that generally likes being secure in your plugin.

    This is not a good idea, and you really should not attempt to do this.
     
  13. Offline

    1Rogue

    Use maven shade to include the necessary files from the api within your own jarfile.

    You can add a check for whether or not the system has installed Skype. There's no direct Java API way of doing so, however you can use JNI to load a C-library and then compile scripts for checking on different platforms. It'd be a bit roundabout, but it is possible.

    Please don't state comments like fact if you aren't certain that they're true, as in this case neither of these statements are correct :(
     
  14. Offline

    FameForAim

    If you dont try it you will never learn it ;D @mythbusterma

    Yeah i will try it with maven shading but i dont know exactly how :D has someone experiences with that skype api?
     
  15. Offline

    mythbusterma

    @FameForAim

    I'm not saying that it is too difficult, I'm saying it's a terrible, insecure, ill-founded idea.

    There are very good reasons not to do this, and if you do do this, I look forward to stealing the Skype passwords of everyone that joins your server.
     
    Skionz likes this.
  16. Offline

    FameForAim

    I think you did not understand it? The plugin only runs on the server. How the hell this should get the skype passwords of the users? It is a porject with friends so i think there will not be someone who steal the passwords.

    The server just should be like a skype bot who posts when someone is logging in ?
    @mythbusterma
     
  17. Offline

    mythbusterma

    @FameForAim

    Ah, that's different. Then what's your issue with this? Use Maven's shading and you'll be fine.
     
  18. Offline

    FameForAim

    yes and thats why i am struggeling about ;D get multiple errors because of my packages etc...
    and i do not know how to add the ressource and the dependencys:)
    @mythbusterma

    i even get a error when creating a maven project... this maven thing sucks that hard.. :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  19. Offline

    mythbusterma

    @FameForAim

    Does the Skype API even have a Maven repository? Also, it would probably just be easier to add it to your build path in Eclipse (assuming you use that inferior IDE...).
     
    teej107 and Skionz like this.
  20. Offline

    FameForAim

    yeah i found another way to manage it i just add the folders to the project.
    But now i have the problem that skype does not send the message in the group conversation.

    Skype registers the external interaction with java because it shows the message weather i will allow it :)
    But the chat does not sends at all. Here my code
    Code:
        String id = Skype.getContactList().getGroup("Conferencename").getId();
                        Skype.chat(id).send(p + " joins the server");
    i always get a nullpointerexception at string Id line ;(
    Edit: i found out the getGroup("String") returns null... do not know what this gives out can someone help?
     
    Last edited: Jan 13, 2015
  21. Offline

    mythbusterma

    @FameForAim

    Perhaps that group doesn't exist? Check their API's docs for information, this is certainly outside the scope of this forum.
     
  22. Offline

    leon3001

    What makes Eclipse inferior? And which IDE do you prefer? :)
     
  23. Offline

    mythbusterma

    @leon3001

    Kind of a satirical jab, but I do prefer IntelliJ IDEA, honestly.
     
    leon3001 likes this.
  24. Offline

    1Rogue

    leon3001 likes this.
  25. Offline

    leon3001

    @1Rogue Interesting post; can only agree to most of it. I used Eclipse up to now without really thinking about the alternatives. But thank you for linking that post, I might just switch over to Netbeans now. :)
     
  26. Offline

    FameForAim

    i checked the docs already there isnt a example for this:/ can someone help me out pls?
     
Thread Status:
Not open for further replies.

Share This Page