Skip to content

Commit 2dc4e23

Browse files
committed
fix ingores and gift club
1 parent ba04499 commit 2dc4e23

20 files changed

+422
-27
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Akiled.Communication.Packets.Outgoing.Catalog;
2+
using Akiled.HabboHotel.GameClients;
3+
4+
namespace Akiled.Communication.Packets.Incoming.Catalog
5+
{
6+
internal class GetClubGiftsEvent : IPacketEvent
7+
{
8+
public void Parse(GameClient session, ClientPacket packet)
9+
{
10+
session.SendPacket(new ClubGiftsComposer());
11+
}
12+
}
13+
}

Communication/Packets/Incoming/ClientPacketHeader.cs

+6
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ public static class ClientPacketHeader //PRODUCTION-201705012204-567246680
252252
public const int GetCraftingRecipesAvailableMessageEvent = 3086;
253253
public const int YoutubeRequestPlaylists = 336;
254254
public const int ToggleStaffPickEvent = 1918;
255+
public const int GetEventCategoriesMessageEvent = 1782;
256+
public const int GetClubGiftsMessageEvent = 487;
257+
public const int GetHabboClubCenterInfoMessageEvent = 869;
258+
public const int GetIgnoredUsersMessageEvent = 3878;
259+
260+
255261

256262
}
257263
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System.Collections.Generic;
2+
using Akiled.Communication.Packets.Outgoing.Navigator;
3+
using Akiled.HabboHotel.GameClients;
4+
using Akiled.HabboHotel.Navigators;
5+
6+
namespace Akiled.Communication.Packets.Incoming.Navigator
7+
{
8+
internal class GetNavigatorFlatsEvent : IPacketEvent
9+
{
10+
public void Parse(GameClient session, ClientPacket packet)
11+
{
12+
ICollection<SearchResultList> categories = AkiledEnvironment.GetGame().GetNavigator().GetEventCategories();
13+
14+
session.SendPacket(new NavigatorFlatCatsComposer(categories));
15+
}
16+
}
17+
}

Communication/Packets/Incoming/Rooms/Engine/GetRoomEntryDataEvent.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ public void Parse(GameClient Session, ClientPacket Packet)
4343
}
4444

4545
Room.SendObjects(Session);
46-
46+
47+
if (Room.HideWired && Room.CheckRights(Session, true))
48+
49+
50+
Session.SendMessage(new RoomNotificationComposer("furni_placement_error", "message", "Wired Foi Fechado nesse qiarto."));
4751

4852
Session.SendPacket(new RoomEntryInfoComposer(Room.Id, Room.CheckRights(Session, true)));
4953
Session.SendPacket(new RoomVisualizationSettingsComposer(Room.RoomData.WallThickness, Room.RoomData.FloorThickness, Room.RoomData.Hidewall));

