Plus Emu [ Badges/News on the Hotel view]

Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #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.

  2. #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.

  3. #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.

  4. #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



Page 2 of 2 FirstFirst 12

Advertisement