Plus Emu [ Badges/News on the Hotel view]

Results 1 to 19 of 19
  1. #1
    Banned Hindi is offline
    BannedRank
    Dec 2013 Join Date
    C:/Location
    163Posts

    Plus Emu [ Badges/News on the Hotel view]

    Well hey guys, Here I am talking about those top stories and news seen on the hotel view where one can read em and scroll through etc, So How would someone add that I would appreciate someones help <3


  2. #2
    Member Habbo2 is offline
    MemberRank
    Aug 2013 Join Date
    86Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    Do you mean this?:

    If so please follow this tutorial:
    Spoiler:

    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.


    Credits for tutorial: AKIXX

  3. #3
    Banned Hindi is offline
    BannedRank
    Dec 2013 Join Date
    C:/Location
    163Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    One problem, When I open the emulator in the visual studios and save the project after editing it, It dosent affect the emulator any helps please? :< @Habbo2

  4. #4
    Member Habbo2 is offline
    MemberRank
    Aug 2013 Join Date
    86Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    Quote Originally Posted by Hindi View Post
    One problem, When I open the emulator in the visual studios and save the project after editing it, It dosent affect the emulator any helps please? :< @Habbo2
    You need to replace this.. not add it to the end:
    Code:
    landing.view.dynamic.slot.2.widget=promoarticle
    landing.view.dynamic.slot.2.layout=

    (external_variables)

  5. #5
    Banned Hindi is offline
    BannedRank
    Dec 2013 Join Date
    C:/Location
    163Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    Yeah, I understand that. But what I'm saying is when you save the stuff. It doesn't affect the emulator, like when you edit the .cs file it doesn't affect emu so do I need to decompile it. Then edit it and recompile or what. Thanks in advance :)

    Sent from my HTC One X using Tapatalk

  6. #6
    Banned Hindi is offline
    BannedRank
    Dec 2013 Join Date
    C:/Location
    163Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    @Habbo2

    Sent from my HTC One X using Tapatalk

  7. #7
    Proficient Member KeineChance is offline
    MemberRank
    Aug 2012 Join Date
    174Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    After editing the emulator you need to debug

  8. #8
    Member Habbo2 is offline
    MemberRank
    Aug 2013 Join Date
    86Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    Press the green arrow on the top of the Visual C# Studio.
    Looks like this:

    @Hindi

  9. #9
    Banned Hindi is offline
    BannedRank
    Dec 2013 Join Date
    C:/Location
    163Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    When I do that, it basically runs the emulator, and when I run it from the original folder it isn't changed abit, :( @Habbo2 @KeineChance

    Sent from my HTC One X using Tapatalk

  10. #10
    Member Habbo2 is offline
    MemberRank
    Aug 2013 Join Date
    86Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    Quote Originally Posted by Hindi View Post
    When I do that, it basically runs the emulator, and when I run it from the original folder it isn't changed abit, :( @Habbo2 @KeineChance

    Sent from my HTC One X using Tapatalk
    I've messaged you regarding this matter.

  11. #11
    Banned Hindi is offline
    BannedRank
    Dec 2013 Join Date
    C:/Location
    163Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    I've replied @Habbo2 thanks pal :)

    Sent from my HTC One X using Tapatalk

  12. #12
    Banned Hindi is offline
    BannedRank
    Dec 2013 Join Date
    C:/Location
    163Posts

    Re: Plus Emu [ Badges/News on the Hotel view]



    So i've edited it, But still won't show green arrow HELP

  13. #13
    Member Habbo2 is offline
    MemberRank
    Aug 2013 Join Date
    86Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    Quote Originally Posted by Hindi View Post


    So i've edited it, But still won't show green arrow HELP
    Press F5

  14. #14
    Proficient Member SubDababa is offline
    MemberRank
    Jan 2014 Join Date
    191Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    where do i add " HotelView = new HotelView(); //below PixelManager = new PixelManager(); " ?

    - - - Updated - - -

    never mind

  15. #15
    Banned Hindi is offline
    BannedRank
    Dec 2013 Join Date
    C:/Location
    163Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    Quote Originally Posted by Habbo2 View Post
    Press F5
    Do you have working Plus Emu and SWFS and DB?

  16. #16
    Proficient Member SubDababa is offline
    MemberRank
    Jan 2014 Join Date
    191Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    I guess i have the same problem that you had a while ago... when i run it after editing it just runs the emulator, and when I run it from the original folder it isn't changed. Please help :)

    - - - Updated - - -

    and when it runs and after that i go into the client, it shows like 20 errors.

  17. #17
    Banned Hindi is offline
    BannedRank
    Dec 2013 Join Date
    C:/Location
    163Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    Quote Originally Posted by Habbo2 View Post
    Do you mean this?:

    If so please follow this tutorial:
    Spoiler:

    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.


    Credits for tutorial: AKIXX
    Tried it again, Theres one tiny error bro,
    @HillBilly @Habbo2 @AKllX

    Wont show it. and when I click more news it, Disconnects.
    Last edited by Hindi; 19-01-14 at 07:33 AM.

  18. #18
    Account Upgraded | Title Enabled! Sledmore is offline
    MemberRank
    Jun 2009 Join Date
    1,133Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    Make sure you've registered the Incoming packet and that both headers are correct, furthermore you can use dev tools and check the console to see what error you've being returned.

  19. #19
    Banned Hindi is offline
    BannedRank
    Dec 2013 Join Date
    C:/Location
    163Posts

    Re: Plus Emu [ Badges/News on the Hotel view]

    Quote Originally Posted by Sledmore View Post
    Make sure you've registered the Incoming packet and that both headers are correct, furthermore you can use dev tools and check the console to see what error you've being returned.


    Dont think they are these errors, But yes I've registered outgoing.cs and incoming.cs header packets. Could be anything wrong with hotelview_promos table? Thank you



Advertisement