Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
[RELEASE] Fix for Hotel View Disconnections [Any R63B EMU]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Jerry" data-source="post: 271885" data-attributes="member: 35321"><p>ello, long time no releases so it's time.</p><p></p><p>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.</p><p></p><p>1) In your external variable find the following lines and replace as it's set here:</p><p>landing.view.dynamic.slot.2.widget=promoarticle</p><p>landing.view.dynamic.slot.2.layout=</p><p>landing.view.dynamic.slot.2.conf=</p><p></p><p>2) Run the following MySQL script:</p><p>[CODE]-- ----------------------------</p><p>-- Table structure for `hotelview_promos`</p><p>-- ----------------------------</p><p>DROP TABLE IF EXISTS `hotelview_promos`;</p><p>CREATE TABLE `hotelview_promos` (</p><p> `index` int(10) unsigned NOT NULL AUTO_INCREMENT,</p><p> `header` varchar(255) NOT NULL DEFAULT '[Header Name]',</p><p> `body` varchar(255) NOT NULL DEFAULT '[BODY]',</p><p> `button` varchar(255) NOT NULL DEFAULT '[BUTTON]',</p><p> `in_game_promo` enum('0','1') NOT NULL DEFAULT '1',</p><p> `special_action` varchar(255) NOT NULL DEFAULT '[LINK HERE]',</p><p> `image` varchar(255) NOT NULL DEFAULT '',</p><p> `enabled` enum('0','1') NOT NULL DEFAULT '1',</p><p> PRIMARY KEY (`index`)</p><p>) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;</p><p></p><p></p><p>-- ----------------------------</p><p>-- Records of hotelview_promos</p><p>-- ----------------------------</p><p>INSERT INTO hotelview_promos VALUES ('1', 'Was it crashing ?', 'Long time no fixes, so I hope you enjoy it. Find more at forum.*****.com', 'Go to *****', '0', 'http://forum.*****.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');[/CODE]</p><p>3) Go to Messages\Requests\Navigator.cs</p><p>[CODE] </p><p> internal void RefreshPromoEvent() {</p><p> if (Session == null || Session.GetHabbo() == null)</p><p> {</p><p> return;</p><p> }</p><p></p><p></p><p> HotelView currentView = SilverwaveEnvironment.GetGame().GetHotelView();</p><p> if (!(currentView.HotelViewPromosIndexers.Count > 0))</p><p> return;</p><p> else</p><p> {</p><p> ServerMessage Message = currentView.SmallPromoComposer(new ServerMessage(Outgoing.SmallPromoComposer));</p><p> this.Session.SendMessage(Message);</p><p> }</p><p> }[/CODE]</p><p>You may need to change SilverwaveEnvironment to your current sever environment.</p><p></p><p>Next, go to your Outgoing headers class definitions. Outgoing.cs or Composer.cs </p><p>mostly. Add the following header:</p><p>[CODE]internal static int SmallPromoComposer = 949; //ak[/CODE]</p><p>Next, go to HabboHotel > Navigators > Create the file HotelView.cs and replace with the following.</p><p></p><p>Notice that you will need to change the 'Silverwave' to match your emulator environment again.</p><p>[CODE]using System;</p><p>using System.Collections.Generic;</p><p>using System.Linq;</p><p>using System.Text;</p><p>using System.Threading.Tasks;</p><p>using System.Data;</p><p>using HabboEncryption;</p><p>using Silverwave.Messages.Headers;</p><p>using Silverwave.Messages.ClientMessages;</p><p>using Silverwave.Core;</p><p>using Silverwave.Messages;</p><p>using ConnectionManager;</p><p>using Database_Manager.Database.Session_Details.Interfaces;</p><p>using System.Threading;</p><p>using Silverwave.HabboHotel.Users.Messenger;</p><p></p><p></p><p></p><p></p><p>namespace Silverwave.HabboHotel.Navigators</p><p>{</p><p> public class HotelView</p><p> {</p><p> internal List<SmallPromo> HotelViewPromosIndexers = new List<SmallPromo>();</p><p></p><p></p><p> public HotelView()</p><p> {</p><p> this.list();</p><p> }</p><p></p><p></p><p> private void list()</p><p> {</p><p> DataTable dTable;</p><p> using (IQueryAdapter DbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())</p><p> {</p><p> DbClient.setQuery("SELECT * from hotelview_promos WHERE hotelview_promos.enabled = '1' ORDER BY hotelview_promos.`index` ASC");</p><p> dTable = DbClient.getTable();</p><p> }</p><p></p><p></p><p> foreach (DataRow dRow in dTable.Rows)</p><p> {</p><p> 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]));</p><p> }</p><p> }</p><p></p><p></p><p> public void RefreshPromoList()</p><p> {</p><p> HotelViewPromosIndexers.Clear();</p><p> this.list();</p><p> }</p><p></p><p></p><p> internal ServerMessage SmallPromoComposer(ServerMessage Message)</p><p> {</p><p> Message.AppendInt32(HotelViewPromosIndexers.Count);</p><p> foreach (SmallPromo promo in HotelViewPromosIndexers)</p><p> {</p><p> promo.Serialize(Message);</p><p> }</p><p></p><p></p><p> return Message;</p><p> }</p><p></p><p></p><p> public static SmallPromo load(int index)</p><p> {</p><p> DataRow dRow;</p><p> using (IQueryAdapter DbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())</p><p> {</p><p> DbClient.setQuery("SELECT hotelview_promos.`index`,hotelview_promos.header,hotelview_promos.body,hotelview_promos.button,hotelview_promos.in_game_promo,hotelview_promos.special_action," +</p><p> "hotelview_promos.image,hotelview_promos.enabled FROM hotelview_promos WHERE hotelview_promos.`index` = @x LIMIT 1");</p><p> DbClient.addParameter("x", index);</p><p> dRow = DbClient.getRow();</p><p> }</p><p></p><p></p><p> SmallPromo newPromo = new SmallPromo(index, (string)dRow[1], (string)dRow[2], (string)dRow[3], Convert.ToInt32(dRow[4]), (string)dRow[5], (string)dRow[6]);</p><p> return newPromo;</p><p> }</p><p> }</p><p></p><p></p><p> public class SmallPromo</p><p> {</p><p> int Index;</p><p> string Header;</p><p> string Body;</p><p> string Button;</p><p> int inGamePromo;</p><p> string SpecialAction;</p><p> string Image;</p><p></p><p></p><p> public SmallPromo(int index, string header, string body,string button, int inGame, string specialAction, string image)</p><p> {</p><p> this.Index = index;</p><p> this.Header = header;</p><p> this.Body = body;</p><p> this.Button = button;</p><p> this.inGamePromo = inGame;</p><p> this.SpecialAction = specialAction;</p><p> this.Image = image;</p><p> }</p><p></p><p></p><p> internal ServerMessage Serialize(ServerMessage Composer)</p><p> {</p><p> Composer.AppendInt32(Index);</p><p> Composer.AppendString(Header);</p><p> Composer.AppendString(Body);</p><p> Composer.AppendString(Button);</p><p> Composer.AppendInt32(inGamePromo);</p><p> Composer.AppendString(SpecialAction);</p><p> Composer.AppendString(Image);</p><p> return Composer;</p><p> }</p><p></p><p></p><p> }</p><p>}[/CODE]</p><p>Next go to Game.cs.</p><p>Add the following (make sure you add it in the right places):</p><p>Add;</p><p>[CODE]private HotelView HotelView;[/CODE]</p><p>Below;</p><p>[CODE]private RoomManager RoomManager;[/CODE]</p><p>Add: (below any other which looks like that)</p><p>[CODE]internal HotelView GetHotelView()</p><p>{</p><p>return HotelView;</p><p>}[/CODE]</p><p>[CODE]HotelView = new HotelView(); //below PixelManager = new PixelManager();[/CODE]</p><p>Finally, go to your <strong>Incoming </strong>packets class. Namely, Incoming.cs or Events.cs ( don't mess with the Rooms>Events . It's not this. ) </p><p>Add the following:</p><p>[CODE]internal static int RefreshPromoEvent = 1946; //ak[/CODE]</p><p>Go to <strong>SharedPacketLib.cs</strong> and add:</p><p>[CODE] internal static void RefreshPromoEvent(GameClientMessageHandler handler) {</p><p> handler.RefreshPromoEvent();</p><p> }[/CODE]</p><p>Go to <strong>StaticClientMessageHandler.cs </strong>and add:</p><p>[CODE]handlers.Add(Incoming.RefreshPromoEvent, new StaticRequestHandler(SharedPacketLib.RefreshPromoEvent));[/CODE]</p><p>below any other handler.</p><p>4) Compile it, and that's what you should have:</p><p><img src="http://forum.*****.com/attachment.php?attachmentid=140566&amp;d=1384703828" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>PS: I may post a quick guide about how to use the Small Promos widget later, if anyone else does so.</p><p></p><p>All credits goes to AKLLX for releasing this..</p></blockquote><p></p>
[QUOTE="Jerry, post: 271885, member: 35321"] ello, 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]-- ---------------------------- -- 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.*****.com', 'Go to *****', '0', 'http://forum.*****.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');[/CODE] 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); } }[/CODE] 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: [CODE]internal static int SmallPromoComposer = 949; //ak[/CODE] 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; } } }[/CODE] Next go to Game.cs. Add the following (make sure you add it in the right places): Add; [CODE]private HotelView HotelView;[/CODE] Below; [CODE]private RoomManager RoomManager;[/CODE] Add: (below any other which looks like that) [CODE]internal HotelView GetHotelView() { return HotelView; }[/CODE] [CODE]HotelView = new HotelView(); //below PixelManager = new PixelManager();[/CODE] Finally, go to your [B]Incoming [/B]packets class. Namely, Incoming.cs or Events.cs ( don't mess with the Rooms>Events . It's not this. ) Add the following: [CODE]internal static int RefreshPromoEvent = 1946; //ak[/CODE] Go to [B]SharedPacketLib.cs[/B] and add: [CODE] internal static void RefreshPromoEvent(GameClientMessageHandler handler) { handler.RefreshPromoEvent(); }[/CODE] Go to [B]StaticClientMessageHandler.cs [/B]and add: [CODE]handlers.Add(Incoming.RefreshPromoEvent, new StaticRequestHandler(SharedPacketLib.RefreshPromoEvent));[/CODE] below any other handler. 4) Compile it, and that's what you should have: [IMG]http://forum.*****.com/attachment.php?attachmentid=140566&d=1384703828[/IMG] PS: I may post a quick guide about how to use the Small Promos widget later, if anyone else does so. All credits goes to AKLLX for releasing this.. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
[RELEASE] Fix for Hotel View Disconnections [Any R63B EMU]
Top