Butterfly emu , class.users editing

Results 1 to 4 of 4
  1. #1
    Loyalty Vaulient is offline
    MemberRank
    May 2012 Join Date
    MalaysiaLocation
    1,796Posts

    Butterfly emu , class.users editing

    Hello guys.

    Recently , I was helping a friend with butterfly emulator and I thought the problem would be the same as min before , when I was using butterfly emu , but then I noticed something different. Usually , if we changed the user_ticket to auth_ticket , the client would work with butterfly , but this :

    Code:
                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    if (!useSso || !ButterflyEnvironment.useSSO)
                    {
                        dbClient.setQuery("SELECT userid " +
                        "FROM user_tickets " +
                                            "WHERE user_tickets.sessionticket = @sso LIMIT 1");
                    }
                    else
                    {
                        dbClient.setQuery("SELECT userid " +
                                            "FROM user_tickets " +
                                            "WHERE user_tickets.sessionticket = @sso " +
                                            "AND ipaddress = @iPaddress ");
     
                    }
     
                    dbClient.addParameter("sso", sessionTicket);
                    dbClient.addParameter("ipaddress", ip);
                    userid = (uint)dbClient.getInteger();
     
     
                    if (userid == 0)
                    {
                        errorCode = 1;
                        return null;
                        //Logging.LogException("No user found. Debug data: [" + sessionTicket + "], [" + ip + "]");
                        //throw new UserDataNotFoundException(string.Format("No user found with ip {0} and sso {1}. Use SSO: {2} ", ip, sessionTicket, ButterflyEnvironment.useSSO.ToString()));
                    }
                    userData = ButterflyEnvironment.GetGame().GetClientManager().GetHabboData(userid);
                   
                    if (userData == null)
                    {
                        errorCode = 1;
                        return null;
                    }
                    //if (ip != "127.0.0.1")
                    //{
                    //    dbClient.setQuery("DELETE FROM user_tickets WHERE sessionticket = @Sessionticket");
                    //    dbClient.addParameter("sessionticket", sessionTicket);
                    //    dbClient.runQuery();
                    //}
    From this code I can notice that it's set to get the sso ticket from user_tickets table , and not from the users table , so it's separate.

    What I can understand is that , if I somehow manage to change the code to make it get the sso from auth_ticket table or edit revcms to enter the ssso ticket into the user_tickets table , the client might start working.

    Code:
    /*
    Navicat MySQL Data Transfer
    
    Source Server         : efdsf
    Source Server Version : 50532
    Source Host           : localhost:3306
    Source Database       : jo
    
    Target Server Type    : MYSQL
    Target Server Version : 50532
    File Encoding         : 65001
    
    Date: 2013-12-16 23:29:39
    */
    
    SET FOREIGN_KEY_CHECKS=0;
    -- ----------------------------
    -- Table structure for `user_tickets`
    -- ----------------------------
    DROP TABLE IF EXISTS `user_tickets`;
    CREATE TABLE `user_tickets` (
      `userid` int(10) unsigned NOT NULL,
      `sessionticket` varchar(100) NOT NULL,
      `ipaddress` varchar(20) NOT NULL,
      PRIMARY KEY (`sessionticket`,`ipaddress`),
      UNIQUE KEY `index_id` (`userid`) USING HASH
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    
    -- ----------------------------
    -- Records of user_tickets
    -- ----------------------------
    That's the sql for user_tickets , I hope anybody would know how to help. Thanks :)


  2. #2
    R.I.P Millercent FatalLulz is offline
    MemberRank
    Nov 2012 Join Date
    AustraliaLocation
    2,248Posts

    Re: Butterfly emu , class.users editing

    Code:
     using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    if (!useSso || !ButterflyEnvironment.useSSO)
                    {
                        dbClient.setQuery("SELECT userid " +
                        "FROM users " +
                                            "WHERE users.auth_ticket = @sso LIMIT 1");
                    }
                    else
                    {
                        dbClient.setQuery("SELECT userid " +
                                            "FROM users " +
                                            "WHERE users.auth_ticket = @sso " +
                                            "AND ip_last = @iPaddress ");
     
                    }
     
                    dbClient.addParameter("sso", sessionTicket);
                    dbClient.addParameter("ipaddress", ip);
                    userid = (uint)dbClient.getInteger();
     
     
                    if (userid == 0)
                    {
                        errorCode = 1;
                        return null;
                        //Logging.LogException("No user found. Debug data: [" + sessionTicket + "], [" + ip + "]");
                        //throw new UserDataNotFoundException(string.Format("No user found with ip {0} and sso {1}. Use SSO: {2} ", ip, sessionTicket, ButterflyEnvironment.useSSO.ToString()));
                    }
                    userData = ButterflyEnvironment.GetGame().GetClientManager().GetHabboData(userid);
                   
                    if (userData == null)
                    {
                        errorCode = 1;
                        return null;
                    }
                    //if (ip != "127.0.0.1")
                    //{
                    //    dbClient.setQuery("DELETE FROM user_tickets WHERE sessionticket = @Sessionticket");
                    //    dbClient.addParameter("sessionticket", sessionTicket);
                    //    dbClient.runQuery();
                    //}
    Try that.

  3. #3
    Loyalty Vaulient is offline
    MemberRank
    May 2012 Join Date
    MalaysiaLocation
    1,796Posts

    Re: Butterfly emu , class.users editing

    Problem is mate , the butterfly emu won't debug ... It says I need to build ,m but when I do it gives errors.

  4. #4
    Web & Interaction Design Gangnam is offline
    MemberRank
    Dec 2010 Join Date
    Lincoln, UKLocation
    1,983Posts

    Re: Butterfly emu , class.users editing

    Quote Originally Posted by Vaulient View Post
    Problem is mate , the butterfly emu won't debug ... It says I need to build ,m but when I do it gives errors.
    Then, list the errors. It is the only way you are going to be able to compile your emulator.



Advertisement