Crowley - r63 - Java - Hibernate/BoneCP (MySQL)

Page 1 of 15 12345678911 ... LastLast
Results 1 to 15 of 224
  1. #1
    Member Crossroads is offline
    MemberRank
    Dec 2011 Join Date
    59Posts

    Crowley - r63 - Java - Hibernate/BoneCP (MySQL)

    Crowley

    Crowley is a truly unique Habbo Hotel emulator designed to support the "RELEASE63" post-shuffle client, it is designed from the ground up to be non-blocking and scalable.

    Object persistence is handled using the Hibernate library with the BoneCP connection handler, using these tools allows us to avoid heavy database logic which can be difficult to maintain by using industry standard tools that have a large user base and are well documented and tested.

    Network communication is handled using the Netty NIO library which is designed to solve the C10K problem (google it) as a result it can handle and scale to handle large amounts of clients.

    Github HEAD
    Github (last V13 capable build)

    Change log:
    commit 0126326249bb78a9d934a61f82422fc0fb035399
    Author: Crowley <crowlie@hybridcore.net>
    Date: Thu Feb 16 06:34:12 2012 +0000

    Online / Offline notifications are now instant chat now works and update checks if the user is online before sending the message.

    commit d02a3d027dbe33898f935b575427e88c7264f5d6
    Author: Crowley <crowlie@hybridcore.net>
    Date: Thu Feb 16 04:58:15 2012 +0000

    Added support for a Message of the day.

    commit 450776fd77be982e6262339d9a48f03c3d33af53
    Author: Crowley <crowlie@hybridcore.net>
    Date: Thu Feb 16 04:40:57 2012 +0000

    Fixed dependencies, Fixed an issue with the Decoder (my bad! Dom did tell me this would happen), Session manager now lets you get a GameSession by Habbo ID, Messenger Updates done, LatencyTest done Moved logic for friend update / init messenger into Habbo class as it's the same (save dead code).

    commit 3bde8ef9a2cd22dcd6b212ef51a49818614bb7b8
    Author: Crowley <crowlie@hybridcore.net>
    Date: Mon Feb 13 02:39:41 2012 +0000

    Removed iml files.

    commit 0120e9252391538169ba0738ae441370ca410224
    Author: Crowley <crowlie@hybridcore.net>
    Date: Mon Feb 13 02:38:46 2012 +0000

    Now use Maven to build.

    commit e5aed90ad9b4109579cf081288e5ceaa91706b9f
    Author: Crowley <crowlie@hybridcore.net>
    Date: Mon Feb 13 00:56:42 2012 +0000

    Logger options

    commit a03ba8b5456509457b22b9998f1a2da827926ef5
    Author: Crowley <crowlie@hybridcore.net>
    Date: Sat Feb 11 19:33:27 2012 +0000

    Working db

    commit 330cff0a1f038c60622b844804444c301893fc48
    Author: Crowley <crowlie@hybridcore.net>
    Date: Sat Feb 11 19:32:38 2012 +0000

    Credits, Activity Points, Properties.

    commit 9d1e9284172805ebfa2342c90980fc1a8111a333
    Author: Crowley <crowlie@hybridcore.net>
    Date: Sat Feb 11 18:54:42 2012 +0000

    Start of messenger and userinfo

    commit c983582d76dba3cc00e19c860fa170586dcb6927
    Author: Crowley <crowlie@hybridcore.net>
    Date: Fri Feb 10 20:26:59 2012 +0000

    Now handle decoding properly and pass channel disconnects to the session manager

    commit 4759976f3a4bb55393e124d43ab9a6e7d2cd4860
    Author: Crowley <crowlie@hybridcore.net>
    Date: Fri Feb 10 07:19:57 2012 +0000

    Changed auto_increment values

    commit 0666ae9dd033f3f46103209b4657f23ecdbff81a
    Author: Crowley <crowlie@hybridcore.net>
    Date: Fri Feb 10 07:18:38 2012 +0000

    Added initial version of the database

    commit ad6bb2680dcfd64281269847cd2dc35951199f3c
    Author: Crowley <crowlie@hybridcore.net>
    Date: Fri Feb 10 07:14:03 2012 +0000

    Implement Fuserights and Bans inside the Login handler.

    commit 9cb993f3c7802190b1d5eb6092a9aace03e33323
    Author: Crowley <crowlie@hybridcore.net>
    Date: Fri Feb 10 03:38:18 2012 +0000

    SSOTicket shit

    commit 875c04664102147a90c067946d92bf666a5c4e51
    Author: Crowley <crowlie@hybridcore.net>
    Date: Thu Feb 9 12:18:18 2012 +0000

    Added mapping for the habbo class

    commit bc1e0e4349c7dfe2cde66db974b7fd10e35cf586
    Author: Crowley <crowlie@hybridcore.net>
    Date: Thu Feb 9 12:01:46 2012 +0000

    Hey ho we get asked if the SSOTicket is correct!

    commit b62445c8a824a8cb996c2b285f54947b41c68aab
    Author: Crowley <crowlie@hybridcore.net>
    Date: Thu Feb 9 01:32:54 2012 +0000

    Improved ServerMessage and implemented the XML Policy request used in R34 "BETA" and above

    commit d3c17233ec51edff5054b44c62464d0ff6ff93c8
    Author: Crowley <crowlie@hybridcore.net>
    Date: Sun Jan 22 14:25:34 2012 +0000

    Try to bypass the ParentalConsent message by sending 'CY1\01' early, doesn't seem to work though.

    commit a92de63942af4e182e013973405da4eb55cda980
    Author: Crowley <crowlie@hybridcore.net>
    Date: Fri Jan 20 00:38:10 2012 +0000

    Fixed a few small issues with logging

    commit b0cf515dd56cb368c68d010f3052750b4a82a477
    Author: Crowley <crowlie@hybridcore.net>
    Date: Thu Jan 19 04:09:07 2012 +0000

    Reformatted imports.

    commit 3859f36fe4bf495981cbebe204bef4299efa45c7
    Author: Crowley <crowlie@hybridcore.net>
    Date: Thu Jan 19 03:20:58 2012 +0000

    Moved messages that are reusable into the outgoing package.

    commit e92648d8effc0e82b05fa0e5ad9e80f85db154e0
    Author: Crowley <crowlie@hybridcore.net>
    Date: Tue Jan 17 02:15:08 2012 +0000

    Added first mapping, the lookup in ApproveName WILL block the event loop - this will be moved to a ThreadPool in due time.

    commit 1c1c2efba5708c7f108f1f66e653932a69450fc9
    Author: Crowley <crowlie@hybridcore.net>
    Date: Mon Jan 16 02:30:50 2012 +0000

    We now try to validate email addresses, ApproveName NEEDS to check the database but i'm to lazy to finish the database design for now.

    commit 2f27b39e9f8a6c1031e80f57625253f7e2db958e
    Author: Crowley <crowlie@hybridcore.net>
    Date: Wed Jan 11 02:31:43 2012 +0000

    Try to decrypt incoming data

    commit 59b69ec83d240fdaeec7994cd220412b5ecb1fdb
    Author: Crowley <crowlie@hybridcore.net>
    Date: Wed Jan 11 02:28:45 2012 +0000

    Attented to fix encryption.

    commit f20d3e2c4d6ae9899814f595781ea1e2b044532d
    Author: Crowley <crowlie@hybridcore.net>
    Date: Mon Jan 9 04:11:22 2012 +0000

    Removed unused imports

    commit 7e5256ad52c6a46638ad854d78aac8621393e30b
    Author: Crowley <crowlie@hybridcore.net>
    Date: Mon Jan 9 04:10:34 2012 +0000

    Attempted to get encryption to work.

    commit 9818035fd9ddb752c69dbbaf2c1a5ce835709a10
    Author: Crowley <crowlie@hybridcore.net>
    Date: Sun Jan 8 17:14:09 2012 +0000

    Added some debugging to decodeKey changed a few parts of generateKey

    commit 336f25d096f346c837a74a0a45973970965a4a2b
    Author: Crowley <crowlie@hybridcore.net>
    Date: Sun Jan 8 16:55:14 2012 +0000

    Implemented MessageHandler and modified Session and the Decoder to use it, Implemented first two "security" messages and attempted to get encryption running.

    commit 4df0f3e50562b5332db03e9fcf894f06df43b3b5
    Author: Crowley <crowlie@hybridcore.net>
    Date: Thu Jan 5 18:30:52 2012 +0000

    Modified boot message

    commit 3e68a306d6534efbd59409640724fa27cc92a90c
    Author: Crowley <crowlie@hybridcore.net>
    Date: Thu Jan 5 18:20:20 2012 +0000

    Moved session manager into the game package.

    commit 3f7c398cd84ebeaf3af665cd450f53c6160616b0
    Author: Crowley <crowlie@hybridcore.net>
    Date: Thu Jan 5 17:44:59 2012 +0000

    Updated .gitignore

    commit 644494d902e07979c585df6ed1e67bc464cf1510
    Author: Crowley <crowlie@hybridcore.net>
    Date: Wed Jan 4 02:35:47 2012 +0000

    Added README

    commit 481ee3cdb67416f04acb7fdf153dbbfdb02a40c7
    Author: Crowley <crowlie@hybridcore.net>
    Date: Wed Jan 4 02:28:23 2012 +0000

    ServerMessage now supports method chaining, SessionManager allows you to fetch a session from it's channel.

    commit 59a047866bb6e43918fb8d48798bf56f51801fdd
    Author: Crowley <crowlie@hybridcore.net>
    Date: Wed Jan 4 00:51:55 2012 +0000

    Initial commit


    Screenshots:
    Web


    Server








    Shout out:
    Myrax
    office.boy
    Jeax
    Moogly
    Nillus
    KT
    Aaron
    Last edited by Makarov; 25-02-12 at 08:11 PM.


  2. #2
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: "Crowley"

    Ok king of hell, luck be with you.

  3. #3
    swagggggg Livar is offline
    MemberRank
    Oct 2008 Join Date
    United KingdomLocation
    2,272Posts

    Re: "Crowley"

    Goodluck, but Cobe, stop editing posts?

  4. #4
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: "Crowley"

    Quote Originally Posted by PowahAlert View Post
    Goodluck, but Cobe, stop editing posts?
    He was warned about the image and keeps bring it back to prove some cocky point.

  5. #5
    <insert title here> Shorty is offline
    MemberRank
    Feb 2007 Join Date
    United KingdomLocation
    1,861Posts

    Re: "Crowley"

    Good luck, I'm sure most of it will get completed. +rep'd

  6. #6
    Account Upgraded | Title Enabled! chillhabbo is offline
    MemberRank
    Jun 2007 Join Date
    RotterdamLocation
    367Posts

    Re: "Crowley"

    Good luck dude ^^

  7. #7
    Custom Title Enabled James is offline
    LegendRank
    Jan 2007 Join Date
    DenverLocation
    2,288Posts

    Re: "Crowley"

    Quote Originally Posted by DominicGunn View Post
    Not sure how true this statement is for some of m8.

    *puts this back again*
    DA IMAGE IS TO SYMBOLISE THE AGE, KNOWLEDGE AND INFLUENCE DIFFERENCE BETWEEN MYSELF AND ORIGINAL POSTER. IT IS IN NO WAY JUST A SILLY IMAGE THAT I GOT FRACTIONED FOR. DISCLAIMER 2011


    dnt edit ma posts oh cocki 1
    Not cool, there is a difference between getting respect for your accomplishments, and being a complete jerk. Not trying to flame, but your being really really cocky.

    OT: This should be a pretty cool project =) gave you the client yesterday, and said I wanted to help on skype, but you won't message me back ;"(

  8. #8
    Member Crossroads is offline
    MemberRank
    Dec 2011 Join Date
    59Posts

    Re: "Crowley"

    Quote Originally Posted by james View Post
    Not cool, there is a difference between getting respect for your accomplishments, and being a complete jerk. Not trying to flame, but your being really really cocky.

    OT: This should be a pretty cool project =) gave you the client yesterday, and said I wanted to help on skype, but you won't message me back ;"(
    Yeah sorry about that left skype on while i was out ;P

  9. #9
    Ultra Light Beam Makarov is offline
    MemberRank
    Apr 2010 Join Date
    GothamLocation
    3,622Posts

    Re: "Crowley"

    Sad I had to delete every single one of Dominic's posts, the cockiness is really getting annoying and no one truly sees you as some great god in this section, learn your position in this 'boon infested section of RaGEZONE.

    Now let's all stay on topic before I have to give out more warnings and infractions than I already have today(too many..)

    --------------------------------------------------------------------------------------
    It's really not the best thing when I'm tempted to close a thread after only a few hours because of the constant spam and arguing. Which of course all rooted from Dominic. Anyone after this post that spams or flames or whatever you all want to call it, will receive a warning. If you want to be a repeat offender, an infraction will come nicely with that warning for no cost at all.

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

    Re: "Crowley"

    Quote Originally Posted by Crossroads View Post
    So unlike most of the threads in this section i'm not going to post a load of horseshit.

    Me and Lord Moogles have taken it upon ourselves to resurrect the client known as V13 and because i'm the King of Hell i can do just that.
    Orly? Carlos and I were talking about furthering the development of Woodpecker to something usable, I wasn't aware he'd changed his mind and decided to do a from-scratch.

    On another note, that code... seems, vaguely familiar. Not so much the code but rather how it's been written. ... Josh?

  11. #11
    Alpha Member Moogly is offline
    MemberRank
    Feb 2008 Join Date
    Pool LidoLocation
    2,322Posts

    Re: "Crowley"

    Quote Originally Posted by scottstamp851 View Post
    Orly? Carlos and I were talking about furthering the development of Woodpecker to something usable, I wasn't aware he'd changed his mind and decided to do a from-scratch.

    On another note, that code... seems, vaguely familiar. Not so much the code but rather how it's been written. ... Josh?
    I don't mind working on it still, there were bugs I fixed ages back and there's always small things that can be done to improve it, nontheless that's not Josh, his name is *wispers* Eric Northman, but you didn't hear that from me. In other news, v13 is ancient as fuck. Wow

  12. #12
    Retired maritnmine is offline
    MemberRank
    May 2007 Join Date
    North KoreaLocation
    1,103Posts

    Re: "Crowley"

    I don't really get the point of the code in the first post, just makes me want to yell at simple noob-mistakes :)
    Anyways, good luck with this.

    - Martin

  13. #13
    Member Crossroads is offline
    MemberRank
    Dec 2011 Join Date
    59Posts

    Re: "Crowley"

    Quote Originally Posted by maritnmine View Post
    I don't really get the point of the code in the first post, just makes me want to yell at simple noob-mistakes :)
    Anyways, good luck with this.

    - Martin
    Go for it big shot ;)

  14. #14
    The next don TheAJ is offline
    DeveloperRank
    May 2007 Join Date
    Toronto, CanadaLocation
    3,946Posts

    Re: "Crowley"

    Just checked out your source (on github). You should take an abstract approach to your networking system. It will allow you to reuse the same system for multiple purposes.

    For example, you would have an abstract management class (eg. IoAdapter), which managements remote connections.
    Code:
    public abstract class IoAdapter 
    {
        private readonly int maxConnections;
        private List<Client> connections;
    
        public IoAdapter(string ip, ushort port, ...)
        {
            ... (do not put logic code here)
        }
    
        public abstract void ConnectionOpened(Client client);
        public abstract void ConnectionClosed(Client client);
        public abstract void ConnectionDenied(Socket socket);
        
        public void DisconnectAll()
        {
            List<Client> clients = new List<Client>(this.connections);
            clients.Foreach((c) => c.OnDisconnect());
            this.connections.Clear();
        }
    }
    "Client" object would be equivalent to your "TCPConnection"


    You can now use IoAdapter to implement different types of network usage:

    eg. A update server: (i actually use this code, for a runescape emulator i've been developing called Jolt)
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    using RuneScape.Commons.Network;
    using RuneScape.Commons.Data.Sql;
    using System.Net.Sockets;
    
    namespace RuneScape.MasterServer.Update.Network
    {
        /// <summary>
        /// Handles connections for self-updating.
        /// </summary>
        public class ConnectionHandler : IoAdapter
        {
            #region Constructors
            /// <summary>
            /// Constructs a handler for game connections.
            /// </summary>
            /// <param name="ip">The ip server will be listening from.</param>
            /// <param name="port">The port the server will be listening from.</param>
            /// <param name="maxConnections">Maximum amount of simultaneous connections.</param>
            public ConnectionHandler(string ip, ushort port, int maxConnections, SqlDatabaseManager databaseManager) 
                : base(ip, port, maxConnections, databaseManager)
            {
            }
            #endregion Constructors
    
            #region Methods
            /// <summary>
            /// A connection is opened for a client.
            /// </summary>
            /// <param name="client">The client created.</param>
            public override void ConnectionOpened(Client client)
            {
                Program.Logger.PrintDebug("Connection opened [id=" + client.Id + ", ip=" + client.Socket.RemoteEndPoint + "].");
                lock (this.CurrentConnections)
                {
                    this.CurrentConnections.Add(client);
                }
                new Request(client);
            }
    
            /// <summary>
            /// An existing connection is dropped.
            /// </summary>
            /// <param name="client">The client to be dropped.</param>
            public override void ConnectionClosed(Client client)
            {
                lock (this.CurrentConnections)
                {
                    if (client != null && this.CurrentConnections.Contains(client))
                    {
                        client.Dispose();
                        this.CurrentConnections.Remove(client);
                        Program.Logger.PrintDebug("Connection dropped [id=" + client.Id + "].");
                    }
                }
            }
    
            /// <summary>
            /// A connection attempt was denied.
            /// </summary>
            /// <param name="socket">The socket attached to the connection.</param>
            public override void ConnectionDenied(Socket socket)
            {
                Program.Logger.PrintWarn("A connection was denied access [ip=" + socket.RemoteEndPoint + "].");
            }
            #endregion Methods
        }
    }
    We can now use the Client object to create a high-level, purpose-specific controller for that client (eg. for the update server, a Request session.)

    Code:
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    using RuneScape.Commons.Cache;
    using RuneScape.Commons.Messages;
    using RuneScape.Commons.Network;
    using RuneScape.MasterServer.Update.Protocol;
    using RuneScape.MasterServer.Update.Protocol.OnDemand;
    using RuneScape.Commons.Utilities;
    
    namespace RuneScape.MasterServer.Update
    {
        /// <summary>
        /// Represents a login request from a new connection.
        /// </summary>
        public class Request : IDisposable
        {
            #region Fields
            /// <summary>
            /// The ondemand worker which processes requested files.
            /// </summary>
            public OnDemandWorker onDemandWorker;
            #endregion Fields
    
            #region Properties
            /// <summary>
            /// The client requesting a login.
            /// </summary>
            public Client Client { get; private set; }
            /// <summary>
            /// Gets if client connection was accepted.
            /// </summary>
            public bool Accepted { get; private set; }
            /// <summary>
            /// Gets if update requester is logged in game or just in loading screen.
            /// </summary>
            public bool LoggedIn { get; set; }
            /// <summary>
            /// Gets encryption byte if it's enabled. (0 = disabled)
            /// </summary>
            public byte Encryption { get; set; }
            /// <summary>
            /// Gets whether the request is being disconnected.
            /// </summary>
            public bool Disconnecting { get; set; }
            #endregion Properties
    
            #region Constructors
            /// <summary>
            /// Constructs a new request connection.
            /// </summary>
            /// <param name="client">The client being handled.</param>
            public Request(Client client)
            {
                this.Client = client;
                this.Client.Start(
                    new DataRouteEventHandler(ProcessData),
                    new DisconnectEventHandler(Disconnect));
            }
            #endregion Constructors
    
            #region Methods
            /// <summary>
            /// Prepare's request for updating.
            /// </summary>
            public void PrepareUpdating()
            {
                this.Accepted = true;
                this.onDemandWorker = new OnDemandWorker();
            }
    
            /// <summary>
            /// Process incoming data.
            /// </summary>
            /// <param name="data">The data to be processed.</param>
            public void ProcessData(byte[] data)
            {
                if (!this.Disconnecting)
                {
                    try
                    {
                        Packet p = new Packet(data);
    
                        while (p.RemainingAmount > 0)
                        {
                            byte opcode = p.ReadByte();
                            if (Accepted)
                            {
                                byte[] packetData = new byte[3];
    
                                for (int i = 0; i < 3; i++)
                                    packetData[i] = p.ReadByte();
                                UpdateServerHandler.HandlePacket(this, new Packet(packetData), opcode);
                                continue;
                            }
    
                            if (p.RemainingAmount < 4)
                            {
                                Disconnect();
                                return;
                            }
    
                            int revision = p.ReadInt();
                            if (opcode != 15 || revision != Constants.Revision)
                            {
                                if (opcode == 15)
                                {
                                    GenericPacketComposer compser = new GenericPacketComposer();
                                    compser.SetOpcode(6);
                                    Client.SendData(compser.Serialize());
                                }
                                Disconnect();
                                return;
                            }
                            PrepareUpdating();
                            GenericPacketComposer cmp = new GenericPacketComposer();
                            cmp.SetOpcode(0);
                            foreach (int i in Cache.LoginInts)
                                cmp.AppendInt(i);
                            Client.SendData(cmp.Serialize());
                        }
                    }
                    catch (Exception ex)
                    {
                        Program.Logger.PrintException(ex);
                        Disconnect();
                    }
                }
            }
    
            /// <summary>
            /// Disconnects the client.
            /// </summary>
            public void Disconnect()
            {
                try
                {
                    if (this.Client != null)
                    {
                        this.Disconnecting = true;
                        UpdateServer.ConnectionHandler.ConnectionClosed(this.Client);
                        this.Dispose();
                    }
                }
                catch (Exception ex)
                {
                    Program.Logger.PrintException(ex);
                }
            }
    
            #region IDispose Members
            /// <summary>
            /// Attempts to dispose the session.
            /// </summary>
            public void Dispose()
            {
                Dispose(true);
            }
    
            /// <summary>
            /// Disposes the object.
            /// </summary>
            /// <param name="disposing">Whether to dispose managed code.</param>
            protected virtual void Dispose(bool disposing)
            {
                if (disposing)
                {
                    if (this.Client != null)
                        this.Client.Dispose();
                }
            }
            #endregion IDispose Members
            #endregion Methods
        }
    }
    Good luck.
    Last edited by TheAJ; 28-12-11 at 08:34 PM.

  15. #15
    Member Crossroads is offline
    MemberRank
    Dec 2011 Join Date
    59Posts

    Re: "Crowley"

    Cheers for the hint's Aj but i don't really see a need for decoupling the networking layer since i don't really plan on reusing the code anywhere else.

    When i wake up i shall sort parsing and handling the data struggling to stay awake at the minute.
    Last edited by Crossroads; 29-12-11 at 11:35 PM.



Page 1 of 15 12345678911 ... LastLast

Advertisement