[Admin/Chat/Dev] MinecraftIM v0.2 - Get IM notifications, send chat messages through IM [1000]

Discussion in 'Inactive/Unsupported Plugins' started by jascotty2, Mar 24, 2011.

  1. Offline

    jascotty2

    Minecraft Messenger (MinecraftIM) - a server IM interface
    Version: 0.2
    Download: Minecraft IM.jar
    Source: GitHub

    Provides an Instant Messenger interface for your server
    Intended for those who have a small server (like me) and want to know when a friend gets on

    it expects to be the only program using the login you give it, so you should probably create one for it
    a configuration file is created on first start, or you can make a folder "MinecraftIM" in your plugins folder & save the file from https://github.com/jascotty2/Minecraft-IM/blob/master/src/config.yml

    Features:
    • Single-user
    • Supports: AIM, GTalk, Jabber
    • messages on player login & logoff
    • chat through IM
    • console commands through IM
    • multi-line responses are condensed to a single message
    API (open)


    API :D
    Code:
    // to get plugin:
    if (this.getServer().getPluginManager().isPluginEnabled("MinecraftIM")) {
    	MinecraftIM messenger = (MinecraftIM) this.getServer().getPluginManager().getPlugin("MinecraftIM");
    }
    // to send messages to the main user:
    messenger.sendNotify("message"); // will automatically format color formatting :)
    
    // to intercept chat messages (will need the plugin as a libary in your manifest):
    (your class)  implements ChatMessageHandler
    
    public interface ChatMessageHandler {
        /**
         * Called when MinecraftIM receives a message from the authorized user
         * @param message what was received
         * @return if this method used the command, and don't do anything else
         */
        public boolean messageHandled(String message);
        /**
         * Called after any message received
         * @param fromUser what username this message came from
         * @param message what was received
         * @return if this method used the command, and don't do anything else
         */
        public boolean messageHandled(String fromUser, String message);
    }
    // then:
    messenger.registerMessageHandler(your class);
    


    Known Bugs:
    the AIM client sometimes does not recieve a message..... fixed in 0.1.1 :)
    when receiving a multiline response from a plugin, each line is 2 seconds apart
    - made faster with multi-line condensing
    if you're using AIM with recieveChat, will eventually quit receiving anything (including command output)
    - if this happens, " /mmess reload" will tell it to reload the messenger (may take a few moments)
    - don't know if this bug occurs with the new aim handler

    TODO:
    add more protocols ?
    more users to send notifications to ?
    list of users to check for login (and ignore others) ?
    custom player-created "pounces" to notify when a given player logs in (w/ permissions) ?

    Changelog:


    Version 0.2 - 8/11/11
    AIM toc handler classes changed - now works with AIM again :D
    - old method quit working about 7/20/11 17:10GMT for reasons still unknown
    now chat ignores auto-responses
    XMPP protocol added.. for now, just GTalk & Jabber
    - may add custom xmpp, if someone needs

    Older Changes (open)


    Version 0.1.6 - 6/24/11
    blocked aolsystemmsg
    removed "from" from login notifications
    changed offline message handling to allow condensed messages (instead of individual)
    resolved (most) reconnect duplication errors & made more /reload friendly
    added kick event notification (instead of logout)
    added custom timestamp config, with custom timezone

    Version 0.1.5 - 4/1/11
    617 compatibility

    Version 0.1.4 - 3/29/11
    fixed double-newline
    fixed null pointer exception on start

    Version 0.1.3 - 3/28/11
    removed some debug output
    long (multi-line) messages condensed to single messages
    messages longer than limit (1024 chars in aim) are split into multiple messages
    color formatting is optional
    fixed auto-response for public users

    Version 0.1.2 - 3/27/11
    the user set as sendTo can send commands as op and retrieve the output from the command (requires a newer build of bukkit.. does not work with 531 & lower)
    if chat is turned off, there is a configurable time after sending a chat message that you can recieve a reply

    Version 0.1.1 - 3/25/11
    message queue, so can get messages if the recipiant is offline once they login
    figured out the missed message bug :)a custom command register method added for API

    Version 0.1 - 3/25/11
    Initial Release
     
  2. Offline

    Kostronor

    Very nice work!
    Thanks
     
  3. Offline

    jjfs85

    cool, man! You're a programmin' animal!
     
  4. Offline

    jascotty2

    Version 0.1.1
    message queue, so can get messages if the recipiant is offline once they login
    figured out the missed message bug :D
     
  5. Offline

    GizmoTheGreen

    so this is like those irc bridges?

    support for skype would be splendid (my users have a skypechat-room) :)
     
  6. Offline

    jascotty2

    not yet, but it could be
    sure :) i'll look into it
     
  7. Offline

    iSushi

    I get this error on CraftBukkit 556:

    (Sending messages with AIM)
    12:47:13 [WARNING] null
    java.lang.NullPointerException
    at com.jascotty2.MinecraftIM.Messenger.sendNotify(Messenger.java:146)
    at com.jascotty2.MinecraftIM.Messenger.sendNotify(Messenger.java:151)
    at com.jascotty2.MinecraftIM.Messenger.messageRecieved(Messenger.java:237)
    at com.jascotty2.MinecraftIM.AIM_Messenger.handleMessage(AIM_Messenger.java:120)
    at com.levelonelabs.aim.AIMClient.generateMessage(AIMClient.java:804)
    at com.levelonelabs.aim.AIMClient.fromAIM(AIMClient.java:1015)
    at com.levelonelabs.aim.AIMClient.run(AIMClient.java:416)
    at java.lang.Thread.run(Thread.java:680)
    12:47:13 [WARNING] null

    (Also on start up, tons of them)

    ERROR: NOTIFICATION ABOUT NON BUDDY

    And: (on start up/reload of server)
    null loading MinecraftIM v0.1.3 (Is it up to date?)
    java.lang.NullPointerException
    at com.jascotty2.MinecraftIM.Messenger.sendNotify(Messenger.java:146)
    at com.jascotty2.MinecraftIM.Messenger.sendNotify(Messenger.java:151)
    at com.jascotty2.MinecraftIM.MinecraftIM.startIM(MinecraftIM.java:71)
    at com.jascotty2.MinecraftIM.MinecraftIM.onEnable(MinecraftIM.java:43)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:92)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:70)
    at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:260)
    at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:196)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:221)
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:380)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:366)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)!

    And I'm getting frequent pings from myself :)
    What do I do wrong? .-.
     
  8. Offline

    jascotty2

    Version 0.1.4
    fixed double-newline
    fixed null pointer exception on start

    thanks for the bug report :)
    i was interrupted while working on it, and uploaded it when i got back... guess i forgot to double-check :oops:
    as far as the PING's go, that's how the client i'm using makes sure it's still connected to TOC (it assumes it's the only client using that login). you should have a separate login for the plugin
    not sure how you're getting the non-buddy error...

    well, i cannot find any method for directly connecting to skype :(
    there seems to be a roundabout method, using an existing skype installation, but i can't get it to work on my machine & definitely would not work on a server like mine (no desktop environment)
    hopefully xmpp and msn should be easier to add

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

    GizmoTheGreen

    thats a shame :/

    iirc they have an API to talk to a running Skype and do stuff.
    though I don't know how that would work on a linux box...

    a more realistic scenario would be having a clientplugin on the server talking to a clientapp written in c# that does the skype stuff on a windows box :|

    oh well, glad you tried! ^^
     
  10. Offline

    Josh Harwood

    can you allow a setting for all the console output to be sent via MSN to a specific address too?
     
  11. Offline

    jascotty2

    that is something i had in mind... it's just a little more complicated than is sounds.
    i was thinking if my first method doesn't work, i could have a thread scan the server.log file every few seconds & send new output to the user
     
  12. Offline

    Josh Harwood

    i would love to be able to command my server over msn and have the log get sent when offline ready for me to login again :)
     
  13. Offline

    Steve Cole

    would love to have this but it would need to do google talk or yim because i don't have/use aim.
     
  14. Offline

    Kahl

    it would be very cool if it could use AIM to send messages to multiple users. AIM is nice because if you use a phone number as a screen name, you can have it text you :)

    Edit: You should have it so that it normally will only notify if people log in, but if send a message through aim, then it will send replies back that come within 5minutes after (and if you send another message the 5minutes will be reset back so if you are having conversations through aim it will continue sending)

    I hope that made sense
     
  15. Offline

    jascotty2

    receive chat when chatting was implemented in 0.1.3.. sorry if i didn't make that more clear
    (if recieveChat: false, will recieve chat for the time specified in tempChat after sending a chat message)
    not sure if i want to implement multi-admins, but i could..
    could also/instead add a notifiyusers setting as a semiadmin (without sever command ability)

    sorry, havent had much spare time to work on adding xmpp/msn, since was workking on bettershop & cookiemonster
    i hope to expand this plugin soon, though
     
  16. Offline

    Agret

    if you can get jabber working that will support aim/msn/google talk/icq through transports and you wont have to worry about adding more protocols :p
     
    ibigpapa likes this.
  17. Offline

    GizmoTheGreen

    maybe you could add a custom "protocol" so an external app connects to the port on the server, and all messages are then sent to this app, and this app can "inject" chat messages, this way I could try to do the skype bridge in c# :)
     
  18. Offline

    OkinKun

    Thank you so much for making this! I'm already getting good use out of it on my server.

    Quick question, for the sake of security, only the username in the "sendto:" config, can send console commands to the server via AIM, correct?
    And is the public chat thing so that other users can send chat message the server and see who's on, from their AIM, when they're not on the server?
    Just making sure I understand this correctly.
     
  19. Offline

    jascotty2


    i'll have to look into that.. don't think it'd be too hard, since i've made a chat server in java before :)

    you're welcome :)
    i'm using it on my server as well (nice to know when someone gets on :) )
    yes, only the sendto user can send console commands to the server,
    and public chat is so anyone can chat to players on the server (aim username shown, not minecraft player name)
     
  20. Offline

    zombiemann

    I was asking a fellow server admin today if something like this was even possible, and BEHOLD this plugin in all its glory. I love you man.... you are a life saver.
     
  21. Offline

    Dangazzm

    Ohhh, see now I like this. Most of the people on my server use skype so I went ahead and got it. Just asked though and none use AIM.

    This is a cool idea though it makes chat a lot more manageable! Thank you for this, keep up the good work I can't wait to see what this turns into :D
     
  22. Offline

    Rikeshar

    Hey, I'm getting the: "[SEVERE] ERROR: NOTIFICATION ABOUT NON BUDDY(oarhegos)]" error also. Oarhegos is another person who I told to add the screen name I set in the plugin to see if he could chat with it as well. I've logged into AIM using the plugin SN and added him to the friends list, but I'm still getting this message.

    **EDIT** I had oarhegos remove the plugin screen name, and I'm still getting the error it seems :-/
     
  23. Offline

    overlordror

    I'm with the person who suggested getting Jabber working as a protocol. It works with so many instant messenger interfaces you'd have a lot less to worry about. Plug us GTalk users could use this wonderful plugin. :p
     
  24. Offline

    GizmoTheGreen

    nice, I already have the clientside working, talking to skype and some basic bot commands.
    just need to put in networking when/if you put in "custom" support or whatever you want to call it xD

    she can also give info from minequery already, a bit dirty though.

    I'll make this app available for everyone to use (setting sin gui) when/if it's supported by MinecraftIM :)
     
  25. Offline

    Nananea

    Sorry if this is a stupid question but..

    Where it says username/password in the config. Is that my AIM user/pass or my Minecraft user/pass?

    I am assuming it's my Minecraft user/pass and then in the sendto it's my AIM username?

    I'd like to get this working, I also have a small server and knowing when my friends get on would be amazing!

    Thanks!
     
  26. Offline

    Liger_XT5

    @jascotty2
    I haven't installed this yet, but I can already tell you this WILL work for xfire.
    Xfire supports logging into AIM, Yahoo, MSN, and Google Chat. (twitter is obsolete in xfire :/ )

    Great Work Man! This will do great for my small private server.

    edit:
    Looking at the setting, only one person can receive the messages from the server? Or can people linked to the account all receive the messages?
     
  27. Offline

    OkinKun

    It'd be nice if there was a way for "public chat" users who message the server from AIM, had some way of talking with the players in the server/getting information. Right now, they can send messages, and say hi, but they can't see any responses.

    Maybe a toggle command would be in order? So for example, a user who message the server from AIM would receive a prompt after sending their first message "You can not see responses currently, please type /chattoggle to see messages from in-game players". And they could type that again to turn it off. OR /chatOn and /chatOff. Whatever is easier to implement.

    This would also GREATLY help the admin, who automatically receives messages from MinecraftIM, in AIM. So if we wanted to get EVERY chat message, we could type that command in AIM, and see them, or turn it off, when we only want to see login/logout information.

    I really hope you can implement something like this. Being able to turn on/off the chat messages, directly from AIM, without restarting, and optionally allowing Public users to do the same, would be amazing and so useful!
     
  28. Offline

    Procrastination

    Get MSN support and I'll love you.
     
  29. Offline

    jascotty2

    sorry haven't replied here for a while.. (i'm not abandoning it, if anyone was worried)
    while working on bettershop, i let other 'real world' projects pile up, and i should get them attended to to keep a pesky instructor happy for a class i learned on my own two years ago :(

    xmpp has the greater priority once i get back, followed with a custom chat interface i'll have to make (for programs like what @GizmoTheGreen mentioned) , then maybe msn

    @Nananea
    the username & password are for the program to log into a messenger protocol (AIM for now)
    sendto is the username (AIM) that you want to have OP privileges (and receive notifications, if enabled)

    @OkinKun
    public chat should work so that chat messages are send to recent senders.. i'll have to do some testing when i get back to this if it's not..
    and i am considering of runtime setting changes.. it's just that i want it to save & don't want the comments to be removed ;) (might be a little while before i get that working..)

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

    OkinKun

    hmm, well a friend who I had send a couple messages to the server, said they didn't see any responses.. But I didn't get a chance to test that more than a very little amount tonight. Might give it another shot later.

    Still, I think being able to Toggle chat messages from AIM, would provide a nice level of control. I like being able to see chat from AIM/outside the game, but sometimes it'd be nice to disable and enable that without editing the configuration files. Just a suggestion, no worries. ^_^;
     

Share This Page