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: NavigatorSavedSearchEvent.cs
And this DeleteNavigatorSavedSearchEvent.cs
Next go to: HabboHotel/Users/Navigator/SavedSearches
after
Add these:
Communication/Packets/Incoming
add:
Communication/Packets/Outgoing/Navigator/New
Create: NavigatorSavedSearchComposer.cs
missing somethings..
Next go to: Communication/Packets/Incoming/Navigator/New
After:
Add:
Add after
Header ID:
Updates:
Notification: goto /Communication/Packets/Outgoing/Moderation
search ModeratorSupportTicketResponseComposer.cs
go search GameClient.cs
add
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: NavigatorSavedSearchEvent.cs
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));
}
}
}
And this DeleteNavigatorSavedSearchEvent.cs
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));
}
}
}
Next go to: HabboHotel/Users/Navigator/SavedSearches
after
Code:
public string Search
{
get { return this._search; }
set { this._search = value; }
}
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;
}
Communication/Packets/Incoming
add:
Code:
public const int DeleteNavigatorSavedSearchMessageEvent = 448;
public const int NavigatorSavedSearchMessageEvent = 117;
Communication/Packets/Outgoing/Navigator/New
Create: NavigatorSavedSearchComposer.cs
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("");
}
}
}
}
Next go to: Communication/Packets/Incoming/Navigator/New
After:
Code:
ICollection<SearchResultList> SearchResultLists = PlusEnvironment.GetGame().GetNavigator().GetSearchResultLists();
Code:
ICollection<SavedSearch> ListSearch = Session.GetHabbo().GetNavigatorSearches().Searches;
Code:
Session.SendMessage(new NavigatorPreferencesComposer());
Code:
Session.SendMessage(new NavigatorSavedSearchComposer(ListSearch));
Code:
public const int NavigatorSavedSearchMessageComposer = 1818;
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);
}
}
}
go search GameClient.cs
Code:
_habbo.InitProcess();
Code:
_habbo.InitSearches();
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));
}
Last edited: