From 14a1c56877fa73e95af025768a25121cc513e2f4 Mon Sep 17 00:00:00 2001 From: Mike <76-Mike@users.noreply.git.krews.org> Date: Tue, 5 May 2020 01:27:39 +0200 Subject: [PATCH] Remove unused packet ids and fix duplicate composer. --- .../eu/habbo/messages/incoming/Incoming.java | 4 --- .../rooms/bots/BotSaveSettingsEvent.java | 4 +-- .../eu/habbo/messages/outgoing/Outgoing.java | 23 +++++----------- .../users/RoomUnitUpdateUsernameComposer.java | 25 ------------------ .../users/RoomUserNameChangedComposer.java | 26 ++++++++++++------- 5 files changed, 26 insertions(+), 56 deletions(-) delete mode 100644 src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitUpdateUsernameComposer.java diff --git a/src/main/java/com/eu/habbo/messages/incoming/Incoming.java b/src/main/java/com/eu/habbo/messages/incoming/Incoming.java index ee3b7193..2f2bfc1d 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/Incoming.java +++ b/src/main/java/com/eu/habbo/messages/incoming/Incoming.java @@ -35,7 +35,6 @@ public class Incoming { public static final int RoomUserShoutEvent = 2085; public static final int ScratchPetEvent = 3202; public static final int RoomUserWalkEvent = 3320; - public static final int RequestUserTagsEvent = 17; public static final int RequestTagsEvent = 826; public static final int GetMarketplaceConfigEvent = 2597; public static final int RequestHeightmapEvent = 3898; @@ -114,8 +113,6 @@ public class Incoming { public static final int SearchRoomsMyFavoriteEvent = 2578; public static final int TradeStartEvent = 1481; public static final int RequestTargetOfferEvent = 2487; - public static final int ClientActionsMessageEvent = 3457; - public static final int UknownMessageEventSomethingSomething = 1827; public static final int ChangeRelationEvent = 3768; public static final int RoomUserSitEvent = 2235; public static final int RequestCanCreateRoomEvent = 2128; @@ -275,7 +272,6 @@ public class Incoming { public static final int GuardianNoUpdatesWantedEvent = 2501; public static final int GuardianVoteEvent = 3961; public static final int GuardianAcceptRequestEvent = 3365; - public static final int RequestGameConfigurationsEvent = 741; public static final int RequestAchievementConfigurationEvent = -1; public static final int RequestReportUserBullyingEvent = 3786; public static final int ReportBullyEvent = 3060; diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java index a0d13549..aea766c0 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java @@ -8,8 +8,8 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.DanceType; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.generic.alerts.BotErrorComposer; -import com.eu.habbo.messages.outgoing.rooms.users.RoomUnitUpdateUsernameComposer; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserDanceComposer; +import com.eu.habbo.messages.outgoing.rooms.users.RoomUserNameChangedComposer; import com.eu.habbo.messages.outgoing.rooms.users.RoomUsersComposer; import com.eu.habbo.plugin.events.bots.BotSavedChatEvent; import com.eu.habbo.plugin.events.bots.BotSavedLookEvent; @@ -143,7 +143,7 @@ public class BotSaveSettingsEvent extends MessageHandler { bot.setName(nameEvent.name); bot.needsUpdate(true); - room.sendComposer(new RoomUnitUpdateUsernameComposer(bot.getRoomUnit(), nameEvent.name).compose()); + room.sendComposer(new RoomUserNameChangedComposer(bot.getRoomUnit().getId(), bot.getRoomUnit().getId(), nameEvent.name).compose()); } } diff --git a/src/main/java/com/eu/habbo/messages/outgoing/Outgoing.java b/src/main/java/com/eu/habbo/messages/outgoing/Outgoing.java index 38cba122..c6e299c0 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/Outgoing.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/Outgoing.java @@ -138,11 +138,11 @@ public class Outgoing { public final static int WallItemUpdateComposer = 2009; // PRODUCTION-201611291003-338511768 public final static int TradeAcceptedComposer = 2568; // PRODUCTION-201611291003-338511768 public final static int AddWallItemComposer = 2187; // PRODUCTION-201611291003-338511768 - public final static int RoomEntryInfoComposer = 749; // PRODUCTION-201611291003-338511768 + public final static int RoomEntryInfoComposer = -1; // PRODUCTION-201611291003-338511768 public final static int HotelViewDataComposer = 1745; // PRODUCTION-201611291003-338511768 public final static int PresentItemOpenedComposer = 56; // PRODUCTION-201611291003-338511768 public final static int RoomUserRemoveRightsComposer = 84; // PRODUCTION-201611291003-338511768 - public final static int UserBCLimitsComposer = 3828; // PRODUCTION-201611291003-338511768 + public final static int UserBCLimitsComposer = -1; // PRODUCTION-201611291003-338511768 public final static int PetTrainingPanelComposer = 1164; // PRODUCTION-201611291003-338511768 public final static int RoomPaneComposer = 749; // PRODUCTION-201611291003-338511768 public final static int RedeemVoucherErrorComposer = 714; // PRODUCTION-201611291003-338511768 @@ -199,7 +199,6 @@ public class Outgoing { public final static int NewNavigatorCollapsedCategoriesComposer = 1543; // PRODUCTION-201611291003-338511768 public final static int NewNavigatorLiftedRoomsComposer = 3104; // PRODUCTION-201611291003-338511768 public final static int NewNavigatorSavedSearchesComposer = 3984; // PRODUCTION-201611291003-338511768 - public final static int RoomUnitUpdateUsernameComposer = 2182; // PRODUCTION-201611291003-338511768 public final static int PostItDataComposer = 2202; // PRODUCTION-201611291003-338511768 public final static int ModToolReportReceivedAlertComposer = 3635; // PRODUCTION-201611291003-338511768 public final static int ModToolIssueResponseAlertComposer = 3796; // PRODUCTION-201611291003-338511768 @@ -237,7 +236,7 @@ public class Outgoing { public final static int ItemExtraDataComposer = 2547; // PRODUCTION-201611291003-338511768 public final static int PostUpdateMessageComposer = 324; // PRODUCTION-201611291003-338511768 //NotSure Needs Testing - public final static int QuestionInfoComposer = 2665; // PRODUCTION-201611291003-338511768 + public final static int QuestionInfoComposer = -1; // PRODUCTION-201611291003-338511768 public final static int TalentTrackEmailVerifiedComposer = 612; // PRODUCTION-201611291003-338511768 public final static int TalentTrackEmailFailedComposer = 1815; // PRODUCTION-201611291003-338511768 public final static int UnknownAvatarEditorComposer = 3473; // PRODUCTION-201611291003-338511768 @@ -249,8 +248,8 @@ public class Outgoing { public final static int GuildForumAddCommentComposer = 2049; // PRODUCTION-201611291003-338511768 public final static int GuildForumDataComposer = 3011; // PRODUCTION-201611291003-338511768 public final static int GuildForumCommentsComposer = 509; // PRODUCTION-201611291003-338511768 - public final static int UnknownGuildForumComposer6 = 324; // PRODUCTION-201611291003-338511768 - public final static int UnknownGuildForumComposer7 = 2528; // PRODUCTION-201611291003-338511768 + public final static int UnknownGuildForumComposer6 = -1; // PRODUCTION-201611291003-338511768 + public final static int UnknownGuildForumComposer7 = -1; // PRODUCTION-201611291003-338511768 public final static int GuildForumThreadsComposer = 1073; // PRODUCTION-201611291003-338511768 public final static int GuildForumListComposer = 3001; // PRODUCTION-201611291003-338511768 public final static int ThreadUpdateMessageComposer = 2528; @@ -342,11 +341,11 @@ public class Outgoing { public final static int MostUselessErrorAlertComposer = 662; // PRODUCTION-201611291003-338511768 public final static int AchievementsConfigurationComposer = 1689; // PRODUCTION-201611291003-338511768 public final static int PetBreedingResultComposer = 634; // PRODUCTION-201611291003-338511768 - public final static int RoomUserQuestionAnsweredComposer = 2589; // PRODUCTION-201611291003-338511768 + public final static int RoomUserQuestionAnsweredComposer = -1; // PRODUCTION-201611291003-338511768 public final static int PetBreedingStartComposer = 1746; // PRODUCTION-201611291003-338511768 public final static int CustomNotificationComposer = 909; // PRODUCTION-201611291003-338511768 public final static int UpdateStackHeightTileHeightComposer = 2816; // PRODUCTION-201611291003-338511768 - public final static int HotelViewCustomTimerComposer = 3926; // PRODUCTION-201611291003-338511768 + public final static int HotelViewCustomTimerComposer = -1; // PRODUCTION-201611291003-338511768 public final static int MarketplaceItemPostedComposer = 1359; // PRODUCTION-201611291003-338511768 public final static int HabboWayQuizComposer2 = 2927; // PRODUCTION-201611291003-338511768 public final static int GuildFavoriteRoomUserUpdateComposer = 3403; // PRODUCTION-201611291003-338511768 @@ -413,7 +412,6 @@ public class Outgoing { public final static int CraftingComposerFour = 2124; // PRODUCTION-201611291003-338511768 public final static int UnknownComposer_100 = 1553; // PRODUCTION-201611291003-338511768 //PetBReedingResult - public final static int UnknownComposer_1031 = 1001; // PRODUCTION-201611291003-338511768 public final static int ConnectionErrorComposer = 1004; // PRODUCTION-201611291003-338511768 public final static int BotForceOpenContextMenuComposer = 296; // PRODUCTION-201611291003-338511768 public final static int UnknownComposer_1111 = 1551; // PRODUCTION-201611291003-338511768 @@ -421,13 +419,10 @@ public class Outgoing { public final static int UnknownComposer_1165 = 904; // PRODUCTION-201611291003-338511768 public final static int EffectsListAddComposer = 2867; // PRODUCTION-201611291003-338511768 public final static int UnknownComposer_1188 = 1437; // PRODUCTION-201611291003-338511768 - public final static int UnknownComposer_1218 = 1730; // PRODUCTION-201611291003-338511768 public final static int SubmitCompetitionRoomComposer = 3841; // PRODUCTION-201611291003-338511768 public final static int GameAchievementsListComposer = 2265; // PRODUCTION-201611291003-338511768 - public final static int UnknownComposer_1271 = 1660; // PRODUCTION-201611291003-338511768 public final static int OtherTradingDisabledComposer = 1254; // PRODUCTION-201611291003-338511768 public final static int BaseJumpUnloadGameComposer = 1715; // PRODUCTION-201611291003-338511768 - public final static int UnknownComposer_1322 = 1730; // PRODUCTION-201611291003-338511768 public final static int UnknownComposer_137 = 2897; // PRODUCTION-201611291003-338511768 public final static int GameCenterAccountInfoComposer = 2893; // PRODUCTION-201611291003-338511768 public final static int UnknowComposer_1390 = 2270; // PRODUCTION-201611291003-338511768 @@ -435,20 +430,16 @@ public class Outgoing { public final static int UnknowComposer_1427 = 3319; // PRODUCTION-201611291003-338511768 public final static int AdventCalendarDataComposer = 2531; // PRODUCTION-201611291003-338511768 public final static int UnknownComposer_152 = 3954; // PRODUCTION-201611291003-338511768 - public final static int UnknownComposer_1529 = 1730; // PRODUCTION-201611291003-338511768 public final static int UnknownComposer_1577 = 2641; // PRODUCTION-201611291003-338511768 - public final static int UnknownComposer_1712 = 1730; // PRODUCTION-201611291003-338511768 public final static int NewYearResolutionCompletedComposer = 740; // PRODUCTION-201611291003-338511768 public final static int UnknownComposer_1741 = 2246; // PRODUCTION-201611291003-338511768 public final static int UnknownComposer_1744 = 2873; // PRODUCTION-201611291003-338511768 public final static int AdventCalendarProductComposer = 2551; // PRODUCTION-201611291003-338511768 public final static int ModToolSanctionInfoComposer = 2221; // PRODUCTION-201611291003-338511768 public final static int UnknownComposer_1965 = 3292; // PRODUCTION-201611291003-338511768 - public final static int UnknownComposer_2053 = 1660; // PRODUCTION-201611291003-338511768 public final static int GuideSessionPartnerIsPlayingComposer = 448; // PRODUCTION-201611291003-338511768 public final static int BaseJumpLeaveQueueComposer = 1477; // PRODUCTION-201611291003-338511768 public final static int Game2WeeklySmallLeaderboardComposer = 3512; // PRODUCTION-201611291003-338511768 - public final static int CatalogBuyVIPSMSComposer = 3315; // PRODUCTION-201611291003-338511768 public final static int GameCenterGameListComposer = 222; // PRODUCTION-201611291003-338511768 public final static int RoomUsersGuildBadgesComposer = 2402; // PRODUCTION-201611291003-338511768 public final static int UnknownComposer_2563 = 1774; // PRODUCTION-201611291003-338511768 diff --git a/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitUpdateUsernameComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitUpdateUsernameComposer.java deleted file mode 100644 index c3cde9be..00000000 --- a/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitUpdateUsernameComposer.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.eu.habbo.messages.outgoing.rooms.users; - -import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.outgoing.MessageComposer; -import com.eu.habbo.messages.outgoing.Outgoing; - -public class RoomUnitUpdateUsernameComposer extends MessageComposer { - private RoomUnit roomUnit; - private String name; - - public RoomUnitUpdateUsernameComposer(RoomUnit roomUnit, String name) { - this.roomUnit = roomUnit; - this.name = name; - } - - @Override - public ServerMessage compose() { - this.response.init(Outgoing.RoomUnitUpdateUsernameComposer); - this.response.appendInt(this.roomUnit.getId()); - this.response.appendInt(this.roomUnit.getId()); - this.response.appendString(this.name); - return this.response; - } -} diff --git a/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserNameChangedComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserNameChangedComposer.java index 53c8b5b9..f62b4d2e 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserNameChangedComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserNameChangedComposer.java @@ -7,25 +7,33 @@ import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; public class RoomUserNameChangedComposer extends MessageComposer { - private final Habbo habbo; - private final boolean includePrefix; + + private final int userId; + private final int roomId; + private final String name; public RoomUserNameChangedComposer(Habbo habbo) { - this.habbo = habbo; - this.includePrefix = false; + this(habbo, false); } public RoomUserNameChangedComposer(Habbo habbo, boolean includePrefix) { - this.habbo = habbo; - this.includePrefix = includePrefix; + this.userId = habbo.getHabboInfo().getId(); + this.roomId = habbo.getRoomUnit().getId(); + this.name = (includePrefix ? Room.PREFIX_FORMAT.replace("%color%", habbo.getHabboInfo().getRank().getPrefixColor()).replace("%prefix%", habbo.getHabboInfo().getRank().getPrefix()) : "") + habbo.getHabboInfo().getUsername(); + } + + public RoomUserNameChangedComposer(int userId, int roomId, String name) { + this.userId = userId; + this.roomId = roomId; + this.name = name; } @Override public ServerMessage compose() { this.response.init(Outgoing.RoomUserNameChangedComposer); - this.response.appendInt(this.habbo.getHabboInfo().getId()); - this.response.appendInt(this.habbo.getRoomUnit().getId()); - this.response.appendString((this.includePrefix ? Room.PREFIX_FORMAT.replace("%color%", this.habbo.getHabboInfo().getRank().getPrefixColor()).replace("%prefix%", this.habbo.getHabboInfo().getRank().getPrefix()) : "") + this.habbo.getHabboInfo().getUsername()); + this.response.appendInt(this.userId); + this.response.appendInt(this.roomId); + this.response.appendString(this.name); return this.response; } } \ No newline at end of file