[LATEST] Icarus Emulator [Java, Netty, MySQL, Plugins, Camera]

Page 1 of 23 12345678911 ... LastLast
Results 1 to 15 of 333
  1. #1
    Developer Quackster is offline
    DeveloperRank
    Dec 2010 Join Date
    AustraliaLocation
    3,470Posts

    [LATEST] Icarus Emulator [Java, Netty, MySQL, Plugins, Camera]

    Icarus

    Icarus is a server which is emulating the most recent version of Habbo. It's programmed in Java 1.8. The server aims at minimising memory leaks, easy to maintain and expand upon and to maximise the server uptime/stability.

    All files which access and query the database are called data access objects (DAO) and they have been completely separated from the rest of the server, and the only calls to the database are forced through the data access objects.

    This server is created by me and built from the ground up, it is not based on any previous servers

    Example of the database access separated from the main project.

    Spoiler:
    Code:
    package org.alexdev.icarus.dao.mysql.item;
    
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    
    import org.alexdev.icarus.dao.mysql.Dao;
    import org.alexdev.icarus.dao.mysql.Storage;
    
    public class TeleporterDao {
    
        /**
         * Gets the pair id.
         *
         *           @param id the id
         *           @return the pair id
         */
        public static int getPairId(int id) {
            
            Connection sqlConnection = null;
            PreparedStatement preparedStatement = null;
            ResultSet resultSet = null;
    
            try {
                sqlConnection = Dao.getStorage().getConnection();
    
                preparedStatement = Dao.getStorage().prepare("SELECT * FROM item_teleporter_links WHERE item_one = ? OR item_two = ? LIMIT 1;", sqlConnection);
                preparedStatement.setInt(1, id);
                preparedStatement.setInt(2, id);
                resultSet = preparedStatement.executeQuery();
    
                if (resultSet.next()) {
    
                    if (resultSet.getInt("item_two") != id) {
                        return resultSet.getInt("item_two");
                    } else {
                        return resultSet.getInt("item_one");
                    }
                    
                }
            } catch (Exception e) {
                Storage.logError(e);
            } finally {
                Storage.closeSilently(resultSet);
                Storage.closeSilently(preparedStatement);
                Storage.closeSilently(sqlConnection);
            }
    
            return 0;
        }
    
        /**
         * Save pair.
         *
         *           @param item1 the item 1
         *           @param item2 the item 2
         */
        public static void savePair(int item1, int item2) {
            
            Connection sqlConnection = null;
            PreparedStatement preparedStatement = null;
    
            try {
                sqlConnection = Dao.getStorage().getConnection();
    
                preparedStatement = Dao.getStorage().prepare("INSERT into item_teleporter_links (item_one, item_two) VALUES(?, ?);", sqlConnection);
                preparedStatement.setInt(1, item1);
                preparedStatement.setInt(2, item2);
                preparedStatement.execute();
                
            } catch (Exception e) {
                Storage.logError(e);
            } finally {
                Storage.closeSilently(preparedStatement);
                Storage.closeSilently(sqlConnection);
            }
        }
    }


    Open-source

    Yes, this project is open source, the stable source can code can be located at:

    https://github.com/Quackster/Icarus

    (All pull requests will be rejected while this project is in alpha and beta stage).

    Features

    The current client version it's using is called PRODUCTION-201710172204-432325793 this includes the new loader and the new navigator which gives more customisation on how you want your navigator displayed.

    • User
      • Login with SSO (single sign on) ticket
      • Show targeted offers (special deals)
      • Show Habbo Club susbcription (can expire)
    • Navigator
      • View public spaces
      • View most popular rooms
      • View own rooms
      • View promoted events
    • Messenger
      • Search for users
      • Send a friend request
      • Accept friend request
      • Reject friend request
      • Send friend a message
      • Delete friend
      • Invite friend
      • Follow friend
    • Rooms
      • Create own room
      • Edit room details
      • Room entry
      • Delete room
      • Walking/pathfinding around items and users (if walking through people is ticked)
      • Give rights
      • Take away rights
      • Remove all rights
        • Edit floor plan
        • Save floor plan
    • Items
      • Take photo
      • Purchase photo
      • Place items
      • Rotate and move items
      • Pickup items
      • Sit on items
      • Interact with items

    • Camera
      • Take photo
      • Purchase photo
      • Take photo for room thumbail
    • Inventory
      • Load floor items
      • Load wall items
      • Load pets
      • Update inventory when a new item is purchased/picked up
      • Show new item in inventory once item is purchased/picked up
      • Update inventory when a pet is purchased/picked up
      • Show new item when a pet is purchased/picked up
    • Catalogue
      • Catalogue tabs
      • Catalogue pages, visible depending on rank
      • Catalogue item discount
      • Purchase items
      • Buy Habbo Club subscription
    • Promotions
      • Buy promotion
      • Edit promotion
      • Show promotion in the special promotions part of the navigator
    • Pets
      • Purchase pet
      • Load pet races
      • Verify pet name
      • Place pet
      • Pick up pet
    • Groups
      • Purchase grpup
      • Set group homeroom
      • Delete group
      • Group furni
      • Edit group settings
      • Manage group users
      • Group decorative rights


    Completed Interaction Types

    • Default
    • Vending
    • Gate
    • Rollers
    • Teleporters
    • Moodlights
    • Bed
    • Chair
    • One way gates
    • Mannequins
    • ads_background
    • Background Toner


    Libraries

    - Netty 4.1.16
    - HikariCP 2.7.1
    - Gson 2.8.0
    - ini4j 0.5.4
    - Luaj 3.0-beta2
    - MySQL Connector Java 6.0.6
    - slf4j 1.7.25
    - log4j 1.2.17

    The source code is built using the Gradle (which is like Maven, except doesn't require XML configuration). So once imported, all libraries will be downloaded automatically without the need to maintain third-party Jar files.

    Plugin System

    Icarus has a plugin system, completely in Lua. Using Luaj it's possible to extend the functionality of the server without writing any Java or recompiling the server.

    The following events coded right now are listed below, and the name next to them indicates the event function name will be called.

    Player Events
    • PLAYER_LOGIN_EVENT
    • PLAYER_DISCONNECT_EVENT


    Messenger Events
    • MESSENGER_TALK_EVENT


    Room Events
    • ROOM_REQUEST_ENTER_EVENT
    • ROOM_FIRST_ENTRY_EVENT
    • ROOM_ENTER_EVENT
    • ROOM_LEAVE_EVENT
    • ROOM_PLAYER_CHAT_EVENT
    • ROOM_PLAYER_SHOUT_EVENT
    • ROOM_PLAYER_WHISPER_EVENT
    • ROOM_WALK_REQUEST_EVENT
    • ROOM_STOP_WALKING_EVENT


    Item Events
    • PLACE_FLOOR_ITEM_EVENT
    • PLACE_WALL_ITEM_EVENT
    • FLOOR_ITEM_INTERACT_EVENT
    • WALL_ITEM_INTERACT_EVENT


    More will be added as more development time passes, and each event will be documentated on what event does what, and what parameters each event takes.

    For example, this will create 200 bots that will walk around when a user enters a room.

    Code:
    function onRoomEnterEvent(player, room)
    	log:println("Room enter event called")
    
    	for i = 0, 200 - 1 do
    		local bot = createBot(room)
    		randomWalkEntity(bot)
    	end
    	
    	return false
    end
    
    function createBot(room) 
    
    	local bot = luajava.newInstance("org.alexdev.icarus.game.bot.Bot");
    	bot:getDetails():setName("RandomAlexBot")
    	bot:getDetails():setMotto("")
    	
    	room:addEntity(bot)
    
    	return bot
    end
    
    function randomWalkEntity(entity)
    	
    	local randomX = math.random(0, 25)
    	local randomY = math.random(0, 25)
    	
    	entity:getRoomUser():walkTo(randomX, randomY)
    	plugin:runTaskLater(1, randomWalkEntity, { entity })
    	
    end
    Screenshots

    Server









    Credits

    - @Leon, giving me some help for fixing structures, etc.
    - @Glaceon, guidance on fixing client crash when item quantity is enabled on the catalogue.
    Last edited by Quackster; 02-12-17 at 04:50 PM.


  2. #2
    Account Upgraded | Title Enabled! asesinato is offline
    MemberRank
    Aug 2014 Join Date
    601Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Approved. Good luck with your development.

  3. #3
    C# Programmer Jax is offline
    MemberRank
    Dec 2009 Join Date
    1,030Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Good luck my friend - this will be your magnum opus

  4. #4
    j’aime ma famille dominic is offline
    MemberRank
    Aug 2012 Join Date
    ~/Location
    611Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Good luck bro! Welcome back! :3

  5. #5
    Banned rafa95123 is offline
    BannedRank
    May 2009 Join Date
    /home/RaphaLocation
    564Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Good Luck man! Good to see you back :D

  6. #6
    ☮TAKU???? seanrom is offline
    MemberRank
    Nov 2009 Join Date
    1,004Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Interesting.

    But didn't you receive a C&D?

  7. #7
    Account Upgraded | Title Enabled! Alozi is offline
    MemberRank
    Nov 2014 Join Date
    SwedenLocation
    452Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Good luck with this!

  8. #8
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,607Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    First line says minimizing memory leaks, first example given already has 3 memory leaks.

    I don't have much hope for this.

    PS: John broke his neck.

  9. #9
    j’aime ma famille dominic is offline
    MemberRank
    Aug 2012 Join Date
    ~/Location
    611Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by The General View Post
    First line says minimizing memory leaks, first example given already has 3 memory leaks.

    I don't have much hope for this.

    PS: John broke his neck.
    Teach us master! Where is these memory leaks?

  10. #10
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,607Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by Dominic View Post
    Teach us master! Where is these memory leaks?
    Not spoonfeeding. I've done (most) things all by myself with little suggestions. He'll figure it out if he ever gets to the point where he runs out of memory which, if he continues to work like this, is pretty soon.

  11. #11
    j’aime ma famille dominic is offline
    MemberRank
    Aug 2012 Join Date
    ~/Location
    611Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by The General View Post
    Not spoonfeeding. I've done (most) things all by myself with little suggestions. He'll figure it out if he ever gets to the point where he runs out of memory which, if he continues to work like this, is pretty soon.
    Not even close to spoonfeeding, but suit yourself

  12. #12
    ☮TAKU???? seanrom is offline
    MemberRank
    Nov 2009 Join Date
    1,004Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by The General View Post
    Not spoonfeeding. I've done (most) things all by myself with little suggestions. He'll figure it out if he ever gets to the point where he runs out of memory which, if he continues to work like this, is pretty soon.
    You can not argue with no arguments.

    Says itself.

  13. #13
    C# Programmer Jax is offline
    MemberRank
    Dec 2009 Join Date
    1,030Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by The General View Post
    First line says minimizing memory leaks, first example given already has 3 memory leaks.

    I don't have much hope for this.

    PS: John broke his neck.
    Is it due to the fact that he isn't disposing the memory after use?

  14. #14
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,607Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by Jax View Post
    Is it due to the fact that he isn't disposing the memory after use?
    Thats what memory leaks are...

  15. #15
    C# / Java Programmer scottstamp851 is offline
    MemberRank
    Jan 2007 Join Date
    EverywhereLocation
    504Posts

    re: Icarus Server (Production) - [Python, Multi-DB/MySQL]

    Quote Originally Posted by The General View Post
    Thats what memory leaks are...
    He's releasing objects after use, the GC handles disposal afterwards. This code is fine.


    Sent from my iPhone using Tapatalk



Page 1 of 23 12345678911 ... LastLast

Advertisement