From 062df1b752c82c0e253970dad7c5189c9c6190c1 Mon Sep 17 00:00:00 2001 From: Snaiker Date: Fri, 23 Dec 2022 11:36:20 +0000 Subject: [PATCH 1/2] Nux Packets (Gifts) --- src/nitro/communication/NitroMessages.ts | 8 ++++ .../messages/incoming/IncomingHeader.ts | 1 + .../incoming/nux/NewUserExperienceGift.ts | 37 +++++++++++++++++ .../NewUserExperienceGiftOfferMessageEvent.ts | 16 ++++++++ .../nux/NewUserExperienceGiftOptions.ts | 40 +++++++++++++++++++ .../messages/incoming/nux/ProductOffer.ts | 28 +++++++++++++ .../messages/incoming/nux/index.ts | 4 ++ .../messages/outgoing/OutgoingHeader.ts | 1 + .../nux/NewUserExperienceGetGiftsComposer.ts | 28 +++++++++++++ .../nux/NewUserExperienceGetGiftsSelection.ts | 28 +++++++++++++ .../messages/outgoing/nux/index.ts | 2 + ...NewUserExperienceGiftOfferMessageParser.ts | 34 ++++++++++++++++ .../messages/parser/nux/index.ts | 1 + 13 files changed, 228 insertions(+) create mode 100644 src/nitro/communication/messages/incoming/nux/NewUserExperienceGift.ts create mode 100644 src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOfferMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOptions.ts create mode 100644 src/nitro/communication/messages/incoming/nux/ProductOffer.ts create mode 100644 src/nitro/communication/messages/incoming/nux/index.ts create mode 100644 src/nitro/communication/messages/outgoing/nux/NewUserExperienceGetGiftsComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/nux/NewUserExperienceGetGiftsSelection.ts create mode 100644 src/nitro/communication/messages/outgoing/nux/index.ts create mode 100644 src/nitro/communication/messages/parser/nux/NewUserExperienceGiftOfferMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/nux/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index ed39e38d..c9ec9bcd 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,7 @@ import { IMessageConfiguration } from '../../api'; import { AcceptFriendMessageComposer, AcceptFriendResultEvent, AcceptGameInviteMessageComposer, AcceptQuestMessageComposer, AchievementEvent, AchievementNotificationMessageEvent, AchievementResolutionCompletedMessageEvent, AchievementResolutionProgressMessageEvent, AchievementResolutionsMessageEvent, AchievementsEvent, AchievementsScoreEvent, ActivateQuestMessageComposer, ActivityPointNotificationMessageEvent, AddFavouriteRoomMessageComposer, AddJukeboxDiskComposer, AddSpamWallPostItMessageComposer, ApplySnapshotMessageComposer, ApplyTonerComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AuthenticatedEvent, AuthenticationMessageComposer, AvailabilityStatusMessageEvent, AvailabilityTimeMessageEvent, AvatarEffectActivatedComposer, AvatarEffectActivatedEvent, AvatarEffectAddedEvent, AvatarEffectExpiredEvent, AvatarEffectSelectedComposer, AvatarEffectsEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BadgesEvent, BannedUsersFromRoomEvent, BonusRareInfoMessageEvent, BotAddedToInventoryEvent, BotCommandConfigurationEvent, BotErrorEvent, BotInventoryMessageEvent, BotPlaceComposer, BotReceivedMessageEvent, BotRemoveComposer, BotRemovedFromInventoryEvent, BotSkillSaveComposer, BuildersClubFurniCountMessageEvent, BuildersClubPlaceRoomItemMessageComposer, BuildersClubPlaceWallItemMessageComposer, BuildersClubQueryFurniCountMessageComposer, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpDisabledNotifyMessageEvent, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CallForHelpPendingCallsDeletedMessageEvent, CallForHelpPendingCallsMessageEvent, CallForHelpReplyMessageEvent, CallForHelpResultMessageEvent, CameraPublishStatusMessageEvent, CameraPurchaseOKMessageEvent, CameraStorageUrlMessageEvent, CampaignCalendarDataMessageEvent, CampaignCalendarDoorOpenedMessageEvent, CancelEventMessageComposer, CancelMarketplaceOfferMessageComposer, CancelMysteryBoxWaitMessageEvent, CancelQuestMessageComposer, CanCreateRoomEvent, CanCreateRoomEventEvent, CanCreateRoomMessageComposer, CatalogGroupsComposer, CatalogPageExpirationEvent, CatalogPageMessageEvent, CatalogPagesListEvent, CatalogPageWithEarliestExpiryMessageEvent, CatalogPublishedMessageEvent, CategoriesWithVisitorCountEvent, CfhChatlogEvent, CfhSanctionMessageEvent, CfhTopicsInitEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, ChatReviewSessionDetachedMessageEvent, ChatReviewSessionOfferedToGuideMessageEvent, ChatReviewSessionResultsMessageEvent, ChatReviewSessionStartedMessageEvent, ChatReviewSessionVotingStatusMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClientHelloMessageComposer, ClientPingEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftInfoEvent, ClubGiftNotificationEvent, ClubGiftSelectedEvent, CommunityGoalEarnedPrizesMessageEvent, CommunityGoalHallOfFameMessageEvent, CommunityGoalProgressMessageEvent, CommunityGoalVoteMessageComposer, CommunityGoalVoteMessageEvent, CompetitionEntrySubmitResultEvent, CompetitionRoomsDataMessageEvent, CompetitionRoomsSearchMessageComposer, CompetitionStatusMessageEvent, CompetitionVotingInfoMessageEvent, CompostPlantMessageComposer, ConcurrentUsersGoalProgressMessageEvent, ControlYoutubeDisplayPlaybackMessageComposer, ConvertedRoomIdEvent, ConvertGlobalRoomIdMessageComposer, CraftableProductsEvent, CraftComposer, CraftingRecipeEvent, CraftingRecipesAvailableEvent, CraftingResultEvent, CraftSecretComposer, CreateFlatMessageComposer, CurrentTimingCodeMessageEvent, CustomUserNotificationMessageEvent, DeclineFriendMessageComposer, DefaultSanctionMessageComposer, DeleteFavouriteRoomMessageComposer, DeletePendingCallsForHelpMessageComposer, DesktopViewComposer, DesktopViewEvent, DiceValueMessageEvent, DirectSMSClubBuyAvailableMessageEvent, DisconnectMessageComposer, DoorbellMessageEvent, EditEventMessageComposer, EpicPopupMessageEvent, FavoriteMembershipUpdateMessageEvent, FavouriteChangedEvent, FavouritesEvent, FigureSetIdsMessageEvent, FigureUpdateEvent, FindFriendsProcessResultEvent, FindNewFriendsMessageComposer, FlatAccessDeniedMessageEvent, FlatControllerAddedEvent, FlatControllerRemovedEvent, FlatControllersEvent, FlatCreatedEvent, FloodControlEvent, FloorHeightMapEvent, FollowFriendFailedEvent, FollowFriendMessageComposer, ForumDataMessageEvent, ForumsListMessageEvent, ForwardToACompetitionRoomMessageComposer, ForwardToARandomPromotedRoomMessageComposer, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, ForwardToSomeRoomMessageComposer, FriendFurniConfirmLockMessageComposer, FriendListFragmentEvent, FriendListUpdateComposer, FriendListUpdateEvent, FriendNotificationEvent, FriendRequestQuestCompleteMessageComposer, FriendRequestsEvent, FurnitureAliasesComposer, FurnitureAliasesEvent, FurnitureColorWheelComposer, FurnitureDataEvent, FurnitureDiceActivateComposer, FurnitureDiceDeactivateComposer, FurnitureExchangeComposer, FurnitureFloorAddEvent, FurnitureFloorEvent, FurnitureFloorRemoveEvent, FurnitureFloorUpdateComposer, FurnitureFloorUpdateEvent, FurnitureGroupInfoComposer, FurnitureListAddOrUpdateEvent, FurnitureListComposer, FurnitureListEvent, FurnitureListInvalidateEvent, FurnitureListRemovedEvent, FurnitureMannequinSaveLookComposer, FurnitureMannequinSaveNameComposer, FurnitureMultiStateComposer, FurnitureOneWayDoorComposer, FurniturePickupComposer, FurniturePlaceComposer, FurniturePlacePaintComposer, FurniturePostItPlaceComposer, FurniturePostItPlacedEvent, FurnitureRandomStateComposer, FurnitureStackHeightComposer, FurnitureStackHeightEvent, FurnitureWallAddEvent, FurnitureWallEvent, FurnitureWallMultiStateComposer, FurnitureWallRemoveEvent, FurnitureWallUpdateComposer, FurnitureWallUpdateEvent, Game2AccountGameStatusMessageEvent, Game2CheckGameDirectoryStatusMessageComposer, Game2ExitGameMessageComposer, Game2GameChatMessageComposer, Game2GetAccountGameStatusMessageComposer, Game2GetWeeklyFriendsLeaderboardComposer, Game2GetWeeklyLeaderboardComposer, Game2LoadStageReadyMessageComposer, Game2PlayAgainMessageComposer, Game2RequestFullStatusUpdateMessageComposer, GameAchievementsMessageEvent, GameInviteMessageEvent, GameListMessageEvent, GameStatusMessageEvent, GameUnloadedMessageComposer, GenericErrorEvent, GetBadgePointLimitsComposer, GetBonusRareInfoMessageComposer, GetBotInventoryComposer, GetBundleDiscountRulesetComposer, GetCatalogIndexComposer, GetCatalogPageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCategoriesWithUserCountMessageComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetClubGiftInfo, GetClubOffersMessageComposer, GetCommunityGoalEarnedPrizesMessageComposer, GetCommunityGoalHallOfFameMessageComposer, GetCommunityGoalProgressMessageComposer, GetConcurrentUsersGoalProgressMessageComposer, GetConcurrentUsersRewardMessageComposer, GetCraftableProductsComposer, GetCraftingRecipeComposer, GetCraftingRecipesAvailableComposer, GetCurrentTimingCodeMessageComposer, GetCustomRoomFilterMessageComposer, GetDailyQuestMessageComposer, GetDirectClubBuyAvailableComposer, GetExtendedProfileByNameMessageComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetFriendRequestsComposer, GetGameAchievementsMessageComposer, GetGameListMessageComposer, GetGameStatusMessageComposer, GetGiftMessageComposer, GetGiftWrappingConfigurationComposer, GetGuestRoomMessageComposer, GetGuestRoomResultEvent, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetHabboGroupBadgesMessageComposer, GetIgnoredUsersComposer, GetInterstitialMessageComposer, GetIsBadgeRequestFulfilledComposer, GetIsOfferGiftableComposer, GetIsUserPartOfCompetitionMessageComposer, GetItemDataComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceCanMakeOfferComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetModeratorRoomInfoMessageComposer, GetModeratorUserInfoMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOccupiedTilesMessageComposer, GetOfficialRoomsMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetPetCommandsComposer, GetPopularRoomTagsMessageComposer, GetProductOfferComposer, GetPromoArticlesComposer, GetQuestsMessageComposer, GetQuizQuestionsComposer, GetResolutionAchievementsMessageComposer, GetRoomAdPurchaseInfoComposer, GetRoomChatlogMessageComposer, GetRoomEntryDataMessageComposer, GetRoomEntryTileMessageComposer, GetRoomVisitsMessageComposer, GetSeasonalCalendarDailyOfferComposer, GetSeasonalQuestsOnlyMessageComposer, GetSecondsUntilMessageComposer, GetSellablePetPalettesComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetSoundSettingsComposer, GetTargetedOfferComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserChatlogMessageComposer, GetUserEventCatsMessageComposer, GetUserFlatCatsMessageComposer, GetUserGameAchievementsMessageComposer, GetUserSongDisksMessageComposer, GetUserTagsComposer, GetWardrobeMessageComposer, GetWeeklyGameRewardComposer, GetWeeklyGameRewardWinnersComposer, GetYoutubeDisplayStatusMessageComposer, GiftReceiverNotFoundEvent, GiftWrappingConfigurationEvent, GotMysteryBoxPrizeMessageEvent, GoToFlatMessageComposer, GroupAdminGiveComposer, GroupAdminTakeComposer, GroupBadgePartsComposer, GroupBadgePartsEvent, GroupBuyComposer, GroupBuyDataComposer, GroupBuyDataEvent, GroupConfirmMemberRemoveEvent, GroupConfirmRemoveMemberComposer, GroupDeleteComposer, GroupFavoriteComposer, GroupFurniContextMenuInfoMessageEvent, GroupInformationComposer, GroupInformationEvent, GroupJoinComposer, GroupMembersComposer, GroupMembersEvent, GroupMembershipAcceptComposer, GroupMembershipDeclineComposer, GroupPurchasedEvent, GroupRemoveMemberComposer, GroupSaveBadgeComposer, GroupSaveColorsComposer, GroupSaveInformationComposer, GroupSavePreferencesComposer, GroupSettingsComposer, GroupSettingsEvent, GroupUnfavoriteComposer, GuestRoomSearchResultEvent, GuideOnDutyStatusMessageEvent, GuideReportingStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionCreateMessageComposer, GuideSessionDetachedMessageEvent, GuideSessionEndedMessageEvent, GuideSessionErrorMessageEvent, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInvitedToGuideRoomMessageEvent, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionMessageMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionPartnerIsTypingMessageEvent, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer, GuideSessionStartedMessageEvent, GuideTicketCreationResultMessageEvent, GuideTicketResolutionMessageEvent, GuildBaseSearchMessageComposer, GuildForumThreadsEvent, GuildMembershipsMessageEvent, HabboBroadcastMessageEvent, HabboClubExtendOfferMessageEvent, HabboClubOffersMessageEvent, HabboGroupBadgesMessageEvent, HabboGroupDeactivatedMessageEvent, HabboSearchComposer, HabboSearchResultEvent, HarvestPetMessageComposer, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelMergeNameChangeEvent, HotelWillCloseInMinutesEvent, IgnoredUsersEvent, IgnoreResultEvent, IgnoreUserComposer, IgnoreUserIdComposer, InClientLinkEvent, IncomingHeader, InfoFeedEnableMessageEvent, InfoRetrieveMessageComposer, InitCameraMessageEvent, InstantMessageErrorEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, IssueCloseNotificationMessageEvent, IssueDeletedMessageEvent, IssueInfoMessageEvent, IssuePickFailedMessageEvent, IsUserPartOfCompetitionMessageEvent, ItemDataUpdateMessageEvent, JoinedQueueMessageEvent, JoiningQueueFailedMessageEvent, JoinQueueMessageComposer, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LeaveQueueMessageComposer, LeftQueueMessageEvent, LimitedEditionSoldOutEvent, LimitedOfferAppearingNextMessageEvent, LoadGameMessageEvent, LoadGameUrlEvent, LoveLockFurniFinishedEvent, LoveLockFurniFriendConfirmedEvent, LoveLockFurniStartEvent, MaintenanceStatusMessageEvent, MakeOfferMessageComposer, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferResultEvent, MarketplaceCancelOfferResultEvent, MarketplaceCanMakeOfferResult, MarketplaceConfigurationEvent, MarketplaceItemStatsEvent, MarketplaceMakeOfferResult, MarketPlaceOffersEvent, MarketplaceOwnOffersEvent, MessageErrorEvent, MessengerInitComposer, MessengerInitEvent, MiniMailNewMessageEvent, MiniMailUnreadCountEvent, ModAlertMessageComposer, ModBanMessageComposer, ModerateMessageMessageComposer, ModerateRoomMessageComposer, ModerateThreadMessageComposer, ModeratorActionMessageComposer, ModeratorActionResultMessageEvent, ModeratorCautionEvent, ModeratorInitMessageEvent, ModeratorMessageEvent, ModeratorRoomInfoEvent, ModeratorToolPreferencesEvent, ModeratorUserInfoEvent, ModKickMessageComposer, ModMessageMessageComposer, ModMuteMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, ModTradingLockMessageComposer, MoodlightSettingsComposer, MoodlightSettingsSaveComposer, MoodlightTogggleStateComposer, MOTDNotificationEvent, MuteAllInRoomEvent, MyFavouriteRoomsSearchMessageComposer, MyFrequentRoomHistorySearchMessageComposer, MyFriendsRoomsSearchMessageComposer, MyGuildBasesSearchMessageComposer, MyRecommendedRoomsMessageComposer, MyRoomHistorySearchMessageComposer, MyRoomRightsSearchMessageComposer, MyRoomsSearchMessageComposer, MysteryBoxKeysEvent, MysteryBoxWaitingCanceledMessageComposer, NavigatorCategoryListModeComposer, NavigatorCollapsedEvent, NavigatorHomeRoomEvent, NavigatorInitComposer, NavigatorLiftedEvent, NavigatorMetadataEvent, NavigatorOpenRoomCreatorEvent, NavigatorSearchCloseComposer, NavigatorSearchComposer, NavigatorSearchesEvent, NavigatorSearchEvent, NavigatorSearchOpenComposer, NavigatorSearchSaveComposer, NavigatorSettingsEvent, NavigatorSettingsSaveComposer, NewConsoleMessageEvent, NewFriendRequestEvent, NoobnessLevelMessageEvent, NoOwnedRoomsAlertMessageEvent, NoSuchFlatEvent, NotEnoughBalanceMessageEvent, NotificationDialogMessageEvent, NowPlayingMessageEvent, ObjectsDataUpdateEvent, ObjectsRollingEvent, OfficialSongIdMessageEvent, OneWayDoorStatusMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, OpenMessageComposer, OpenPresentComposer, OpenQuestTrackerMessageComposer, OutgoingHeader, PerkAllowancesMessageEvent, PetAddedToInventoryEvent, PetExperienceEvent, PetFigureUpdateEvent, PetInfoEvent, PetInventoryEvent, PetLevelNotificationEvent, PetMountComposer, PetMoveComposer, PetPlaceComposer, PetPlacingErrorEvent, PetReceivedMessageEvent, PetRemoveComposer, PetRemovedFromInventory, PetRespectComposer, PetRespectNoficationEvent, PetStatusUpdateEvent, PetSupplementComposer, PetSupplementedNotificationEvent, PetTrainingPanelMessageEvent, PhotoCompetitionMessageComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PongMessageComposer, PopularRoomsSearchMessageComposer, PostMessageMessageComposer, PostMessageMessageEvent, PostQuizAnswersComposer, PostThreadMessageEvent, PresentOpenedMessageEvent, ProductOfferEvent, PromoArticlesMessageEvent, PublishPhotoMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseErrorMessageEvent, PurchaseFromCatalogAsGiftComposer, PurchaseFromCatalogComposer, PurchaseNotAllowedMessageEvent, PurchaseOKMessageEvent, PurchasePhotoMessageComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestCancelledMessageEvent, QuestCompletedMessageEvent, QuestDailyMessageEvent, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, QuestMessageEvent, QuestsMessageEvent, QuizDataMessageEvent, QuizResultsMessageEvent, RateFlatMessageComposer, RedeemCommunityGoalPrizeMessageComposer, RedeemItemClothingComposer, RedeemMarketplaceOfferCreditsMessageComposer, RedeemVoucherMessageComposer, RejectQuestMessageComposer, RelationshipStatusInfoEvent, ReleaseIssuesMessageComposer, RemainingMuteEvent, RemoveAllRightsMessageComposer, RemoveFriendComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RemoveWallItemComposer, RenderRoomMessageComposer, RenderRoomThumbnailMessageComposer, RequestABadgeComposer, RequestAchievementsMessageComposer, RequestBadgesComposer, RequestBotCommandConfigurationComposer, RequestCameraConfigurationComposer, RequestFriendComposer, RequestFurniInventoryWhenNotInRoomComposer, RequestPetInfoComposer, RequestPetsComposer, RequestSpamWallPostItMessageEvent, ResetPhoneNumberStateMessageComposer, ResetResolutionAchievementMessageComposer, RespectReceivedEvent, RoomAdErrorEvent, RoomAdEventTabAdClickedComposer, RoomAdEventTabViewedComposer, RoomAdPurchaseInfoEvent, RoomAdPurchaseInitiatedComposer, RoomAdSearchMessageComposer, RoomAmbassadorAlertComposer, RoomBannedUsersComposer, RoomBanUserComposer, RoomChatlogEvent, RoomChatSettingsEvent, RoomCompetitionInitMessageComposer, RoomDeleteComposer, RoomDimmerPresetsEvent, RoomDoorbellAcceptedEvent, RoomDoorbellAccessComposer, RoomEnterComposer, RoomEnterErrorEvent, RoomEnterEvent, RoomEntryInfoMessageEvent, RoomEntryTileMessageEvent, RoomEventCancelEvent, RoomEventEvent, RoomFilterSettingsMessageEvent, RoomForwardEvent, RoomGiveRightsComposer, RoomHeightMapEvent, RoomHeightMapUpdateEvent, RoomInviteErrorEvent, RoomInviteEvent, RoomKickUserComposer, RoomMuteComposer, RoomMuteUserComposer, RoomOccupiedTilesMessageEvent, RoomPaintEvent, RoomReadyMessageEvent, RoomRightsClearEvent, RoomRightsEvent, RoomRightsOwnerEvent, RoomScoreEvent, RoomSettingsComposer, RoomSettingsDataEvent, RoomSettingsErrorEvent, RoomSettingsSavedEvent, RoomSettingsSaveErrorEvent, RoomSettingsUpdatedEvent, RoomsWhereMyFriendsAreSearchMessageComposer, RoomsWithHighestScoreSearchMessageComposer, RoomTakeRightsComposer, RoomTextSearchMessageComposer, RoomThumbnailUpdateResultEvent, RoomUnbanUserComposer, RoomUnitActionComposer, RoomUnitChatComposer, RoomUnitChatEvent, RoomUnitChatShoutComposer, RoomUnitChatShoutEvent, RoomUnitChatStyleComposer, RoomUnitChatWhisperComposer, RoomUnitChatWhisperEvent, RoomUnitDanceComposer, RoomUnitDanceEvent, RoomUnitDropHandItemComposer, RoomUnitEffectEvent, RoomUnitEvent, RoomUnitExpressionEvent, RoomUnitGiveHandItemComposer, RoomUnitGiveHandItemPetComposer, RoomUnitHandItemEvent, RoomUnitHandItemReceivedEvent, RoomUnitIdleEvent, RoomUnitInfoEvent, RoomUnitLookComposer, RoomUnitNumberEvent, RoomUnitPostureComposer, RoomUnitRemoveEvent, RoomUnitSignComposer, RoomUnitStatusEvent, RoomUnitTypingEvent, RoomUnitTypingStartComposer, RoomUnitTypingStopComposer, RoomUnitWalkComposer, RoomUsersWithRightsComposer, RoomVisitsEvent, RoomVisualizationSettingsEvent, SanctionStatusEvent, SaveRoomSettingsComposer, SaveWardrobeOutfitMessageComposer, ScrGetKickbackInfoMessageComposer, ScrSendKickbackInfoMessageEvent, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SeasonalQuestsMessageEvent, SecondsUntilMessageEvent, SelectClubGiftComposer, SellablePetPalettesMessageEvent, SendMessageComposer, SendRoomInviteComposer, SetActivatedBadgesComposer, SetItemDataMessageComposer, SetObjectDataMessageComposer, SetPhoneNumberVerificationStatusMessageComposer, SetRelationshipStatusComposer, SetRoomSessionTagsMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, ShowEnforceRoomCategoryDialogEvent, ShowMysteryBoxWaitMessageEvent, SSOTicketMessageComposer, StartCampaignMessageComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, ThreadMessagesMessageEvent, ThumbnailStatusMessageEvent, TogglePetBreedingComposer, TogglePetRidingComposer, ToggleStaffPickMessageComposer, TradingAcceptComposer, TradingAcceptEvent, TradingCancelComposer, TradingCloseComposer, TradingCloseEvent, TradingCompletedEvent, TradingConfirmationComposer, TradingConfirmationEvent, TradingListAddItemComposer, TradingListAddItemsComposer, TradingListItemEvent, TradingListItemRemoveComposer, TradingNotOpenEvent, TradingOpenComposer, TradingOpenEvent, TradingOpenFailedEvent, TradingOtherNotAllowedEvent, TradingUnacceptComposer, TradingYouAreNotAllowedEvent, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnignoreUserComposer, UniqueIDMessageComposer, UnloadGameMessageEvent, UnreadForumsCountMessageEvent, UnseenItemsEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateActionMessageComposer, UpdateConditionMessageComposer, UpdateFloorPropertiesMessageComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateHomeRoomMessageComposer, UpdateMessageMessageEvent, UpdateRoomFilterMessageComposer, UpdateRoomThumbnailMessageComposer, UpdateThreadMessageComposer, UpdateThreadMessageEvent, UpdateTriggerMessageComposer, UsePetProductComposer, UserBannedMessageEvent, UserChatlogEvent, UserCreditsEvent, UserCurrencyComposer, UserCurrencyEvent, UserCurrentBadgesComposer, UserCurrentBadgesEvent, UserEventCatsEvent, UserFigureComposer, UserFlatCatsEvent, UserGameAchievementsMessageEvent, UserInfoEvent, UserMottoComposer, UserNameChangeMessageEvent, UserPermissionsEvent, UserProfileComposer, UserProfileEvent, UserRelationshipsComposer, UserRespectComposer, UserSettingsCameraFollowComposer, UserSettingsEvent, UserSettingsOldChatComposer, UserSettingsRoomInvitesComposer, UserSettingsSoundComposer, UserSongDisksInventoryMessageEvent, UserSubscriptionComposer, UserSubscriptionEvent, UserTagsMessageEvent, UserUnbannedFromRoomEvent, UserWardrobePageEvent, VerifyCodeMessageComposer, VersionCheckMessageComposer, VisitUserComposer, VoteForRoomMessageComposer, VoucherRedeemErrorMessageEvent, VoucherRedeemOkMessageEvent, WardrobeMessageEvent, WiredFurniActionEvent, WiredFurniConditionEvent, WiredFurniTriggerEvent, WiredOpenEvent, WiredRewardResultMessageEvent, WiredSaveSuccessEvent, WiredValidationErrorEvent, YouArePlayingGameEvent, YouAreSpectatorMessageEvent, YoutubeControlVideoMessageEvent, YoutubeDisplayPlaylistsEvent, YoutubeDisplayVideoMessageEvent } from './messages'; +import { NewUserExperienceGiftOfferMessageEvent } from './messages/incoming/nux/NewUserExperienceGiftOfferMessageEvent'; +import { NewUserExperienceGetGiftsComposer } from './messages/outgoing/nux'; export class NitroMessages implements IMessageConfiguration { @@ -483,6 +485,9 @@ export class NitroMessages implements IMessageConfiguration // HANDSHAKE this._events.set(IncomingHeader.NOOBNESS_LEVEL, NoobnessLevelMessageEvent); + + // NUX + this._events.set(IncomingHeader.NEW_USER_EXPERIENCE_GIFT_OFFER, NewUserExperienceGiftOfferMessageEvent); } private registerComposers(): void @@ -1036,6 +1041,9 @@ export class NitroMessages implements IMessageConfiguration // TALENT this._composers.set(OutgoingHeader.HELPER_TALENT_TRACK, TalentTrackComposer); + + //NUX + this._composers.set(OutgoingHeader.NEW_USER_EXPERIENCE_GET_GIFTS, NewUserExperienceGetGiftsComposer); } public get events(): Map diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index c087f559..878344e1 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -404,4 +404,5 @@ export class IncomingHeader public static ROOM_SETTINGS_ERROR = 2897; public static SHOW_ENFORCE_ROOM_CATEGORY = 3896; public static CUSTOM_USER_NOTIFICATION = 909; + public static NEW_USER_EXPERIENCE_GIFT_OFFER = 3575; } diff --git a/src/nitro/communication/messages/incoming/nux/NewUserExperienceGift.ts b/src/nitro/communication/messages/incoming/nux/NewUserExperienceGift.ts new file mode 100644 index 00000000..ebf92403 --- /dev/null +++ b/src/nitro/communication/messages/incoming/nux/NewUserExperienceGift.ts @@ -0,0 +1,37 @@ +import { IMessageDataWrapper } from '../../../../../api'; +import { ProductOffer } from './ProductOffer'; + +export class NewUserExperienceGift +{ + private _thumbnailUrl: string; + private _productOfferList: ProductOffer[]; + + constructor(wrapper: IMessageDataWrapper) + { + this._thumbnailUrl = wrapper.readString(); + if(this._thumbnailUrl == '') + { + this._thumbnailUrl = null; + } + + this._productOfferList = []; + const count:number = wrapper.readInt(); + let totalOffers:number; + + while(totalOffers < count) + { + this._productOfferList.push(new ProductOffer(wrapper)); + totalOffers++; + } + } + + public get productOfferList(): ProductOffer[] + { + return this._productOfferList; + } + + public get thumbnailUrl(): string + { + return this._thumbnailUrl; + } +} diff --git a/src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOfferMessageEvent.ts b/src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOfferMessageEvent.ts new file mode 100644 index 00000000..3f8d4d06 --- /dev/null +++ b/src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOfferMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../api'; +import { MessageEvent } from '../../../../../events'; +import { NewUserExperienceGiftOfferMessageParser } from '../../parser/nux'; + +export class NewUserExperienceGiftOfferMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, NewUserExperienceGiftOfferMessageParser); + } + + public getParser(): NewUserExperienceGiftOfferMessageParser + { + return this.parser as NewUserExperienceGiftOfferMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOptions.ts b/src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOptions.ts new file mode 100644 index 00000000..bd61899d --- /dev/null +++ b/src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOptions.ts @@ -0,0 +1,40 @@ +import { IMessageDataWrapper } from '../../../../../api'; +import { NewUserExperienceGift } from './NewUserExperienceGift'; + +export class NewUserExperienceGiftOptions +{ + private _dayIndex: number; + private _stepIndex: number; + private _options: NewUserExperienceGift[]; + + constructor(wrapper: IMessageDataWrapper) + { + this._dayIndex = wrapper.readInt(); + this._stepIndex = wrapper.readInt(); + this._options = []; + + const _local_2:number = wrapper.readInt(); + let _local_3:number; + + while(_local_3 < _local_2) + { + this._options.push(new NewUserExperienceGift(wrapper)); + _local_3++; + } + } + + public get dayIndex(): number + { + return this._dayIndex; + } + + public get stepIndex(): number + { + return this._stepIndex; + } + + public get options(): NewUserExperienceGift[] + { + return this._options; + } +} diff --git a/src/nitro/communication/messages/incoming/nux/ProductOffer.ts b/src/nitro/communication/messages/incoming/nux/ProductOffer.ts new file mode 100644 index 00000000..9fc58b41 --- /dev/null +++ b/src/nitro/communication/messages/incoming/nux/ProductOffer.ts @@ -0,0 +1,28 @@ +import { IMessageDataWrapper } from '../../../../../api'; + +export class ProductOffer +{ + private _itemName: string; + private _extraInfo: string; + + constructor(wrapper: IMessageDataWrapper) + { + this._itemName = wrapper.readString(); + this._extraInfo = wrapper.readString(); + + if(this._extraInfo == '') + { + this._extraInfo = null; + } + } + + public get itemName(): string + { + return this._itemName; + } + + public get extraInfo(): string + { + return this._extraInfo; + } +} diff --git a/src/nitro/communication/messages/incoming/nux/index.ts b/src/nitro/communication/messages/incoming/nux/index.ts new file mode 100644 index 00000000..32252ed6 --- /dev/null +++ b/src/nitro/communication/messages/incoming/nux/index.ts @@ -0,0 +1,4 @@ +export * from './NewUserExperienceGift'; +export * from './NewUserExperienceGiftOfferMessageEvent'; +export * from './NewUserExperienceGiftOptions'; +export * from './ProductOffer'; diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 858ca318..694117fd 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -433,4 +433,5 @@ export class OutgoingHeader public static COMPOST_PLANT = 3835; public static HARVEST_PET = 1521; public static GROUP_UNFAVORITE = 1820; + public static NEW_USER_EXPERIENCE_GET_GIFTS = 1822; } diff --git a/src/nitro/communication/messages/outgoing/nux/NewUserExperienceGetGiftsComposer.ts b/src/nitro/communication/messages/outgoing/nux/NewUserExperienceGetGiftsComposer.ts new file mode 100644 index 00000000..1c12dbcb --- /dev/null +++ b/src/nitro/communication/messages/outgoing/nux/NewUserExperienceGetGiftsComposer.ts @@ -0,0 +1,28 @@ +import { IMessageComposer } from '../../../../../api'; +import { NewUserExperienceGetGiftsSelection } from './NewUserExperienceGetGiftsSelection'; + +export class NewUserExperienceGetGiftsComposer implements IMessageComposer> +{ + private _data: any; + + constructor(...data: NewUserExperienceGetGiftsSelection[]) + { + this._data = [data.length * 3]; + data.forEach(entry => + { + this._data.push(entry.dayIndex); + this._data.push(entry.stepIndex); + this._data.push(entry.giftIndex); + }); + } + + dispose(): void + { + this._data = null; + } + + public getMessageArray() + { + return this._data; + } +} diff --git a/src/nitro/communication/messages/outgoing/nux/NewUserExperienceGetGiftsSelection.ts b/src/nitro/communication/messages/outgoing/nux/NewUserExperienceGetGiftsSelection.ts new file mode 100644 index 00000000..fd95d6bb --- /dev/null +++ b/src/nitro/communication/messages/outgoing/nux/NewUserExperienceGetGiftsSelection.ts @@ -0,0 +1,28 @@ +export class NewUserExperienceGetGiftsSelection +{ + private _dayIndex: number; + private _stepIndex: number; + private _giftIndex: number; + + constructor(dayIndex: number, stepIndex: number, giftIndex: number) + { + this._dayIndex = dayIndex; + this._stepIndex = stepIndex; + this._giftIndex = giftIndex; + } + + public get dayIndex(): number + { + return this._dayIndex; + } + + public get stepIndex(): number + { + return this._stepIndex; + } + + public get giftIndex(): number + { + return this._giftIndex; + } +} diff --git a/src/nitro/communication/messages/outgoing/nux/index.ts b/src/nitro/communication/messages/outgoing/nux/index.ts new file mode 100644 index 00000000..cd8f6db9 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/nux/index.ts @@ -0,0 +1,2 @@ +export * from './NewUserExperienceGetGiftsComposer'; +export * from './NewUserExperienceGetGiftsSelection'; diff --git a/src/nitro/communication/messages/parser/nux/NewUserExperienceGiftOfferMessageParser.ts b/src/nitro/communication/messages/parser/nux/NewUserExperienceGiftOfferMessageParser.ts new file mode 100644 index 00000000..99922744 --- /dev/null +++ b/src/nitro/communication/messages/parser/nux/NewUserExperienceGiftOfferMessageParser.ts @@ -0,0 +1,34 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../api'; +import { NewUserExperienceGiftOptions } from '../../incoming/nux'; + +export class NewUserExperienceGiftOfferMessageParser implements IMessageParser +{ + private _giftOptions: NewUserExperienceGiftOptions[]; + + public flush(): boolean + { + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + const _local_2 = wrapper.readInt(); + this._giftOptions = []; + let _local_3:number; + + while(_local_3 < _local_2) + { + this._giftOptions.push(new NewUserExperienceGiftOptions(wrapper)); + _local_3++; + } + + return true; + } + + public get giftOptions(): NewUserExperienceGiftOptions[] + { + return this._giftOptions; + } +} diff --git a/src/nitro/communication/messages/parser/nux/index.ts b/src/nitro/communication/messages/parser/nux/index.ts new file mode 100644 index 00000000..9d88ec00 --- /dev/null +++ b/src/nitro/communication/messages/parser/nux/index.ts @@ -0,0 +1 @@ +export * from './NewUserExperienceGiftOfferMessageParser'; From ee3f59cda84768ca3bb73dcdd88afb51240ba47f Mon Sep 17 00:00:00 2001 From: Snaiker Date: Fri, 23 Dec 2022 22:15:59 +0000 Subject: [PATCH 2/2] Changes --- .../messages/incoming/nux/NewUserExperienceGift.ts | 6 +++--- .../messages/incoming/nux/NewUserExperienceGiftOptions.ts | 8 ++++---- .../parser/nux/NewUserExperienceGiftOfferMessageParser.ts | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/nitro/communication/messages/incoming/nux/NewUserExperienceGift.ts b/src/nitro/communication/messages/incoming/nux/NewUserExperienceGift.ts index ebf92403..ecc40454 100644 --- a/src/nitro/communication/messages/incoming/nux/NewUserExperienceGift.ts +++ b/src/nitro/communication/messages/incoming/nux/NewUserExperienceGift.ts @@ -16,12 +16,12 @@ export class NewUserExperienceGift this._productOfferList = []; const count:number = wrapper.readInt(); - let totalOffers:number; + let index = 0; - while(totalOffers < count) + while(index < count) { this._productOfferList.push(new ProductOffer(wrapper)); - totalOffers++; + index++; } } diff --git a/src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOptions.ts b/src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOptions.ts index bd61899d..ff2fd1b4 100644 --- a/src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOptions.ts +++ b/src/nitro/communication/messages/incoming/nux/NewUserExperienceGiftOptions.ts @@ -13,13 +13,13 @@ export class NewUserExperienceGiftOptions this._stepIndex = wrapper.readInt(); this._options = []; - const _local_2:number = wrapper.readInt(); - let _local_3:number; + const count:number = wrapper.readInt(); + let index = 0; - while(_local_3 < _local_2) + while(index < count) { this._options.push(new NewUserExperienceGift(wrapper)); - _local_3++; + index++; } } diff --git a/src/nitro/communication/messages/parser/nux/NewUserExperienceGiftOfferMessageParser.ts b/src/nitro/communication/messages/parser/nux/NewUserExperienceGiftOfferMessageParser.ts index 99922744..07c48d9e 100644 --- a/src/nitro/communication/messages/parser/nux/NewUserExperienceGiftOfferMessageParser.ts +++ b/src/nitro/communication/messages/parser/nux/NewUserExperienceGiftOfferMessageParser.ts @@ -14,14 +14,14 @@ export class NewUserExperienceGiftOfferMessageParser implements IMessageParser { if(!wrapper) return false; - const _local_2 = wrapper.readInt(); + const count = wrapper.readInt(); this._giftOptions = []; - let _local_3:number; + let index = 0; - while(_local_3 < _local_2) + while(index < count) { this._giftOptions.push(new NewUserExperienceGiftOptions(wrapper)); - _local_3++; + index++; } return true;