LucidBot - R63a Clientless Java Library / Maven / Netty / Trove

Results 1 to 10 of 10
  1. #1
    Novice SarcasmPW is offline
    MemberRank
    Mar 2015 Join Date
    Netherlands.Location
    4Posts

    LucidBot - R63a Clientless Java Library / Maven / Netty / Trove


    Hey there!


    About;

    I created this project to make it easier to connect to a retro without using the flash client. The aim is to make sure that it's really easy to use and implement. It does even run on android.


    Dependencies;

    - Maven for project- and dependency management.
    - Netty for the networking.
    - Trove for the high performance collections.


    Project (Aiming for);

    - High performance.
    - Stable.
    - Multi threading.
    - Event handler with a lot of events.


    Video;

    Warning; This project is still in its early stages, code is not optimized fully yet.

    In the following video I show how easy it is to connect to a retro and register an event listener, at the end I'll show an example of it being intergrated into an android application.


    00:00 - 05:33; Console application implementation.
    05:39 - 08:36; Android example, talking to cleverbot.


    Events at the moment;
    • HabboConnectedEvent() - Local player succesfully connected to the server.
    • MessengerBuddyChatEvent() - A friend sent you a message.
    • MessengerBuddyJoinEvent() - A friend came online.
    • MessengerBuddyQuitEvent() - A friend left.
    • MessengerBuddyRequestEvent() - Someone wants to add you as a friend.
    • MessengerServerMessageEvent() - Received message from server (Like a mute, being worked on at the moment).
    • ServerMessageEvent() - Room alert / Server alert / MOTD.



    Snippets;

    Example of a listener with the events existing at the moment.
    PHP Code:
    public class EListener implements Listener {
         [
    MENTION=1333442518]even[/MENTION]tHandler
        
    public void messageEvent(ServerMessageEvent e){
            
    System.out.println("Server Message Received: " e.getMessage());
        }

          [
    MENTION=1333442518]even[/MENTION]tHandler
        
    public void habboConnectedEvent(HabboConnectedEvent e){
            
    System.out.println("[Messenger] You have " e.getMessenger().getOnlineMessengerBuddies().size() + " friends online.");
        }

         [
    MENTION=1333442518]even[/MENTION]tHandler
        
    public void messengerBuddyJoinEvent(MessengerBuddyJoinEvent e){
            
    // Print out data
            
    System.out.println("[Messenger][" e.getMessengerBuddy().getName() + "]: joined.");
            
    System.out.println("[Messenger][" e.getMessengerBuddy().getName() + "]: " e.getMessengerBuddy().getId());
            
    System.out.println("[Messenger][" e.getMessengerBuddy().getName() + "]: " e.getMessengerBuddy().getMotto());
            
    System.out.println("[Messenger][" e.getMessengerBuddy().getName() + "]: " e.getMessengerBuddy().getFigure());
            
    System.out.println("[Messenger][" e.getMessengerBuddy().getName() + "]: " e.getMessengerBuddy().getLastOnline());

            
    // Send message to welcome my friend
            
    e.getMessengerBuddy().sendMessage("Welcome online, " e.getMessengerBuddy().getName() + "!");
        }

          [
    MENTION=1333442518]even[/MENTION]tHandler
        
    public void messengerBuddyQuitEvent(MessengerBuddyQuitEvent e){
            
    System.out.println("[Messenger][" e.getMessengerBuddy().getName() + "]: left.");
        }

          [
    MENTION=1333442518]even[/MENTION]tHandler
        
    public void messengerBuddyRequestEvent(MessengerBuddyRequestEvent e){
            
    System.out.println("[Messenger]: I am accepting " e.getMessengerRequest().getSenderUsername() + " as a friend.");
            
    e.getMessengerRequest().accept().sendMessage("Welcome to my friendslist, " e.getMessengerRequest().getSenderUsername() + "!");
        }

          [
    MENTION=1333442518]even[/MENTION]tHandler
        
    public void messengerBuddyChatEvent(MessengerBuddyChatEvent e){
            
    System.out.println("[Messenger][" e.getMessengerBuddy().getName() + "]: " e.getMessage());

            
    // Let's echo his message.
            
    e.getMessengerBuddy().sendMessage(e.getMessage());
        }




    The registerListener() method.
    PHP Code:
    public void registerListener(Listener listenerthrows DuplicateEventException {
        for (
    Method m listener.getClass().getMethods()) {
            if(
    m.isAnnotationPresent(EventHandler.class)){
                for (Class 
    m.getParameterTypes()) {
                    if(
    Event.class.isAssignableFrom(c)){
                        
    String eventId c.getSimpleName();

                        if(!
    this.eventListeners.containsKey(eventId) && !this.eventMethods.containsKey(eventId)) {
                            
    this.eventListeners.put(eventIdlistener);
                            
    this.eventMethods.put(eventIdm.getName());
                        }
                        else
                            throw new 
    DuplicateEventException();
                    }
                }
            }
        }

        
    Logger.devDebug("Registered " this.eventListeners.size() + " event handlers.");




    Team;
    - Just me!




    If you have any questions or ideas let me know. It would also be cool if you can drop some ideas about what to make with this library. The library is limited at the moment however it will eventually be able to join rooms, walk, buy furni, place furni and all that stuff.

    Thanks for reading!


    tl-dr; nah, just read it.
    Last edited by SarcasmPW; 28-03-15 at 12:00 AM.


  2. #2
    Developer & Designer Francis Joseph is offline
    MemberRank
    Mar 2007 Join Date
    /f282Location
    246Posts

    Re: LucidBot - R63a Clientless Java Library / Maven / Netty / Trove

    Looks fantastic! Following this thread closely :)

  3. #3
    Account Upgraded | Title Enabled! PR0 is offline
    MemberRank
    Mar 2007 Join Date
    1,207Posts

    Re: LucidBot - R63a Clientless Java Library / Maven / Netty / Trove

    Love it, great innovation and this I'm guessing with some editing can be very versatile for various projects.

  4. #4
    Evil Italian Overlowrd Droppy is offline
    [Internal Coder]Rank
    Feb 2012 Join Date
    /home/droppyLocation
    2,078Posts

    Re: LucidBot - R63a Clientless Java Library / Maven / Netty / Trove

    I swear I though of this some days ago, but not as a library. I was thinking about loads of stuff like HTML 5 client login (connects to the server using the same protocol, and the ability to see users, and talk, even if they are using Flash Client), or a 2D game control...

    Login > you typ command like "open navigator", then move with cursors around, select navigator, press enter, go to room and see all chats... Perhaps in HTML + JS, or some console...

  5. #5
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,479Posts

    Re: LucidBot - R63a Clientless Java Library / Maven / Netty / Trove


    Project (Aiming for);
    - OOP all the way.
    LOL!

    Java is an object orientated programming language already.

  6. #6
    Novice SarcasmPW is offline
    MemberRank
    Mar 2015 Join Date
    Netherlands.Location
    4Posts

    Re: LucidBot - R63a Clientless Java Library / Maven / Netty / Trove

    Quote Originally Posted by Quackster View Post
    LOL!

    Java is an object orientated programming language already.
    Well, nothing wrong then?
    Guess I'll edit it.

  7. #7
    PM for free snacks! Hoshiko is offline
    MemberRank
    May 2013 Join Date
    сикаLocation
    282Posts

    Re: LucidBot - R63a Clientless Java Library / Maven / Netty / Trove

    An open TCP connection to get push messages thus forcing the WiFi chip to be on all the time?
    I barely get 4 hours out of my Nexus already, imagine if I start using stuff like this, it would probably get sliced in half.

  8. #8
    Novice SarcasmPW is offline
    MemberRank
    Mar 2015 Join Date
    Netherlands.Location
    4Posts

    Re: LucidBot - R63a Clientless Java Library / Maven / Netty / Trove

    Quote Originally Posted by Hoshiko View Post
    An open TCP connection to get push messages thus forcing the WiFi chip to be on all the time?
    I barely get 4 hours out of my Nexus already, imagine if I start using stuff like this, it would probably get sliced in half.
    It was just an example of what to do with the library. It's possible to make desktop applications too.

  9. #9
    Evil Italian Overlowrd Droppy is offline
    [Internal Coder]Rank
    Feb 2012 Join Date
    /home/droppyLocation
    2,078Posts

    Re: LucidBot - R63a Clientless Java Library / Maven / Netty / Trove

    Probably a good use would be to making a PocketHabbo clone... Make some Mod Tools stuff, so you can check chatlog and all, and then you should be able to handle tickets from a cellphone or a desktop app

  10. #10
    "(still lacks brains)" NoBrain is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    2,658Posts

    Re: LucidBot - R63a Clientless Java Library / Maven / Netty / Trove

    Closed since it seems like a dead development. PM me if you would like it re-opened.



Advertisement