[RELEASE] Fix for Hotel View disconnections

Page 1 of 4 1234 LastLast
Results 1 to 15 of 50
  1. #1
    Unspoiled Perfection AKllX is offline
    MemberRank
    Aug 2007 Join Date
    @ akllxprojectLocation
    366Posts

    [RELEASE] Fix for Hotel View disconnections

    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:

    final.png

    PS: I may post a quick guide about how to use the Small Promos widget later, if anyone else does so.
    Last edited by AKllX; 21-11-13 at 07:01 PM.


  2. #2
    Account Upgraded | Title Enabled! FapInc is offline
    MemberRank
    Nov 2012 Join Date
    499Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    Thanks man!

  3. #3
    Valued Member cabeludo007 is offline
    MemberRank
    Nov 2013 Join Date
    My HouseLocation
    147Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    so amazing man! very nice, great

    everything you did or took from other tutorials?

    I see that u are using a swf Brazilian language which is it?, I'm Brazilian too
    Last edited by cabeludo007; 17-11-13 at 05:51 PM.

  4. #4
    En Français? Bjork is offline
    MemberRank
    Apr 2007 Join Date
    854Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    Nice fix ! ;)

  5. #5
    Account Upgraded | Title Enabled! FapInc is offline
    MemberRank
    Nov 2012 Join Date
    499Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    AKIIX this sounded a bit hard to do, can you release a Skybird emu with this fix added to it in the same thread?

  6. #6
    Unspoiled Perfection AKllX is offline
    MemberRank
    Aug 2007 Join Date
    @ akllxprojectLocation
    366Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    Quote Originally Posted by FapInc View Post
    AKIIX this sounded a bit hard to do, can you release a Skybird emu with this fix added to it in the same thread?
    Ok, will be attached to this thread later.

    The packet structure for Swift should be a little different btw. It uses the 'GenericWidgetGenerator' for it. If someone have a hotelview packetlog for it's revision I can make code it too.

  7. #7
    Account Upgraded | Title Enabled! FapInc is offline
    MemberRank
    Nov 2012 Join Date
    499Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    Quote Originally Posted by AKllX View Post
    Ok, will be attached to this thread later.

    The packet structure for Swift should be a little different btw. It uses the 'GenericWidgetGenerator' for it. If someone have a hotelview packetlog for it's revision I can make code it too.
    Thanks, this is why i asked: Screenshot by Lightshot

    Also AKIIX if you dont have time to do the fix for PlusEMU you can release your current swift edit that is on that picture there, also i have seen that you updated the packets on that emu because the friendstream isnt there. So if you didnt mind?

  8. #8
    Hakuna Matata Matata is offline
    MemberRank
    Sep 2012 Join Date
    DenmarkLocation
    807Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    Thank you for this.
    I don't have those disconnections, but it's nice that I'm able to post news on the hotel view!

  9. #9
    Account Upgraded | Title Enabled! FapInc is offline
    MemberRank
    Nov 2012 Join Date
    499Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    Quote Originally Posted by Matata View Post
    Thank you for this.
    I don't have those disconnections, but it's nice that I'm able to post news on the hotel view!
    Yeah, its simple just change the sql he gave us and import it again and there you have another news :D

    What did you edit in the post?

  10. #10
    Unspoiled Perfection AKllX is offline
    MemberRank
    Aug 2007 Join Date
    @ akllxprojectLocation
    366Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    It's not Swift. I'm running on Silverwave

  11. #11
    Account Upgraded | Title Enabled! FapInc is offline
    MemberRank
    Nov 2012 Join Date
    499Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    You do? Well mind uploading it then, :DDD

    You know, i that you we're using Swift since you have a major thread about it and alot if different versions. Sorry for my mistake then.

  12. #12
    Member MichaeelS is offline
    MemberRank
    Jul 2012 Join Date
    95Posts

    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):

    PHP Code:
    private HotelView HotelView
    below
    PHP Code:
    private RoomManager RoomManager
    and the following methods in the proper 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:

    final.png

    PS: I may post a quick guide about how to use the Small Promos widget later, if anyone else does so.
    of swift does not work why?

  13. #13
    Account Upgraded | Title Enabled! FapInc is offline
    MemberRank
    Nov 2012 Join Date
    499Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    Quote Originally Posted by MichaeelS View Post
    of swift does not work why?
    It works with swift to, but you need to find the right packet since Plus and Swift isnt same revision, Plus is more updated if you know what i meen about that.

  14. #14
    Member MichaeelS is offline
    MemberRank
    Jul 2012 Join Date
    95Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    Quote Originally Posted by FapInc View Post
    It works with swift to, but you need to find the right packet since Plus and Swift isnt same revision, Plus is more updated if you know what i meen about that.
    ok, I know what you mean I thought the packet header was too swift for

  15. #15
    Valued Member cabeludo007 is offline
    MemberRank
    Nov 2013 Join Date
    My HouseLocation
    147Posts

    Re: [RELEASE] Fix for Hotel View disconnections

    AKIIX, how do I update the news on hotel view?



Page 1 of 4 1234 LastLast

Advertisement