Communication/Packets/Incoming/Rooms/Furni/Wired/SaveWiredConfigEvent.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Akiled.Communication.Packets.Outgoing.Structure;
12
using Akiled.HabboHotel.GameClients;
23
using Akiled.HabboHotel.Rooms;
34
using Akiled.HabboHotel.Rooms.Wired;
@@ -8,7 +9,8 @@ class SaveWiredConfigEvent : IPacketEvent
89
{
910
public void Parse(GameClient Session, ClientPacket Packet)
1011
{
11-
Room room = Session.GetHabbo().CurrentRoom; if (room == null) return; if (!room.CheckRights(Session) && !room.CheckRights(Session, true)) return; WiredSaver.HandleSave(Session, Packet.PopInt(), Session.GetHabbo().CurrentRoom, Packet);
12+
Room room = Session.GetHabbo().CurrentRoom; if (room == null) return; if (!room.CheckRights(Session) && !room.CheckRights(Session, true)) return;
13+
Session.SendPacket(new SaveWired()); WiredSaver.HandleSave(Session, Packet.PopInt(), Session.GetHabbo().CurrentRoom, Packet);
1214
}
1315
}
1416
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System.Collections.Generic;
2+
using Akiled.Communication.Packets.Outgoing.Users;
3+
using Akiled.HabboHotel.GameClients;
4+
using Akiled.HabboHotel.Users;
5+
6+
namespace Akiled.Communication.Packets.Incoming.Users
7+
{
8+
internal class GetIgnoredUsersEvent : IPacketEvent
9+
{
10+
public void Parse(GameClient session, ClientPacket packet)
11+
{
12+
List<string> ignoredUsers = new();
13+
14+
foreach (int userId in new List<int>(session.GetHabbo().GetIgnores().IgnoredUserIds()))
15+
{
16+
Habbo player = AkiledEnvironment.GetHabboById(userId);
17+
if (player != null)
18+
{
19+
if (!ignoredUsers.Contains(player.Username))
20+
ignoredUsers.Add(player.Username);
21+
}
22+
}
23+
24+
session.SendPacket(new IgnoredUsersComposer(ignoredUsers));
25+
}
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
namespace Akiled.Communication.Packets.Outgoing.Catalog
2+
{
3+
internal class ClubGiftsComposer : ServerPacket
4+
{
5+
public ClubGiftsComposer()
6+
: base(ServerPacketHeader.ClubGiftsMessageComposer)
7+
{
8+
WriteInteger(0); //Days until next gift.
9+
WriteInteger(10); //Gifts available
10+
WriteInteger(1); //Count?
11+
{
12+
WriteInteger(14689);
13+
WriteString("hc_arab_chair");
14+
WriteBoolean(false);
15+
WriteInteger(5);
16+
WriteInteger(0);
17+
WriteInteger(0);
18+
WriteBoolean(true);
19+
WriteInteger(1); //Count for some reason
20+
21+
{
22+
WriteString("s");
23+
WriteInteger(6341);
24+
WriteString("");
25+
WriteInteger(1);
26+
WriteBoolean(false);
27+
}
28+
WriteInteger(0);
29+
WriteBoolean(false);
30+
WriteBoolean(false); // TODO: Figure out
31+
WriteString(""); //previewImage -> e.g; catalogue/pet_lion.png
32+
}
33+
34+
WriteInteger(1); //Count
35+
{
36+
//int, bool, int, bool
37+
WriteInteger(14689); //Maybe the item id?
38+
WriteBoolean(true); //Can we get?
39+
WriteInteger(-1); //idk
40+
WriteBoolean(true); //idk
41+
}
42+
}
43+
44+
}
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System.Collections.Generic;
2+
using System.Linq;
3+
using Akiled.HabboHotel.Navigators;
4+
5+
namespace Akiled.Communication.Packets.Outgoing.Navigator
6+
{
7+
internal class NavigatorFlatCatsComposer : ServerPacket
8+
{
9+
public ICollection<SearchResultList> Categories { get; }
10+
11+
public NavigatorFlatCatsComposer(ICollection<SearchResultList> categories)
12+
: base(ServerPacketHeader.NavigatorFlatCatsMessageComposer)
13+
{
14+
Categories = categories;
15+
16+
WriteInteger(Categories.Count);
17+
foreach (SearchResultList category in Categories.ToList())
18+
{
19+
WriteInteger(category.Id);
20+
WriteString(category.PublicName);
21+
WriteBoolean(true); // TODO
22+
}
23+
}
24+
25+
26+
}
27+
}

Communication/Packets/Outgoing/ServerPacketHeader.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ public static class ServerPacketHeader
247247
public const int CraftingFoundMessageComposer = 2124;
248248
public const int YoutubeDisplayListComposer = 1112;
249249
public const int ModeratorUserRoomVisitsMessageComposer = 1752;
250-
250+
public const int ClubGiftsMessageComposer = 619;
251+
public const int IgnoredUsersMessageComposer = 126;
251252
}
252253
}

Communication/Packets/Outgoing/Structure/ObjectsComposer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public ObjectsComposer(Item[] Objects, Room Room)
1919
WriteInteger(Objects.Length);
2020
foreach (Item Item in Objects)
2121
{
22-
WriteFloorItem(Item, Item.OwnerId, Room.RoomData.HideWireds);
22+
WriteFloorItem(Item, Item.OwnerId, Room.HideWired);
2323
}
2424
}
2525

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System.Collections.Generic;
2+
3+
namespace Akiled.Communication.Packets.Outgoing.Users
4+
{
5+
public class IgnoredUsersComposer : ServerPacket
6+
{
7+
public IReadOnlyCollection<string> IgnoredUsers { get; }
8+
9+
public IgnoredUsersComposer(IReadOnlyCollection<string> ignoredUsers)
10+
: base(ServerPacketHeader.IgnoredUsersMessageComposer)
11+
{
12+
IgnoredUsers = ignoredUsers;
13+
14+
WriteInteger(IgnoredUsers.Count);
15+
foreach (string username in IgnoredUsers)
16+
{
17+
WriteString(username);
18+
}
19+
}
20+
21+
22+
}
23+
}

