[RELEASE] Fix for Hotel View disconnections

Page 4 of 4 FirstFirst 1234
Results 46 to 50 of 50
  1. #46
    Account Upgraded | Title Enabled! Fishing Rod is offline
    MemberRank
    Dec 2013 Join Date
    214Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    Im getting errors :

    Error 2 The type or namespace name 'Headers' does not exist in the namespace 'Butterfly.Messages' (are you missing an assembly reference?) C:\Users\Totoy\Desktop\Revision 6 - Alpha 6\Butterfly\HabboHotel\Navigators\HotelView.cs 9 26 Butterfly Emulator

    Error 3 The name 'Session' does not exist in the current context C:\Users\Totoy\Desktop\Revision 6 - Alpha 6\Butterfly\HabboHotel\Navigators\Navigator.cs 132 17 Butterfly Emulator


    Error 4 The name 'Session' does not exist in the current context C:\Users\Totoy\Desktop\Revision 6 - Alpha 6\Butterfly\HabboHotel\Navigators\Navigator.cs 132 36 Butterfly Emulator


    Error 7 'Butterfly.Messages.GameClientMessageHandler' does not contain a definition for 'RefreshPromoEvent' and no extension method 'RefreshPromoEvent' accepting a first argument of type 'Butterfly.Messages.GameClientMessageHandler' could be found (are you missing a using directive or an assembly reference?) C:\Users\Totoy\Desktop\Revision 6 - Alpha 6\Butterfly\Messages\StaticMessageHandlers\SharedPacketLib.cs 796 21 Butterfly Emulator


    Error 5 'Butterfly.HabboHotel.Navigators.Navigator' does not contain a definition for 'Session' and no extension method 'Session' accepting a first argument of type 'Butterfly.HabboHotel.Navigators.Navigator' could be found (are you missing a using directive or an assembly reference?) C:\Users\Totoy\Desktop\Revision 6 - Alpha 6\Butterfly\HabboHotel\Navigators\Navigator.cs 144 22 Butterfly Emulator

  2. #47
    Right here, right now.. jordynegen11 is offline
    MemberRank
    Jul 2009 Join Date
    NetherlandsLocation
    398Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    I need packets for: RELEASE63-201311181105-772225098

    ":P

  3. #48
    Enthusiast IcePhreak is offline
    MemberRank
    Nov 2013 Join Date
    The Great DividLocation
    41Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    Great work AKIIX I've used this and it works 100% Keep up the awesome releases

  4. #49
    Member Dcbest is offline
    MemberRank
    Mar 2013 Join Date
    NorwayLocation
    94Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    Quote Originally Posted by AKllX View Post
    Hello, long time no releases so it's time.

    This release is applicable for any R63B release. This is the proper solution for it as I actually handled the missing packets. I will provide the packet headers for the following releases: Swift Emulator, Revision 5 and Plus Emulator, Skybird, any other plus edit.

    1) In your external variable find the following lines and replace as it's set here:

    landing.view.dynamic.slot.2.widget=promoarticle
    landing.view.dynamic.slot.2.layout=

    landing.view.dynamic.slot.2.conf=


    2) Run the following MySQL script:


    Code:
    Source Server         : weblink
    Source Server Version : 50141
    Source Host           : localhost:3306
    Source Database       : lannok
    
    
    Target Server Type    : MYSQL
    Target Server Version : 50141
    File Encoding         : 65001
    
    
    Date: 2013-11-17 12:05:01
    */
    
    
    SET FOREIGN_KEY_CHECKS=0;
    -- ----------------------------
    -- Table structure for `hotelview_promos`
    -- ----------------------------
    DROP TABLE IF EXISTS `hotelview_promos`;
    CREATE TABLE `hotelview_promos` (
      `index` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `header` varchar(255) NOT NULL DEFAULT '[Header Name]',
      `body` varchar(255) NOT NULL DEFAULT '[BODY]',
      `button` varchar(255) NOT NULL DEFAULT '[BUTTON]',
      `in_game_promo` enum('0','1') NOT NULL DEFAULT '1',
      `special_action` varchar(255) NOT NULL DEFAULT '[LINK HERE]',
      `image` varchar(255) NOT NULL DEFAULT '',
      `enabled` enum('0','1') NOT NULL DEFAULT '1',
      PRIMARY KEY (`index`)
    ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
    
    
    -- ----------------------------
    -- Records of hotelview_promos
    -- ----------------------------
    INSERT INTO hotelview_promos VALUES ('1', 'Was it crashing ?', 'Long time no fixes, so I hope you enjoy it. Find more at forum.ragezone.com', 'Go to RaGEZONE', '0', 'http://forum.ragezone.com/f282/', 'web_promo_small/meter_level_3_NY2013Resolution.png', '1');INSERT INTO hotelview_promos VALUES ('2', '${landing.view.hween13furni1.header}', '${landing.view.hween13furni1.body}', '${landing.view.hween13furni1.button}', '1', 'catalog/open/frightfulfurni', 'web_promo_small/habboween_furni_smallpromo.gif', '1');
    3) Go to Messages\Requests\Navigator.cs

    Code:
            
                internal void RefreshPromoEvent()    {
                if (Session == null || Session.GetHabbo() == null)
                {
                    return;
                }
    
    
                HotelView currentView = SilverwaveEnvironment.GetGame().GetHotelView();
                if (!(currentView.HotelViewPromosIndexers.Count > 0))
                    return;
                else
                {
                    ServerMessage Message = currentView.SmallPromoComposer(new ServerMessage(Outgoing.SmallPromoComposer));
                    this.Session.SendMessage(Message);
                }
            }
    You may need to change SilverwaveEnvironment to your current sever environment.

    Next, go to your Outgoing headers class definitions. Outgoing.cs or Composer.cs
    mostly. Add the following header:

    PHP Code:
    internal static int SmallPromoComposer 949//ak 
    Next, go to HabboHotel > Navigators > Create the file HotelView.cs and replace with the following.

    Notice that you will need to change the 'Silverwave' to match your emulator environment again.

    Code:
     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Data;
    using HabboEncryption;
    using Silverwave.Messages.Headers;
    using Silverwave.Messages.ClientMessages;
    using Silverwave.Core;
    using Silverwave.Messages;
    using ConnectionManager;
    using Database_Manager.Database.Session_Details.Interfaces;
    using System.Threading;
    using Silverwave.HabboHotel.Users.Messenger;
    
    
    
    
    namespace Silverwave.HabboHotel.Navigators
    {
        public class HotelView
        {
            internal List<SmallPromo> HotelViewPromosIndexers = new List<SmallPromo>();
    
    
            public HotelView()
            {
                this.list();
            }
    
    
            private void list()
            {
                DataTable dTable;
                using (IQueryAdapter DbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    DbClient.setQuery("SELECT * from hotelview_promos WHERE hotelview_promos.enabled = '1' ORDER BY hotelview_promos.`index` ASC");
                    dTable = DbClient.getTable();
                }
    
    
                foreach (DataRow dRow in dTable.Rows)
                {
                    HotelViewPromosIndexers.Add(new SmallPromo(Convert.ToInt32(dRow[0]), (string)dRow[1], (string)dRow[2], (string)dRow[3], Convert.ToInt32(dRow[4]), (string)dRow[5], (string)dRow[6]));
                }
            }
    
    
            public void RefreshPromoList()
            {
                HotelViewPromosIndexers.Clear();
                this.list();
            }
    
    
            internal ServerMessage SmallPromoComposer(ServerMessage Message)
            {
                Message.AppendInt32(HotelViewPromosIndexers.Count);
                foreach (SmallPromo promo in HotelViewPromosIndexers)
                {
                    promo.Serialize(Message);
                }
    
    
                return Message;
            }
    
    
            public static SmallPromo load(int index)
            {
                DataRow dRow;
                using (IQueryAdapter DbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    DbClient.setQuery("SELECT hotelview_promos.`index`,hotelview_promos.header,hotelview_promos.body,hotelview_promos.button,hotelview_promos.in_game_promo,hotelview_promos.special_action," +
                        "hotelview_promos.image,hotelview_promos.enabled FROM hotelview_promos WHERE hotelview_promos.`index` = @x LIMIT 1");
                    DbClient.addParameter("x", index);
                    dRow = DbClient.getRow();
                }
    
    
                SmallPromo newPromo = new SmallPromo(index, (string)dRow[1], (string)dRow[2], (string)dRow[3], Convert.ToInt32(dRow[4]), (string)dRow[5], (string)dRow[6]);
                return newPromo;
            }
        }
    
    
        public class SmallPromo
        {
            int Index;
            string Header;
            string Body;
            string Button;
            int inGamePromo;
            string SpecialAction;
            string Image;
    
    
            public SmallPromo(int index, string header, string body,string button, int inGame, string specialAction, string image)
            {
                this.Index = index;
                this.Header = header;
                this.Body = body;
                this.Button = button;
                this.inGamePromo = inGame;
                this.SpecialAction = specialAction;
                this.Image = image;
            }
    
    
            internal ServerMessage Serialize(ServerMessage Composer)
            {
                Composer.AppendInt32(Index);
                Composer.AppendString(Header);
                Composer.AppendString(Body);
                Composer.AppendString(Button);
                Composer.AppendInt32(inGamePromo);
                Composer.AppendString(SpecialAction);
                Composer.AppendString(Image);
                return Composer;
            }
    
    
        }
    }
    Next go to Game.cs.
    Add the following (make sure you add it in the right places):

    Add
    PHP Code:
    private HotelView HotelView
    below
    PHP Code:
    private RoomManager RoomManager
    Add: (below any other which looks like that)
    Code:
    internal HotelView GetHotelView()
    {
    return HotelView;
    }
    Code:
    HotelView = new HotelView(); //below PixelManager = new PixelManager();



    Finally, go to your Incoming packets class. Namely, Incoming.cs or Events.cs ( don't mess with the Rooms>Events . It's not this. )

    Add the following:

    PHP Code:
    internal static int RefreshPromoEvent 1946//ak 
    Go to SharedPacketLib.cs and add:

    Code:
            internal static void RefreshPromoEvent(GameClientMessageHandler handler)        {
                handler.RefreshPromoEvent();
            }
    Go to StaticClientMessageHandler.cs and add:

    PHP Code:
    handlers.Add(Incoming.RefreshPromoEvent, new StaticRequestHandler(SharedPacketLib.RefreshPromoEvent)); 
    below any other handler.

    4) Compile it, and that's what you should have:

    Attachment 140566

    PS: I may post a quick guide about how to use the Small Promos widget later, if anyone else does so.
    Can u make a swift emulator with this source i didnt understand this?.

  5. #50
    Enthusiast AvioraNL is offline
    MemberRank
    Feb 2013 Join Date
    48Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    since when is this help section lol?



Page 4 of 4 FirstFirst 1234

Advertisement