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

Page 6 of 15 FirstFirst 1234567891011121314 ... LastLast
Results 76 to 90 of 224
  1. #76
    Member Crossroads is offline
    MemberRank
    Dec 2011 Join Date
    59Posts

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

    Back from my break tonight / tomorrow work resumes.

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

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

    Very tempted to switch to the R54 client because i'm having some weird issues i can't debug and lets face it shockwave is dead. I'll try to get the client to boot tomorrow and if it does i will write a minimalistic login and registration system that allows you to choose your "habbo" upon login before entering the client using either Rails or JSP not sure yet ;P

  3. #78
    8-bit Bitch Slapper Alpha Ducky is offline
    MemberRank
    Mar 2007 Join Date
    In My HouseLocation
    2,436Posts
    Quote Originally Posted by Crossroads View Post
    Very tempted to switch to the R54 client because i'm having some weird issues i can't debug and lets face it shockwave is dead. I'll try to get the client to boot tomorrow and if it does i will write a minimalistic login and registration system that allows you to choose your "habbo" upon login before entering the client using either Rails or JSP not sure yet ;P
    i say do it
    mostly everyone says they will do it but never release it
    i wanna see atleast one done, and you seem to know what your doing so it will be good
    Posted via Mobile Device

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

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

    So i started on the "welcome page" for the login system opinions?


  5. #80
    Demi-god on these 'ere wa DominicGunn is offline
    MemberRank
    Jun 2011 Join Date
    347Posts

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

    Quote Originally Posted by Crossroads View Post
    So i started on the "welcome page" for the login system opinions?

    fkin bootstrap lazi bastard

  6. #81
    prjRev.com Kryptos is offline
    MemberRank
    Feb 2010 Join Date
    Planet EarthLocation
    579Posts

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

    Quote Originally Posted by Crossroads View Post
    So i started on the "welcome page" for the login system opinions?

    Bootstrap, nice ;)

  7. #82
    Alpha Member Caustik is offline
    MemberRank
    May 2011 Join Date
    LondonLocation
    1,837Posts

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

    Quote Originally Posted by Crossroads View Post
    So i started on the "welcome page" for the login system opinions?

    Lemon's design/colour scheme :D
    Anyway, will the cms be in JSP or Rails?

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

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

    Quote Originally Posted by Caustik View Post
    Lemon's design/colour scheme :D
    Anyway, will the cms be in JSP or Rails?
    Not "lemons design colour scheme" it's based on Twitter Bootstrap and i was the one that suggested using Bootstrap to Dom.

    Probably Rails since i can whip up the basic system in a few minutes and Rails doesn't require Apache Tomcat :P

  9. #84
    Alpha Member Caustik is offline
    MemberRank
    May 2011 Join Date
    LondonLocation
    1,837Posts

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

    Quote Originally Posted by Crossroads View Post
    Not "lemons design colour scheme" it's based on Twitter Bootstrap and i was the one that suggested using Bootstrap to Dom.

    Probably Rails since i can whip up the basic system in a few minutes and Rails doesn't require Apache Tomcat :P
    Bootstrap looks awesome
    Will you be going with the r54 client instead of v13 then?

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

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

    Quote Originally Posted by Caustik View Post
    Bootstrap looks awesome
    Will you be going with the r54 client instead of v13 then?
    Going to try and get the R54 client to work tomorrow since i have the day off if it does i'll start work right away :)

    Not sure if i should go for R63 pre-shuffle or R54 (can't find a working set of client files) so far i've implemented the policy request and started on the InitCrypto message. Not sure if i should be responding with 277 (DU) or 257 (DA) though so i'll do some digging tomorrow.

    The new "Decoder" is bellow.
    PHP Code:

    package styx.net.codec;

    import org.apache.log4j.Logger;
    import org.jboss.netty.buffer.ChannelBuffer;
    import org.jboss.netty.channel.Channel;
    import org.jboss.netty.channel.ChannelHandlerContext;
    import org.jboss.netty.handler.codec.frame.FrameDecoder;
    import styx.Crowley;
    import styx.habbo.encoding.Base64Encoding;
    import styx.habbo.game.Session;
    import styx.habbo.message.ClientMessage;

    /**
     * "THE BEER-WARE LICENSE" (Revision 42):
     * <crowlie@hybridcore.net> wrote this file. As long as you retain this notice you
     * can do whatever you want with this stuff. If we meet some day, and you think
     * this stuff is worth it, you can buy me a beer in return Crowley.
     */
    public class Decoder extends FrameDecoder {
        private static final Logger logger = Logger.getLogger(Decoder.class.getName());

        @Override
        protected Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer) throws Exception {
            if (buffer.readableBytes() < 5) {
                return null;
            }

            int bufferIndex = buffer.readerIndex();
            Session session = Crowley.getHabbo().getSessions().getSession(channel);
            byte[] messageLengthBytes = buffer.readBytes(3).array();

            if (messageLengthBytes[0] == 0x3C) {
                buffer.discardReadBytes();

                session.getChannel().write(
                        "<?xml version=\"1.0\"?>\r\n" +
                                
    "<!DOCTYPE cross-domain-policy SYSTEM \"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\">\r\n" +
                                
    "<cross-domain-policy>\r\n" +
                                
    "<allow-access-from domain=\"*\" to-ports=\"*\" />\r\n" +
                                
    "</cross-domain-policy>\0"
                
    );

                
    logger.info("Sent policy to client #" session.getID());

                
    session.getChannel().close();
                return 
    null;
            } else if (
    messageLengthBytes[0] == 0x40) {
                
    int messageLength Base64Encoding.PopInt(messageLengthBytes);

                if (!(
    buffer.readableBytes() >= messageLength)) {
                    
    buffer.resetReaderIndex();
                    return 
    null;
                }

                
    int messageID Base64Encoding.PopIntbuffer.readBytes(2).array() );

                
    // messageLength passed to ClientMessage is (messageLength - 2) to account for the messageID
                
    ClientMessage message =  new ClientMessage((messageLength 2), messageIDbuffer);


                
    logger.info("Message received (id: " message.getID() + " length: " message.getLength() + ") from client #" session.getID());
                
    logger.debug("Message data: " message.toString());

                
    session.handleMessage(message);

                return 
    message;
            }

            return 
    null//wtf
        
    }
    }

  11. #86
    Demi-god on these 'ere wa DominicGunn is offline
    MemberRank
    Jun 2011 Join Date
    347Posts

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

    PHP Code:
            byte[] messageLengthBytes buffer.readBytes(3).array(); 
    Bare noob move, y have such overhead if is simply policy request.

  12. #87
    hi i'm robbie Roper is offline
    MemberRank
    Oct 2008 Join Date
    /home/roperLocation
    2,283Posts

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

    Awesome, glad to see it's flash now too - perhaps you should release the v13 version for other developers to play around with?

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

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

    Quote Originally Posted by DominicGunn View Post
    PHP Code:
            byte[] messageLengthBytes buffer.readBytes(3).array(); 
    Bare noob move, y have such overhead if is simply policy request.
    Unless you've changed it since you sent me your decoder lemon does the same thing 0_o

    @above: it's on github

  14. #89
    Demi-god on these 'ere wa DominicGunn is offline
    MemberRank
    Jun 2011 Join Date
    347Posts

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

    Quote Originally Posted by Crossroads View Post
    Unless you've changed it since you sent me your decoder lemon does the same thing 0_o

    @above: it's on github
    y read 3 bytes wen onli 1 needed to check policy also i have a feeling the above snippet will fail at reading messages properly if the client sends multiple msg ids in one packet

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

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

    Quote Originally Posted by DominicGunn View Post
    y read 3 bytes wen onli 1 needed to check policy also i have a feeling the above snippet will fail at reading messages properly if the client sends multiple msg ids in one packet
    Probably will, I know it's possible but I've never seen the client actually send such a message.

    Pushed the last V13 suitable build to Github and i fixed a possible issue in my handling of ServerMessage's.

    Turns out the flash client is more particular and was picking up on the tiny-bug in my implementation of 'ServerMessage' so the client now sends the SSOTicket - pushed to Github.

    Can a mod change the topic to:
    Crowley - R63 (pre-shuffle) - Java - Hibernate/BoneCP (MySQL)
    Currently looking at writing the Web frontend using the SpringMVC framework so that i can use RMI to get stats such as online users and instruct the server to perform certain operations for administrators.

    Now only read the first byte for the policy (might as well avoid overhead where possible) mapped the Users and Habbo classes so we can now handle the SSOTicket message.

    PHP Code:
    package styx.habbo.message.outgoing;

    import org.apache.log4j.Logger;
    import org.hibernate.Session;
    import org.hibernate.criterion.Restrictions;
    import styx.habbo.beans.Habbo;
    import styx.habbo.game.GameSession;
    import styx.habbo.message.ServerMessage;
    import styx.util.DatastoreUtil;

    /**
     * "THE BEER-WARE LICENSE" (Revision 42):
     * <crowlie@hybridcore.net> wrote this file. As long as you retain this notice you
     * can do whatever you want with this stuff. If we meet some day, and you think
     * this stuff is worth it, you can buy me a beer in return Crowley.
     */
    public class LoginHabbo implements Runnable {
        private static 
    Logger logger Logger.getLogger(LoginHabbo.class.getName());

        private 
    GameSession networkGameSession;
        private 
    String ssoTicket;

        public 
    LoginHabbo(GameSession networkGameSessionString ssoTicket) {
            
    this.networkGameSession networkGameSession;
            
    this.ssoTicket ssoTicket;
        }

        public 
    void run() {
            
    Session session DatastoreUtil.currentSession();

            
    Habbo habbo = (Habbo)session.createCriteria(Habbo.class).add(Restrictions.eq("ssoTicket"this.ssoTicket)).uniqueResult();

            
    // Invalid login ticket :o
            
    if (habbo == null) {
                
    this.networkGameSession.sendMessage(
                        new 
    ServerMessage(161)
                        .
    appendString("Invalid login ticket, refresh the client and try again.")
                );

                
    this.networkGameSession.getChannel().close();
                return;
            }
            
    //TODO: Check if ticket has expired and the IP matches the current clients
            //TODO: Check for bans
            //TODO: Send fuse rights
            /*
            msg-id 2
            wired int count

            string right
             */

            //TODO: Show mod tools if has fuse_mod
            //TODO: Send effects inventory

            
    this.networkGameSession.getMessageHandler().unregisterLoginHandlers();
            
    //TODO: Register other handlers
        
    }

    Code:
    INFO [main] (Crowley.java132) - Server bound on 127.0.0.1:9001
     INFO [New I/O server boss #1 ([id: 0x5e725967, /127.0.0.1:9001])] (SessionManager.java26) - Accepted gameSession (id: 1 ip: 127.0.0.1)
     INFO [New I/O server worker #1-1] (Encoder.java37) - Message sent (string possible policy response) to client #1
     INFO [New I/O server worker #1-1] (Decoder.java43) - Sent policy to client #1
     INFO [New I/O server boss #1 ([id: 0x5e725967, /127.0.0.1:9001])] (SessionManager.java26) - Accepted gameSession (id: 2 ip: 127.0.0.1)
     INFO [New I/O server worker #1-2] (Decoder.java60) - Message received (id: 206 length: 1) from client #2
    DEBUG [New I/O server worker #1-2] (Decoder.java61) - Message data: CNH
     INFO [New I/O server worker #1-2] (Encoder.java28) - Message sent (id: 277 length: 32) to client #2
    DEBUG [New I/O server worker #1-2] (Encoder.java29) - Message data: DU576b145a0c17f8a385971e0b6324a4bc
     INFO [New I/O server worker #1-2] (Decoder.java60) - Message received (id: 2002 length: 127) from client #2
    DEBUG [New I/O server worker #1-2] (Decoder.java61) - Message data: _RA}26287857330965620209588911483532825267711412350069960934103840731132801428748005396153626463827555369048202098929707512226560
     INFO [New I/O server worker #1-2] (Encoder.java28) - Message sent (id: 257 length: 49) to client #2
    DEBUG [New I/O server worker #1-2] (Encoder.java29) - Message data: DAHMIHKHJIPANQAdd-MM-yyyyRAISAHPBhotel-co.ukQBH
     INFO [New I/O server worker #1-2] (Decoder.java60) - Message received (id: 415 length: 12) from client #2
    DEBUG [New I/O server worker #1-2] (Decoder.java61) - Message data: F_@JtestTicket
    DEBUG [pool-2-thread-1] (SessionImpl.java265) - opened session at timestamp: 13288443953
    DEBUG [pool-2-thread-1] (AbstractBatcher.java410) - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
    DEBUG [pool-2-thread-1] (ConnectionManager.java444) - opening JDBC connection
    DEBUG [pool-2-thread-1] (SQLStatementLogger.java111) - select this_.id as id1_0_, this_.name as name1_0_, this_.user_id as user3_1_0_, this_.figure as figure1_0_, this_.sso_ticket as sso5_1_0_, this_.sso_ip as sso6_1_0_, this_.sso_expires as sso7_1_0_ from habbos this_ where this_.sso_ticket=?
    DEBUG [pool-2-thread-1] (AbstractBatcher.java426) - about to open ResultSet (open ResultSets: 0, globally: 0)
    DEBUG [pool-2-thread-1] (AbstractBatcher.java433) - about to close ResultSet (open ResultSets: 1, globally: 1)
    DEBUG [pool-2-thread-1] (AbstractBatcher.java418) - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    DEBUG [pool-2-thread-1] (StatefulPersistenceContext.java893) - initializing non-lazy collections
    DEBUG [pool-2-thread-1] (ConnectionManager.java427) - aggressively releasing JDBC connection
    DEBUG [pool-2-thread-1] (ConnectionManager.java464) - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
     INFO [pool-2-thread-1] (Encoder.java28) - Message sent (id: 161 length: 57) to client #2
    DEBUG [pool-2-thread-1] (Encoder.java29) - Message data: BaInvalid login ticket, refresh the client and try again.
    
    Process finished with exit code 143
    Just implemented Fuseranks => Fuserights and Bans :)
    Last edited by Crossroads; 10-02-12 at 04:45 AM.



Advertisement