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="DJGOMEZV" data-source="post: 435398" data-attributes="member: 42255"><p>I found an error, and that is that when adding or deleting the browser search, or the package "NavigatorSavedSearchComposer" is not updated as such because it does not load the recently added or deleted searches to the database, modify the 2 files: NavigatorSavedSearchEvent.cs and DeleteNavigatorSavedSearchEvent.cs</p><p></p><p><strong><strong>Communication/Packets/Incoming/Navigator/New/</strong>NavigatorSavedSearchEvent.cs:</strong></p><p>[CODE]</p><p>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> SavedSearch.OnSave(Session, Filter, SearchCode, true);</p><p> Session.GetHabbo().GetNavigatorSearches().Init(Session.GetHabbo());</p><p> ICollection<SavedSearch> ListSearch = Session.GetHabbo().GetNavigatorSearches().Searches;</p><p> Session.SendMessage(new NavigatorSavedSearchComposer(ListSearch));</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p><strong>Communication/Packets/Incoming/Navigator/New/DeleteNavigatorSavedSearchEvent.cs:</strong></p><p>[CODE]</p><p>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> int searchId = Packet.PopInt();</p><p> var ListSaved = new SavedSearch(0, "", "");</p><p></p><p> SavedSearch.OnDelete(Session, true, searchId);</p><p> //Console.WriteLine("SearchId: " + searchId);</p><p> Session.GetHabbo().GetNavigatorSearches().Init(Session.GetHabbo());</p><p> ICollection<SavedSearch> ListSearch = Session.GetHabbo().GetNavigatorSearches().Searches;</p><p> Session.SendMessage(new NavigatorSavedSearchComposer(ListSearch));</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>Replace in: <strong>HabboHotel/Users/Navigator/SavedSearches/SavedSearch.cs:</strong></p><p>[CODE]</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> }</p><p>[/CODE]</p><p>to:</p><p>[CODE]</p><p> public static bool OnDelete(GameClients.GameClient Session, bool asDelete, int SearchId)</p><p> {</p><p> using (IQueryAdapter db = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> db.SetQuery("DELETE FROM `user_saved_searches` WHERE `id` = @id LIMIT 1;");</p><p> db.AddParameter("id", SearchId);</p><p> db.RunQuery();</p><p> }</p><p> return asDelete;</p><p> }</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="DJGOMEZV, post: 435398, member: 42255"] I found an error, and that is that when adding or deleting the browser search, or the package "NavigatorSavedSearchComposer" is not updated as such because it does not load the recently added or deleted searches to the database, modify the 2 files: NavigatorSavedSearchEvent.cs and DeleteNavigatorSavedSearchEvent.cs [B][B]Communication/Packets/Incoming/Navigator/New/[/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; } SavedSearch.OnSave(Session, Filter, SearchCode, true); Session.GetHabbo().GetNavigatorSearches().Init(Session.GetHabbo()); ICollection<SavedSearch> ListSearch = Session.GetHabbo().GetNavigatorSearches().Searches; Session.SendMessage(new NavigatorSavedSearchComposer(ListSearch)); } } } [/CODE] [B]Communication/Packets/Incoming/Navigator/New/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) { int searchId = Packet.PopInt(); var ListSaved = new SavedSearch(0, "", ""); SavedSearch.OnDelete(Session, true, searchId); //Console.WriteLine("SearchId: " + searchId); Session.GetHabbo().GetNavigatorSearches().Init(Session.GetHabbo()); ICollection<SavedSearch> ListSearch = Session.GetHabbo().GetNavigatorSearches().Searches; Session.SendMessage(new NavigatorSavedSearchComposer(ListSearch)); } } } [/CODE] Replace in: [B]HabboHotel/Users/Navigator/SavedSearches/SavedSearch.cs:[/B] [CODE] 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] to: [CODE] public static bool OnDelete(GameClients.GameClient Session, bool asDelete, int SearchId) { using (IQueryAdapter db = PlusEnvironment.GetDatabaseManager().GetQueryReactor()) { db.SetQuery("DELETE FROM `user_saved_searches` WHERE `id` = @id LIMIT 1;"); db.AddParameter("id", SearchId); db.RunQuery(); } return asDelete; } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
[RELEASE] Navigator SavedSearches
Top