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
Server Releases
[RELEASE] Navigator SavedSearches
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="oStrs" data-source="post: 434777" data-attributes="member: 81003"><p>Hey Devbest!</p><p>so i decided to share navigator saved search completly.</p><p>coded myself in Plus Emulator.</p><p></p><p>Release: RODUCTION-201802201205-141713395</p><p></p><p>Big thanks to : AssLikeThat for cleaning my thread.</p><p></p><p>Communication/Packets/Incoming/Navigator/New</p><p></p><p>Create file name: <strong>NavigatorSavedSearchEvent.cs</strong></p><p></p><p>[CODE]using Plus.Communication.Packets.Outgoing.Navigator.New;</p><p>using Plus.Database.Interfaces;</p><p>using Plus.HabboHotel.Users.Navigator.SavedSearches;</p><p>using System;</p><p>using System.Collections.Generic;</p><p>using System.Linq;</p><p></p><p>namespace Plus.Communication.Packets.Incoming.Navigator.New</p><p>{</p><p> class NavigatorSavedSearchEvent : IPacketEvent</p><p> {</p><p> public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)</p><p> {</p><p> String Filter = Packet.PopString();</p><p> String SearchCode = Packet.PopString();</p><p></p><p> if (Session.GetHabbo().GetNavigatorSearches().Searches.Count >= 15)</p><p> {</p><p> Session.SendSimple(1, "Limited");</p><p> return;</p><p> }</p><p> </p><p> ICollection<SavedSearch> ListSearch = Session.GetHabbo().GetNavigatorSearches().Searches;</p><p></p><p> SavedSearch.OnSave(Session, Filter, SearchCode, true);</p><p></p><p> Session.SendMessage(new NavigatorSavedSearchComposer(ListSearch));</p><p> }</p><p> }</p><p>}[/CODE]</p><p></p><p>And this <strong>DeleteNavigatorSavedSearchEvent.cs</strong></p><p></p><p>[CODE]using Plus.Communication.Packets.Outgoing.Navigator.New;</p><p>using Plus.Database.Interfaces;</p><p>using Plus.HabboHotel.Users.Navigator.SavedSearches;</p><p>using System;</p><p>using System.Collections.Generic;</p><p></p><p>namespace Plus.Communication.Packets.Incoming.Navigator.New</p><p>{</p><p> class DeleteNavigatorSavedSearchEvent : IPacketEvent</p><p> {</p><p> public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)</p><p> {</p><p> Int32 searchId = Packet.PopInt();</p><p> var ListSaved = new SavedSearch(0, "", "");</p><p></p><p> SavedSearch.OnDelete(Session, true);</p><p></p><p> ICollection<SavedSearch> ListSearch = Session.GetHabbo().GetNavigatorSearches().Searches</p><p> Session.SendMessage(new NavigatorSavedSearchComposer(ListSearch));</p><p> }</p><p> }</p><p>}[/CODE]</p><p></p><p>Next go to: HabboHotel/Users/Navigator/SavedSearches</p><p>after</p><p> </p><p>[CODE]public string Search</p><p> {</p><p> get { return this._search; }</p><p> set { this._search = value; }</p><p> }[/CODE]</p><p></p><p>Add these:</p><p></p><p>[CODE]public static bool OnSave(GameClients.GameClient Session, string Filter, string SearchCode, bool asSave)</p><p> {</p><p> using (IQueryAdapter db = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> db.SetQuery("INSERT INTO `user_saved_searches` (`id`,`user_id`,`filter`,`search_code`) VALUES (@id, @habboid, @filter, @Code)");</p><p> db.AddParameter("id", null);</p><p> db.AddParameter("habboid", Session.GetHabbo().Id);</p><p> db.AddParameter("filter", Filter);</p><p> db.AddParameter("code", SearchCode);</p><p> db.RunQuery();</p><p> }</p><p> return asSave;</p><p> }</p><p></p><p> public static bool OnDelete(GameClients.GameClient Session, bool asDelete)</p><p> {</p><p> using (IQueryAdapter db = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> db.SetQuery("DELETE FROM `user_saved_searches` WHERE `user_id` = @id LIMIT 1;");</p><p> db.AddParameter("id", Session.GetHabbo().Id);</p><p> db.RunQuery();</p><p> }</p><p> return asDelete;</p><p> }[/CODE]</p><p></p><p>Communication/Packets/Incoming</p><p></p><p>add:</p><p> </p><p>[CODE]public const int DeleteNavigatorSavedSearchMessageEvent = 448;</p><p> public const int NavigatorSavedSearchMessageEvent = 117;[/CODE]</p><p></p><p>Communication/Packets/Outgoing/Navigator/New</p><p></p><p>Create: <strong>NavigatorSavedSearchComposer.cs</strong></p><p></p><p>[CODE]using Plus.HabboHotel.Users.Navigator.SavedSearches;</p><p>using System.Collections.Generic;</p><p></p><p>namespace Plus.Communication.Packets.Outgoing.Navigator.New</p><p>{</p><p> class NavigatorSavedSearchComposer : ServerPacket</p><p> {</p><p> public NavigatorSavedSearchComposer(ICollection<SavedSearch> Saved)</p><p> : base(ServerPacketHeader.NavigatorSavedSearchMessageComposer)</p><p> {</p><p> //</p><p> /*</p><p> * _SafeStr_20180[117] = _SafeStr_2636; // add event</p><p> * _SafeStr_20180[448] = _SafeStr_2640; // delete event</p><p> _SafeStr_24860["popular"] = _SafeStr_6076;</p><p> _SafeStr_24860["official"] = _SafeStr_6085;</p><p> _SafeStr_24860["me"] = _SafeStr_6086;</p><p> _SafeStr_24860["events"] = _SafeStr_6087;</p><p> _SafeStr_24860["search"] = _SafeStr_6088;</p><p> _SafeStr_24860["categories"] = _SafeStr_9419;</p><p> */</p><p> base.WriteInteger(Saved.Count);</p><p> foreach (SavedSearch Save in Saved)</p><p> {</p><p> base.WriteInteger(Save.Id);</p><p> base.WriteString(Save.Filter);</p><p> base.WriteString(Save.Search);</p><p> base.WriteString("");</p><p> }</p><p> }</p><p> }</p><p>}[/CODE]</p><p>missing somethings..</p><p>Next go to: Communication/Packets/Incoming/Navigator/New</p><p></p><p>After:</p><p>[CODE]</p><p>ICollection<SearchResultList> SearchResultLists = PlusEnvironment.GetGame().GetNavigator().GetSearchResultLists();</p><p>[/CODE]</p><p>Add:</p><p>[CODE]</p><p>ICollection<SavedSearch> ListSearch = Session.GetHabbo().GetNavigatorSearches().Searches;</p><p>[/CODE]</p><p>Add after</p><p>[CODE]</p><p>Session.SendMessage(new NavigatorPreferencesComposer());</p><p>[/CODE]</p><p>[CODE]</p><p>Session.SendMessage(new NavigatorSavedSearchComposer(ListSearch));</p><p>[/CODE]</p><p>Header ID:</p><p>[CODE]</p><p> public const int NavigatorSavedSearchMessageComposer = 1818;</p><p>[/CODE]</p><p></p><p>Updates:</p><p></p><p>Notification: goto /Communication/Packets/Outgoing/Moderation</p><p></p><p>search ModeratorSupportTicketResponseComposer.cs</p><p></p><p>[CODE]</p><p>namespace Plus.Communication.Packets.Outgoing.Moderation</p><p>{</p><p> class ModeratorSupportTicketResponseComposer : ServerPacket</p><p> {</p><p> public ModeratorSupportTicketResponseComposer(int Result)</p><p> : base(ServerPacketHeader.ModeratorSupportTicketResponseMessageComposer)</p><p> {</p><p> base.WriteInteger(Result);</p><p> base.WriteString("");</p><p> }</p><p></p><p> public ModeratorSupportTicketResponseComposer(int Result, string message)</p><p> : base(ServerPacketHeader.ModeratorSupportTicketResponseMessageComposer)</p><p> {</p><p> base.WriteInteger(Result);</p><p> base.WriteString(message);</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>go search GameClient.cs</p><p>[CODE]</p><p>_habbo.InitProcess();</p><p>[/CODE]</p><p>add</p><p>[CODE]</p><p>_habbo.InitSearches();</p><p>[/CODE]</p><p>[CODE]</p><p>after</p><p>public void SendMessage(IServerPacket Message)</p><p> {</p><p> byte[] bytes = Message.GetBytes();</p><p></p><p> if (Message == null)</p><p> return;</p><p></p><p> if (GetConnection() == null)</p><p> return;</p><p></p><p> GetConnection().SendData(bytes);</p><p> }</p><p>add:</p><p> public void SendSimple(int result, string message)</p><p> {</p><p> SendMessage(new ModeratorSupportTicketResponseComposer(result, message));</p><p> }</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="oStrs, post: 434777, member: 81003"] Hey Devbest! so i decided to share navigator saved search completly. coded myself in Plus Emulator. Release: RODUCTION-201802201205-141713395 Big thanks to : AssLikeThat for cleaning my thread. Communication/Packets/Incoming/Navigator/New Create file name: [B]NavigatorSavedSearchEvent.cs[/B] [CODE]using Plus.Communication.Packets.Outgoing.Navigator.New; using Plus.Database.Interfaces; using Plus.HabboHotel.Users.Navigator.SavedSearches; using System; using System.Collections.Generic; using System.Linq; namespace Plus.Communication.Packets.Incoming.Navigator.New { class NavigatorSavedSearchEvent : IPacketEvent { public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { String Filter = Packet.PopString(); String SearchCode = Packet.PopString(); if (Session.GetHabbo().GetNavigatorSearches().Searches.Count >= 15) { Session.SendSimple(1, "Limited"); return; } ICollection<SavedSearch> ListSearch = Session.GetHabbo().GetNavigatorSearches().Searches; SavedSearch.OnSave(Session, Filter, SearchCode, true); Session.SendMessage(new NavigatorSavedSearchComposer(ListSearch)); } } }[/CODE] And this [B]DeleteNavigatorSavedSearchEvent.cs[/B] [CODE]using Plus.Communication.Packets.Outgoing.Navigator.New; using Plus.Database.Interfaces; using Plus.HabboHotel.Users.Navigator.SavedSearches; using System; using System.Collections.Generic; namespace Plus.Communication.Packets.Incoming.Navigator.New { class DeleteNavigatorSavedSearchEvent : IPacketEvent { public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet) { Int32 searchId = Packet.PopInt(); var ListSaved = new SavedSearch(0, "", ""); SavedSearch.OnDelete(Session, true); ICollection<SavedSearch> ListSearch = Session.GetHabbo().GetNavigatorSearches().Searches Session.SendMessage(new NavigatorSavedSearchComposer(ListSearch)); } } }[/CODE] Next go to: HabboHotel/Users/Navigator/SavedSearches after [CODE]public string Search { get { return this._search; } set { this._search = value; } }[/CODE] Add these: [CODE]public static bool OnSave(GameClients.GameClient Session, string Filter, string SearchCode, bool asSave) { using (IQueryAdapter db = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { db.SetQuery("INSERT INTO `user_saved_searches` (`id`,`user_id`,`filter`,`search_code`) VALUES (@id, @habboid, @filter, @Code)"); db.AddParameter("id", null); db.AddParameter("habboid", Session.GetHabbo().Id); db.AddParameter("filter", Filter); db.AddParameter("code", SearchCode); db.RunQuery(); } return asSave; } public static bool OnDelete(GameClients.GameClient Session, bool asDelete) { using (IQueryAdapter db = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { db.SetQuery("DELETE FROM `user_saved_searches` WHERE `user_id` = @id LIMIT 1;"); db.AddParameter("id", Session.GetHabbo().Id); db.RunQuery(); } return asDelete; }[/CODE] Communication/Packets/Incoming add: [CODE]public const int DeleteNavigatorSavedSearchMessageEvent = 448; public const int NavigatorSavedSearchMessageEvent = 117;[/CODE] Communication/Packets/Outgoing/Navigator/New Create: [B]NavigatorSavedSearchComposer.cs[/B] [CODE]using Plus.HabboHotel.Users.Navigator.SavedSearches; using System.Collections.Generic; namespace Plus.Communication.Packets.Outgoing.Navigator.New { class NavigatorSavedSearchComposer : ServerPacket { public NavigatorSavedSearchComposer(ICollection<SavedSearch> Saved) : base(ServerPacketHeader.NavigatorSavedSearchMessageComposer) { // /* * _SafeStr_20180[117] = _SafeStr_2636; // add event * _SafeStr_20180[448] = _SafeStr_2640; // delete event _SafeStr_24860["popular"] = _SafeStr_6076; _SafeStr_24860["official"] = _SafeStr_6085; _SafeStr_24860["me"] = _SafeStr_6086; _SafeStr_24860["events"] = _SafeStr_6087; _SafeStr_24860["search"] = _SafeStr_6088; _SafeStr_24860["categories"] = _SafeStr_9419; */ base.WriteInteger(Saved.Count); foreach (SavedSearch Save in Saved) { base.WriteInteger(Save.Id); base.WriteString(Save.Filter); base.WriteString(Save.Search); base.WriteString(""); } } } }[/CODE] missing somethings.. Next go to: Communication/Packets/Incoming/Navigator/New After: [CODE] ICollection<SearchResultList> SearchResultLists = PlusEnvironment.GetGame().GetNavigator().GetSearchResultLists(); [/CODE] Add: [CODE] ICollection<SavedSearch> ListSearch = Session.GetHabbo().GetNavigatorSearches().Searches; [/CODE] Add after [CODE] Session.SendMessage(new NavigatorPreferencesComposer()); [/CODE] [CODE] Session.SendMessage(new NavigatorSavedSearchComposer(ListSearch)); [/CODE] Header ID: [CODE] public const int NavigatorSavedSearchMessageComposer = 1818; [/CODE] Updates: Notification: goto /Communication/Packets/Outgoing/Moderation search ModeratorSupportTicketResponseComposer.cs [CODE] namespace Plus.Communication.Packets.Outgoing.Moderation { class ModeratorSupportTicketResponseComposer : ServerPacket { public ModeratorSupportTicketResponseComposer(int Result) : base(ServerPacketHeader.ModeratorSupportTicketResponseMessageComposer) { base.WriteInteger(Result); base.WriteString(""); } public ModeratorSupportTicketResponseComposer(int Result, string message) : base(ServerPacketHeader.ModeratorSupportTicketResponseMessageComposer) { base.WriteInteger(Result); base.WriteString(message); } } } [/CODE] go search GameClient.cs [CODE] _habbo.InitProcess(); [/CODE] add [CODE] _habbo.InitSearches(); [/CODE] [CODE] after public void SendMessage(IServerPacket Message) { byte[] bytes = Message.GetBytes(); if (Message == null) return; if (GetConnection() == null) return; GetConnection().SendData(bytes); } add: public void SendSimple(int result, string message) { SendMessage(new ModeratorSupportTicketResponseComposer(result, message)); } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
[RELEASE] Navigator SavedSearches
Top