Communication/Packets/PacketManager.cs

+8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
using Akiled.Communication.Packets.Incoming;
2+
using Akiled.Communication.Packets.Incoming.Catalog;
23
using Akiled.Communication.Packets.Incoming.Marketplace;
4+
using Akiled.Communication.Packets.Incoming.Navigator;
35
using Akiled.Communication.Packets.Incoming.Rooms.AI.Pets.Horse;
46
using Akiled.Communication.Packets.Incoming.Rooms.Engine;
57
using Akiled.Communication.Packets.Incoming.Rooms.Furni;
68
using Akiled.Communication.Packets.Incoming.Rooms.Furni.Moodlight;
79
using Akiled.Communication.Packets.Incoming.Sound;
810
using Akiled.Communication.Packets.Incoming.Structure;
11+
using Akiled.Communication.Packets.Incoming.Users;
912
using Akiled.Communication.Packets.Incoming.WebSocket;
1013
using Akiled.HabboHotel.GameClients;
1114
using Akiled.HabboHotel.WebClients;
@@ -165,6 +168,8 @@ private void RegisterCatalog()
165168
_incomingPackets.Add(ClientPacketHeader.GetMarketplaceConfigurationMessageEvent, new GetMarketplaceConfigurationEvent());
166169
_incomingPackets.Add(ClientPacketHeader.CameraPurchaseMessageEvent, new CameraPurchaseEvent());
167170
_incomingPackets.Add(ClientPacketHeader.RequestCameraConfigurationMessageEvent, new RequestCameraConfigurationEvent());
171+
_incomingPackets.Add(ClientPacketHeader.GetClubGiftsMessageEvent, new GetClubGiftsEvent());
172+
168173

169174
}
170175

@@ -190,7 +195,9 @@ private void RegisterNavigator()
190195
_incomingPackets.Add(ClientPacketHeader.CanCreateRoomMessageEvent, new CanCreateRoomEvent());
191196
_incomingPackets.Add(ClientPacketHeader.CreateFlatMessageEvent, new CreateFlatEvent());
192197
_incomingPackets.Add(ClientPacketHeader.GetGuestRoomMessageEvent, new GetGuestRoomEvent());
198+
_incomingPackets.Add(ClientPacketHeader.GetEventCategoriesMessageEvent, new GetNavigatorFlatsEvent());
193199
_incomingPackets.Add(1918, (IPacketEvent)new ToggleStaffPickEvent());
200+
194201
}
195202

196203
private void RegisterRoomCamera()
@@ -415,6 +422,7 @@ private void RegisterUsers()
415422
_incomingPackets.Add(ClientPacketHeader.CheckValidNameMessageEvent, new CheckValidNameEvent());
416423
_incomingPackets.Add(ClientPacketHeader.ChangeNameMessageEvent, new ChangeNameEvent());
417424
_incomingPackets.Add(ClientPacketHeader.GetHabboGroupBadgesMessageEvent, new GetHabboGroupBadgesEvent());
425+
_incomingPackets.Add(ClientPacketHeader.GetIgnoredUsersMessageEvent, new GetIgnoredUsersEvent());
418426
}
419427

420428
private void RegisterSound()

HabboHotel/Items/Item.cs

+79
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,85 @@ public FurniInteractor Interactor
318318
}
319319
}
320320

321+
public bool IsWired
322+
{
323+
get
324+
{
325+
switch (GetBaseItem().InteractionType)
326+
{
327+
case InteractionType.triggertimer:
328+
case InteractionType.triggerroomenter:
329+
case InteractionType.triggergameend:
330+
case InteractionType.triggergamestart:
331+
case InteractionType.triggerrepeater:
332+
case InteractionType.triggerrepeaterlong:
333+
case InteractionType.triggeronusersay:
334+
case InteractionType.triggercommand:
335+
case InteractionType.triggercollisionuser:
336+
case InteractionType.triggerscoreachieved:
337+
case InteractionType.triggerstatechanged:
338+
case InteractionType.triggerwalkonfurni:
339+
case InteractionType.triggerwalkofffurni:
340+
case InteractionType.triggercollision:
341+
case InteractionType.actiongivescore:
342+
case InteractionType.actionposreset:
343+
case InteractionType.actionmoverotate:
344+
case InteractionType.actionresettimer:
345+
case InteractionType.actionshowmessage:
346+
case InteractionType.highscore:
347+
case InteractionType.highscorepoints:
348+
case InteractionType.actiongivereward:
349+
case InteractionType.superwired:
350+
case InteractionType.superwiredcondition:
351+
case InteractionType.actionteleportto:
352+
case InteractionType.wf_act_endgame_team:
353+
case InteractionType.wf_act_call_stacks:
354+
case InteractionType.actiontogglestate:
355+
case InteractionType.actionkickuser:
356+
case InteractionType.actionflee:
357+
case InteractionType.actionchase:
358+
case InteractionType.collisioncase:
359+
case InteractionType.collisionteam:
360+
case InteractionType.actionmovetodir:
361+
case InteractionType.conditionfurnishaveusers:
362+
case InteractionType.conditionfurnishavenousers:
363+
case InteractionType.conditionhasfurnionfurni:
364+
case InteractionType.conditionhasfurnionfurniNegative:
365+
case InteractionType.conditionstatepos:
366+
case InteractionType.wf_cnd_stuff_is:
367+
case InteractionType.wf_cnd_not_stuff_is:
368+
case InteractionType.conditionstateposNegative:
369+
case InteractionType.conditiontimelessthan:
370+
case InteractionType.conditiontimemorethan:
371+
case InteractionType.conditiontriggeronfurni:
372+
case InteractionType.conditiontriggeronfurniNegative:
373+
case InteractionType.conditionactoringroup:
374+
case InteractionType.conditionnotingroup:
375+
case InteractionType.wf_trg_bot_reached_stf:
376+
case InteractionType.wf_trg_bot_reached_avtr:
377+
case InteractionType.wf_act_bot_clothes:
378+
case InteractionType.wf_act_bot_teleport:
379+
case InteractionType.wf_act_bot_follow_avatar:
380+
case InteractionType.wf_act_bot_give_handitem:
381+
case InteractionType.wf_act_bot_move:
382+
case InteractionType.wf_act_user_move:
383+
case InteractionType.wf_act_bot_talk_to_avatar:
384+
case InteractionType.wf_act_bot_talk:
385+
case InteractionType.wf_cnd_has_handitem:
386+
case InteractionType.wf_act_join_team:
387+
case InteractionType.wf_act_leave_team:
388+
case InteractionType.wf_act_give_score_tm:
389+
case InteractionType.wf_cnd_actor_in_team:
390+
case InteractionType.wf_cnd_not_in_team:
391+
case InteractionType.wf_cnd_not_user_count:
392+
case InteractionType.wf_cnd_user_count_in:
393+
return true;
394+
}
395+
396+
return false;
397+
}
398+
}
399+
321400
public Item(int mId, int fOwnerId, int RoomId, int mBaseItem, string ExtraData, int limitedNumber, int limitedStack, int X, int Y, double Z, int Rot, string wallCoord, Room pRoom = null)
322401
{
323402
ItemData Data = null;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace AkiledEmulator.HabboHotel.Rooms.Chat.Commands.Others
8+
{
9+
internal class RoomSpotifyCommand
10+
{
11+
}
12+
}

0 commit comments

Comments
 (0)