From 1bea85dd6ed73ff6c1eb0774641e1292e458681f Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Fri, 3 Sep 2021 01:33:00 -0300 Subject: [PATCH 001/108] Added GroupPurchasedEvent --- src/nitro/communication/NitroMessages.ts | 2 ++ .../messages/incoming/IncomingHeader.ts | 1 + .../incoming/group/GroupPurchasedEvent.ts | 16 +++++++++ .../messages/incoming/group/index.ts | 1 + .../parser/group/GroupPurchasedParser.ts | 35 +++++++++++++++++++ .../messages/parser/group/index.ts | 1 + 6 files changed, 56 insertions(+) create mode 100644 src/nitro/communication/messages/incoming/group/GroupPurchasedEvent.ts create mode 100644 src/nitro/communication/messages/parser/group/GroupPurchasedParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 3fdf2e18..416de5d2 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -45,6 +45,7 @@ import { GroupBuyDataEvent } from './messages/incoming/group/GroupBuyDataEvent'; import { GroupConfirmMemberRemoveEvent } from './messages/incoming/group/GroupConfirmMemberRemoveEvent'; import { GroupInformationEvent } from './messages/incoming/group/GroupInformationEvent'; import { GroupMembersEvent } from './messages/incoming/group/GroupMembersEvent'; +import { GroupPurchasedEvent } from './messages/incoming/group/GroupPurchasedEvent'; import { GroupSettingsEvent } from './messages/incoming/group/GroupSettingsEvent'; import { CallForHelpResultMessageEvent } from './messages/incoming/help/CallForHelpResultMessageEvent'; import { IncomingHeader } from './messages/incoming/IncomingHeader'; @@ -582,6 +583,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.GROUP_CREATE_OPTIONS, GroupBuyDataEvent); this._events.set(IncomingHeader.GROUP_BADGE_PARTS, GroupBadgePartsEvent); this._events.set(IncomingHeader.GROUP_SETTINGS, GroupSettingsEvent); + this._events.set(IncomingHeader.GROUP_PURCHASED, GroupPurchasedEvent); // HELP this._events.set(IncomingHeader.CFH_RESULT_MESSAGE, CallForHelpResultMessageEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 711e88d8..bdcab2fc 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -49,6 +49,7 @@ export class IncomingHeader public static GROUP_MEMBERS = 1200; public static GROUP_MEMBERS_REFRESH = 2445; public static GROUP_MEMBER_REMOVE_CONFIRM = 1876; + public static GROUP_PURCHASED = 2808; public static GROUP_SETTINGS = 3965; public static GROUP_BADGE_PARTS = 2238; public static ITEM_DIMMER_SETTINGS = 2710; diff --git a/src/nitro/communication/messages/incoming/group/GroupPurchasedEvent.ts b/src/nitro/communication/messages/incoming/group/GroupPurchasedEvent.ts new file mode 100644 index 00000000..3fb1723d --- /dev/null +++ b/src/nitro/communication/messages/incoming/group/GroupPurchasedEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GroupPurchasedParser } from '../../parser/group/GroupPurchasedParser'; + +export class GroupPurchasedEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GroupPurchasedParser); + } + + public getParser(): GroupPurchasedParser + { + return this.parser as GroupPurchasedParser; + } +} diff --git a/src/nitro/communication/messages/incoming/group/index.ts b/src/nitro/communication/messages/incoming/group/index.ts index 8dba73a7..ac39ba28 100644 --- a/src/nitro/communication/messages/incoming/group/index.ts +++ b/src/nitro/communication/messages/incoming/group/index.ts @@ -3,4 +3,5 @@ export * from './GroupBuyDataEvent'; export * from './GroupConfirmMemberRemoveEvent'; export * from './GroupInformationEvent'; export * from './GroupMembersEvent'; +export * from './GroupPurchasedEvent'; export * from './GroupSettingsEvent'; diff --git a/src/nitro/communication/messages/parser/group/GroupPurchasedParser.ts b/src/nitro/communication/messages/parser/group/GroupPurchasedParser.ts new file mode 100644 index 00000000..6696bd62 --- /dev/null +++ b/src/nitro/communication/messages/parser/group/GroupPurchasedParser.ts @@ -0,0 +1,35 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GroupPurchasedParser implements IMessageParser +{ + private _roomId: number; + private _groupId: number; + + flush(): boolean + { + this._roomId = 0; + this._groupId = 0; + + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._roomId = wrapper.readInt(); + this._groupId = wrapper.readInt(); + + return true; + } + + public get roomId(): number + { + return this._roomId; + } + + public get guildId(): number + { + return this._groupId; + } +} diff --git a/src/nitro/communication/messages/parser/group/index.ts b/src/nitro/communication/messages/parser/group/index.ts index 8532e9aa..6ece4610 100644 --- a/src/nitro/communication/messages/parser/group/index.ts +++ b/src/nitro/communication/messages/parser/group/index.ts @@ -3,5 +3,6 @@ export * from './GroupBuyDataParser'; export * from './GroupConfirmMemberRemoveParser'; export * from './GroupInformationParser'; export * from './GroupMembersParser'; +export * from './GroupPurchasedParser'; export * from './GroupSettingsParser'; export * from './utils'; From 54144c28c677e536595080425016c7f418490669 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Fri, 3 Sep 2021 02:08:49 -0300 Subject: [PATCH 002/108] Fix GroupBuyComposer --- .../communication/messages/outgoing/group/GroupBuyComposer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitro/communication/messages/outgoing/group/GroupBuyComposer.ts b/src/nitro/communication/messages/outgoing/group/GroupBuyComposer.ts index 38e1662a..f15c5360 100644 --- a/src/nitro/communication/messages/outgoing/group/GroupBuyComposer.ts +++ b/src/nitro/communication/messages/outgoing/group/GroupBuyComposer.ts @@ -6,7 +6,7 @@ export class GroupBuyComposer implements IMessageComposer constructor(name: string, description: string, roomId: number, colorA: number, colorB: number, badge: number[]) { - this._data = [ name, description, roomId, colorA, colorB, badge.length, badge ]; + this._data = [ name, description, roomId, colorA, colorB, badge.length, ...badge ]; } public getMessageArray() From 4e46c1510759b098951db69224693917c4b4cee9 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Fri, 3 Sep 2021 02:44:44 -0300 Subject: [PATCH 003/108] Fix FurnitureBadgeDisplayLogic --- .../room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts index 083b6bfc..b0f7be66 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts @@ -12,7 +12,7 @@ export class FurnitureBadgeDisplayLogic extends FurnitureLogic { public getEventTypes(): string[] { - const types = [ RoomObjectBadgeAssetEvent.LOAD_BADGE ]; + const types = [ RoomObjectWidgetRequestEvent.BADGE_DISPLAY_ENGRAVING, RoomObjectBadgeAssetEvent.LOAD_BADGE ]; return this.mergeTypes(super.getEventTypes(), types); } From 49f934b8209666a4dc956a867b2dd0e30508b6c9 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Fri, 3 Sep 2021 16:01:49 -0300 Subject: [PATCH 004/108] New Group packets --- src/nitro/communication/NitroMessages.ts | 6 +- .../messages/incoming/IncomingHeader.ts | 2 +- .../incoming/group/GroupBadgesEvent.ts | 16 +++++ .../messages/incoming/group/index.ts | 1 + .../messages/outgoing/OutgoingHeader.ts | 2 + .../outgoing/group/GroupBadgesComposer.ts | 21 ++++++ .../outgoing/group/GroupFavoriteComposer.ts | 21 ++++++ .../messages/outgoing/group/index.ts | 2 + .../parser/group/GroupBadgesParser.ts | 36 ++++++++++ .../messages/parser/group/index.ts | 1 + src/nitro/session/GroupInformationManager.ts | 72 +++++++++++++++++++ src/nitro/session/ISessionDataManager.ts | 3 + src/nitro/session/SessionDataManager.ts | 17 +++++ 13 files changed, 198 insertions(+), 2 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/group/GroupBadgesEvent.ts create mode 100644 src/nitro/communication/messages/outgoing/group/GroupBadgesComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/group/GroupFavoriteComposer.ts create mode 100644 src/nitro/communication/messages/parser/group/GroupBadgesParser.ts create mode 100644 src/nitro/session/GroupInformationManager.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 416de5d2..c417c7b1 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetDirectClubBuyAvailableComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetDirectClubBuyAvailableComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; @@ -278,6 +278,7 @@ import { GroupBuyComposer } from './messages/outgoing/group/GroupBuyComposer'; import { GroupBuyDataComposer } from './messages/outgoing/group/GroupBuyDataComposer'; import { GroupConfirmRemoveMemberComposer } from './messages/outgoing/group/GroupConfirmRemoveMemberComposer'; import { GroupDeleteComposer } from './messages/outgoing/group/GroupDeleteComposer'; +import { GroupFavoriteComposer } from './messages/outgoing/group/GroupFavoriteComposer'; import { GroupInformationComposer } from './messages/outgoing/group/GroupInformationComposer'; import { GroupJoinComposer } from './messages/outgoing/group/GroupJoinComposer'; import { GroupMembersComposer } from './messages/outgoing/group/GroupMembersComposer'; @@ -584,6 +585,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.GROUP_BADGE_PARTS, GroupBadgePartsEvent); this._events.set(IncomingHeader.GROUP_SETTINGS, GroupSettingsEvent); this._events.set(IncomingHeader.GROUP_PURCHASED, GroupPurchasedEvent); + this._events.set(IncomingHeader.GROUP_BADGES, GroupBadgesEvent); // HELP this._events.set(IncomingHeader.CFH_RESULT_MESSAGE, CallForHelpResultMessageEvent); @@ -971,6 +973,8 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.GROUP_SAVE_COLORS, GroupSaveColorsComposer); this._composers.set(OutgoingHeader.GROUP_SAVE_INFORMATION, GroupSaveInformationComposer); this._composers.set(OutgoingHeader.GROUP_SAVE_PREFERENCES, GroupSavePreferencesComposer); + this._composers.set(OutgoingHeader.GROUP_FAVORITE, GroupFavoriteComposer); + this._composers.set(OutgoingHeader.GROUP_BADGES, GroupBadgesComposer); // SECURITY this._composers.set(OutgoingHeader.SECURITY_TICKET, SecurityTicketComposer); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index bdcab2fc..0460359b 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -37,7 +37,7 @@ export class IncomingHeader public static GENERIC_ALERT = 3801; public static MODERATOR_MESSAGE = 2030; public static GENERIC_ERROR = 1600; - public static GIFT_WRAPPER_CONFIG = 2234; + public static GIFT_WRAPPER_CONFIG = 2234; public static GROUP_BADGES = 2402; public static GROUP_CREATE_OPTIONS = 2159; public static GROUP_FORUM_INFO = 3011; diff --git a/src/nitro/communication/messages/incoming/group/GroupBadgesEvent.ts b/src/nitro/communication/messages/incoming/group/GroupBadgesEvent.ts new file mode 100644 index 00000000..4eb278d3 --- /dev/null +++ b/src/nitro/communication/messages/incoming/group/GroupBadgesEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GroupBadgesParser } from '../../parser/group/GroupBadgesParser'; + +export class GroupBadgesEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GroupBadgesParser); + } + + public getParser(): GroupBadgesParser + { + return this.parser as GroupBadgesParser; + } +} diff --git a/src/nitro/communication/messages/incoming/group/index.ts b/src/nitro/communication/messages/incoming/group/index.ts index ac39ba28..607855e1 100644 --- a/src/nitro/communication/messages/incoming/group/index.ts +++ b/src/nitro/communication/messages/incoming/group/index.ts @@ -1,4 +1,5 @@ export * from './GroupBadgePartsEvent'; +export * from './GroupBadgesEvent'; export * from './GroupBuyDataEvent'; export * from './GroupConfirmMemberRemoveEvent'; export * from './GroupInformationEvent'; diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 43ce08c0..8ebd3888 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -40,6 +40,7 @@ export class OutgoingHeader public static GROUP_ADMIN_ADD = 2894; public static GROUP_ADMIN_REMOVE = 722; public static GROUP_CREATE_OPTIONS = 798; + public static GROUP_FAVORITE = 3549; public static GROUP_FORUM_INFO = 3149; public static GROUP_FORUM_LIST = 873; public static GROUP_FORUM_THREADS = 436; @@ -59,6 +60,7 @@ export class OutgoingHeader public static GROUP_SAVE_BADGE = 1991; public static GROUP_SAVE_COLORS = 1764; public static GROUP_SAVE_PREFERENCES = 3435; + public static GROUP_BADGES = 21; public static INVENTORY_UNKNOWN = 1371; public static ITEM_CLOTHING_REDEEM = 3374; public static ITEM_COLOR_WHEEL_CLICK = 2144; diff --git a/src/nitro/communication/messages/outgoing/group/GroupBadgesComposer.ts b/src/nitro/communication/messages/outgoing/group/GroupBadgesComposer.ts new file mode 100644 index 00000000..f43c167e --- /dev/null +++ b/src/nitro/communication/messages/outgoing/group/GroupBadgesComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GroupBadgesComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/group/GroupFavoriteComposer.ts b/src/nitro/communication/messages/outgoing/group/GroupFavoriteComposer.ts new file mode 100644 index 00000000..b8a941d3 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/group/GroupFavoriteComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GroupFavoriteComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(groupId: number) + { + this._data = [ groupId ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/group/index.ts b/src/nitro/communication/messages/outgoing/group/index.ts index f830f016..bf1b8fc3 100644 --- a/src/nitro/communication/messages/outgoing/group/index.ts +++ b/src/nitro/communication/messages/outgoing/group/index.ts @@ -1,10 +1,12 @@ export * from './GroupAdminGiveComposer'; export * from './GroupAdminTakeComposer'; export * from './GroupBadgePartsComposer'; +export * from './GroupBadgesComposer'; export * from './GroupBuyComposer'; export * from './GroupBuyDataComposer'; export * from './GroupConfirmRemoveMemberComposer'; export * from './GroupDeleteComposer'; +export * from './GroupFavoriteComposer'; export * from './GroupInformationComposer'; export * from './GroupJoinComposer'; export * from './GroupMembersComposer'; diff --git a/src/nitro/communication/messages/parser/group/GroupBadgesParser.ts b/src/nitro/communication/messages/parser/group/GroupBadgesParser.ts new file mode 100644 index 00000000..85789225 --- /dev/null +++ b/src/nitro/communication/messages/parser/group/GroupBadgesParser.ts @@ -0,0 +1,36 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GroupBadgesParser implements IMessageParser +{ + private _badges: Map; + + flush(): boolean + { + this._badges = new Map(); + + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + let badgesCount = wrapper.readInt(); + + while(badgesCount > 0) + { + const id = wrapper.readInt(); + const badge = wrapper.readString(); + + this._badges.set(id, badge); + badgesCount--; + } + + return true; + } + + public get badges(): Map + { + return this._badges; + } +} diff --git a/src/nitro/communication/messages/parser/group/index.ts b/src/nitro/communication/messages/parser/group/index.ts index 6ece4610..1c04c870 100644 --- a/src/nitro/communication/messages/parser/group/index.ts +++ b/src/nitro/communication/messages/parser/group/index.ts @@ -1,4 +1,5 @@ export * from './GroupBadgePartsParser'; +export * from './GroupBadgesParser'; export * from './GroupBuyDataParser'; export * from './GroupConfirmMemberRemoveParser'; export * from './GroupInformationParser'; diff --git a/src/nitro/session/GroupInformationManager.ts b/src/nitro/session/GroupInformationManager.ts new file mode 100644 index 00000000..a989551a --- /dev/null +++ b/src/nitro/session/GroupInformationManager.ts @@ -0,0 +1,72 @@ +import { IDisposable } from '../../core/common/disposable/IDisposable'; +import { IMessageEvent } from '../../core/communication/messages/IMessageEvent'; +import { GroupBadgesEvent } from '../communication/messages/incoming/group/GroupBadgesEvent'; +import { GroupBadgesComposer } from '../communication/messages/outgoing/group/GroupBadgesComposer'; +import { SessionDataManager } from './SessionDataManager'; + +export class GroupInformationManager implements IDisposable +{ + private _sessionDataManager: SessionDataManager; + private _groupBadges: Map; + + private _messages: IMessageEvent[]; + + constructor(sessionDataManager: SessionDataManager) + { + this._sessionDataManager = sessionDataManager; + this._groupBadges = new Map(); + } + + public init(): void + { + if(this._sessionDataManager && this._sessionDataManager.communication) + { + this._messages = [ + new GroupBadgesEvent(this.onGroupBadgesEvent.bind(this)) + ]; + + for(const message of this._messages) this._sessionDataManager.communication.registerMessageEvent(message); + } + } + + public dispose(): void + { + if(this.disposed) return; + + if(this._messages && this._messages.length) + { + for(const message of this._messages) this._sessionDataManager.communication.removeMessageEvent(message); + + this._messages = null; + } + + this._groupBadges = null; + this._sessionDataManager = null; + } + + public requestGroupBadges(): void + { + this._sessionDataManager.send(new GroupBadgesComposer()); + } + + private onGroupBadgesEvent(event: GroupBadgesEvent): void + { + if(!event) return; + + const parser = event.getParser(); + + if(!parser) return; + + this._groupBadges = parser.badges; + } + + public getGroupBadge(groupId: number): string + { + return this._groupBadges.get(groupId); + } + + public get disposed(): boolean + { + return !!this._sessionDataManager; + } +} diff --git a/src/nitro/session/ISessionDataManager.ts b/src/nitro/session/ISessionDataManager.ts index 51a598c3..22e5000a 100644 --- a/src/nitro/session/ISessionDataManager.ts +++ b/src/nitro/session/ISessionDataManager.ts @@ -3,6 +3,7 @@ import { INitroManager } from '../../core/common/INitroManager'; import { INitroCommunicationManager } from '../communication/INitroCommunicationManager'; import { IFurnitureData } from './furniture/IFurnitureData'; import { IFurnitureDataListener } from './furniture/IFurnitureDataListener'; +import { GroupInformationManager } from './GroupInformationManager'; import { IgnoredUsersManager } from './IgnoredUsersManager'; import { IProductData } from './product/IProductData'; @@ -29,6 +30,7 @@ export interface ISessionDataManager extends INitroManager ignoreUser(name: string): void; unignoreUser(name: string): void; isUserIgnored(name: string): boolean; + getGroupBadge(groupId: number): string; communication: INitroCommunicationManager; userId: number; userName: string; @@ -37,6 +39,7 @@ export interface ISessionDataManager extends INitroManager isGodMode: boolean; realName: string; ignoredUsersManager: IgnoredUsersManager; + groupInformationManager: GroupInformationManager; respectsReceived: number; respectsLeft: number; respectsPetLeft: number; diff --git a/src/nitro/session/SessionDataManager.ts b/src/nitro/session/SessionDataManager.ts index 47c468a9..7b78bb8a 100644 --- a/src/nitro/session/SessionDataManager.ts +++ b/src/nitro/session/SessionDataManager.ts @@ -26,6 +26,7 @@ import { UserNameUpdateEvent } from './events/UserNameUpdateEvent'; import { FurnitureDataLoader } from './furniture/FurnitureDataLoader'; import { IFurnitureData } from './furniture/IFurnitureData'; import { IFurnitureDataListener } from './furniture/IFurnitureDataListener'; +import { GroupInformationManager } from './GroupInformationManager'; import { IgnoredUsersManager } from './IgnoredUsersManager'; import { ISessionDataManager } from './ISessionDataManager'; import { IProductData } from './product/IProductData'; @@ -47,6 +48,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana private _canChangeName: boolean; private _ignoredUsersManager: IgnoredUsersManager; + private _groupInformationManager: GroupInformationManager; private _clubLevel: number; private _securityLevel: number; @@ -82,6 +84,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana this.resetUserInfo(); this._ignoredUsersManager = new IgnoredUsersManager(this); + this._groupInformationManager = new GroupInformationManager(this); this._clubLevel = 0; this._securityLevel = 0; @@ -111,6 +114,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana this.onProductDataReadyEvent = this.onProductDataReadyEvent.bind(this); this.onNitroSettingsEvent = this.onNitroSettingsEvent.bind(this); } + groupInformationManager: GroupInformationManager; protected onInit(): void { @@ -119,6 +123,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana this.loadBadgeImageManager(); (this._ignoredUsersManager && this._ignoredUsersManager.init()); + (this._groupInformationManager && this._groupInformationManager.init()); this._communication.registerMessageEvent(new FigureUpdateEvent(this.onUserFigureEvent.bind(this))); this._communication.registerMessageEvent(new UserInfoEvent(this.onUserInfoEvent.bind(this))); @@ -144,6 +149,13 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana this._ignoredUsersManager = null; } + if(this._groupInformationManager) + { + this._groupInformationManager.dispose(); + + this._groupInformationManager = null; + } + Nitro.instance.events.removeEventListener(NitroSettingsEvent.SETTINGS_UPDATED, this.onNitroSettingsEvent); super.onDispose(); @@ -541,6 +553,11 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana return (this._ignoredUsersManager && this._ignoredUsersManager.isIgnored(name)); } + public getGroupBadge(groupId: number): string + { + return (this._groupInformationManager && this._groupInformationManager.getGroupBadge(groupId)); + } + public send(composer: IMessageComposer): void { this._communication.connection.send(composer); From 612afb8025d56c65945f494b60e8f5542f43962e Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 4 Sep 2021 00:33:25 -0400 Subject: [PATCH 005/108] Allow multiple external text urls --- .../localization/NitroLocalizationManager.ts | 44 ++++++++++++++++--- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/src/nitro/localization/NitroLocalizationManager.ts b/src/nitro/localization/NitroLocalizationManager.ts index 2499938e..bef2a2d9 100644 --- a/src/nitro/localization/NitroLocalizationManager.ts +++ b/src/nitro/localization/NitroLocalizationManager.ts @@ -9,6 +9,7 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca private _definitions: Map; private _parameters: Map>; private _romanNumerals: string[]; + private _pendingUrls: string[]; constructor() { @@ -17,28 +18,55 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca this._definitions = new Map(); this._parameters = new Map(); this._romanNumerals = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', 'XXI', 'XXII', 'XXIII', 'XXIV', 'XXV', 'XXVI', 'XXVII', 'XXVIII', 'XXIX', 'XXX']; + this._pendingUrls = []; } protected onInit(): void { - this.loadLocalizationFromURL(Nitro.instance.getConfiguration('external.texts.url')); + //@ts-ignore + let urls: string[] = Nitro.instance.getConfiguration('external.texts.url'); + + if(!Array.isArray(urls)) + { + urls = [ Nitro.instance.getConfiguration('external.texts.url') ]; + } + + this._pendingUrls = urls; + + this.loadNextLocalization(); + } + + private loadNextLocalization(): void + { + if(!this._pendingUrls.length) + { + this.events && this.events.dispatchEvent(new NitroLocalizationEvent(NitroLocalizationEvent.LOADED)); + + return; + } + + this.loadLocalizationFromURL(this._pendingUrls[0]); } public loadLocalizationFromURL(url: string): void { fetch(url) .then(response => response.json()) - .then(data => this.onLocalizationLoaded(data)) + .then(data => this.onLocalizationLoaded(data, url)) .catch(err => this.onLocalizationFailed(err)); } - private onLocalizationLoaded(data: { [index: string]: any }): void + private onLocalizationLoaded(data: { [index: string]: any }, url: string): void { if(!data) return; - this.parseLocalization(data); + if(!this.parseLocalization(data)) return; - this.events && this.events.dispatchEvent(new NitroLocalizationEvent(NitroLocalizationEvent.LOADED)); + const index = this._pendingUrls.indexOf(url); + + if(index >= 0) this._pendingUrls.splice(index, 1); + + this.loadNextLocalization(); } private onLocalizationFailed(error: Error): void @@ -46,11 +74,13 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca this.events && this.events.dispatchEvent(new NitroLocalizationEvent(NitroLocalizationEvent.FAILED)); } - private parseLocalization(data: { [index: string]: any }): void + private parseLocalization(data: { [index: string]: any }): boolean { - if(!data) return; + if(!data) return false; for(const key in data) this._definitions.set(key, data[key]); + + return true; } public getRomanNumeral(number: number): string From 76e9344222bae2f2f9ad68326ffd4d14f0c83102 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 4 Sep 2021 00:37:24 -0400 Subject: [PATCH 006/108] Fix url --- src/nitro/localization/NitroLocalizationManager.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nitro/localization/NitroLocalizationManager.ts b/src/nitro/localization/NitroLocalizationManager.ts index bef2a2d9..892c713d 100644 --- a/src/nitro/localization/NitroLocalizationManager.ts +++ b/src/nitro/localization/NitroLocalizationManager.ts @@ -31,6 +31,8 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca urls = [ Nitro.instance.getConfiguration('external.texts.url') ]; } + for(let i = 0; i < urls.length; i++) urls[i] = Nitro.instance.core.configuration.interpolate(urls[i]); + this._pendingUrls = urls; this.loadNextLocalization(); From 25bf909d6f3fbfbc4e0a923f112e8c2e0d908980 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 4 Sep 2021 00:38:59 -0400 Subject: [PATCH 007/108] Remove ts ignore --- package.json | 1 + src/nitro/localization/NitroLocalizationManager.ts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c56be1bc..ace00f84 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "type": "git", "url": "https://git.krews.org/nitro/nitro-renderer" }, + "main": "./index.ts", "scripts": { "compile": "tsc --project ./tsconfig.json", "eslint": "eslint ./src --fix" diff --git a/src/nitro/localization/NitroLocalizationManager.ts b/src/nitro/localization/NitroLocalizationManager.ts index 892c713d..a1183edb 100644 --- a/src/nitro/localization/NitroLocalizationManager.ts +++ b/src/nitro/localization/NitroLocalizationManager.ts @@ -23,7 +23,6 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca protected onInit(): void { - //@ts-ignore let urls: string[] = Nitro.instance.getConfiguration('external.texts.url'); if(!Array.isArray(urls)) From 9432c8b6d86f6cda39df036b8aa3fc9942ec2141 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 5 Sep 2021 21:15:38 -0300 Subject: [PATCH 008/108] we --- src/nitro/session/badge/BadgeImageManager.ts | 275 +++++++++++++++++++ src/nitro/session/badge/GroupBadge.ts | 31 +++ src/nitro/session/badge/GroupBadgePart.ts | 69 +++++ src/nitro/session/badge/index.ts | 2 + 4 files changed, 377 insertions(+) create mode 100644 src/nitro/session/badge/BadgeImageManager.ts create mode 100644 src/nitro/session/badge/GroupBadge.ts create mode 100644 src/nitro/session/badge/GroupBadgePart.ts create mode 100644 src/nitro/session/badge/index.ts diff --git a/src/nitro/session/badge/BadgeImageManager.ts b/src/nitro/session/badge/BadgeImageManager.ts new file mode 100644 index 00000000..c95b5c36 --- /dev/null +++ b/src/nitro/session/badge/BadgeImageManager.ts @@ -0,0 +1,275 @@ +import { Resource, Texture } from '@pixi/core'; +import { BadgeTypeEnum, GroupBadge } from '.'; +import { IAssetManager } from '../../../core/asset/IAssetManager'; +import { IMessageEvent } from '../../../core/communication/messages/IMessageEvent'; +import { NitroSprite } from '../../../core/utils/proxy/NitroSprite'; +import { GroupBadgePartsEvent } from '../../communication/messages/incoming/group/GroupBadgePartsEvent'; +import { GroupBadgePartsComposer } from '../../communication/messages/outgoing/group/GroupBadgePartsComposer'; +import { Nitro } from '../../Nitro'; +import { BadgeImageReadyEvent } from '../events/BadgeImageReadyEvent'; +import { ISessionDataManager } from '../ISessionDataManager'; +import { TextureUtils } from './../../../room/utils/TextureUtils'; +import { SessionDataManager } from './../SessionDataManager'; +import { BadgeInfo } from './BadgeInfo'; +import { GroupBadgePart } from './GroupBadgePart'; +import { IBadgeImageManager } from './IBadgeImageManager'; + +export class BadgeImageManager implements IBadgeImageManager +{ + private _assets: IAssetManager; + private _sessionDataManager: SessionDataManager; + private _messages: IMessageEvent[]; + + private _groupBases: Map; + private _groupSymbols: Map; + private _groupPartColors: Map; + + private _requestedBadges: Map; + private _groupBadgesQueue: Map; + + private _readyToGenerateGroupBadges: boolean; + + constructor(assetManager: IAssetManager, sessionDataManager: ISessionDataManager) + { + this._assets = assetManager; + this._sessionDataManager = sessionDataManager; + + this._groupBases = new Map(); + this._groupSymbols = new Map(); + this._groupPartColors = new Map(); + + this._requestedBadges = new Map(); + + this._readyToGenerateGroupBadges = false; + } + + public init(): void + { + if(this._sessionDataManager && this._sessionDataManager.communication) + { + this._messages = [ + new GroupBadgePartsEvent(this.onGroupBadgePartsEvent.bind(this)) + ]; + + for(const message of this._messages) this._sessionDataManager.communication.registerMessageEvent(message); + + this._sessionDataManager.send(new GroupBadgePartsComposer()); + } + } + + public dispose(): void + { + if(this._messages && this._messages.length) + { + for(const message of this._messages) this._sessionDataManager.communication.removeMessageEvent(message); + + this._messages = null; + } + + this._sessionDataManager = null; + } + + public getBadgeImage(badgeName: string, type: string = BadgeTypeEnum.NORMAL_BADGE, load: boolean = true): Texture + { + let badge = this.getBadgeTexture(badgeName, type); + + if(!badge && load) badge = this.getBadgePlaceholder(); + + return badge; + } + + public getBadgeInfo(k: string): BadgeInfo + { + const badge = this.getBadgeTexture(k); + + return (badge) ? new BadgeInfo(badge, false) : new BadgeInfo(this.getBadgePlaceholder(), true); + } + + public loadBadgeImage(badgeName: string, type: string = BadgeTypeEnum.NORMAL_BADGE): string + { + if(this._assets.getTexture(this.getBadgeUrl(badgeName, type))) return badgeName; + + this.getBadgeTexture(badgeName, type); + + return null; + } + + private getBadgeTexture(badgeName: string, type: string = BadgeTypeEnum.NORMAL_BADGE): Texture + { + const url = this.getBadgeUrl(badgeName, type); + + const existing = this._assets.getTexture(url); + + if(existing) return existing.clone(); + + if(this._requestedBadges.get(badgeName)) return null; + + if(url) + { + this._requestedBadges.set(badgeName, true); + + if(type === BadgeTypeEnum.NORMAL_BADGE) + { + this._assets.downloadAsset(url, (flag: boolean) => + { + if(flag) + { + this._requestedBadges.delete(badgeName); + + const texture = this._assets.getTexture(url); + + if(texture && this._sessionDataManager) this._sessionDataManager.events.dispatchEvent(new BadgeImageReadyEvent(badgeName, texture.clone())); + } + }); + } + else + { + if(!this._readyToGenerateGroupBadges) + { + if(this._groupBadgesQueue.get(badgeName)) this._groupBadgesQueue.set(badgeName, true); + } + else + { + this.loadGroupBadge(badgeName); + } + } + } + + return null; + } + + private getBadgePlaceholder(): Texture + { + const url = (Nitro.instance.getConfiguration('images.url') + '/loading_icon.png'); + const existing = this._assets.getTexture(url); + + if(!existing) return null; + + return existing.clone(); + } + + public getBadgeUrl(badge: string, type: string = BadgeTypeEnum.NORMAL_BADGE): string + { + let url = null; + + switch(type) + { + case BadgeTypeEnum.NORMAL_BADGE: + url = (Nitro.instance.getConfiguration('badge.asset.url')).replace('%badgename%', badge); + break; + case BadgeTypeEnum.GROUP_BADGE: + //url = (Nitro.instance.getConfiguration('badge.asset.group.url')).replace('%badgedata%', badge); + url = badge; + break; + } + + return url; + } + + private loadGroupBadge(badgeCode: string): void + { + const groupBadge = new GroupBadge(badgeCode); + const imagePath = Nitro.instance.getConfiguration('badge.asset.grouparts.url'); + + const urlsToLoad: string[] = []; + + for(let i = 0; i < badgeCode.length; i += 6) + { + const partType = badgeCode.slice(i, i + 1); + + let partId = parseInt(badgeCode.slice(i + 1, i + 3)); + const partColor = parseInt(badgeCode.slice(i + 3, i + 5)); + const partPosition = parseInt(badgeCode.slice(i + 5, i + 6)); + + if(partType === 't') partId += 100; + + const part = new GroupBadgePart(partType, partId, partColor, partPosition); + groupBadge.parts.push(part); + + const isBase = (partType === 'b'); + + const requiredAssets = isBase ? this._groupBases.get(partId) : this._groupSymbols.get(partId); + + for(const requiredAsset of requiredAssets) + { + if(requiredAsset.length > 0) + { + const url = imagePath.replace('%part%', requiredAsset); + part.urls.push(url); + + if(!this._assets.getAsset(requiredAsset)) urlsToLoad.push(url); + } + } + } + + if(urlsToLoad.length === 0) return this.renderGroupBadge(groupBadge); + + this._assets.downloadAssets(urlsToLoad, (flag: boolean) => + { + this.renderGroupBadge(groupBadge); + }); + } + + private renderGroupBadge(groupBadge: GroupBadge): void + { + for(const part of groupBadge.parts) + { + for(const partUrl of part.urls) + { + const texture = this._assets.getTexture(partUrl); + + if(!texture) continue; //Generate with what we got + + const pos = part.calculatePosition(texture); + + const sprite = new NitroSprite(texture); + sprite.x = pos.x; + sprite.y = pos.y; + sprite.tint = parseInt(this._groupPartColors.get(part.color), 16); + + groupBadge.container.addChild(sprite); + } + } + + this._requestedBadges.delete(groupBadge.code); + this._groupBadgesQueue.delete(groupBadge.code); + + const texture = TextureUtils.generateTexture(groupBadge.container); + + this._assets.setTexture(groupBadge.code, texture); + + if(this._sessionDataManager) this._sessionDataManager.events.dispatchEvent(new BadgeImageReadyEvent(groupBadge.code, texture)); + } + + private onGroupBadgePartsEvent(event: GroupBadgePartsEvent): void + { + if(!event) return; + + const data = event.getParser(); + + if(!data) return; + + data.bases.forEach( (names, id) => + { + this._groupBases.set(id, names.map( val => val.replace('.png', '').replace('.gif', ''))); + }); + + data.symbols.forEach( (names, id) => + { + this._groupSymbols.set(id, names.map( val => val.replace('.png', '').replace('.gif', ''))); + }); + + this._groupPartColors = data.partColors; + this._readyToGenerateGroupBadges = true; + + this._groupBadgesQueue.forEach((_, badgeCode) => + { + this.loadGroupBadge(badgeCode); + }); + } + + public get disposed(): boolean + { + return !!this._sessionDataManager; + } +} diff --git a/src/nitro/session/badge/GroupBadge.ts b/src/nitro/session/badge/GroupBadge.ts new file mode 100644 index 00000000..b9064693 --- /dev/null +++ b/src/nitro/session/badge/GroupBadge.ts @@ -0,0 +1,31 @@ +import { NitroContainer } from '../../..'; +import { GroupBadgePart } from './GroupBadgePart'; + +export class GroupBadge +{ + private _code: string; + private _parts: GroupBadgePart[]; + private _container: NitroContainer; + + constructor(code: string) + { + this._code = code; + this._parts = []; + this._container = new NitroContainer(); + } + + public get code(): string + { + return this._code; + } + + public get parts(): GroupBadgePart[] + { + return this._parts; + } + + public get container(): NitroContainer + { + return this._container; + } +} diff --git a/src/nitro/session/badge/GroupBadgePart.ts b/src/nitro/session/badge/GroupBadgePart.ts new file mode 100644 index 00000000..4b545d90 --- /dev/null +++ b/src/nitro/session/badge/GroupBadgePart.ts @@ -0,0 +1,69 @@ +import { NitroPoint, NitroTexture } from '../../..'; + +export class GroupBadgePart +{ + public static BASE: string = 'b'; + public static SYMBOL: string = 's'; + public static SYMBOL_ALT: string = 't'; + + public static BASE_PART: number = 0; + public static LAYER_PART: number = 1; + public static IMAGE_WIDTH: number = 39; + public static IMAGE_HEIGHT: number = 39; + public static CELL_WIDTH: number = 13; + public static CELL_HEIGHT: number = 13; + + public type: string; + public key: number; + public color: number; + public position: number; + public urls: string[]; + + constructor(type: string, key?: number, color?: number, position?: number) + { + this.type = type; + this.key = key ? key : 0; + this.color = color ? color : 0; + this.position = position ? position : 4; + this.urls = []; + } + + public get code(): string + { + if(this.key === 0) return null; + + return GroupBadgePart.getCode(this.type, this.key, this.color, this.position); + } + + public static getCode(type: string, key: number, color: number, position: number): string + { + return (type === GroupBadgePart.BASE ? type : key >= 100 ? GroupBadgePart.SYMBOL_ALT : GroupBadgePart.SYMBOL) + (key < 10 ? '0' : '') + (type === GroupBadgePart.BASE ? key : key >= 100 ? key - 100 : key) + (color < 10 ? '0' : '') + color + position; + } + + public calculatePosition(asset: NitroTexture) : NitroPoint + { + const gridPos = this.calculateGridPos(this.position); + + let x: number = (((GroupBadgePart.CELL_WIDTH * gridPos.x) + (GroupBadgePart.CELL_WIDTH / 2)) - (asset.width / 2)); + let y: number = (((GroupBadgePart.CELL_HEIGHT * gridPos.y) + (GroupBadgePart.CELL_HEIGHT / 2)) - (asset.height / 2)); + + if(x < 0) x = 0; + + if((x + asset.width) > GroupBadgePart.IMAGE_WIDTH) x = (GroupBadgePart.IMAGE_WIDTH - asset.width); + + if(y < 0) y = 0; + + if((y + asset.height) > GroupBadgePart.IMAGE_HEIGHT) y = (GroupBadgePart.IMAGE_HEIGHT - asset.height); + + return new NitroPoint(Math.floor(x), Math.floor(y)); + } + + private calculateGridPos(gridVal: number): NitroPoint + { + const point = new NitroPoint(); + point.x = Math.floor((gridVal % 3)); + point.y = Math.floor((gridVal / 3)); + + return point; + } +} diff --git a/src/nitro/session/badge/index.ts b/src/nitro/session/badge/index.ts new file mode 100644 index 00000000..fa31d966 --- /dev/null +++ b/src/nitro/session/badge/index.ts @@ -0,0 +1,2 @@ +export * from './BadgeImageManager'; +export * from './GroupBadgePart'; From 475a83cb268ce36934b9d2310f3e287aef844a07 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 5 Sep 2021 22:30:30 -0300 Subject: [PATCH 009/108] Working --- .../parser/group/GroupSettingsParser.ts | 8 +- ...roupBadgePart.ts => GroupDataBadgePart.ts} | 2 +- .../messages/parser/group/utils/index.ts | 2 +- src/nitro/session/BadgeImageManager.ts | 108 ------------------ src/nitro/session/SessionDataManager.ts | 5 +- src/nitro/session/badge/BadgeImageManager.ts | 43 ++++--- src/nitro/session/{ => badge}/BadgeInfo.ts | 0 src/nitro/session/badge/index.ts | 2 + src/nitro/session/index.ts | 3 +- 9 files changed, 37 insertions(+), 136 deletions(-) rename src/nitro/communication/messages/parser/group/utils/{GroupBadgePart.ts => GroupDataBadgePart.ts} (94%) delete mode 100644 src/nitro/session/BadgeImageManager.ts rename src/nitro/session/{ => badge}/BadgeInfo.ts (100%) diff --git a/src/nitro/communication/messages/parser/group/GroupSettingsParser.ts b/src/nitro/communication/messages/parser/group/GroupSettingsParser.ts index 289ad01b..291033fb 100644 --- a/src/nitro/communication/messages/parser/group/GroupSettingsParser.ts +++ b/src/nitro/communication/messages/parser/group/GroupSettingsParser.ts @@ -1,5 +1,5 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { GroupBadgePart } from './utils/GroupBadgePart'; +import { GroupDataBadgePart } from './utils/GroupDataBadgePart'; export class GroupSettingsParser implements IMessageParser { @@ -12,7 +12,7 @@ export class GroupSettingsParser implements IMessageParser private _colorB: number; private _state: number; private _canMembersDecorate: boolean; - private _badgeParts: Map; + private _badgeParts: Map; private _badgeCode: string; private _membersCount: number; @@ -67,7 +67,7 @@ export class GroupSettingsParser implements IMessageParser for(let i = 0; i < badgePartsCount; i++) { - const part = new GroupBadgePart(i === 0); + const part = new GroupDataBadgePart(i === 0); part.key = wrapper.readInt(); part.color = wrapper.readInt(); @@ -132,7 +132,7 @@ export class GroupSettingsParser implements IMessageParser return this._canMembersDecorate; } - public get badgeParts(): Map + public get badgeParts(): Map { return this._badgeParts; } diff --git a/src/nitro/communication/messages/parser/group/utils/GroupBadgePart.ts b/src/nitro/communication/messages/parser/group/utils/GroupDataBadgePart.ts similarity index 94% rename from src/nitro/communication/messages/parser/group/utils/GroupBadgePart.ts rename to src/nitro/communication/messages/parser/group/utils/GroupDataBadgePart.ts index bc7010af..7ebdb588 100644 --- a/src/nitro/communication/messages/parser/group/utils/GroupBadgePart.ts +++ b/src/nitro/communication/messages/parser/group/utils/GroupDataBadgePart.ts @@ -1,4 +1,4 @@ -export class GroupBadgePart +export class GroupDataBadgePart { public isBase: boolean; public key: number; diff --git a/src/nitro/communication/messages/parser/group/utils/index.ts b/src/nitro/communication/messages/parser/group/utils/index.ts index 7b7b9649..5daf3554 100644 --- a/src/nitro/communication/messages/parser/group/utils/index.ts +++ b/src/nitro/communication/messages/parser/group/utils/index.ts @@ -1,3 +1,3 @@ -export * from './GroupBadgePart'; +export * from './GroupDataBadgePart'; export * from './GroupDataParser'; export * from './GroupMemberParser'; diff --git a/src/nitro/session/BadgeImageManager.ts b/src/nitro/session/BadgeImageManager.ts deleted file mode 100644 index 89d112b6..00000000 --- a/src/nitro/session/BadgeImageManager.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { Resource, Texture } from '@pixi/core'; -import { IAssetManager } from '../../core/asset/IAssetManager'; -import { IEventDispatcher } from '../../core/events/IEventDispatcher'; -import { Nitro } from '../Nitro'; -import { BadgeInfo } from './BadgeInfo'; -import { BadgeImageReadyEvent } from './events/BadgeImageReadyEvent'; - -export class BadgeImageManager -{ - public static GROUP_BADGE: string = 'group_badge'; - public static NORMAL_BADGE: string = 'normal_badge'; - - private _assets: IAssetManager; - private _events: IEventDispatcher; - private _requestedBadges: Map; - - constructor(assetManager: IAssetManager, eventDispatcher: IEventDispatcher) - { - this._assets = assetManager; - this._events = eventDispatcher; - this._requestedBadges = new Map(); - } - - public dispose(): void - { - this._assets = null; - } - - public getBadgeImage(badgeName: string, type: string = BadgeImageManager.NORMAL_BADGE, load: boolean = true): Texture - { - let badge = this.getBadgeTexture(badgeName, type); - - if(!badge && load) badge = this.getBadgePlaceholder(); - - return badge; - } - - public getBadgeInfo(k: string): BadgeInfo - { - const badge = this.getBadgeTexture(k); - - return (badge) ? new BadgeInfo(badge, false) : new BadgeInfo(this.getBadgePlaceholder(), true); - } - - public loadBadgeImage(badgeName: string, type: string = BadgeImageManager.NORMAL_BADGE): string - { - if(this._assets.getTexture(this.getBadgeUrl(badgeName, type))) return badgeName; - - this.getBadgeTexture(badgeName, type); - - return null; - } - - private getBadgeTexture(badgeName: string, type: string = BadgeImageManager.NORMAL_BADGE): Texture - { - const url = this.getBadgeUrl(badgeName, type); - - const existing = this._assets.getTexture(url); - - if(existing) return existing.clone(); - - if(this._requestedBadges.get(badgeName)) return null; - - if(url) - { - this._requestedBadges.set(badgeName, true); - - this._assets.downloadAsset(url, (flag: boolean) => - { - if(flag) - { - const texture = this._assets.getTexture(url); - - if(texture && this._events) this._events.dispatchEvent(new BadgeImageReadyEvent(badgeName, texture.clone())); - } - }); - } - - return null; - } - - private getBadgePlaceholder(): Texture - { - const url = (Nitro.instance.getConfiguration('images.url') + '/loading_icon.png'); - const existing = this._assets.getTexture(url); - - if(!existing) return null; - - return existing.clone(); - } - - public getBadgeUrl(badge: string, type: string = BadgeImageManager.NORMAL_BADGE): string - { - let url = null; - - switch(type) - { - case BadgeImageManager.NORMAL_BADGE: - url = (Nitro.instance.getConfiguration('badge.asset.url')).replace('%badgename%', badge); - break; - case BadgeImageManager.GROUP_BADGE: - url = (Nitro.instance.getConfiguration('badge.asset.group.url')).replace('%badgedata%', badge); - break; - } - - return url; - } -} diff --git a/src/nitro/session/SessionDataManager.ts b/src/nitro/session/SessionDataManager.ts index 7b78bb8a..50e13c7d 100644 --- a/src/nitro/session/SessionDataManager.ts +++ b/src/nitro/session/SessionDataManager.ts @@ -18,7 +18,7 @@ import { UserRespectComposer } from '../communication/messages/outgoing/user/Use import { NitroSettingsEvent } from '../events/NitroSettingsEvent'; import { Nitro } from '../Nitro'; import { HabboWebTools } from '../utils/HabboWebTools'; -import { BadgeImageManager } from './BadgeImageManager'; +import { BadgeImageManager } from './badge/BadgeImageManager'; import { SecurityLevel } from './enum/SecurityLevel'; import { MysteryBoxKeysUpdateEvent } from './events'; import { SessionDataPreferencesEvent } from './events/SessionDataPreferencesEvent'; @@ -197,7 +197,8 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana { if(this._badgeImageManager) return; - this._badgeImageManager = new BadgeImageManager(Nitro.instance.core.asset, this.events); + this._badgeImageManager = new BadgeImageManager(Nitro.instance.core.asset, this); + this._badgeImageManager.init(); } public hasProductData(listener: IProductDataListener): boolean diff --git a/src/nitro/session/badge/BadgeImageManager.ts b/src/nitro/session/badge/BadgeImageManager.ts index c95b5c36..ba4f942f 100644 --- a/src/nitro/session/badge/BadgeImageManager.ts +++ b/src/nitro/session/badge/BadgeImageManager.ts @@ -1,21 +1,22 @@ import { Resource, Texture } from '@pixi/core'; -import { BadgeTypeEnum, GroupBadge } from '.'; import { IAssetManager } from '../../../core/asset/IAssetManager'; import { IMessageEvent } from '../../../core/communication/messages/IMessageEvent'; import { NitroSprite } from '../../../core/utils/proxy/NitroSprite'; import { GroupBadgePartsEvent } from '../../communication/messages/incoming/group/GroupBadgePartsEvent'; -import { GroupBadgePartsComposer } from '../../communication/messages/outgoing/group/GroupBadgePartsComposer'; import { Nitro } from '../../Nitro'; import { BadgeImageReadyEvent } from '../events/BadgeImageReadyEvent'; -import { ISessionDataManager } from '../ISessionDataManager'; +import { IDisposable } from './../../../core/common/disposable/IDisposable'; import { TextureUtils } from './../../../room/utils/TextureUtils'; import { SessionDataManager } from './../SessionDataManager'; import { BadgeInfo } from './BadgeInfo'; +import { GroupBadge } from './GroupBadge'; import { GroupBadgePart } from './GroupBadgePart'; -import { IBadgeImageManager } from './IBadgeImageManager'; -export class BadgeImageManager implements IBadgeImageManager +export class BadgeImageManager implements IDisposable { + public static GROUP_BADGE: string = 'group_badge'; + public static NORMAL_BADGE: string = 'normal_badge'; + private _assets: IAssetManager; private _sessionDataManager: SessionDataManager; private _messages: IMessageEvent[]; @@ -29,7 +30,7 @@ export class BadgeImageManager implements IBadgeImageManager private _readyToGenerateGroupBadges: boolean; - constructor(assetManager: IAssetManager, sessionDataManager: ISessionDataManager) + constructor(assetManager: IAssetManager, sessionDataManager: SessionDataManager) { this._assets = assetManager; this._sessionDataManager = sessionDataManager; @@ -38,7 +39,8 @@ export class BadgeImageManager implements IBadgeImageManager this._groupSymbols = new Map(); this._groupPartColors = new Map(); - this._requestedBadges = new Map(); + this._requestedBadges = new Map(); + this._groupBadgesQueue = new Map(); this._readyToGenerateGroupBadges = false; } @@ -53,7 +55,7 @@ export class BadgeImageManager implements IBadgeImageManager for(const message of this._messages) this._sessionDataManager.communication.registerMessageEvent(message); - this._sessionDataManager.send(new GroupBadgePartsComposer()); + //this._sessionDataManager.send(new GroupBadgePartsComposer()); } } @@ -69,7 +71,7 @@ export class BadgeImageManager implements IBadgeImageManager this._sessionDataManager = null; } - public getBadgeImage(badgeName: string, type: string = BadgeTypeEnum.NORMAL_BADGE, load: boolean = true): Texture + public getBadgeImage(badgeName: string, type: string = BadgeImageManager.NORMAL_BADGE, load: boolean = true): Texture { let badge = this.getBadgeTexture(badgeName, type); @@ -85,7 +87,7 @@ export class BadgeImageManager implements IBadgeImageManager return (badge) ? new BadgeInfo(badge, false) : new BadgeInfo(this.getBadgePlaceholder(), true); } - public loadBadgeImage(badgeName: string, type: string = BadgeTypeEnum.NORMAL_BADGE): string + public loadBadgeImage(badgeName: string, type: string = BadgeImageManager.NORMAL_BADGE): string { if(this._assets.getTexture(this.getBadgeUrl(badgeName, type))) return badgeName; @@ -94,7 +96,7 @@ export class BadgeImageManager implements IBadgeImageManager return null; } - private getBadgeTexture(badgeName: string, type: string = BadgeTypeEnum.NORMAL_BADGE): Texture + private getBadgeTexture(badgeName: string, type: string = BadgeImageManager.NORMAL_BADGE): Texture { const url = this.getBadgeUrl(badgeName, type); @@ -108,7 +110,7 @@ export class BadgeImageManager implements IBadgeImageManager { this._requestedBadges.set(badgeName, true); - if(type === BadgeTypeEnum.NORMAL_BADGE) + if(type === BadgeImageManager.NORMAL_BADGE) { this._assets.downloadAsset(url, (flag: boolean) => { @@ -126,7 +128,7 @@ export class BadgeImageManager implements IBadgeImageManager { if(!this._readyToGenerateGroupBadges) { - if(this._groupBadgesQueue.get(badgeName)) this._groupBadgesQueue.set(badgeName, true); + if(!this._groupBadgesQueue.get(badgeName)) this._groupBadgesQueue.set(badgeName, true); } else { @@ -148,16 +150,16 @@ export class BadgeImageManager implements IBadgeImageManager return existing.clone(); } - public getBadgeUrl(badge: string, type: string = BadgeTypeEnum.NORMAL_BADGE): string + public getBadgeUrl(badge: string, type: string = BadgeImageManager.NORMAL_BADGE): string { let url = null; switch(type) { - case BadgeTypeEnum.NORMAL_BADGE: + case BadgeImageManager.NORMAL_BADGE: url = (Nitro.instance.getConfiguration('badge.asset.url')).replace('%badgename%', badge); break; - case BadgeTypeEnum.GROUP_BADGE: + case BadgeImageManager.GROUP_BADGE: //url = (Nitro.instance.getConfiguration('badge.asset.group.url')).replace('%badgedata%', badge); url = badge; break; @@ -190,6 +192,8 @@ export class BadgeImageManager implements IBadgeImageManager const requiredAssets = isBase ? this._groupBases.get(partId) : this._groupSymbols.get(partId); + if(!requiredAssets) continue; + for(const requiredAsset of requiredAssets) { if(requiredAsset.length > 0) @@ -214,6 +218,7 @@ export class BadgeImageManager implements IBadgeImageManager { for(const part of groupBadge.parts) { + let isFirst = true; for(const partUrl of part.urls) { const texture = this._assets.getTexture(partUrl); @@ -225,7 +230,10 @@ export class BadgeImageManager implements IBadgeImageManager const sprite = new NitroSprite(texture); sprite.x = pos.x; sprite.y = pos.y; - sprite.tint = parseInt(this._groupPartColors.get(part.color), 16); + + if(isFirst) sprite.tint = parseInt(this._groupPartColors.get(part.color), 16); + + isFirst = false; groupBadge.container.addChild(sprite); } @@ -235,7 +243,6 @@ export class BadgeImageManager implements IBadgeImageManager this._groupBadgesQueue.delete(groupBadge.code); const texture = TextureUtils.generateTexture(groupBadge.container); - this._assets.setTexture(groupBadge.code, texture); if(this._sessionDataManager) this._sessionDataManager.events.dispatchEvent(new BadgeImageReadyEvent(groupBadge.code, texture)); diff --git a/src/nitro/session/BadgeInfo.ts b/src/nitro/session/badge/BadgeInfo.ts similarity index 100% rename from src/nitro/session/BadgeInfo.ts rename to src/nitro/session/badge/BadgeInfo.ts diff --git a/src/nitro/session/badge/index.ts b/src/nitro/session/badge/index.ts index fa31d966..dd81f9cf 100644 --- a/src/nitro/session/badge/index.ts +++ b/src/nitro/session/badge/index.ts @@ -1,2 +1,4 @@ export * from './BadgeImageManager'; +export * from './BadgeInfo'; +export * from './GroupBadge'; export * from './GroupBadgePart'; diff --git a/src/nitro/session/index.ts b/src/nitro/session/index.ts index e04ba2f2..670d2cce 100644 --- a/src/nitro/session/index.ts +++ b/src/nitro/session/index.ts @@ -1,5 +1,4 @@ -export * from './BadgeImageManager'; -export * from './BadgeInfo'; +export * from './badge'; export * from './enum'; export * from './events'; export * from './furniture'; From c073921a5881d6a9f941d79999f4b5d9d85045c4 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Mon, 6 Sep 2021 02:02:06 -0300 Subject: [PATCH 010/108] BadgeImager fix --- src/nitro/session/badge/BadgeImageManager.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/nitro/session/badge/BadgeImageManager.ts b/src/nitro/session/badge/BadgeImageManager.ts index ba4f942f..4d9b09c9 100644 --- a/src/nitro/session/badge/BadgeImageManager.ts +++ b/src/nitro/session/badge/BadgeImageManager.ts @@ -175,15 +175,17 @@ export class BadgeImageManager implements IDisposable const urlsToLoad: string[] = []; - for(let i = 0; i < badgeCode.length; i += 6) + const partMatches = [...badgeCode.matchAll(/[b|s][0-9]{5,6}/g)]; + + for(const partMatch of partMatches) { - const partType = badgeCode.slice(i, i + 1); + const partCode = partMatch[0]; + const shortMethod = (partCode.length === 6); - let partId = parseInt(badgeCode.slice(i + 1, i + 3)); - const partColor = parseInt(badgeCode.slice(i + 3, i + 5)); - const partPosition = parseInt(badgeCode.slice(i + 5, i + 6)); - - if(partType === 't') partId += 100; + const partType = partCode[0]; + const partId = parseInt(partCode.slice(1, shortMethod ? 3 : 4)); + const partColor = parseInt(partCode.slice(shortMethod ? 3 : 4, shortMethod ? 5 : 6)); + const partPosition = parseInt(partCode.slice(shortMethod ? 5 : 6, shortMethod ? 6 : 7)); const part = new GroupBadgePart(partType, partId, partColor, partPosition); groupBadge.parts.push(part); From c21f2f66b3585db82b86b600eaf8507b87e01c27 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 6 Sep 2021 02:33:03 -0400 Subject: [PATCH 011/108] Add badgePointLimit to localization --- .../localization/INitroLocalizationManager.ts | 1 + .../localization/NitroLocalizationManager.ts | 25 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/nitro/localization/INitroLocalizationManager.ts b/src/nitro/localization/INitroLocalizationManager.ts index 450f1211..5b759307 100644 --- a/src/nitro/localization/INitroLocalizationManager.ts +++ b/src/nitro/localization/INitroLocalizationManager.ts @@ -11,4 +11,5 @@ export interface INitroLocalizationManager extends INitroManager registerParameter(key: string, parameter: string, value: string): void; getBadgeName(key: string): string; getBadgeDesc(key: string): string; + setBadgePointLimit(badge: string, point: number): void; } diff --git a/src/nitro/localization/NitroLocalizationManager.ts b/src/nitro/localization/NitroLocalizationManager.ts index a1183edb..47d987cb 100644 --- a/src/nitro/localization/NitroLocalizationManager.ts +++ b/src/nitro/localization/NitroLocalizationManager.ts @@ -8,6 +8,7 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca { private _definitions: Map; private _parameters: Map>; + private _badgePointLimits: Map; private _romanNumerals: string[]; private _pendingUrls: string[]; @@ -17,6 +18,7 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca this._definitions = new Map(); this._parameters = new Map(); + this._badgePointLimits = new Map(); this._romanNumerals = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII', 'XIII', 'XIV', 'XV', 'XVI', 'XVII', 'XVIII', 'XIX', 'XX', 'XXI', 'XXII', 'XXIII', 'XXIV', 'XXV', 'XXVI', 'XXVII', 'XXVIII', 'XXIX', 'XXX']; this._pendingUrls = []; } @@ -84,6 +86,16 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca return true; } + public getBadgePointLimit(badge: string): number + { + return this._badgePointLimits.get(badge); + } + + public setBadgePointLimit(badge: string, point: number): void + { + this._badgePointLimits.set(badge, point); + } + public getRomanNumeral(number: number): string { return this._romanNumerals[Math.max(0, (number - 1))]; @@ -263,7 +275,11 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca const badge = new BadgeBaseAndLevel(key); const keys = [ 'badge_name_' + key, 'badge_name_' + badge.base ]; - return this._Str_2103(this.getExistingKey(keys)).replace('%roman%', this.getRomanNumeral(badge.level)); + let name = this._Str_2103(this.getExistingKey(keys)); + + name = name.replace('%roman%', this.getRomanNumeral(badge.level)); + + return name; } public getBadgeDesc(key: string): string @@ -271,7 +287,12 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca const badge = new BadgeBaseAndLevel(key); const keys = [ 'badge_desc_' + key, 'badge_desc_' + badge.base ]; - return this._Str_2103(this.getExistingKey(keys)).replace('%roman%', this.getRomanNumeral(badge.level)); + let desc = this._Str_2103(this.getExistingKey(keys)); + + desc = desc.replace('%limit$', this.getBadgePointLimit(key).toString()); + desc = desc.replace('%roman%', this.getRomanNumeral(badge.level)); + + return desc; } private getExistingKey(keys: string[]): string From e02084db716f4a9948b4051123f83c794db22d42 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 6 Sep 2021 02:42:43 -0400 Subject: [PATCH 012/108] Add new badge packets --- src/nitro/communication/NitroMessages.ts | 4 +++- src/nitro/communication/messages/incoming/IncomingHeader.ts | 2 ++ .../incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index c417c7b1..f5102f61 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetDirectClubBuyAvailableComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetDirectClubBuyAvailableComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; @@ -781,6 +781,8 @@ export class NitroMessages implements IMessageConfiguration // BADGES this._events.set(IncomingHeader.USER_BADGES, BadgesEvent); this._events.set(IncomingHeader.USER_BADGES_ADD, BadgeReceivedEvent); + this._events.set(IncomingHeader.BADGE_POINT_LIMITS, BadgePointLimitsEvent); + this._events.set(IncomingHeader.BADGE_REQUEST_FULFILLED, IsBadgeRequestFulfilledEvent); // ACCESS this._events.set(IncomingHeader.USER_PERKS, UserPerksEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 0460359b..6bf27d55 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -315,4 +315,6 @@ export class IncomingHeader public static COMPETITION_USER_PART_OF = 3841; public static COMPETITION_NO_OWNED_ROOMS = 2064; public static COMPETITION_SECONDS_UNTIL = 3926; + public static BADGE_POINT_LIMITS = 2501; + public static BADGE_REQUEST_FULFILLED = 2998; } diff --git a/src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts b/src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts index c50a257e..c9f1beac 100644 --- a/src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts +++ b/src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts @@ -1,6 +1,7 @@ import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; import { IsBadgeRequestFulfilledParser } from '../../../parser/inventory/badges/IsBadgeRequestFulfilledParser'; + export class IsBadgeRequestFulfilledEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) From 228c258aab8130767641e43b036a0185df48dd65 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 6 Sep 2021 02:54:54 -0400 Subject: [PATCH 013/108] Update BadgePointLimit --- src/nitro/localization/INitroLocalizationManager.ts | 1 + src/nitro/localization/NitroLocalizationManager.ts | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nitro/localization/INitroLocalizationManager.ts b/src/nitro/localization/INitroLocalizationManager.ts index 5b759307..f09140bf 100644 --- a/src/nitro/localization/INitroLocalizationManager.ts +++ b/src/nitro/localization/INitroLocalizationManager.ts @@ -11,5 +11,6 @@ export interface INitroLocalizationManager extends INitroManager registerParameter(key: string, parameter: string, value: string): void; getBadgeName(key: string): string; getBadgeDesc(key: string): string; + getBadgePointLimit(badge: string): number; setBadgePointLimit(badge: string, point: number): void; } diff --git a/src/nitro/localization/NitroLocalizationManager.ts b/src/nitro/localization/NitroLocalizationManager.ts index 47d987cb..7a49b926 100644 --- a/src/nitro/localization/NitroLocalizationManager.ts +++ b/src/nitro/localization/NitroLocalizationManager.ts @@ -88,7 +88,7 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca public getBadgePointLimit(badge: string): number { - return this._badgePointLimits.get(badge); + return (this._badgePointLimits.get(badge) || -1); } public setBadgePointLimit(badge: string, point: number): void @@ -289,7 +289,10 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca let desc = this._Str_2103(this.getExistingKey(keys)); - desc = desc.replace('%limit$', this.getBadgePointLimit(key).toString()); + const limit = this.getBadgePointLimit(key); + + if(limit > -1) desc = desc.replace('%limit%', limit.toString()); + desc = desc.replace('%roman%', this.getRomanNumeral(badge.level)); return desc; From 7d75fdd1b3408efe7f4c25bee488bad9d4e0eb46 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 6 Sep 2021 03:18:44 -0400 Subject: [PATCH 014/108] Fix GuildIsometricBadgeVisualization --- .../FurnitureDynamicThumbnailVisualization.ts | 4 +- .../FurnitureGuildCustomizedVisualization.ts | 9 ++- ...rnitureGuildIsometricBadgeVisualization.ts | 71 ++++++++++++++++++- ...ts => IsometricImageFurniVisualization.ts} | 6 +- .../object/visualization/furniture/index.ts | 2 +- 5 files changed, 81 insertions(+), 11 deletions(-) rename src/nitro/room/object/visualization/furniture/{FurnitureThumbnailVisualization.ts => IsometricImageFurniVisualization.ts} (94%) diff --git a/src/nitro/room/object/visualization/furniture/FurnitureDynamicThumbnailVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureDynamicThumbnailVisualization.ts index 34636fee..a9ffbf30 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureDynamicThumbnailVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureDynamicThumbnailVisualization.ts @@ -1,8 +1,8 @@ import { SCALE_MODES } from '@pixi/constants'; import { Texture } from '@pixi/core'; -import { FurnitureThumbnailVisualization } from './FurnitureThumbnailVisualization'; +import { IsometricImageFurniVisualization } from './IsometricImageFurniVisualization'; -export class FurnitureDynamicThumbnailVisualization extends FurnitureThumbnailVisualization +export class FurnitureDynamicThumbnailVisualization extends IsometricImageFurniVisualization { private _cachedUrl: string; diff --git a/src/nitro/room/object/visualization/furniture/FurnitureGuildCustomizedVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureGuildCustomizedVisualization.ts index d71ed348..ed9c2506 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureGuildCustomizedVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureGuildCustomizedVisualization.ts @@ -40,8 +40,13 @@ export class FurnitureGuildCustomizedVisualization extends FurnitureAnimatedVisu } } - this._color1 = this.object.model.getValue(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_COLOR_1); - this._color2 = this.object.model.getValue(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_COLOR_2); + const color1 = this.object.model.getValue(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_COLOR_1); + + this._color1 = color1 ? color1: FurnitureGuildCustomizedVisualization.DEFAULT_COLOR_1; + + const color2 = this.object.model.getValue(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_COLOR_2); + + this._color2 = color2 ? color2: FurnitureGuildCustomizedVisualization.DEFAULT_COLOR_2; return flag; } diff --git a/src/nitro/room/object/visualization/furniture/FurnitureGuildIsometricBadgeVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureGuildIsometricBadgeVisualization.ts index 31ac55e4..66efd952 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureGuildIsometricBadgeVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureGuildIsometricBadgeVisualization.ts @@ -1,6 +1,71 @@ -import { FurnitureThumbnailVisualization } from './FurnitureThumbnailVisualization'; +import { IGraphicAsset, IRoomObjectSprite } from '../../../../../room'; +import { RoomObjectVariable } from '../../RoomObjectVariable'; +import { IsometricImageFurniVisualization } from './IsometricImageFurniVisualization'; -export class FurnitureGuildIsometricBadgeVisualization extends FurnitureThumbnailVisualization +export class FurnitureGuildIsometricBadgeVisualization extends IsometricImageFurniVisualization { + public static PRIMARY_COLOUR_SPRITE_TAG: string = 'COLOR1'; + public static SECONDARY_COLOUR_SPRITE_TAG: string = 'COLOR2'; + public static DEFAULT_COLOR_1: number = 0xEEEEEE; + public static DEFAULT_COLOR_2: number = 0x4B4B4B; -} \ No newline at end of file + private _color1: number; + private _color2: number; + + protected updateModel(scale: number): boolean + { + const flag = super.updateModel(scale); + + if(!this.hasThumbnailImage) + { + const assetName = this.object.model.getValue(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_ASSET_NAME); + + if(assetName && assetName.length) this.setThumbnailImages(this.getBitmapAsset(assetName)); + } + + const color1 = this.object.model.getValue(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_COLOR_1); + + this._color1 = color1 ? color1: FurnitureGuildIsometricBadgeVisualization.DEFAULT_COLOR_1; + + const color2 = this.object.model.getValue(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_COLOR_2); + + this._color2 = color2 ? color2: FurnitureGuildIsometricBadgeVisualization.DEFAULT_COLOR_2; + + return flag; + } + + protected getLayerColor(scale: number, layerId: number, colorId: number): number + { + const tag = this.getLayerTag(scale, this._direction, layerId); + + switch(tag) + { + case FurnitureGuildIsometricBadgeVisualization.PRIMARY_COLOUR_SPRITE_TAG: return this._color1; + case FurnitureGuildIsometricBadgeVisualization.SECONDARY_COLOUR_SPRITE_TAG: return this._color2; + } + + return super.getLayerColor(scale, layerId, colorId); + } + + protected getLibraryAssetNameForSprite(asset: IGraphicAsset, sprite: IRoomObjectSprite): string + { + if(sprite.tag === FurnitureGuildIsometricBadgeVisualization.THUMBNAIL) + { + if(this.object && this.object.model.getValue(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_ASSET_NAME)) + { + return '%group.badge.url%' + this.object.model.getValue(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_ASSET_NAME); + } + } + + return super.getLibraryAssetNameForSprite(asset, sprite); + } + + private getBitmapAsset(name: string) + { + const asset = this.asset.getAsset(name); + + if(!asset || !asset.texture) return null; + + return asset.texture; + } +} diff --git a/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts b/src/nitro/room/object/visualization/furniture/IsometricImageFurniVisualization.ts similarity index 94% rename from src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts rename to src/nitro/room/object/visualization/furniture/IsometricImageFurniVisualization.ts index cdde344b..59a447f5 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/IsometricImageFurniVisualization.ts @@ -5,7 +5,7 @@ import { IGraphicAsset } from '../../../../../room/object/visualization/utils/IG import { TextureUtils } from '../../../../../room/utils/TextureUtils'; import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization'; -export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualization +export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualization { protected static THUMBNAIL: string = 'THUMBNAIL'; @@ -71,7 +71,7 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat while(layerId < this.totalSprites) { - if(this.getLayerTag(scale, this.direction, layerId) === FurnitureThumbnailVisualization.THUMBNAIL) + if(this.getLayerTag(scale, this.direction, layerId) === IsometricImageFurniVisualization.THUMBNAIL) { const assetName = (this.cacheSpriteAssetName(scale, layerId, false) + this.getFrameNumber(scale, layerId)); const asset = this.getAsset(assetName, layerId); @@ -140,7 +140,7 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat protected getSpriteAssetName(scale: number, layerId: number): string { - if(this._thumbnailImageNormal && (this.getLayerTag(scale, this.direction, layerId) === FurnitureThumbnailVisualization.THUMBNAIL)) return this.getThumbnailAssetName(scale); + if(this._thumbnailImageNormal && (this.getLayerTag(scale, this.direction, layerId) === IsometricImageFurniVisualization.THUMBNAIL)) return this.getThumbnailAssetName(scale); return super.getSpriteAssetName(scale, layerId); } diff --git a/src/nitro/room/object/visualization/furniture/index.ts b/src/nitro/room/object/visualization/furniture/index.ts index 33e62c57..996f2972 100644 --- a/src/nitro/room/object/visualization/furniture/index.ts +++ b/src/nitro/room/object/visualization/furniture/index.ts @@ -29,7 +29,6 @@ export * from './FurnitureRoomBackgroundVisualization'; export * from './FurnitureScoreBoardVisualization'; export * from './FurnitureSoundBlockVisualization'; export * from './FurnitureStickieVisualization'; -export * from './FurnitureThumbnailVisualization'; export * from './FurnitureValRandomizerVisualization'; export * from './FurnitureVisualization'; export * from './FurnitureVisualizationData'; @@ -37,3 +36,4 @@ export * from './FurnitureVoteCounterVisualization'; export * from './FurnitureVoteMajorityVisualization'; export * from './FurnitureWaterAreaVisualization'; export * from './FurnitureYoutubeVisualization'; +export * from './IsometricImageFurniVisualization'; From a1eb711f6ab7e345aacb3d711676ce3f347af863 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Mon, 6 Sep 2021 06:00:25 -0300 Subject: [PATCH 015/108] Talent Track messages --- src/nitro/communication/NitroMessages.ts | 9 ++- .../messages/incoming/IncomingHeader.ts | 1 + .../incoming/help/TalentTrackEvent.ts | 16 ++++ .../messages/incoming/help/index.ts | 1 + .../messages/outgoing/OutgoingHeader.ts | 1 + .../outgoing/helper/TalentTrackComposer.ts | 21 +++++ .../messages/outgoing/helper/index.ts | 1 + .../communication/messages/outgoing/index.ts | 1 + .../messages/parser/help/TalentTrackParser.ts | 79 +++++++++++++++++++ .../parser/help/common/TalentTrackLevel.ts | 45 +++++++++++ .../common/TalentTrackLevelAchievement.ts | 49 ++++++++++++ .../help/common/TalentTrackLevelItem.ts | 21 +++++ .../messages/parser/help/common/index.ts | 3 + .../messages/parser/help/index.ts | 2 + 14 files changed, 249 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/incoming/help/TalentTrackEvent.ts create mode 100644 src/nitro/communication/messages/outgoing/helper/TalentTrackComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/helper/index.ts create mode 100644 src/nitro/communication/messages/parser/help/TalentTrackParser.ts create mode 100644 src/nitro/communication/messages/parser/help/common/TalentTrackLevel.ts create mode 100644 src/nitro/communication/messages/parser/help/common/TalentTrackLevelAchievement.ts create mode 100644 src/nitro/communication/messages/parser/help/common/TalentTrackLevelItem.ts create mode 100644 src/nitro/communication/messages/parser/help/common/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index f5102f61..85c860b8 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetDirectClubBuyAvailableComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetDirectClubBuyAvailableComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; @@ -293,6 +293,7 @@ import { GroupSettingsComposer } from './messages/outgoing/group/GroupSettingsCo import { AuthenticationMessageComposer } from './messages/outgoing/handshake/AuthenticationMessageComposer'; import { InfoRetrieveBaseMessageComposer } from './messages/outgoing/handshake/InfoRetrieveBaseMessageComposer'; import { SecurityTicketComposer } from './messages/outgoing/handshake/SecurityTicketComposer'; +import { TalentTrackComposer } from './messages/outgoing/helper/TalentTrackComposer'; import { RequestBadgesComposer } from './messages/outgoing/inventory/badges/RequestBadgesComposer'; import { SetActivatedBadgesComposer } from './messages/outgoing/inventory/badges/SetActivatedBadgesComposer'; import { GetBotInventoryComposer } from './messages/outgoing/inventory/bots/GetBotInventoryComposer'; @@ -873,6 +874,9 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.PLAYLIST_SONG_ADDED, PlayListSongAddedMessageEvent); this._events.set(IncomingHeader.TRAX_SONG_INFO, TraxSongInfoMessageEvent); this._events.set(IncomingHeader.USER_SONG_DISKS_INVENTORY, UserSongDisksInventoryMessageEvent); + + // HELPER + this._events.set(IncomingHeader.HELPER_TALENT_TRACK, TalentTrackEvent); } private registerComposers(): void @@ -1267,6 +1271,9 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.GET_SOUND_MACHINE_PLAYLIST, GetSoundMachinePlayListMessageComposer); this._composers.set(OutgoingHeader.GET_USER_SONG_DISKS, GetUserSongDisksMessageComposer); this._composers.set(OutgoingHeader.REMOVE_JUKEBOX_DISK, RemoveJukeboxDiskComposer); + + // HELPER + this._composers.set(OutgoingHeader.HELPER_TALENT_TRACK, TalentTrackComposer); } public get events(): Map diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 6bf27d55..736bec3a 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -317,4 +317,5 @@ export class IncomingHeader public static COMPETITION_SECONDS_UNTIL = 3926; public static BADGE_POINT_LIMITS = 2501; public static BADGE_REQUEST_FULFILLED = 2998; + public static HELPER_TALENT_TRACK = 3406; } diff --git a/src/nitro/communication/messages/incoming/help/TalentTrackEvent.ts b/src/nitro/communication/messages/incoming/help/TalentTrackEvent.ts new file mode 100644 index 00000000..488e9f42 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/TalentTrackEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { TalentTrackParser } from '../../parser/help/TalentTrackParser'; + +export class TalentTrackEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, TalentTrackParser); + } + + public getParser(): TalentTrackParser + { + return this.parser as TalentTrackParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/index.ts b/src/nitro/communication/messages/incoming/help/index.ts index 82185bf2..b0bcb133 100644 --- a/src/nitro/communication/messages/incoming/help/index.ts +++ b/src/nitro/communication/messages/incoming/help/index.ts @@ -1 +1,2 @@ export * from './CallForHelpResultMessageEvent'; +export * from './TalentTrackEvent'; diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 8ebd3888..e82aeb68 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -307,4 +307,5 @@ export class OutgoingHeader public static ROOM_AD_PURCHASE_INITIATED = 2283; public static SET_TARGETTED_OFFER_STATE = 2041; public static SHOP_TARGETED_OFFER_VIEWED = 3483; + public static HELPER_TALENT_TRACK = 196; } diff --git a/src/nitro/communication/messages/outgoing/helper/TalentTrackComposer.ts b/src/nitro/communication/messages/outgoing/helper/TalentTrackComposer.ts new file mode 100644 index 00000000..6992b7e7 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/helper/TalentTrackComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class TalentTrackComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(type: string) + { + this._data = [ type ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/helper/index.ts b/src/nitro/communication/messages/outgoing/helper/index.ts new file mode 100644 index 00000000..018730e0 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/helper/index.ts @@ -0,0 +1 @@ +export * from './TalentTrackComposer'; diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index a91f1642..ceca7a00 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -9,6 +9,7 @@ export * from './desktop'; export * from './friendlist'; export * from './group'; export * from './handshake'; +export * from './helper'; export * from './inventory'; export * from './landingview'; export * from './marketplace'; diff --git a/src/nitro/communication/messages/parser/help/TalentTrackParser.ts b/src/nitro/communication/messages/parser/help/TalentTrackParser.ts new file mode 100644 index 00000000..71e97ccd --- /dev/null +++ b/src/nitro/communication/messages/parser/help/TalentTrackParser.ts @@ -0,0 +1,79 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; +import { TalentTrackLevel } from './common/TalentTrackLevel'; +import { TalentTrackLevelAchievement } from './common/TalentTrackLevelAchievement'; +import { TalentTrackLevelItem } from './common/TalentTrackLevelItem'; + +export class TalentTrackParser implements IMessageParser +{ + private _type: string; + private _levels: TalentTrackLevel[]; + + public flush(): boolean + { + this._type = null; + this._levels = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._type = wrapper.readString(); + + this._levels = []; + const levelsCount = wrapper.readInt(); + + for(let i = 0; i < levelsCount; i++) + { + const levelId = wrapper.readInt(); + const levelState = wrapper.readInt(); + + const levelAchievements: TalentTrackLevelAchievement[] = []; + const achievementsCount = wrapper.readInt(); + + for(let j = 0; j < achievementsCount; j++) + { + const id = wrapper.readInt(); + const index = wrapper.readInt(); + const code = wrapper.readString(); + const state = wrapper.readInt(); + const progress = wrapper.readInt(); + const achievementProgress = wrapper.readInt(); + + levelAchievements.push(new TalentTrackLevelAchievement(id, index, code, state, progress, achievementProgress)); + } + + const levelPerks: string[] = []; + const perksCount = wrapper.readInt(); + + for(let j = 0; j < perksCount; j++) levelPerks.push(wrapper.readString()); + + const levelItems: TalentTrackLevelItem[] = []; + const itemsCount = wrapper.readInt(); + + for(let j = 0; j < itemsCount; j++) + { + const name = wrapper.readString(); + const unknownInt = wrapper.readInt(); + + levelItems.push(new TalentTrackLevelItem(name, unknownInt)); + } + + this._levels.push(new TalentTrackLevel(levelId, levelState, levelAchievements, levelPerks, levelItems)); + } + + return true; + } + + public get type(): string + { + return this._type; + } + + public get levels(): TalentTrackLevel[] + { + return this._levels; + } +} diff --git a/src/nitro/communication/messages/parser/help/common/TalentTrackLevel.ts b/src/nitro/communication/messages/parser/help/common/TalentTrackLevel.ts new file mode 100644 index 00000000..ffc487bd --- /dev/null +++ b/src/nitro/communication/messages/parser/help/common/TalentTrackLevel.ts @@ -0,0 +1,45 @@ +import { TalentTrackLevelAchievement } from './TalentTrackLevelAchievement'; +import { TalentTrackLevelItem } from './TalentTrackLevelItem'; + +export class TalentTrackLevel +{ + private _level: number; + private _state: number; + private _achievements: TalentTrackLevelAchievement[] + private _perks: string[]; + private _items: TalentTrackLevelItem[]; + + constructor(level: number, state: number, achievements: TalentTrackLevelAchievement[], perks: string[], items: TalentTrackLevelItem[]) + { + this._level = level; + this._state = state; + this._achievements = achievements; + this._perks = perks; + this._items = items; + } + + public get level(): number + { + return this._level; + } + + public get state(): number + { + return this._state; + } + + public get achievements(): TalentTrackLevelAchievement[] + { + return this._achievements; + } + + public get perks(): string[] + { + return this._perks; + } + + public get items(): TalentTrackLevelItem[] + { + return this._items; + } +} diff --git a/src/nitro/communication/messages/parser/help/common/TalentTrackLevelAchievement.ts b/src/nitro/communication/messages/parser/help/common/TalentTrackLevelAchievement.ts new file mode 100644 index 00000000..cd77c5d7 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/common/TalentTrackLevelAchievement.ts @@ -0,0 +1,49 @@ +export class TalentTrackLevelAchievement +{ + private _id: number; + private _index: number; + private _achievementCode: string; + private _state: number; + private _progress: number; + private _achievementProgress: number; + + constructor(id: number, index: number, achievementCode: string, state: number, progress: number, achievementProgress: number) + { + this._id = id; + this._index = index; + this._achievementCode = achievementCode; + this._state = state; + this._progress = progress; + this._achievementProgress = achievementProgress; + } + + public get id(): number + { + return this._id; + } + + public get index(): number + { + return this._index; + } + + public get achievementCode(): string + { + return this._achievementCode; + } + + public get state(): number + { + return this._state; + } + + public get progress(): number + { + return this._progress; + } + + public get achievementProgress(): number + { + return this._achievementProgress; + } +} diff --git a/src/nitro/communication/messages/parser/help/common/TalentTrackLevelItem.ts b/src/nitro/communication/messages/parser/help/common/TalentTrackLevelItem.ts new file mode 100644 index 00000000..bf59dc07 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/common/TalentTrackLevelItem.ts @@ -0,0 +1,21 @@ +export class TalentTrackLevelItem +{ + private _name: string; + private _unknownInt: number; + + constructor(name: string, unknownInt: number) + { + this._name = name; + this._unknownInt = unknownInt; + } + + public get name(): string + { + return this._name; + } + + public get unknownInt(): number + { + return this._unknownInt; + } +} diff --git a/src/nitro/communication/messages/parser/help/common/index.ts b/src/nitro/communication/messages/parser/help/common/index.ts new file mode 100644 index 00000000..22aefb71 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/common/index.ts @@ -0,0 +1,3 @@ +export * from './TalentTrackLevel'; +export * from './TalentTrackLevelAchievement'; +export * from './TalentTrackLevelItem'; diff --git a/src/nitro/communication/messages/parser/help/index.ts b/src/nitro/communication/messages/parser/help/index.ts index d09023ae..66126c4c 100644 --- a/src/nitro/communication/messages/parser/help/index.ts +++ b/src/nitro/communication/messages/parser/help/index.ts @@ -1 +1,3 @@ export * from './CallForHelpResultMessageParser'; +export * from './common'; +export * from './TalentTrackParser'; From 296ecf4722e4c2808477aa3d8718d75eaf401a5b Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 7 Sep 2021 12:39:58 -0400 Subject: [PATCH 016/108] Rename variables --- .../object/visualization/room/RoomPlane.ts | 2 + .../room/rasterizer/basic/FloorPlane.ts | 18 ++-- .../room/rasterizer/basic/Plane.ts | 38 +++---- .../room/rasterizer/basic/PlaneMaterial.ts | 20 ++-- .../rasterizer/basic/PlaneMaterialCell.ts | 26 ++--- .../basic/PlaneMaterialCellColumn.ts | 54 +++++----- .../basic/PlaneMaterialCellMatrix.ts | 98 +++++++++---------- .../room/rasterizer/basic/PlaneRasterizer.ts | 92 ++++++++--------- .../room/rasterizer/basic/PlaneTexture.ts | 4 +- .../rasterizer/basic/PlaneTextureBitmap.ts | 14 +-- .../rasterizer/basic/PlaneVisualization.ts | 28 +++--- .../basic/PlaneVisualizationLayer.ts | 10 +- .../room/rasterizer/basic/WallPlane.ts | 12 +-- .../room/rasterizer/basic/WallRasterizer.ts | 8 +- 14 files changed, 213 insertions(+), 211 deletions(-) diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index 844bd841..6787e07b 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -1,6 +1,7 @@ import { RenderTexture, Resource, Texture } from '@pixi/core'; import { Graphics } from '@pixi/graphics'; import { Matrix, Point, Rectangle } from '@pixi/math'; +import { NitroRenderTexture } from '../../../../../core'; import { IRoomPlane } from '../../../../../room/object/visualization/IRoomPlane'; import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; import { IVector3D } from '../../../../../room/utils/IVector3D'; @@ -36,6 +37,7 @@ export class RoomPlane implements IRoomPlane private _geometryUpdateId: number; private _type: number; private _isVisible: boolean; + private _bitmapTexture: NitroRenderTexture; private _bitmapData: Graphics; private _hasTexture: boolean; private _offset: Point; diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts index dda20144..95297c1f 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts @@ -9,30 +9,30 @@ export class FloorPlane extends Plane public static HORIZONTAL_ANGLE_DEFAULT: number = 45; public static VERTICAL_ANGLE_DEFAULT: number = 30; - public render(k: Graphics, _arg_2: number, _arg_3: number, size: number, _arg_5: IVector3D, _arg_6: boolean, _arg_7: number, _arg_8: number): Graphics + public render(canvas: Graphics, width: number, height: number, scale: number, normal: IVector3D, useTexture: boolean, offsetX: number, offsetY: number): Graphics { - const visualization = this.getPlaneVisualization(size); + const visualization = this.getPlaneVisualization(scale); if(!visualization || !visualization.geometry) return null; const _local_10 = visualization.geometry.getScreenPoint(new Vector3d(0, 0, 0)); - const _local_11 = visualization.geometry.getScreenPoint(new Vector3d(0, (_arg_3 / visualization.geometry.scale), 0)); - const _local_12 = visualization.geometry.getScreenPoint(new Vector3d((_arg_2 / visualization.geometry.scale), 0, 0)); + const _local_11 = visualization.geometry.getScreenPoint(new Vector3d(0, (height / visualization.geometry.scale), 0)); + const _local_12 = visualization.geometry.getScreenPoint(new Vector3d((width / visualization.geometry.scale), 0, 0)); let _local_13 = 0; let _local_14 = 0; if(_local_10 && _local_11 && _local_12) { - _arg_2 = Math.round(Math.abs((_local_10.x - _local_12.x))); - _arg_3 = Math.round(Math.abs((_local_10.x - _local_11.x))); + width = Math.round(Math.abs((_local_10.x - _local_12.x))); + height = Math.round(Math.abs((_local_10.x - _local_11.x))); const _local_15 = (_local_10.x - visualization.geometry.getScreenPoint(new Vector3d(1, 0, 0)).x); - _local_13 = (_arg_7 * Math.trunc(Math.abs(_local_15))); - _local_14 = (_arg_8 * Math.trunc(Math.abs(_local_15))); + _local_13 = (offsetX * Math.trunc(Math.abs(_local_15))); + _local_14 = (offsetY * Math.trunc(Math.abs(_local_15))); } - return visualization.render(k, _arg_2, _arg_3, _arg_5, _arg_6, _local_13, _local_14); + return visualization.render(canvas, width, height, normal, useTexture, _local_13, _local_14); } } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/Plane.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/Plane.ts index dd0b36a7..d7e434c6 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/Plane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/Plane.ts @@ -17,7 +17,7 @@ export class Plane this._lastSize = -1; } - public isStatic(k: number): boolean + public isStatic(size: number): boolean { return true; } @@ -47,49 +47,49 @@ export class Plane } } - public createPlaneVisualization(k: number, _arg_2: number, _arg_3: IRoomGeometry): PlaneVisualization + public createPlaneVisualization(size: number, totalLayers: number, geometry: IRoomGeometry): PlaneVisualization { - const existing = this._planeVisualizations.get(k.toString()); + const existing = this._planeVisualizations.get(size.toString()); if(existing) return null; - const plane = new PlaneVisualization(k, _arg_2, _arg_3); + const plane = new PlaneVisualization(size, totalLayers, geometry); - this._planeVisualizations.set(k.toString(), plane); + this._planeVisualizations.set(size.toString(), plane); - this._sizes.push(k); + this._sizes.push(size); this._sizes.sort(); return plane; } - private getSizeIndex(k: number): number + private getSizeIndex(size: number): number { - let size = 0; - let index = 1; + let sizeIndex = 0; + let i = 1; - while(index < this._sizes.length) + while(i < this._sizes.length) { - if(this._sizes[index] > k) + if(this._sizes[i] > size) { - if((this._sizes[index] - k) < (k - this._sizes[(index - 1)])) size = index; + if((this._sizes[i] - size) < (size - this._sizes[(i - 1)])) sizeIndex = i; break; } - size = index; + sizeIndex = i; - index++; + i++; } - return size; + return sizeIndex; } - protected getPlaneVisualization(k: number): PlaneVisualization + protected getPlaneVisualization(size: number): PlaneVisualization { - if(k === this._lastSize) return this._lastPlaneVisualization; + if(size === this._lastSize) return this._lastPlaneVisualization; - const sizeIndex = this.getSizeIndex(k); + const sizeIndex = this.getSizeIndex(size); if(sizeIndex < this._sizes.length) { @@ -100,7 +100,7 @@ export class Plane this._lastPlaneVisualization = null; } - this._lastSize = k; + this._lastSize = size; return this._lastPlaneVisualization; } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts index 09c2f743..972c3bef 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts @@ -50,18 +50,18 @@ export class PlaneMaterial this._isCached = false; } - public addMaterialCellMatrix(k: number, _arg_2: number, _arg_3: number, _arg_4: number = -1, _arg_5: number = 1, _arg_6: number = -1, _arg_7: number = 1): PlaneMaterialCellMatrix + public addMaterialCellMatrix(totalColumns: number, repeatMode: number, align: number, normalMinX: number = -1, normalMaxX: number = 1, normalMinY: number = -1, normalMaxY: number = 1): PlaneMaterialCellMatrix { - const cellMatrix = new PlaneMaterialCellMatrix(k, _arg_2, _arg_3, _arg_4, _arg_5, _arg_6, _arg_7); + const cellMatrix = new PlaneMaterialCellMatrix(totalColumns, repeatMode, align, normalMinX, normalMaxX, normalMinY, normalMaxY); this._planeMaterialItems.push(cellMatrix); return cellMatrix; } - public getMaterialCellMatrix(k: IVector3D): PlaneMaterialCellMatrix + public getMaterialCellMatrix(normal: IVector3D): PlaneMaterialCellMatrix { - if(!k) return null; + if(!normal) return null; if(this._planeMaterialItems && this._planeMaterialItems.length) { @@ -69,25 +69,25 @@ export class PlaneMaterial { if(!item) continue; - if((((k.x >= item.normalMinX) && (k.x <= item.normalMaxX)) && (k.y >= item.normalMinY)) && (k.y <= item.normalMaxY)) return item; + if((((normal.x >= item.normalMinX) && (normal.x <= item.normalMaxX)) && (normal.y >= item.normalMinY)) && (normal.y <= item.normalMaxY)) return item; } } return null; } - public render(k: Graphics, _arg_2: number, _arg_3: number, _arg_4: IVector3D, _arg_5: boolean, _arg_6: number, _arg_7: number, _arg_8: boolean): Graphics + public render(canvas: Graphics, width: number, height: number, normal: IVector3D, useTexture: boolean, offsetX: number, offsetY: number, topAlign: boolean): Graphics { - if(_arg_2 < 1) _arg_2 = 1; + if(width < 1) width = 1; - if(_arg_3 < 1) _arg_3 = 1; + if(height < 1) height = 1; - const cellMatrix = this.getMaterialCellMatrix(_arg_4); + const cellMatrix = this.getMaterialCellMatrix(normal); if(!cellMatrix) return null; this._isCached = true; - return cellMatrix.render(k, _arg_2, _arg_3, _arg_4, _arg_5, _arg_6, _arg_7, _arg_8); + return cellMatrix.render(canvas, width, height, normal, useTexture, offsetX, offsetY, topAlign); } } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts index 9289f332..73aca4e7 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts @@ -15,21 +15,21 @@ export class PlaneMaterialCell private _extraItemAssets: IGraphicAsset[]; private _extraItemCount: number = 0; - constructor(k: PlaneTexture, _arg_2: IGraphicAsset[] = null, _arg_3: Point[] = null, _arg_4: number = 0) + constructor(texture: PlaneTexture, assets: IGraphicAsset[] = null, offsetPoints: Point[] = null, limit: number = 0) { this._cachedBitmapData = null; - this._texture = k; + this._texture = texture; this._extraItemOffsets = []; this._extraItemAssets = []; this._extraItemCount = 0; - if(_arg_2 && _arg_2.length && (_arg_4 > 0)) + if(assets && assets.length && (limit > 0)) { let assetIndex = 0; - while(assetIndex < _arg_2.length) + while(assetIndex < assets.length) { - const graphic = _arg_2[assetIndex]; + const graphic = assets[assetIndex]; if(graphic) this._extraItemAssets.push(graphic); @@ -38,13 +38,13 @@ export class PlaneMaterialCell if(this._extraItemAssets.length) { - if(_arg_3) + if(offsetPoints) { let pointIndex = 0; - while(pointIndex < _arg_3.length) + while(pointIndex < offsetPoints.length) { - const point = _arg_3[pointIndex]; + const point = offsetPoints[pointIndex]; if(point) this._extraItemOffsets.push(new Point(point.x, point.y)); @@ -52,7 +52,7 @@ export class PlaneMaterialCell } } - this._extraItemCount = _arg_4; + this._extraItemCount = limit; } } } @@ -93,11 +93,11 @@ export class PlaneMaterialCell } } - public getHeight(k: IVector3D): number + public getHeight(normal: IVector3D): number { if(this._texture) { - const texture = this._texture.getBitmap(k); + const texture = this._texture.getBitmap(normal); if(texture) return texture.height; } @@ -239,8 +239,8 @@ export class PlaneMaterialCell return null; } - public getAssetName(k:IVector3D): string + public getAssetName(normal:IVector3D): string { - return (this._texture == null) ? null : this._texture.getAssetName(k); + return (this._texture == null) ? null : this._texture.getAssetName(normal); } } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts index 0d6ad65a..6f5275c9 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts @@ -22,11 +22,11 @@ export class PlaneMaterialCellColumn private _isCached: boolean; private _isStatic: boolean; - constructor(k: number, _arg_2: PlaneMaterialCell[], _arg_3: number = 1) + constructor(width: number, cells: PlaneMaterialCell[], repeatMode: number = 1) { this._cells = []; - this._repeatMode = _arg_3; - this._width = (k < 1) ? 1 : k; + this._repeatMode = repeatMode; + this._width = (width < 1) ? 1 : width; this._cachedBitmapData = null; this._cachedBitmapNormal = null; this._cachedBitmapDataOffsetX = 0; @@ -34,13 +34,13 @@ export class PlaneMaterialCellColumn this._isCached = false; this._isStatic = true; - if(_arg_2 && _arg_2.length) + if(cells && cells.length) { let cellIndex = 0; - while(cellIndex < _arg_2.length) + while(cellIndex < cells.length) { - const cell = _arg_2[cellIndex]; + const cell = cells[cellIndex]; if(cell) { @@ -215,18 +215,18 @@ export class PlaneMaterialCellColumn return this._cachedBitmapData; } - private getCellsHeight(k: PlaneMaterialCell[], _arg_2: IVector3D): number + private getCellsHeight(cells: PlaneMaterialCell[], normal: IVector3D): number { - if(!k || !k.length) return 0; + if(!cells || !cells.length) return 0; let height = 0; let cellIterator = 0; - while(cellIterator < k.length) + while(cellIterator < cells.length) { - const cell = k[cellIterator]; + const cell = cells[cellIterator]; - if(cell) height += cell.getHeight(_arg_2); + if(cell) height += cell.getHeight(normal); cellIterator++; } @@ -234,57 +234,57 @@ export class PlaneMaterialCellColumn return height; } - private renderCells(k: PlaneMaterialCell[], _arg_2: number, _arg_3: boolean, _arg_4: IVector3D, _arg_5: number = 0, _arg_6: number = 0): number + private renderCells(cells: PlaneMaterialCell[], index: number, flag: boolean, normal: IVector3D, offsetX: number = 0, offsetY: number = 0): number { - if(((!k || !k.length) || !this._cachedBitmapData)) return _arg_2; + if(((!cells || !cells.length) || !this._cachedBitmapData)) return index; let cellIndex = 0; - while(cellIndex < k.length) + while(cellIndex < cells.length) { let cell: PlaneMaterialCell = null; - if(_arg_3) + if(flag) { - cell = k[cellIndex]; + cell = cells[cellIndex]; } else { - cell = k[((k.length - 1) - cellIndex)]; + cell = cells[((cells.length - 1) - cellIndex)]; } if(cell) { - const graphic = cell.render(_arg_4, _arg_5, _arg_6); + const graphic = cell.render(normal, offsetX, offsetY); if(graphic) { - if(!_arg_3) _arg_2 -= graphic.height; + if(!flag) index -= graphic.height; - graphic.y = _arg_2; + graphic.y = index; this._cachedBitmapData.addChild(graphic); - if(_arg_3) _arg_2 = (_arg_2 + graphic.height); + if(flag) index = (index + graphic.height); - if(((_arg_3) && (_arg_2 >= this._cachedBitmapData.height)) || ((!(_arg_3)) && (_arg_2 <= 0))) return _arg_2; + if(((flag) && (index >= this._cachedBitmapData.height)) || ((!(flag)) && (index <= 0))) return index; } } cellIndex++; } - return _arg_2; + return index; } - private renderRepeatNone(k: IVector3D): void + private renderRepeatNone(normal: IVector3D): void { if(!this._cells.length || !this._cachedBitmapData) return; - this.renderCells(this._cells, 0, true, k); + this.renderCells(this._cells, 0, true, normal); } - private renderRepeatAll(k: IVector3D, _arg_2: number, _arg_3: number): void + private renderRepeatAll(normal: IVector3D, offsetX: number, offsetY: number): void { if(!this._cells.length || !this._cachedBitmapData) return; @@ -292,7 +292,7 @@ export class PlaneMaterialCellColumn while(index < this._cachedBitmapData.height) { - index = this.renderCells(this._cells, index, true, k, _arg_2, _arg_3); + index = this.renderCells(this._cells, index, true, normal, offsetX, offsetY); if(!index) return; } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts index 0d38300f..5604cf5d 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts @@ -36,34 +36,34 @@ export class PlaneMaterialCellMatrix private _normalMinY: number = -1; private _normalMaxY: number = 1; - constructor(k: number, _arg_2: number=1, _arg_3: number=1, _arg_4: number=-1, _arg_5: number=1, _arg_6: number=-1, _arg_7: number=1) + constructor(totalColumns: number, repeatMode: number=1, align: number=1, normalMinX: number=-1, normalMaxX: number=1, normalMinY: number=-1, normalMaxY: number=1) { this._columns = []; - if(k < 1) + if(totalColumns < 1) { - k = 1; + totalColumns = 1; } let _local_8 = 0; - while(_local_8 < k) + while(_local_8 < totalColumns) { this._columns.push(null); _local_8++; } - this._repeatMode = _arg_2; - this._align = _arg_3; - this._normalMinX = _arg_4; - this._normalMaxX = _arg_5; - this._normalMinY = _arg_6; - this._normalMaxY = _arg_7; + this._repeatMode = repeatMode; + this._align = align; + this._normalMinX = normalMinX; + this._normalMaxX = normalMaxX; + this._normalMinY = normalMinY; + this._normalMaxY = normalMaxY; if(this._repeatMode == PlaneMaterialCellMatrix.REPEAT_MODE_RANDOM) { this._isStatic = false; } } - private static nextRandomColumnIndex(k: number): number + private static nextRandomColumnIndex(totalColumns: number): number { - return ((Randomizer.getValues(1, 0, (k * 17631))[0]) % k); + return ((Randomizer.getValues(1, 0, (totalColumns * 17631))[0]) % totalColumns); } public get normalMinX(): number @@ -139,16 +139,16 @@ export class PlaneMaterialCellMatrix this._isCached = false; } - public createColumn(k: number, _arg_2: number, _arg_3: PlaneMaterialCell[], _arg_4: number=1): boolean + public createColumn(index: number, width: number, cells: PlaneMaterialCell[], repeatMode: number=1): boolean { - if((k < 0) || (k >= this._columns.length)) return false; + if((index < 0) || (index >= this._columns.length)) return false; - const newColumn = new PlaneMaterialCellColumn(_arg_2, _arg_3, _arg_4); - const oldColumn = this._columns[k]; + const newColumn = new PlaneMaterialCellColumn(width, cells, repeatMode); + const oldColumn = this._columns[index]; if(oldColumn) oldColumn.dispose(); - this._columns[k] = newColumn; + this._columns[index] = newColumn; if(newColumn && !newColumn.isStatic) this._isStatic = false; @@ -313,11 +313,11 @@ export class PlaneMaterialCellMatrix return this._cachedBitmapData; } - private copyCachedBitmapOnCanvas(k: Graphics, _arg_2: number, _arg_3: number, _arg_4: boolean): void + private copyCachedBitmapOnCanvas(canvas: Graphics, height: number, offsetY: number, topAlign: boolean): void { - if(!k || !this._cachedBitmapData || (k === this._cachedBitmapData)) return; + if(!canvas || !this._cachedBitmapData || (canvas === this._cachedBitmapData)) return; - if(!_arg_4) _arg_3 = ((k.height - _arg_2) - _arg_3); + if(!topAlign) offsetY = ((canvas.height - height) - offsetY); let _local_5: Rectangle; @@ -334,20 +334,20 @@ export class PlaneMaterialCellMatrix if(texture) { - k + canvas .beginTextureFill({ texture }) - .drawRect(0, _arg_3, _local_5.width, _local_5.height) + .drawRect(0, offsetY, _local_5.width, _local_5.height) .endFill(); } } - private getColumnsWidth(k: Graphics[]): number + private getColumnsWidth(columns: Graphics[]): number { - if(!k || !k.length) return 0; + if(!columns || !columns.length) return 0; let width = 0; - for(const graphic of k) + for(const graphic of columns) { if(!graphic) continue; @@ -357,34 +357,34 @@ export class PlaneMaterialCellMatrix return width; } - private renderColumns(k: Graphics, _arg_2: Graphics[], _arg_3: number, _arg_4: boolean): Point + private renderColumns(canvas: Graphics, columns: Graphics[], x: number, flag: boolean): Point { - if(!k || !_arg_2 || !_arg_2.length) return new Point(_arg_3, 0); + if(!canvas || !columns || !columns.length) return new Point(x, 0); let height = 0; let _local_6: Graphics = null; let _local_7 = 0; - while(_local_7 < _arg_2.length) + while(_local_7 < columns.length) { - if(_arg_4) + if(flag) { - _local_6 = _arg_2[_local_7]; + _local_6 = columns[_local_7]; } else { - _local_6 = _arg_2[((_arg_2.length - 1) - _local_7)]; + _local_6 = columns[((columns.length - 1) - _local_7)]; } if(_local_6 != null) { - if(!_arg_4) + if(!flag) { - _arg_3 = (_arg_3 - _local_6.width); + x = (x - _local_6.width); } let _local_8 = 0; if(this._align == PlaneMaterialCellMatrix.ALIGN_BOTTOM) { - _local_8 = (k.height - _local_6.height); + _local_8 = (canvas.height - _local_6.height); } let texture = RoomVisualization.getTextureCache(_local_6); @@ -396,40 +396,40 @@ export class PlaneMaterialCellMatrix RoomVisualization.addTextureCache(_local_6, texture); } - k.beginTextureFill({ texture }); - k.drawRect(_arg_3, _local_8, texture.width, texture.height); - k.endFill(); + canvas.beginTextureFill({ texture }); + canvas.drawRect(x, _local_8, texture.width, texture.height); + canvas.endFill(); if(_local_6.height > height) { height = _local_6.height; } - if(_arg_4) + if(flag) { - _arg_3 = (_arg_3 + _local_6.width); + x = (x + _local_6.width); } - if((((_arg_4) && (_arg_3 >= k.width)) || ((!(_arg_4)) && (_arg_3 <= 0)))) + if((((flag) && (x >= canvas.width)) || ((!(flag)) && (x <= 0)))) { - return new Point(_arg_3, height); + return new Point(x, height); } } _local_7++; } - return new Point(_arg_3, height); + return new Point(x, height); } - private renderRepeatAll(k: Graphics, _arg_2: Graphics[]): number + private renderRepeatAll(canvas: Graphics, columns: Graphics[]): number { - if(!k || !_arg_2 || !_arg_2.length) return 0; + if(!canvas || !columns || !columns.length) return 0; - const totalWidth: number = this.getColumnsWidth(_arg_2); + const totalWidth: number = this.getColumnsWidth(columns); let x = 0; let y = 0; - while(x < k.width) + while(x < canvas.width) { - const point = this.renderColumns(k, _arg_2, x, true); + const point = this.renderColumns(canvas, columns, x, true); x = point.x; @@ -695,7 +695,7 @@ export class PlaneMaterialCellMatrix // return _local_3; // } - public getColumns(k: number): PlaneMaterialCellColumn[] + public getColumns(width: number): PlaneMaterialCellColumn[] { if(this._repeatMode === PlaneMaterialCellMatrix.REPEAT_MODE_RANDOM) { @@ -703,7 +703,7 @@ export class PlaneMaterialCellMatrix let columnIndex = 0; - while(columnIndex < k) + while(columnIndex < width) { const column = this._columns[PlaneMaterialCellMatrix.nextRandomColumnIndex(this._columns.length)]; diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts index a1efb007..dd77a660 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -152,30 +152,30 @@ export class PlaneRasterizer implements IPlaneRasterizer this._textures.clear(); } - protected getTexture(k: string): PlaneTexture + protected getTexture(textureId: string): PlaneTexture { - return this._textures.get(k); + return this._textures.get(textureId); } - protected getMaterial(k: string): PlaneMaterial + protected getMaterial(materialId: string): PlaneMaterial { - return this._materials.get(k); + return this._materials.get(materialId); } - protected getPlane(k: string): Plane + protected getPlane(planeId: string): Plane { - return this._planes.get(k); + return this._planes.get(planeId); } - protected addPlane(k: string, _arg_2: Plane): boolean + protected addPlane(id: string, plane: Plane): boolean { - if(!_arg_2) return false; + if(!plane) return false; - const existing = this._planes.get(k); + const existing = this._planes.get(id); if(!existing) { - this._planes.set(k, _arg_2); + this._planes.set(id, plane); return true; } @@ -183,11 +183,11 @@ export class PlaneRasterizer implements IPlaneRasterizer return false; } - public initializeAssetCollection(k: IGraphicAssetCollection): void + public initializeAssetCollection(collection: IGraphicAssetCollection): void { if(!this._data) return; - this._assetCollection = k; + this._assetCollection = collection; this.initializeAll(); } @@ -212,13 +212,13 @@ export class PlaneRasterizer implements IPlaneRasterizer { } - private parseTextures(k: any, _arg_2: IGraphicAssetCollection): void + private parseTextures(textures: any, collection: IGraphicAssetCollection): void { - if(!k || !_arg_2) return; + if(!textures || !collection) return; - if(k.length) + if(textures.length) { - for(const texture of k) + for(const texture of textures) { if(!texture) continue; @@ -246,7 +246,7 @@ export class PlaneRasterizer implements IPlaneRasterizer if(bitmap.normalMinY !== undefined) normalMinY = bitmap.normalMinY; if(bitmap.normalMaxY !== undefined) normalMaxY = bitmap.normalMaxY; - const asset = _arg_2.getAsset(assetName); + const asset = collection.getAsset(assetName); if(asset) { @@ -273,11 +273,11 @@ export class PlaneRasterizer implements IPlaneRasterizer } } - private parsePlaneMaterials(k: any): void + private parsePlaneMaterials(materials: any): void { - if(!k || !k.length) return; + if(!materials || !materials.length) return; - for(const material of k) + for(const material of materials) { if(!material) continue; @@ -354,17 +354,17 @@ export class PlaneRasterizer implements IPlaneRasterizer } } - private parsePlaneMaterialCellColumn(k: { repeatMode: string, width: number }, _arg_2: PlaneMaterialCellMatrix, _arg_3: number): void + private parsePlaneMaterialCellColumn(column: { repeatMode: string, width: number }, cellMatrix: PlaneMaterialCellMatrix, index: number): void { - if(!k || !_arg_2) return; + if(!column || !cellMatrix) return; let repeatMode = PlaneMaterialCellColumn.REPEAT_MODE_ALL; - const width = k.width; + const width = column.width; - const cells = this.parsePlaneMaterialCells(k); + const cells = this.parsePlaneMaterialCells(column); - switch(k.repeatMode) + switch(column.repeatMode) { case 'borders': repeatMode = PlaneMaterialCellColumn.REPEAT_MODE_BORDERS; @@ -386,20 +386,20 @@ export class PlaneRasterizer implements IPlaneRasterizer break; } - _arg_2.createColumn(_arg_3, width, cells, repeatMode); + cellMatrix.createColumn(index, width, cells, repeatMode); } - private parsePlaneMaterialCells(k: any): PlaneMaterialCell[] + private parsePlaneMaterialCells(column: any): PlaneMaterialCell[] { - if(!k || !k.cells || !k.cells.length) return null; + if(!column || !column.cells || !column.cells.length) return null; const cells: PlaneMaterialCell[] = []; let index = 0; - while(index < k.cells.length) + while(index < column.cells.length) { - const cell = k.cells[index]; + const cell = column.cells[index]; if(cell) { @@ -509,34 +509,34 @@ export class PlaneRasterizer implements IPlaneRasterizer return offsets; } - protected getGeometry(k: number, _arg_2: number, _arg_3: number): IRoomGeometry + protected getGeometry(size: number, horizontalAngle: number, verticalAngle: number): IRoomGeometry { - _arg_2 = Math.abs(_arg_2); - if(_arg_2 > 90) _arg_2 = 90; + horizontalAngle = Math.abs(horizontalAngle); + if(horizontalAngle > 90) horizontalAngle = 90; - _arg_3 = Math.abs(_arg_3); - if(_arg_3 > 90) _arg_3 = 90; + verticalAngle = Math.abs(verticalAngle); + if(verticalAngle > 90) verticalAngle = 90; - const identifier = `${ k }_${ Math.round(_arg_2) }_${ Math.round(_arg_3) }`; + const identifier = `${ size }_${ Math.round(horizontalAngle) }_${ Math.round(verticalAngle) }`; let geometry = this._geometries.get(identifier); if(geometry) return geometry; - geometry = new RoomGeometry(k, new Vector3d(_arg_2, _arg_3), new Vector3d(-10, 0, 0)); + geometry = new RoomGeometry(size, new Vector3d(horizontalAngle, verticalAngle), new Vector3d(-10, 0, 0)); this._geometries.set(identifier, geometry); return geometry; } - protected parseVisualizations(k: Plane, _arg_2: any): void + protected parseVisualizations(plane: Plane, visualizations: any): void { - if(!k || !_arg_2) return; + if(!plane || !visualizations) return; - if(_arg_2 && _arg_2.length) + if(visualizations && visualizations.length) { - for(const visualization of _arg_2) + for(const visualization of visualizations) { if(!visualization) continue; @@ -550,7 +550,7 @@ export class PlaneRasterizer implements IPlaneRasterizer const layers = visualization.layers; - const planeVisualization = k.createPlaneVisualization(size, ((layers && layers.length) || 0), this.getGeometry(size, horizontalAngle, verticalAngle)); + const planeVisualization = plane.createPlaneVisualization(size, ((layers && layers.length) || 0), this.getGeometry(size, horizontalAngle, verticalAngle)); if(planeVisualization && (layers && layers.length)) { @@ -590,19 +590,19 @@ export class PlaneRasterizer implements IPlaneRasterizer } } - public render(k: Graphics, _arg_2: string, _arg_3: number, _arg_4: number, _arg_5: number, _arg_6: IVector3D, _arg_7: boolean, _arg_8: number =0, _arg_9: number = 0, _arg_10: number = 0, _arg_11: number = 0, _arg_12: number = 0): PlaneBitmapData + public render(canvas: Graphics, id: string, width: number, height: number, size: number, normal: IVector3D, useTexture: boolean, offsetX: number = 0, offsetY: number = 0, maxX: number = 0, maxY: number = 0, timeSinceStartMs: number = 0): PlaneBitmapData { return null; } - public getTextureIdentifier(k: number, _arg_2: IVector3D): string + public getTextureIdentifier(k: number, normal: IVector3D): string { return k.toString(); } - public getLayers(k: string): PlaneVisualizationLayer[] + public getLayers(id: string): PlaneVisualizationLayer[] { - let planes = this.getPlane(k); + let planes = this.getPlane(id); if(!planes) planes = this.getPlane(PlaneRasterizer.DEFAULT); diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTexture.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTexture.ts index 8328bb0e..e0d07273 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTexture.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTexture.ts @@ -29,9 +29,9 @@ export class PlaneTexture } } - public addBitmap(k: Texture, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1, _arg_6: string = null): void + public addBitmap(texture: Texture, normalMinX: number = -1, normalMaxX: number = 1, normalMinY: number = -1, normalMaxY: number = 1, assetName: string = null): void { - this._bitmaps.push(new PlaneTextureBitmap(k, _arg_2, _arg_3, _arg_4, _arg_5, _arg_6)); + this._bitmaps.push(new PlaneTextureBitmap(texture, normalMinX, normalMaxX, normalMinY, normalMaxY, assetName)); } public getBitmap(k: IVector3D): Texture diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTextureBitmap.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTextureBitmap.ts index 65b73f5a..adcd06a3 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTextureBitmap.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTextureBitmap.ts @@ -12,14 +12,14 @@ export class PlaneTextureBitmap private _normalMaxY: number; private _assetName: string; - constructor(k: Texture, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1, _arg_6: string = null) + constructor(texture: Texture, normalMinX: number = -1, normalMaxX: number = 1, normalMinY: number = -1, normalMaxY: number = 1, assetName: string = null) { - this._normalMinX = _arg_2; - this._normalMaxX = _arg_3; - this._normalMinY = _arg_4; - this._normalMaxY = _arg_5; - this._assetName = _arg_6; - this._bitmap = k; + this._normalMinX = normalMinX; + this._normalMaxX = normalMaxX; + this._normalMinY = normalMinY; + this._normalMaxY = normalMaxY; + this._assetName = assetName; + this._bitmap = texture; } public get bitmap(): Texture diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts index 191e03ac..bd0ed127 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts @@ -19,20 +19,20 @@ export class PlaneVisualization private _isCached: boolean; private _hasAnimationLayers: boolean; - constructor(k: number, _arg_2: number, _arg_3: IRoomGeometry) + constructor(size: number, totalLayers: number, geometry: IRoomGeometry) { this._layers = []; - this._geometry = _arg_3; + this._geometry = geometry; this._cachedBitmapData = null; this._cachedBitmapNormal = new Vector3d(); this._isCached = false; this._hasAnimationLayers = false; - if(_arg_2 < 0) _arg_2 = 0; + if(totalLayers < 0) totalLayers = 0; let index = 0; - while(index < _arg_2) + while(index < totalLayers) { this._layers.push(null); @@ -107,32 +107,32 @@ export class PlaneVisualization this._isCached = false; } - public setLayer(k: number, _arg_2: PlaneMaterial, _arg_3: number, _arg_4: number, _arg_5: number = 0): boolean + public setLayer(layerId: number, material: PlaneMaterial, color: number, align: number, offset: number = 0): boolean { - if((k < 0) || (k > this._layers.length)) return false; + if((layerId < 0) || (layerId > this._layers.length)) return false; - let layer = this._layers[k]; + let layer = this._layers[layerId]; if(layer) layer.dispose(); - layer = new PlaneVisualizationLayer(_arg_2, _arg_3, _arg_4, _arg_5); + layer = new PlaneVisualizationLayer(material, color, align, offset); - this._layers[k] = layer; + this._layers[layerId] = layer; return true; } - public setAnimationLayer(k: number, _arg_2: any, _arg_3: IGraphicAssetCollection): boolean + public setAnimationLayer(layerId: number, animationItems: any, collection: IGraphicAssetCollection): boolean { - if((k < 0) || (k > this._layers.length)) return false; + if((layerId < 0) || (layerId > this._layers.length)) return false; - let layer = this._layers[k] as IDisposable; + let layer = this._layers[layerId] as IDisposable; if(layer) layer.dispose(); - layer = new PlaneVisualizationAnimationLayer(_arg_2, _arg_3); + layer = new PlaneVisualizationAnimationLayer(animationItems, collection); - this._layers[k] = layer; + this._layers[layerId] = layer; this._hasAnimationLayers = true; return true; diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts index c3ba98e5..9e93c2ba 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts @@ -19,12 +19,12 @@ export class PlaneVisualizationLayer private _bitmapData: Graphics; private _isDisposed: boolean; - constructor(k: PlaneMaterial, _arg_2: number, _arg_3: number, _arg_4: number = 0) + constructor(material: PlaneMaterial, color: number, align: number, offset: number = 0) { - this._material = k; - this._offset = _arg_4; - this._align = _arg_3; - this._color = _arg_2; + this._material = material; + this._offset = offset; + this._align = align; + this._color = color; this._bitmapData = null; this._isDisposed = false; } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts index 6aa5d226..bf8b77a8 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts @@ -9,22 +9,22 @@ export class WallPlane extends Plane public static HORIZONTAL_ANGLE_DEFAULT: number = 45; public static VERTICAL_ANGLE_DEFAULT: number = 30; - public render(k: Graphics, _arg_2: number, _arg_3: number, size: number, _arg_5: IVector3D, _arg_6: boolean): Graphics + public render(canvas: Graphics, width: number, height: number, size: number, normal: IVector3D, useTexture: boolean): Graphics { const visualization = this.getPlaneVisualization(size); if(!visualization || !visualization.geometry) return null; const _local_8 = visualization.geometry.getScreenPoint(new Vector3d(0, 0, 0)); - const _local_9 = visualization.geometry.getScreenPoint(new Vector3d(0, 0, (_arg_3 / visualization.geometry.scale))); - const _local_10 = visualization.geometry.getScreenPoint(new Vector3d(0, (_arg_2 / visualization.geometry.scale), 0)); + const _local_9 = visualization.geometry.getScreenPoint(new Vector3d(0, 0, (height / visualization.geometry.scale))); + const _local_10 = visualization.geometry.getScreenPoint(new Vector3d(0, (width / visualization.geometry.scale), 0)); if(_local_8 && _local_9 && _local_10) { - _arg_2 = Math.round(Math.abs((_local_8.x - _local_10.x))); - _arg_3 = Math.round(Math.abs((_local_8.y - _local_9.y))); + width = Math.round(Math.abs((_local_8.x - _local_10.x))); + height = Math.round(Math.abs((_local_8.y - _local_9.y))); } - return visualization.render(k, _arg_2, _arg_3, _arg_5, _arg_6); + return visualization.render(canvas, width, height, normal, useTexture); } } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts index a63f7550..7956cfa2 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts @@ -64,13 +64,13 @@ export class WallRasterizer extends PlaneRasterizer return new PlaneBitmapData(graphic, -1); } - public getTextureIdentifier(k: number, _arg_2: IVector3D): string + public getTextureIdentifier(k: number, normal: IVector3D): string { - if(_arg_2) + if(normal) { - return `${ k }_${ _arg_2.x }_${ _arg_2.y }_${ _arg_2.z }`; + return `${ k }_${ normal.x }_${ normal.y }_${ normal.z }`; } - return super.getTextureIdentifier(k, _arg_2); + return super.getTextureIdentifier(k, normal); } } From 6b11516ee896a20d38131465f51d7a0242dc03a3 Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 7 Sep 2021 21:05:14 -0400 Subject: [PATCH 017/108] Floor updates --- .../PlaneVisualizationAnimationLayer.ts | 30 +-- .../room/rasterizer/basic/FloorPlane.ts | 10 +- .../room/rasterizer/basic/FloorRasterizer.ts | 8 +- .../rasterizer/basic/PlaneMaterialCell.ts | 173 ++++++++---------- .../basic/PlaneMaterialCellColumn.ts | 10 +- .../basic/PlaneMaterialCellMatrix.ts | 62 +++---- .../rasterizer/basic/PlaneVisualization.ts | 38 ++-- 7 files changed, 146 insertions(+), 185 deletions(-) diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts index 0557724b..178f09d2 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts @@ -71,11 +71,11 @@ export class PlaneVisualizationAnimationLayer implements IDisposable } } - public render(k: Graphics, _arg_2: number, _arg_3: number, _arg_4: IVector3D, _arg_5: number, _arg_6: number, _arg_7: number, _arg_8: number, _arg_9: number, _arg_10: number, _arg_11: number): Graphics + public render(canvas: Graphics, width: number, height: number, normal: IVector3D, offsetX: number, offsetY: number, maxX: number, maxY: number, dimensionX: number, dimensionY: number, timeSinceStartMs: number): Graphics { - if((((k == null) || (!(k.width == _arg_2))) || (!(k.height == _arg_3)))) + if((((canvas == null) || (!(canvas.width == width))) || (!(canvas.height == height)))) { - if((((this._bitmapData == null) || (!(this._bitmapData.width == _arg_2))) || (!(this._bitmapData.height == _arg_3)))) + if((((this._bitmapData == null) || (!(this._bitmapData.width == width))) || (!(this._bitmapData.height == height)))) { if(this._bitmapData != null) { @@ -83,7 +83,7 @@ export class PlaneVisualizationAnimationLayer implements IDisposable } this._bitmapData = new Graphics() - .drawRect(0, 0, _arg_2, _arg_3); + .drawRect(0, 0, width, height); } else { @@ -94,10 +94,10 @@ export class PlaneVisualizationAnimationLayer implements IDisposable //this._bitmapData.fillRect(this._bitmapData.rect, 0xFFFFFF); } - k = this._bitmapData; + canvas = this._bitmapData; } - if(((_arg_7 > 0) && (_arg_8 > 0))) + if(((maxX > 0) && (maxY > 0))) { let _local_12 = 0; @@ -106,16 +106,16 @@ export class PlaneVisualizationAnimationLayer implements IDisposable const _local_13 = (this._items[_local_12] as AnimationItem); if(_local_13 != null) { - const _local_14 = _local_13.getPosition(_arg_7, _arg_8, _arg_9, _arg_10, _arg_11); + const _local_14 = _local_13.getPosition(maxX, maxY, dimensionX, dimensionY, timeSinceStartMs); - _local_14.x = (_local_14.x - _arg_5); - _local_14.y = (_local_14.y - _arg_6); + _local_14.x = (_local_14.x - offsetX); + _local_14.y = (_local_14.y - offsetY); if(_local_13.bitmapData) { - if(_local_14.x > 0 && (_local_14.x + _local_13.bitmapData.width < k.width)) + if(_local_14.x > 0 && (_local_14.x + _local_13.bitmapData.width < canvas.width)) { - k + canvas .beginFill(0x00FF00) .beginTextureFill({ texture: _local_13.bitmapData.texture, matrix: new Matrix(1, 0, 0, 1, _local_14.x, _local_14.y) }) .drawRect(_local_14.x, _local_14.y, _local_13.bitmapData.width, _local_13.bitmapData.height) @@ -123,8 +123,8 @@ export class PlaneVisualizationAnimationLayer implements IDisposable } else if(_local_14.x > 0) { - const difference = k.width - _local_14.x; - k + const difference = canvas.width - _local_14.x; + canvas .beginFill(0x00FF00) .beginTextureFill({ texture: _local_13.bitmapData.texture, matrix: new Matrix(1, 0, 0, 1, _local_14.x, _local_14.y) }) .drawRect(_local_14.x, _local_14.y, difference, _local_13.bitmapData.height) @@ -134,7 +134,7 @@ export class PlaneVisualizationAnimationLayer implements IDisposable { //if(_local_14.x > -_local_13.bitmapData.width) const difference = _local_13.bitmapData.width + _local_14.x; - k + canvas .beginFill(0x00FF00) .beginTextureFill({ texture: _local_13.bitmapData.texture, matrix: new Matrix(1, 0, 0, 1, _local_14.x, _local_14.y) }) .drawRect(0, _local_14.y, difference, _local_13.bitmapData.height) @@ -147,6 +147,6 @@ export class PlaneVisualizationAnimationLayer implements IDisposable } } - return k; + return canvas; } } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts index 95297c1f..6006c27c 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts @@ -19,8 +19,8 @@ export class FloorPlane extends Plane const _local_11 = visualization.geometry.getScreenPoint(new Vector3d(0, (height / visualization.geometry.scale), 0)); const _local_12 = visualization.geometry.getScreenPoint(new Vector3d((width / visualization.geometry.scale), 0, 0)); - let _local_13 = 0; - let _local_14 = 0; + let x = 0; + let y = 0; if(_local_10 && _local_11 && _local_12) { @@ -29,10 +29,10 @@ export class FloorPlane extends Plane const _local_15 = (_local_10.x - visualization.geometry.getScreenPoint(new Vector3d(1, 0, 0)).x); - _local_13 = (offsetX * Math.trunc(Math.abs(_local_15))); - _local_14 = (offsetY * Math.trunc(Math.abs(_local_15))); + x = (offsetX * Math.trunc(Math.abs(_local_15))); + y = (offsetY * Math.trunc(Math.abs(_local_15))); } - return visualization.render(canvas, width, height, normal, useTexture, _local_13, _local_14); + return visualization.render(canvas, width, height, normal, useTexture, x, y); } } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts index d064b265..c3a5790f 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts @@ -43,13 +43,7 @@ export class FloorRasterizer extends PlaneRasterizer if(!plane) return null; - if(canvas) - { - canvas - .beginFill(0xFFFFFF) - .drawRect(0, 0, canvas.width, canvas.height) - .endFill(); - } + if(canvas) canvas.clear(); let graphic = plane.render(canvas, width, height, scale, normal, useTexture, offsetX, offsetY); diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts index 73aca4e7..5f1daba4 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts @@ -1,15 +1,13 @@ -import { Graphics } from '@pixi/graphics'; -import { Point } from '@pixi/math'; -import { Sprite } from '@pixi/sprite'; -import { TilingSprite } from '@pixi/sprite-tiling'; +import { Matrix, Point } from '@pixi/math'; import { NitroSprite } from '../../../../../../../core'; import { IGraphicAsset } from '../../../../../../../room/object/visualization/utils/IGraphicAsset'; import { IVector3D } from '../../../../../../../room/utils/IVector3D'; +import { Randomizer } from '../../utils'; import { PlaneTexture } from './PlaneTexture'; export class PlaneMaterialCell { - private _cachedBitmapData: Graphics; + private _cachedSprite: NitroSprite; private _texture: PlaneTexture; private _extraItemOffsets: Point[]; private _extraItemAssets: IGraphicAsset[]; @@ -17,7 +15,7 @@ export class PlaneMaterialCell constructor(texture: PlaneTexture, assets: IGraphicAsset[] = null, offsetPoints: Point[] = null, limit: number = 0) { - this._cachedBitmapData = null; + this._cachedSprite = null; this._texture = texture; this._extraItemOffsets = []; this._extraItemAssets = []; @@ -71,11 +69,11 @@ export class PlaneMaterialCell this._texture = null; } - if(this._cachedBitmapData) + if(this._cachedSprite) { - this._cachedBitmapData.destroy(); + this._cachedSprite.destroy(); - this._cachedBitmapData = null; + this._cachedSprite = null; } this._extraItemAssets = null; @@ -85,11 +83,11 @@ export class PlaneMaterialCell public clearCache(): void { - if(this._cachedBitmapData) + if(this._cachedSprite) { - this._cachedBitmapData.destroy(); + this._cachedSprite.destroy(); - this._cachedBitmapData = null; + this._cachedSprite = null; } } @@ -105,7 +103,7 @@ export class PlaneMaterialCell return 0; } - public render(normal: IVector3D, textureOffsetX: number, textureOffsetY: number): Sprite + public render(normal: IVector3D, textureOffsetX: number, textureOffsetY: number): NitroSprite { if(!this._texture) return null; @@ -113,7 +111,7 @@ export class PlaneMaterialCell if(!texture) return null; - let bitmap: Sprite = null; + const bitmap = new NitroSprite(texture); if((textureOffsetX !== 0) || (textureOffsetY !== 0)) { @@ -121,117 +119,100 @@ export class PlaneMaterialCell while(textureOffsetY < 0) textureOffsetY += texture.height; - const tiling = new TilingSprite(texture, texture.width, texture.height); - - tiling.tilePosition.x = (textureOffsetX % texture.width); - tiling.tilePosition.y = (textureOffsetY % texture.height); - - tiling.uvRespectAnchor = true; + bitmap.x = (textureOffsetX % texture.width); + bitmap.y = (textureOffsetY % texture.height); if(textureOffsetX) { - tiling.anchor.x = 1; - tiling.scale.x = -1; + bitmap.anchor.x = 1; + bitmap.scale.x = -1; } if(textureOffsetY) { - tiling.anchor.y = 1; - tiling.scale.y = -1; + bitmap.anchor.y = 1; + bitmap.scale.y = -1; } - - bitmap = tiling; - } - else - { - bitmap = new NitroSprite(texture); } if(bitmap) { - // if(!this.isStatic) - // { - // if(this._cachedBitmapData) - // { - // if((this._cachedBitmapData.width !== bitmap.width) || (this._cachedBitmapData.height !== bitmap.height)) - // { - // this._cachedBitmapData.destroy(); + if(!this.isStatic) + { + if(this._cachedSprite) + { + if((this._cachedSprite.width !== bitmap.width) || (this._cachedSprite.height !== bitmap.height)) + { + this._cachedSprite.destroy(); - // this._cachedBitmapData = null; - // } - // else - // { - // const bitmapTexture = TextureUtils.generateTexture(bitmap, new Rectangle(0, 0, bitmap.width, bitmap.height)); + this._cachedSprite = null; + } + } - // RoomVisualization.RENDER_TEXTURES.push(bitmapTexture); + if(!this._cachedSprite) + { + this._cachedSprite = new NitroSprite(texture); + } - // if(bitmapTexture) - // { - // this._cachedBitmapData - // .beginTextureFill({ texture: bitmapTexture }) - // .drawRect(0, 0, bitmapTexture.width, bitmapTexture.height) - // .endFill(); - // } - // } - // } + const limitMin = Math.min(this._extraItemCount, this._extraItemOffsets.length); + const limitMax = Math.max(this._extraItemCount, this._extraItemOffsets.length); + const offsetIndexes = Randomizer.getArray(this._extraItemCount, limitMax); - // if(!this._cachedBitmapData) this._cachedBitmapData = bitmap.clone(); + let i = 0; - // const limitMin = Math.min(this._extraItemCount, this._extraItemOffsets.length); - // const limitMax = Math.max(this._extraItemCount, this._extraItemOffsets.length); - // const offsetIndexes = Randomizer.getArray(this._extraItemCount, limitMax); + while(i < limitMin) + { + const offset = this._extraItemOffsets[offsetIndexes[i]]; + const item = this._extraItemAssets[(i % this._extraItemAssets.length)]; - // let i = 0; + if(offset && item) + { + const assetTexture = item.texture; - // while (i < limitMin) - // { - // const offset = this._extraItemOffsets[offsetIndexes[i]]; - // const item = this._extraItemAssets[(i % this._extraItemAssets.length)]; + if(assetTexture) + { + const offsetFinal = new Point((offset.x + item.offsetX), (offset.y + item.offsetY)); + const flipMatrix = new Matrix(); - // if(offset && item) - // { - // const assetTexture = item.texture; + let x = 1; + let y = 1; + let translateX = 0; + let translateY = 0; - // if(assetTexture) - // { - // const offsetFinal = new Point((offset.x + item.offsetX), (offset.y + item.offsetY)); - // const flipMatrix = new Matrix(); + if(item.flipH) + { + x = -1; + translateX = assetTexture.width; + } - // let x = 1; - // let y = 1; - // let translateX = 0; - // let translateY = 0; + if(item.flipV) + { + y = -1; + translateY = assetTexture.height; + } - // if(item.flipH) - // { - // x = -1; - // translateX = assetTexture.width; - // } + let offsetX = (offsetFinal.x + translateX); + offsetX = ((offsetX >> 1) << 1); - // if(item.flipV) - // { - // y = -1; - // translateY = assetTexture.height; - // } + flipMatrix.scale(x, y); + flipMatrix.translate(offsetX, (offsetFinal.y + translateY)); - // let offsetX = (offsetFinal.x + translateX); - // offsetX = ((offsetX >> 1) << 1); + const sprite = new NitroSprite(assetTexture); - // flipMatrix.scale(x, y); - // flipMatrix.translate(offsetX, (offsetFinal.y + translateY)); + sprite.transform.setFromMatrix(flipMatrix); - // this._cachedBitmapData - // .beginTextureFill({ texture: assetTexture, matrix: flipMatrix }) - // .drawRect(flipMatrix.tx, flipMatrix.ty, assetTexture.width, assetTexture.height) - // .endFill(); - // } - // } + sprite.x = flipMatrix.tx; + sprite.y = flipMatrix.ty; - // i++; - // } + this._cachedSprite.addChild(sprite); + } + } - // return this._cachedBitmapData; - // } + i++; + } + + return this._cachedSprite; + } return bitmap; } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts index 6f5275c9..508ba008 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts @@ -1,4 +1,5 @@ import { Graphics } from '@pixi/graphics'; +import { NitroRenderTexture } from '../../../../../../../core'; import { IVector3D } from '../../../../../../../room/utils/IVector3D'; import { Vector3d } from '../../../../../../../room/utils/Vector3d'; import { PlaneMaterialCell } from './PlaneMaterialCell'; @@ -15,6 +16,7 @@ export class PlaneMaterialCellColumn private _cells: PlaneMaterialCell[]; private _repeatMode: number; private _width: number; + private _cachedTexture: NitroRenderTexture; private _cachedBitmapData: Graphics; private _cachedBitmapNormal: Vector3d; private _cachedBitmapDataOffsetX: number; @@ -192,19 +194,19 @@ export class PlaneMaterialCellColumn this.renderRepeatNone(normal); break; case PlaneMaterialCellColumn.REPEAT_MODE_BORDERS: - console.log('tru2'); + console.log('REPEAT_MODE_BORDERS'); // this.renderRepeatBorders(normal); break; case PlaneMaterialCellColumn.REPEAT_MODE_CENTER: - console.log('tru3'); + console.log('REPEAT_MODE_CENTER'); // this.renderRepeatCenter(normal); break; case PlaneMaterialCellColumn.REPEAT_MODE_FIRST: - console.log('tru4'); + console.log('REPEAT_MODE_FIRST'); // this.renderRepeatFirst(normal); break; case PlaneMaterialCellColumn.REPEAT_MODE_LAST: - console.log('tru5'); + console.log('REPEAT_MODE_LAST'); // this.renderRepeatLast(normal); break; default: diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts index 5604cf5d..1305456b 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts @@ -362,59 +362,43 @@ export class PlaneMaterialCellMatrix if(!canvas || !columns || !columns.length) return new Point(x, 0); let height = 0; - let _local_6: Graphics = null; - let _local_7 = 0; + let i = 0; - while(_local_7 < columns.length) + while(i < columns.length) { - if(flag) - { - _local_6 = columns[_local_7]; - } - else - { - _local_6 = columns[((columns.length - 1) - _local_7)]; - } - if(_local_6 != null) - { - if(!flag) - { - x = (x - _local_6.width); - } - let _local_8 = 0; - if(this._align == PlaneMaterialCellMatrix.ALIGN_BOTTOM) - { - _local_8 = (canvas.height - _local_6.height); - } + const column = flag ? columns[i] : columns[((columns.length - 1) - i)]; - let texture = RoomVisualization.getTextureCache(_local_6); + if(column) + { + if(!flag) x = (x - column.width); + + let y = 0; + + if(this._align == PlaneMaterialCellMatrix.ALIGN_BOTTOM) y = (canvas.height - column.height); + + let texture = RoomVisualization.getTextureCache(column); if(!texture) { - texture = TextureUtils.generateTexture(_local_6, new Rectangle(0, 0, _local_6.width, _local_6.height)); + texture = TextureUtils.generateTexture(column, new Rectangle(0, 0, column.width, column.height)); - RoomVisualization.addTextureCache(_local_6, texture); + RoomVisualization.addTextureCache(column, texture); } canvas.beginTextureFill({ texture }); - canvas.drawRect(x, _local_8, texture.width, texture.height); + canvas.drawRect(x, y, texture.width, texture.height); canvas.endFill(); - if(_local_6.height > height) - { - height = _local_6.height; - } - if(flag) - { - x = (x + _local_6.width); - } - if((((flag) && (x >= canvas.width)) || ((!(flag)) && (x <= 0)))) - { - return new Point(x, height); - } + if(column.height > height) height = column.height; + + if(flag) x = (x + column.width); + + if((flag && (x >= canvas.width)) || (!flag && (x <= 0))) return new Point(x, height); } - _local_7++; + + i++; } + return new Point(x, height); } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts index bd0ed127..68c2f28a 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts @@ -1,10 +1,8 @@ import { Graphics } from '@pixi/graphics'; -import { Rectangle } from '@pixi/math'; import { IDisposable } from '../../../../../../../core/common/disposable/IDisposable'; import { IGraphicAssetCollection } from '../../../../../../../room/object/visualization/utils/IGraphicAssetCollection'; import { IRoomGeometry } from '../../../../../../../room/utils/IRoomGeometry'; import { IVector3D } from '../../../../../../../room/utils/IVector3D'; -import { TextureUtils } from '../../../../../../../room/utils/TextureUtils'; import { Vector3d } from '../../../../../../../room/utils/Vector3d'; import { PlaneVisualizationAnimationLayer } from '../animated/PlaneVisualizationAnimationLayer'; import { PlaneMaterial } from './PlaneMaterial'; @@ -159,17 +157,20 @@ export class PlaneVisualization { if(canvas) { - const texture = TextureUtils.generateTexture(this._cachedBitmapData, new Rectangle(0, 0, width, height)); + canvas.addChild(this._cachedBitmapData); - if(texture) - { - canvas - .beginTextureFill({ texture }) - .drawRect(0, 0, texture.width, texture.height) - .endFill(); + return canvas; + // const texture = TextureUtils.generateTexture(this._cachedBitmapData, new Rectangle(0, 0, width, height)); - return canvas; - } + // if(texture) + // { + // canvas + // .beginTextureFill({ texture }) + // .drawRect(0, 0, texture.width, texture.height) + // .endFill(); + + // return canvas; + // } } return this._cachedBitmapData; @@ -187,12 +188,10 @@ export class PlaneVisualization if(!this._cachedBitmapData) { - const graphic = new Graphics() + this._cachedBitmapData = new Graphics() .beginFill(0xFFFFFF) .drawRect(0, 0, width, height) .endFill(); - - this._cachedBitmapData = graphic; } else { @@ -226,12 +225,13 @@ export class PlaneVisualization if(canvas && (canvas !== this._cachedBitmapData)) { - const texture = TextureUtils.generateTexture(canvas, new Rectangle(0, 0, canvas.width, canvas.height)); + this._cachedBitmapData.addChild(canvas.clone()); + // const texture = TextureUtils.generateTexture(canvas, new Rectangle(0, 0, canvas.width, canvas.height)); - this._cachedBitmapData - .beginTextureFill({ texture }) - .drawRect(0, 0, canvas.width, canvas.height) - .endFill(); + // this._cachedBitmapData + // .beginTextureFill({ texture }) + // .drawRect(0, 0, canvas.width, canvas.height) + // .endFill(); return canvas; } From 9444f62c91040773c854bc91fa88a399d20f6bde Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 9 Sep 2021 00:22:44 -0400 Subject: [PATCH 018/108] Fix busted export --- src/nitro/communication/NitroMessages.ts | 2 +- .../communication/messages/outgoing/achievements/index.ts | 1 - .../outgoing/advertisement/GetInterstitialMessageComposer.ts | 2 +- .../advertisement/InterstitialShownMessageComposer.ts | 2 +- .../RequestAchievementsMessageComposer.ts | 4 ++-- .../communication/messages/outgoing/advertisement/index.ts | 1 + src/nitro/communication/messages/outgoing/index.ts | 1 - 7 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 src/nitro/communication/messages/outgoing/achievements/index.ts rename src/nitro/communication/messages/outgoing/{achievements => advertisement}/RequestAchievementsMessageComposer.ts (80%) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 85c860b8..8e4f24bf 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -222,7 +222,7 @@ import { UserCurrencyEvent } from './messages/incoming/user/inventory/currency/U import { UserSubscriptionEvent } from './messages/incoming/user/inventory/subscription/UserSubscriptionEvent'; import { RespectReceivedEvent } from './messages/incoming/user/RespectReceivedEvent'; import { UserWardrobePageEvent } from './messages/incoming/user/wardrobe/UserWardrobePageEvent'; -import { RequestAchievementsMessageComposer } from './messages/outgoing/achievements/RequestAchievementsMessageComposer'; +import { RequestAchievementsMessageComposer } from './messages/outgoing/advertisement/RequestAchievementsMessageComposer'; import { GetWardrobeMessageComposer } from './messages/outgoing/avatar/GetWardrobeMessageComposer'; import { SaveWardrobeOutfitMessageComposer } from './messages/outgoing/avatar/SaveWardrobeOutfitMessageComposer'; import { PhotoCompetitionMessageComposer } from './messages/outgoing/camera/PhotoCompetitionMessageComposer'; diff --git a/src/nitro/communication/messages/outgoing/achievements/index.ts b/src/nitro/communication/messages/outgoing/achievements/index.ts deleted file mode 100644 index 196ac3f5..00000000 --- a/src/nitro/communication/messages/outgoing/achievements/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './RequestAchievementsMessageComposer'; diff --git a/src/nitro/communication/messages/outgoing/advertisement/GetInterstitialMessageComposer.ts b/src/nitro/communication/messages/outgoing/advertisement/GetInterstitialMessageComposer.ts index 4c96e1c2..b47e69dc 100644 --- a/src/nitro/communication/messages/outgoing/advertisement/GetInterstitialMessageComposer.ts +++ b/src/nitro/communication/messages/outgoing/advertisement/GetInterstitialMessageComposer.ts @@ -9,7 +9,7 @@ export class GetInterstitialMessageComposer implements IMessageComposer> { @@ -18,4 +18,4 @@ export class RequestAchievementsMessageComposer implements IMessageComposer Date: Fri, 10 Sep 2021 01:33:28 -0300 Subject: [PATCH 019/108] Something --- .../room/object/logic/furniture/FurnitureSoundBlockLogic.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts index d60f4c7c..b4b411e8 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts @@ -107,6 +107,8 @@ export class FurnitureSoundBlockLogic extends FurnitureMultiStateLogic private getPitchForHeight(height: number): number { + if(this._noPitch) return 1; + let heightScaled: number = (height * 2); if(heightScaled > FurnitureSoundBlockLogic.HIGHEST_SEMITONE) @@ -114,6 +116,6 @@ export class FurnitureSoundBlockLogic extends FurnitureMultiStateLogic heightScaled = Math.min(0, (FurnitureSoundBlockLogic.LOWEST_SEMITONE + ((heightScaled - FurnitureSoundBlockLogic.HIGHEST_SEMITONE) - 1))); } - return (this._noPitch) ? 1 : Math.pow(2, (heightScaled / 12)); + return Math.pow(2, (heightScaled / 12)); } } From 5ec545635abb289588a70db158e4c5b3bc7cfa7e Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 12 Sep 2021 00:16:01 -0300 Subject: [PATCH 020/108] Fix CatalogAsGift Composer --- .../outgoing/catalog/PurchaseFromCatalogAsGiftComposer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nitro/communication/messages/outgoing/catalog/PurchaseFromCatalogAsGiftComposer.ts b/src/nitro/communication/messages/outgoing/catalog/PurchaseFromCatalogAsGiftComposer.ts index a9e8d918..16f1bba0 100644 --- a/src/nitro/communication/messages/outgoing/catalog/PurchaseFromCatalogAsGiftComposer.ts +++ b/src/nitro/communication/messages/outgoing/catalog/PurchaseFromCatalogAsGiftComposer.ts @@ -4,9 +4,9 @@ export class PurchaseFromCatalogAsGiftComposer implements IMessageComposer; - constructor(pageId: number, itemId: number, extraData: string, receivingName: string, giftMessage: string, spriteId: number, color: number, ribbonId: number, anonymousGift: boolean) + constructor(pageId: number, itemId: number, extraData: string, receivingName: string, giftMessage: string, spriteId: number, boxId: number, ribbonId: number, anonymousGift: boolean) { - this._data = [pageId, itemId, extraData, receivingName, giftMessage, spriteId, color, ribbonId, anonymousGift]; + this._data = [pageId, itemId, extraData, receivingName, giftMessage, spriteId, boxId, ribbonId, anonymousGift]; } public getMessageArray() From 50499e6d2159b0762ff5f96c3bb76467877804e5 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 12 Sep 2021 03:41:50 -0300 Subject: [PATCH 021/108] Fix Composer param misleading name --- .../outgoing/catalog/PurchaseFromCatalogAsGiftComposer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nitro/communication/messages/outgoing/catalog/PurchaseFromCatalogAsGiftComposer.ts b/src/nitro/communication/messages/outgoing/catalog/PurchaseFromCatalogAsGiftComposer.ts index 16f1bba0..e9489d00 100644 --- a/src/nitro/communication/messages/outgoing/catalog/PurchaseFromCatalogAsGiftComposer.ts +++ b/src/nitro/communication/messages/outgoing/catalog/PurchaseFromCatalogAsGiftComposer.ts @@ -4,9 +4,9 @@ export class PurchaseFromCatalogAsGiftComposer implements IMessageComposer; - constructor(pageId: number, itemId: number, extraData: string, receivingName: string, giftMessage: string, spriteId: number, boxId: number, ribbonId: number, anonymousGift: boolean) + constructor(pageId: number, itemId: number, extraData: string, receivingName: string, giftMessage: string, spriteId: number, boxId: number, ribbonId: number, showMyFace: boolean) { - this._data = [pageId, itemId, extraData, receivingName, giftMessage, spriteId, boxId, ribbonId, anonymousGift]; + this._data = [pageId, itemId, extraData, receivingName, giftMessage, spriteId, boxId, ribbonId, showMyFace]; } public getMessageArray() From 88e304227ae57f73d17846baac0e05b02010111d Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Tue, 14 Sep 2021 02:56:25 -0300 Subject: [PATCH 022/108] Moodlight update --- .../room/furniture/moodlightFromServer.ts | 66 ++----------------- .../RoomDimmerPresetsMessageParser.ts | 31 +++------ .../events/RoomSessionDimmerPresetsEvent.ts | 6 +- ...RoomSessionDimmerPresetsEventPresetItem.ts | 26 ++++---- .../handler/RoomDimmerPresetsHandler.ts | 11 +--- 5 files changed, 32 insertions(+), 108 deletions(-) diff --git a/src/nitro/communication/messages/incoming/room/furniture/moodlightFromServer.ts b/src/nitro/communication/messages/incoming/room/furniture/moodlightFromServer.ts index 0aedc1f9..30ad4262 100644 --- a/src/nitro/communication/messages/incoming/room/furniture/moodlightFromServer.ts +++ b/src/nitro/communication/messages/incoming/room/furniture/moodlightFromServer.ts @@ -1,64 +1,8 @@ export class MoodlightFromServer { - private readonly _id: number = 0; - private _type: number = 0; - private _color: number = 0; - private _intensity: number = 0; - private _isParsed: boolean = false; - private _htmlColor: string = null; - - constructor(k: number) - { - this._id = k; - } - - public parsed(): void - { - this._isParsed = true; - } - - public get id(): number - { - return this._id; - } - - public get type(): number - { - return this._type; - } - - public set type(k: number) - { - if(!this._isParsed) this._type = k; - } - - public get color(): number - { - return this._color; - } - - public set color(k: number) - { - if(!this._isParsed) this._color = k; - } - - public get intensity(): number - { - return this._intensity; - } - - public set intensity(k: number) - { - if(!this._isParsed) this._intensity = k; - } - - public set htmlColor(color: string) - { - this._htmlColor = color; - } - - public get htmlColor(): string - { - return this._htmlColor; - } + constructor(public id: number, + public bgOnly: boolean, + public color: string, + public brightness: number) + {} } diff --git a/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts b/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts index f44a8a28..8d3c9106 100644 --- a/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts +++ b/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts @@ -35,33 +35,20 @@ export class RoomDimmerPresetsMessageParser implements IMessageParser return true; } - public parse(k: IMessageDataWrapper): boolean + public parse(wrapper: IMessageDataWrapper): boolean { - const totalPresets = k.readInt(); + const totalPresets = wrapper.readInt(); - this._selectedPresetId = k.readInt(); + this._selectedPresetId = wrapper.readInt(); - let _local_3 = 0; - - while(_local_3 < totalPresets) + for(let i = 0; i < totalPresets; i++) { - const presetId = k.readInt(); - const isBackGroundOnly = k.readInt(); // Background only? 2: 1 - const color = k.readString(); - const colorForSWF = parseInt(color.substr(1), 16); - const intensity = k.readInt(); + const presetId = wrapper.readInt(); + const bgOnly = wrapper.readInt() === 2; + const color = wrapper.readString(); + const brightness = wrapper.readInt(); - const _local_9 = new MoodlightFromServer(presetId); - - _local_9.type = isBackGroundOnly; - _local_9.color = colorForSWF; - _local_9.intensity = intensity; - - _local_9.parsed(); - _local_9.htmlColor = color; - this._presets.push(_local_9); - - _local_3++; + this._presets.push(new MoodlightFromServer(presetId, bgOnly, color, brightness)); } return true; diff --git a/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts b/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts index dc6ccf9f..299bdc4c 100644 --- a/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts +++ b/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts @@ -31,10 +31,10 @@ export class RoomSessionDimmerPresetsEvent extends RoomSessionEvent this._selectedPresetId = k; } - public storePreset(k: number, _arg_2: number, _arg_3: number, _arg_4: number): void + public storePreset(id: number, bgOnly: boolean, color: string, brightness: number): void { - const _local_5:RoomSessionDimmerPresetsEventPresetItem = new RoomSessionDimmerPresetsEventPresetItem(k, _arg_2, _arg_3, _arg_4); - this._presets[(k - 1)] = _local_5; + const _local_5:RoomSessionDimmerPresetsEventPresetItem = new RoomSessionDimmerPresetsEventPresetItem(id, bgOnly, color, brightness); + this._presets[(id - 1)] = _local_5; } public getPreset(k: number):RoomSessionDimmerPresetsEventPresetItem diff --git a/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts b/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts index 8bccc4c3..b311143f 100644 --- a/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts +++ b/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts @@ -1,16 +1,16 @@ export class RoomSessionDimmerPresetsEventPresetItem { private _id: number; - private _type: number; - private _color: number; - private _light: number; + private _bgOnly: boolean; + private _color: string; + private _brightness: number; - constructor(k: number, _arg_2: number, _arg_3: number, _arg_4: number) + constructor(id: number, bgOnly: boolean, color: string, brightness: number) { - this._id = k; - this._type = _arg_2; - this._color = _arg_3; - this._light = _arg_4; + this._id = id; + this._bgOnly = bgOnly; + this._color = color; + this._brightness = brightness; } public get id(): number @@ -18,18 +18,18 @@ return this._id; } - public get type(): number + public get bgOnly(): boolean { - return this._type; + return this._bgOnly; } - public get color(): number + public get color(): string { return this._color; } - public get light(): number + public get brightness(): number { - return this._light; + return this._brightness; } } diff --git a/src/nitro/session/handler/RoomDimmerPresetsHandler.ts b/src/nitro/session/handler/RoomDimmerPresetsHandler.ts index 3a087bdf..672052b0 100644 --- a/src/nitro/session/handler/RoomDimmerPresetsHandler.ts +++ b/src/nitro/session/handler/RoomDimmerPresetsHandler.ts @@ -29,18 +29,11 @@ export class RoomDimmerPresetsHandler extends BaseHandler event.selectedPresetId = parser.selectedPresetId; - let i = 0; - - while(i < parser.presetCount) + for(let i = 0; i < parser.presetCount; i++) { const preset = parser.getPreset(i); - if(preset) - { - event.storePreset(preset.id, preset.type, preset.color, preset.intensity); - } - - i++; + if(preset) event.storePreset(preset.id, preset.bgOnly, preset.color, preset.brightness); } this.listener && this.listener.events.dispatchEvent(event); From 4e3af05d1f48cfd2b76442505afffa5f8b65ca0f Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 14 Sep 2021 02:40:00 -0400 Subject: [PATCH 023/108] Dimmer updates --- ...ver.ts => RoomDimmerPresetsMessageData.ts} | 5 ++- .../messages/incoming/room/furniture/index.ts | 2 +- .../RoomDimmerPresetsMessageParser.ts | 45 ++++++++++--------- .../events/RoomSessionDimmerPresetsEvent.ts | 21 ++++----- .../handler/RoomDimmerPresetsHandler.ts | 14 +++--- 5 files changed, 43 insertions(+), 44 deletions(-) rename src/nitro/communication/messages/incoming/room/furniture/{moodlightFromServer.ts => RoomDimmerPresetsMessageData.ts} (54%) diff --git a/src/nitro/communication/messages/incoming/room/furniture/moodlightFromServer.ts b/src/nitro/communication/messages/incoming/room/furniture/RoomDimmerPresetsMessageData.ts similarity index 54% rename from src/nitro/communication/messages/incoming/room/furniture/moodlightFromServer.ts rename to src/nitro/communication/messages/incoming/room/furniture/RoomDimmerPresetsMessageData.ts index 30ad4262..6f6dccc5 100644 --- a/src/nitro/communication/messages/incoming/room/furniture/moodlightFromServer.ts +++ b/src/nitro/communication/messages/incoming/room/furniture/RoomDimmerPresetsMessageData.ts @@ -1,6 +1,7 @@ -export class MoodlightFromServer +export class RoomDimmerPresetsMessageData { - constructor(public id: number, + constructor( + public id: number, public bgOnly: boolean, public color: string, public brightness: number) diff --git a/src/nitro/communication/messages/incoming/room/furniture/index.ts b/src/nitro/communication/messages/incoming/room/furniture/index.ts index 6f6d34fe..acc01d5e 100644 --- a/src/nitro/communication/messages/incoming/room/furniture/index.ts +++ b/src/nitro/communication/messages/incoming/room/furniture/index.ts @@ -9,6 +9,6 @@ export * from './GroupFurniContextMenuInfoMessageEvent'; export * from './LoveLockFurniFinishedEvent'; export * from './LoveLockFurniFriendConfirmedEvent'; export * from './LoveLockFurniStartEvent'; -export * from './moodlightFromServer'; +export * from './RoomDimmerPresetsMessageData'; export * from './RoomDimmerPresetsMessageEvent'; export * from './wall'; diff --git a/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts b/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts index 8d3c9106..b002df43 100644 --- a/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts +++ b/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts @@ -1,33 +1,17 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -import { MoodlightFromServer } from '../../../incoming/room/furniture/moodlightFromServer'; +import { RoomDimmerPresetsMessageData } from '../../../incoming/room/furniture/RoomDimmerPresetsMessageData'; export class RoomDimmerPresetsMessageParser implements IMessageParser { - private _selectedPresetId: number = 0; - private _presets: MoodlightFromServer[]; + private _selectedPresetId: number; + private _presets: RoomDimmerPresetsMessageData[]; constructor() { + this._selectedPresetId = 0; this._presets = []; } - public get presetCount(): number - { - return this._presets.length; - } - - public get selectedPresetId(): number - { - return this._selectedPresetId; - } - - public getPreset(k: number): MoodlightFromServer - { - if((k < 0) || (k >= this.presetCount)) return null; - - return this._presets[k]; - } - public flush(): boolean { this._presets = []; @@ -44,13 +28,30 @@ export class RoomDimmerPresetsMessageParser implements IMessageParser for(let i = 0; i < totalPresets; i++) { const presetId = wrapper.readInt(); - const bgOnly = wrapper.readInt() === 2; + const bgOnly = (wrapper.readInt() === 2); const color = wrapper.readString(); const brightness = wrapper.readInt(); - this._presets.push(new MoodlightFromServer(presetId, bgOnly, color, brightness)); + this._presets.push(new RoomDimmerPresetsMessageData(presetId, bgOnly, color, brightness)); } return true; } + + public getPreset(id: number): RoomDimmerPresetsMessageData + { + if((id < 0) || (id >= this.presetCount)) return null; + + return this._presets[id]; + } + + public get presetCount(): number + { + return this._presets.length; + } + + public get selectedPresetId(): number + { + return this._selectedPresetId; + } } diff --git a/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts b/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts index 299bdc4c..c4a9385f 100644 --- a/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts +++ b/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts @@ -9,9 +9,9 @@ export class RoomSessionDimmerPresetsEvent extends RoomSessionEvent private _selectedPresetId: number = 0; private _presets: RoomSessionDimmerPresetsEventPresetItem[]; - constructor(k: string, _arg_2: IRoomSession) + constructor(type: string, session: IRoomSession) { - super(k, _arg_2); + super(type, session); this._presets = []; } @@ -26,23 +26,20 @@ export class RoomSessionDimmerPresetsEvent extends RoomSessionEvent return this._selectedPresetId; } - public set selectedPresetId(k: number) + public set selectedPresetId(id: number) { - this._selectedPresetId = k; + this._selectedPresetId = id; } public storePreset(id: number, bgOnly: boolean, color: string, brightness: number): void { - const _local_5:RoomSessionDimmerPresetsEventPresetItem = new RoomSessionDimmerPresetsEventPresetItem(id, bgOnly, color, brightness); - this._presets[(id - 1)] = _local_5; + this._presets[(id - 1)] = new RoomSessionDimmerPresetsEventPresetItem(id, bgOnly, color, brightness); } - public getPreset(k: number):RoomSessionDimmerPresetsEventPresetItem + public getPreset(id: number): RoomSessionDimmerPresetsEventPresetItem { - if(((k < 0) || (k >= this._presets.length))) - { - return null; - } - return this._presets[k]; + if((id < 0) || (id >= this._presets.length)) return null; + + return this._presets[id]; } } diff --git a/src/nitro/session/handler/RoomDimmerPresetsHandler.ts b/src/nitro/session/handler/RoomDimmerPresetsHandler.ts index 672052b0..196d1a21 100644 --- a/src/nitro/session/handler/RoomDimmerPresetsHandler.ts +++ b/src/nitro/session/handler/RoomDimmerPresetsHandler.ts @@ -13,11 +13,11 @@ export class RoomDimmerPresetsHandler extends BaseHandler connection.addMessageEvent(new RoomDimmerPresetsEvent(this.onRoomDimmerPresets.bind(this))); } - private onRoomDimmerPresets(k: RoomDimmerPresetsEvent): void + private onRoomDimmerPresets(event: RoomDimmerPresetsEvent): void { - if(!k) return; + if(!event) return; - const parser = k.getParser(); + const parser = event.getParser(); if(!parser) return; @@ -25,17 +25,17 @@ export class RoomDimmerPresetsHandler extends BaseHandler if(!session) return; - const event = new RoomSessionDimmerPresetsEvent(RoomSessionDimmerPresetsEvent.ROOM_DIMMER_PRESETS, session); + const presetEvent = new RoomSessionDimmerPresetsEvent(RoomSessionDimmerPresetsEvent.ROOM_DIMMER_PRESETS, session); - event.selectedPresetId = parser.selectedPresetId; + presetEvent.selectedPresetId = parser.selectedPresetId; for(let i = 0; i < parser.presetCount; i++) { const preset = parser.getPreset(i); - if(preset) event.storePreset(preset.id, preset.bgOnly, preset.color, preset.brightness); + if(preset) presetEvent.storePreset(preset.id, preset.bgOnly, preset.color, preset.brightness); } - this.listener && this.listener.events.dispatchEvent(event); + this.listener && this.listener.events.dispatchEvent(presetEvent); } } From d2e1081ac7f86349cbde19d7d780cc9661d4a9f1 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Wed, 15 Sep 2021 13:27:03 -0300 Subject: [PATCH 024/108] Room Color Skip Transition config --- src/nitro/room/object/logic/room/RoomLogic.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/nitro/room/object/logic/room/RoomLogic.ts b/src/nitro/room/object/logic/room/RoomLogic.ts index 7a2d0991..fe65fc28 100644 --- a/src/nitro/room/object/logic/room/RoomLogic.ts +++ b/src/nitro/room/object/logic/room/RoomLogic.ts @@ -8,6 +8,7 @@ import { RoomObjectLogicBase } from '../../../../../room/object/logic/RoomObject import { ColorConverter } from '../../../../../room/utils/ColorConverter'; import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; import { Vector3d } from '../../../../../room/utils/Vector3d'; +import { Nitro } from '../../../../Nitro'; import { MouseEventType } from '../../../../ui/MouseEventType'; import { RoomObjectTileMouseEvent } from '../../../events/RoomObjectTileMouseEvent'; import { RoomObjectWallMouseEvent } from '../../../events/RoomObjectWallMouseEvent'; @@ -39,6 +40,7 @@ export class RoomLogic extends RoomObjectLogicBase private _colorTransitionLength: number; private _lastHoleUpdate: number; private _needsMapUpdate: boolean; + private _skipColorTransition: boolean; constructor() { @@ -56,6 +58,7 @@ export class RoomLogic extends RoomObjectLogicBase this._colorTransitionLength = 1500; this._lastHoleUpdate = 0; this._needsMapUpdate = false; + this._skipColorTransition = false; } public getEventTypes(): string[] @@ -97,6 +100,8 @@ export class RoomLogic extends RoomObjectLogicBase this.object.model.setValue(RoomObjectVariable.ROOM_FLOOR_VISIBILITY, 1); this.object.model.setValue(RoomObjectVariable.ROOM_WALL_VISIBILITY, 1); this.object.model.setValue(RoomObjectVariable.ROOM_LANDSCAPE_VISIBILITY, 1); + + this._skipColorTransition = (Nitro.instance.getConfiguration('room.color.skip.transition') === true); } public update(time: number): void @@ -325,7 +330,11 @@ export class RoomLogic extends RoomObjectLogicBase this._targetColor = message.color; this._targetLight = message.light; this._colorChangedTime = this.time; - this._colorTransitionLength = 1500; + + if(this._skipColorTransition) + this._colorTransitionLength = 0; + else + this._colorTransitionLength = 1500; model.setValue(RoomObjectVariable.ROOM_COLORIZE_BG_ONLY, message.backgroundOnly); } From 17968b726578b75d64a0b2e25c210cd0bcfa717a Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 15 Sep 2021 18:56:48 -0400 Subject: [PATCH 025/108] Dimmer updates --- .../furniture/RoomDimmerPresetsMessageData.ts | 4 +-- .../RoomDimmerPresetsMessageParser.ts | 6 ++-- .../furniture/FurnitureRoomDimmerLogic.ts | 28 ++++++++++--------- .../events/RoomSessionDimmerPresetsEvent.ts | 24 ++++++++-------- ...RoomSessionDimmerPresetsEventPresetItem.ts | 14 +++++----- .../handler/RoomDimmerPresetsHandler.ts | 8 ++++-- 6 files changed, 45 insertions(+), 39 deletions(-) diff --git a/src/nitro/communication/messages/incoming/room/furniture/RoomDimmerPresetsMessageData.ts b/src/nitro/communication/messages/incoming/room/furniture/RoomDimmerPresetsMessageData.ts index 6f6dccc5..9264b720 100644 --- a/src/nitro/communication/messages/incoming/room/furniture/RoomDimmerPresetsMessageData.ts +++ b/src/nitro/communication/messages/incoming/room/furniture/RoomDimmerPresetsMessageData.ts @@ -2,8 +2,8 @@ { constructor( public id: number, - public bgOnly: boolean, - public color: string, + public type: number, + public color: number, public brightness: number) {} } diff --git a/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts b/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts index b002df43..fe4fe501 100644 --- a/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts +++ b/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts @@ -28,11 +28,11 @@ export class RoomDimmerPresetsMessageParser implements IMessageParser for(let i = 0; i < totalPresets; i++) { const presetId = wrapper.readInt(); - const bgOnly = (wrapper.readInt() === 2); - const color = wrapper.readString(); + const type = wrapper.readInt(); + const color = parseInt(wrapper.readString().substr(1), 16); const brightness = wrapper.readInt(); - this._presets.push(new RoomDimmerPresetsMessageData(presetId, bgOnly, color, brightness)); + this._presets.push(new RoomDimmerPresetsMessageData(presetId, type, color, brightness)); } return true; diff --git a/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts index 9e87d4f1..2dfa2cab 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts @@ -84,6 +84,8 @@ export class FurnitureRoomDimmerLogic extends FurnitureLogic { if(!data) return; + console.log(data); + const parts = data.split(','); if(parts.length >= 5) @@ -122,21 +124,21 @@ export class FurnitureRoomDimmerLogic extends FurnitureLogic { super.update(time); - if(this.object && this.object.model) - { - const realRoomObject = this.object.model.getValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT); + // if(this.object && this.object.model) + // { + // const realRoomObject = this.object.model.getValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT); - if(realRoomObject === 1) - { - const data = this.object.model.getValue(RoomObjectVariable.FURNITURE_DATA); + // if(realRoomObject === 1) + // { + // const data = this.object.model.getValue(RoomObjectVariable.FURNITURE_DATA); - if(data && data.length > 0) - { - this.object.model.setValue(RoomObjectVariable.FURNITURE_DATA, ''); + // if(data && data.length > 0) + // { + // this.object.model.setValue(RoomObjectVariable.FURNITURE_DATA, ''); - this.processDimmerData(data); - } - } - } + // this.processDimmerData(data); + // } + // } + // } } } diff --git a/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts b/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts index c4a9385f..a17c83f3 100644 --- a/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts +++ b/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts @@ -16,6 +16,18 @@ export class RoomSessionDimmerPresetsEvent extends RoomSessionEvent this._presets = []; } + public storePreset(id: number, type: number, color: number, brightness: number): void + { + this._presets[(id - 1)] = new RoomSessionDimmerPresetsEventPresetItem(id, type, color, brightness); + } + + public getPreset(id: number): RoomSessionDimmerPresetsEventPresetItem + { + if((id < 0) || (id >= this._presets.length)) return null; + + return this._presets[id]; + } + public get presetCount(): number { return this._presets.length; @@ -30,16 +42,4 @@ export class RoomSessionDimmerPresetsEvent extends RoomSessionEvent { this._selectedPresetId = id; } - - public storePreset(id: number, bgOnly: boolean, color: string, brightness: number): void - { - this._presets[(id - 1)] = new RoomSessionDimmerPresetsEventPresetItem(id, bgOnly, color, brightness); - } - - public getPreset(id: number): RoomSessionDimmerPresetsEventPresetItem - { - if((id < 0) || (id >= this._presets.length)) return null; - - return this._presets[id]; - } } diff --git a/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts b/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts index b311143f..9a05be0c 100644 --- a/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts +++ b/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts @@ -1,14 +1,14 @@ export class RoomSessionDimmerPresetsEventPresetItem { private _id: number; - private _bgOnly: boolean; - private _color: string; + private _type: number; + private _color: number; private _brightness: number; - constructor(id: number, bgOnly: boolean, color: string, brightness: number) + constructor(id: number, type: number, color: number, brightness: number) { this._id = id; - this._bgOnly = bgOnly; + this._type = type; this._color = color; this._brightness = brightness; } @@ -18,12 +18,12 @@ return this._id; } - public get bgOnly(): boolean + public get type(): number { - return this._bgOnly; + return this._type; } - public get color(): string + public get color(): number { return this._color; } diff --git a/src/nitro/session/handler/RoomDimmerPresetsHandler.ts b/src/nitro/session/handler/RoomDimmerPresetsHandler.ts index 196d1a21..a89e6896 100644 --- a/src/nitro/session/handler/RoomDimmerPresetsHandler.ts +++ b/src/nitro/session/handler/RoomDimmerPresetsHandler.ts @@ -29,11 +29,15 @@ export class RoomDimmerPresetsHandler extends BaseHandler presetEvent.selectedPresetId = parser.selectedPresetId; - for(let i = 0; i < parser.presetCount; i++) + let i = 0; + + while(i < parser.presetCount) { const preset = parser.getPreset(i); - if(preset) presetEvent.storePreset(preset.id, preset.bgOnly, preset.color, preset.brightness); + if(preset) presetEvent.storePreset(preset.id, preset.type, preset.color, preset.brightness); + + i++; } this.listener && this.listener.events.dispatchEvent(presetEvent); From b19fdb3570f7fa5ace79509b74794fe92abb895f Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 15 Sep 2021 18:58:54 -0400 Subject: [PATCH 026/108] Remove console log --- .../room/object/logic/furniture/FurnitureRoomDimmerLogic.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts index 2dfa2cab..57663855 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts @@ -84,8 +84,6 @@ export class FurnitureRoomDimmerLogic extends FurnitureLogic { if(!data) return; - console.log(data); - const parts = data.split(','); if(parts.length >= 5) From 31bd772c53dadcc33a270611f411c4683a86199b Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 15 Sep 2021 21:48:25 -0500 Subject: [PATCH 027/108] added outgoing competition messages --- src/nitro/communication/NitroMessages.ts | 15 ++++++++++- .../messages/outgoing/OutgoingHeader.ts | 12 +++++++-- ...orwardToACompetitionRoomMessageComposer.ts | 21 +++++++++++++++ ...orwardToASubmittableRoomMessageComposer.ts | 21 +++++++++++++++ ...dToRandomCompetitionRoomMessageComposer.ts | 21 +++++++++++++++ .../GetCurrentTimingCodeMessageComposer.ts | 21 +++++++++++++++ ...tIsUserPartOfCompetitionMessageComposer.ts | 21 +++++++++++++++ .../GetSecondsUntilMessageComposer.ts | 21 +++++++++++++++ .../RoomCompetitionInitMessageComposer.ts | 21 +++++++++++++++ .../SubmitRoomToCompetitionMessageComposer.ts | 26 +++++++++++++++++++ .../competition/VoteForRoomMessageComposer.ts | 21 +++++++++++++++ .../messages/outgoing/competition/index.ts | 9 +++++++ .../communication/messages/outgoing/index.ts | 1 + 13 files changed, 228 insertions(+), 3 deletions(-) create mode 100644 src/nitro/communication/messages/outgoing/competition/ForwardToACompetitionRoomMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/competition/ForwardToASubmittableRoomMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/competition/ForwardToRandomCompetitionRoomMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/competition/GetCurrentTimingCodeMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/competition/GetIsUserPartOfCompetitionMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/competition/GetSecondsUntilMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/competition/RoomCompetitionInitMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/competition/SubmitRoomToCompetitionMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/competition/VoteForRoomMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/competition/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 8e4f24bf..4fbc3c1b 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetDirectClubBuyAvailableComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; @@ -251,6 +251,8 @@ import { RoomAdPurchaseInitiatedComposer } from './messages/outgoing/catalog/Roo import { SelectClubGiftComposer } from './messages/outgoing/catalog/SelectClubGiftComposer'; import { ClientPongComposer } from './messages/outgoing/client/ClientPongComposer'; import { ClientReleaseVersionComposer } from './messages/outgoing/client/ClientReleaseVersionComposer'; +import { ForwardToACompetitionRoomMessageComposer } from './messages/outgoing/competition/ForwardToACompetitionRoomMessageComposer'; +import { GetIsUserPartOfCompetitionMessageComposer } from './messages/outgoing/competition/GetIsUserPartOfCompetitionMessageComposer'; import { CraftComposer } from './messages/outgoing/crafting/CraftComposer'; import { CraftSecretComposer } from './messages/outgoing/crafting/CraftSecretComposer'; import { GetCraftableProductsComposer } from './messages/outgoing/crafting/GetCraftableProductsComposer'; @@ -937,6 +939,17 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.SET_TARGETTED_OFFER_STATE, SetTargetedOfferStateComposer); this._composers.set(OutgoingHeader.SHOP_TARGETED_OFFER_VIEWED, ShopTargetedOfferViewedComposer); + // COMPETITION + this._composers.set(OutgoingHeader.FORWARD_TO_A_COMPETITION_ROOM, ForwardToACompetitionRoomMessageComposer); + this._composers.set(OutgoingHeader.FORWARD_TO_A_SUBMITTABLE_ROOM, ForwardToASubmittableRoomMessageComposer); + this._composers.set(OutgoingHeader.FORWARD_TO_RANDOM_COMPETITION_ROOM, ForwardToRandomCompetitionRoomMessageComposer); + this._composers.set(OutgoingHeader.GET_CURRENT_TIMING_CODE, GetCurrentTimingCodeMessageComposer); + this._composers.set(OutgoingHeader.GET_IS_USER_PART_OF_COMPETITION, GetIsUserPartOfCompetitionMessageComposer); + this._composers.set(OutgoingHeader.GET_SECONDS_UNTIL, GetSecondsUntilMessageComposer); + this._composers.set(OutgoingHeader.ROOM_COMPETITION_INIT, RoomCompetitionInitMessageComposer); + this._composers.set(OutgoingHeader.SUBMIT_ROOM_TO_COMPETITION, SubmitRoomToCompetitionMessageComposer); + this._composers.set(OutgoingHeader.VOTE_FOR_ROOM, VoteForRoomMessageComposer); + // CLIENT this._composers.set(OutgoingHeader.CLIENT_PONG, ClientPongComposer); this._composers.set(OutgoingHeader.RELEASE_VERSION, ClientReleaseVersionComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index e82aeb68..e987c92f 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -19,7 +19,7 @@ export class OutgoingHeader public static CLIENT_PONG = 2596; public static CLIENT_TOOLBAR_TOGGLE = 2313; public static CLIENT_VARIABLES = 1053; - public static DESKTOP_CAMPAIGNS = 2912; + public static GET_CURRENT_TIMING_CODE = 2912; public static DESKTOP_NEWS = 1827; public static DESKTOP_VIEW = 105; public static GET_BUNDLE_DISCOUNT_RULESET = 223; @@ -307,5 +307,13 @@ export class OutgoingHeader public static ROOM_AD_PURCHASE_INITIATED = 2283; public static SET_TARGETTED_OFFER_STATE = 2041; public static SHOP_TARGETED_OFFER_VIEWED = 3483; - public static HELPER_TALENT_TRACK = 196; + public static HELPER_TALENT_TRACK = 196; + public static FORWARD_TO_A_COMPETITION_ROOM = 172; + public static FORWARD_TO_A_SUBMITTABLE_ROOM = 1450; + public static FORWARD_TO_RANDOM_COMPETITION_ROOM = 865; + public static GET_IS_USER_PART_OF_COMPETITION = 2077; + public static GET_SECONDS_UNTIL = 271; + public static ROOM_COMPETITION_INIT = 1334; + public static SUBMIT_ROOM_TO_COMPETITION = 2595; + public static VOTE_FOR_ROOM = 143; } diff --git a/src/nitro/communication/messages/outgoing/competition/ForwardToACompetitionRoomMessageComposer.ts b/src/nitro/communication/messages/outgoing/competition/ForwardToACompetitionRoomMessageComposer.ts new file mode 100644 index 00000000..05f77a64 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/competition/ForwardToACompetitionRoomMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class ForwardToACompetitionRoomMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:string, _arg_2:number) + { + this._data = [ k, _arg_2 ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/competition/ForwardToASubmittableRoomMessageComposer.ts b/src/nitro/communication/messages/outgoing/competition/ForwardToASubmittableRoomMessageComposer.ts new file mode 100644 index 00000000..495eb00c --- /dev/null +++ b/src/nitro/communication/messages/outgoing/competition/ForwardToASubmittableRoomMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class ForwardToASubmittableRoomMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/competition/ForwardToRandomCompetitionRoomMessageComposer.ts b/src/nitro/communication/messages/outgoing/competition/ForwardToRandomCompetitionRoomMessageComposer.ts new file mode 100644 index 00000000..02a51fb7 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/competition/ForwardToRandomCompetitionRoomMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class ForwardToRandomCompetitionRoomMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: string) + { + this._data = [ k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/competition/GetCurrentTimingCodeMessageComposer.ts b/src/nitro/communication/messages/outgoing/competition/GetCurrentTimingCodeMessageComposer.ts new file mode 100644 index 00000000..390a9c66 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/competition/GetCurrentTimingCodeMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class GetCurrentTimingCodeMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: string) + { + this._data = [ k ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/competition/GetIsUserPartOfCompetitionMessageComposer.ts b/src/nitro/communication/messages/outgoing/competition/GetIsUserPartOfCompetitionMessageComposer.ts new file mode 100644 index 00000000..46594652 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/competition/GetIsUserPartOfCompetitionMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class GetIsUserPartOfCompetitionMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: string) + { + this._data = [ k ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/competition/GetSecondsUntilMessageComposer.ts b/src/nitro/communication/messages/outgoing/competition/GetSecondsUntilMessageComposer.ts new file mode 100644 index 00000000..10c4f4b9 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/competition/GetSecondsUntilMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../..'; + +export class GetSecondsUntilMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: string) + { + this._data = [ k ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/competition/RoomCompetitionInitMessageComposer.ts b/src/nitro/communication/messages/outgoing/competition/RoomCompetitionInitMessageComposer.ts new file mode 100644 index 00000000..42365976 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/competition/RoomCompetitionInitMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../..'; + +export class RoomCompetitionInitMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/competition/SubmitRoomToCompetitionMessageComposer.ts b/src/nitro/communication/messages/outgoing/competition/SubmitRoomToCompetitionMessageComposer.ts new file mode 100644 index 00000000..a968cbc5 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/competition/SubmitRoomToCompetitionMessageComposer.ts @@ -0,0 +1,26 @@ +import { IMessageComposer } from '../../../../../core'; + +export class SubmitRoomToCompetitionMessageComposer implements IMessageComposer> +{ + public static readonly CONFIRM_LEVEL_NOT_ACCEPTED = 0; + public static readonly CONFIRM_LEVEL_NOT_SUBMITTED = 1; + public static readonly CONFIRM_LEVEL_NOT_CONFIRMED = 2; + public static readonly CONFIRM_LEVEL_COMMIT = 3; + + private _data: ConstructorParameters; + + constructor(k: string, _arg_2: number) + { + this._data = [k, _arg_2]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/competition/VoteForRoomMessageComposer.ts b/src/nitro/communication/messages/outgoing/competition/VoteForRoomMessageComposer.ts new file mode 100644 index 00000000..9bd15a19 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/competition/VoteForRoomMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../..'; + +export class VoteForRoomMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: string) + { + this._data = [ k ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/competition/index.ts b/src/nitro/communication/messages/outgoing/competition/index.ts new file mode 100644 index 00000000..c99db8f6 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/competition/index.ts @@ -0,0 +1,9 @@ +export * from './ForwardToACompetitionRoomMessageComposer'; +export * from './ForwardToASubmittableRoomMessageComposer'; +export * from './ForwardToRandomCompetitionRoomMessageComposer'; +export * from './GetCurrentTimingCodeMessageComposer'; +export * from './GetIsUserPartOfCompetitionMessageComposer'; +export * from './GetSecondsUntilMessageComposer'; +export * from './RoomCompetitionInitMessageComposer'; +export * from './SubmitRoomToCompetitionMessageComposer'; +export * from './VoteForRoomMessageComposer'; diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index 2e1588d2..5239a0e2 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -4,6 +4,7 @@ export * from './camera'; export * from './campaign'; export * from './catalog'; export * from './client'; +export * from './competition'; export * from './desktop'; export * from './friendlist'; export * from './group'; From 378ef7d75e895ed977ab8954b72d3d35f12a7825 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 15 Sep 2021 21:50:24 -0500 Subject: [PATCH 028/108] move crafting to correct position --- src/nitro/communication/NitroMessages.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 4fbc3c1b..1ecd5619 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -950,6 +950,13 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.SUBMIT_ROOM_TO_COMPETITION, SubmitRoomToCompetitionMessageComposer); this._composers.set(OutgoingHeader.VOTE_FOR_ROOM, VoteForRoomMessageComposer); + // CRAFTING + this._composers.set(OutgoingHeader.CRAFT, CraftComposer); + this._composers.set(OutgoingHeader.CRAFT_SECRET, CraftSecretComposer); + this._composers.set(OutgoingHeader.GET_CRAFTABLE_PRODUCTS, GetCraftableProductsComposer); + this._composers.set(OutgoingHeader.GET_CRAFTING_RECIPE, GetCraftingRecipeComposer); + this._composers.set(OutgoingHeader.GET_CRAFTING_RECIPES_AVAILABLE, GetCraftingRecipesAvailableComposer); + // CLIENT this._composers.set(OutgoingHeader.CLIENT_PONG, ClientPongComposer); this._composers.set(OutgoingHeader.RELEASE_VERSION, ClientReleaseVersionComposer); @@ -1259,13 +1266,6 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.REJECT_QUEST, RejectQuestMessageComposer); this._composers.set(OutgoingHeader.START_CAMPAIGN, StartCampaignMessageComposer); - // CRAFTING - this._composers.set(OutgoingHeader.CRAFT, CraftComposer); - this._composers.set(OutgoingHeader.CRAFT_SECRET, CraftSecretComposer); - this._composers.set(OutgoingHeader.GET_CRAFTABLE_PRODUCTS, GetCraftableProductsComposer); - this._composers.set(OutgoingHeader.GET_CRAFTING_RECIPE, GetCraftingRecipeComposer); - this._composers.set(OutgoingHeader.GET_CRAFTING_RECIPES_AVAILABLE, GetCraftingRecipesAvailableComposer); - // CAMERA this._composers.set(OutgoingHeader.REQUEST_CAMERA_CONFIGURATION, RequestCameraConfigurationComposer); this._composers.set(OutgoingHeader.RENDER_ROOM, RenderRoomMessageComposer); From 94110e66a751194b777bf063b94ab1f1c6877e18 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 15 Sep 2021 21:58:11 -0500 Subject: [PATCH 029/108] fix friendfurni packet names --- src/nitro/communication/NitroMessages.ts | 6 ++++-- .../messages/outgoing/OutgoingHeader.ts | 2 +- .../FriendFurniConfirmLockMessageComposer.ts | 21 +++++++++++++++++++ .../messages/outgoing/friendfurni/index.ts | 1 + .../communication/messages/outgoing/index.ts | 1 + .../logic/LoveLockStartConfirmComposer.ts | 21 ------------------- .../outgoing/room/furniture/logic/index.ts | 1 - 7 files changed, 28 insertions(+), 25 deletions(-) create mode 100644 src/nitro/communication/messages/outgoing/friendfurni/FriendFurniConfirmLockMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/friendfurni/index.ts delete mode 100644 src/nitro/communication/messages/outgoing/room/furniture/logic/LoveLockStartConfirmComposer.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 1ecd5619..ba2f7d14 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -259,6 +259,7 @@ import { GetCraftableProductsComposer } from './messages/outgoing/crafting/GetCr import { GetCraftingRecipeComposer } from './messages/outgoing/crafting/GetCraftingRecipeComposer'; import { GetCraftingRecipesAvailableComposer } from './messages/outgoing/crafting/GetCraftingRecipesAvailableComposer'; import { DesktopViewComposer } from './messages/outgoing/desktop/DesktopViewComposer'; +import { FriendFurniConfirmLockMessageComposer } from './messages/outgoing/friendfurni/FriendFurniConfirmLockMessageComposer'; import { AcceptFriendComposer } from './messages/outgoing/friendlist/AcceptFriendComposer'; import { DeclineFriendComposer } from './messages/outgoing/friendlist/DeclineFriendComposer'; import { FindNewFriendsComposer } from './messages/outgoing/friendlist/FindNewFriendsComposer'; @@ -403,7 +404,6 @@ import { FurnitureOneWayDoorComposer } from './messages/outgoing/room/furniture/ import { FurnitureRandomStateComposer } from './messages/outgoing/room/furniture/logic/FurnitureRandomStateComposer'; import { FurnitureStackHeightComposer } from './messages/outgoing/room/furniture/logic/FurnitureStackHeightComposer'; import { FurnitureWallMultiStateComposer } from './messages/outgoing/room/furniture/logic/FurnitureWallMultiStateComposer'; -import { LoveLockStartConfirmComposer } from './messages/outgoing/room/furniture/logic/LoveLockStartConfirmComposer'; import { FurnitureMannequinSaveLookComposer } from './messages/outgoing/room/furniture/mannequin/FurnitureMannequinSaveLookComposer'; import { FurnitureMannequinSaveNameComposer } from './messages/outgoing/room/furniture/mannequin/FurnitureMannequinSaveNameComposer'; import { OpenPresentComposer } from './messages/outgoing/room/furniture/presents/OpenPresentComposer'; @@ -912,7 +912,6 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.GET_CLUB_OFFERS, GetClubOffersMessageComposer); this._composers.set(OutgoingHeader.GET_CLUB_GIFT_INFO, GetClubGiftInfo); this._composers.set(OutgoingHeader.CATALOG_REDEEM_VOUCHER, RedeemVoucherMessageComposer); - this._composers.set(OutgoingHeader.LOVELOCK_START_CONFIRM, LoveLockStartConfirmComposer); this._composers.set(OutgoingHeader.GROUP_MEMBERSHIPS, CatalogGroupsComposer); this._composers.set(OutgoingHeader.GET_GIFT_WRAPPING_CONFIG, GetGiftWrappingConfigurationComposer); this._composers.set(OutgoingHeader.CATALOG_SELECT_VIP_GIFT, SelectClubGiftComposer); @@ -957,6 +956,9 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.GET_CRAFTING_RECIPE, GetCraftingRecipeComposer); this._composers.set(OutgoingHeader.GET_CRAFTING_RECIPES_AVAILABLE, GetCraftingRecipesAvailableComposer); + // FRIENDFURNI + this._composers.set(OutgoingHeader.FRIEND_FURNI_CONFIRM_LOCK, FriendFurniConfirmLockMessageComposer); + // CLIENT this._composers.set(OutgoingHeader.CLIENT_PONG, ClientPongComposer); this._composers.set(OutgoingHeader.RELEASE_VERSION, ClientReleaseVersionComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index e987c92f..f490d6f3 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -199,7 +199,7 @@ export class OutgoingHeader public static SET_ITEM_DATA = 3666; public static CATALOG_REDEEM_VOUCHER = 339; public static ROOM_TONER_APPLY = 2880; - public static LOVELOCK_START_CONFIRM = 3775; + public static FRIEND_FURNI_CONFIRM_LOCK = 3775; public static MANNEQUIN_SAVE_NAME = 2850; public static MANNEQUIN_SAVE_LOOK = 2209; public static PRESENT_OPEN_PRESENT = 3558; diff --git a/src/nitro/communication/messages/outgoing/friendfurni/FriendFurniConfirmLockMessageComposer.ts b/src/nitro/communication/messages/outgoing/friendfurni/FriendFurniConfirmLockMessageComposer.ts new file mode 100644 index 00000000..bd22ef0a --- /dev/null +++ b/src/nitro/communication/messages/outgoing/friendfurni/FriendFurniConfirmLockMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class FriendFurniConfirmLockMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(itemId: number, confirmed: boolean) + { + this._data = [ itemId, confirmed ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/friendfurni/index.ts b/src/nitro/communication/messages/outgoing/friendfurni/index.ts new file mode 100644 index 00000000..545be877 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/friendfurni/index.ts @@ -0,0 +1 @@ +export * from './FriendFurniConfirmLockMessageComposer'; diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index 5239a0e2..21715cea 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -6,6 +6,7 @@ export * from './catalog'; export * from './client'; export * from './competition'; export * from './desktop'; +export * from './friendfurni'; export * from './friendlist'; export * from './group'; export * from './handshake'; diff --git a/src/nitro/communication/messages/outgoing/room/furniture/logic/LoveLockStartConfirmComposer.ts b/src/nitro/communication/messages/outgoing/room/furniture/logic/LoveLockStartConfirmComposer.ts deleted file mode 100644 index 7f9d0b8e..00000000 --- a/src/nitro/communication/messages/outgoing/room/furniture/logic/LoveLockStartConfirmComposer.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { IMessageComposer } from '../../../../../../../core/communication/messages/IMessageComposer'; - -export class LoveLockStartConfirmComposer implements IMessageComposer> -{ - private _data: ConstructorParameters; - - constructor(itemId: number, confirmed: boolean) - { - this._data = [ itemId, confirmed ]; - } - - public getMessageArray() - { - return this._data; - } - - public dispose(): void - { - return; - } -} diff --git a/src/nitro/communication/messages/outgoing/room/furniture/logic/index.ts b/src/nitro/communication/messages/outgoing/room/furniture/logic/index.ts index 978bb5b1..838e3389 100644 --- a/src/nitro/communication/messages/outgoing/room/furniture/logic/index.ts +++ b/src/nitro/communication/messages/outgoing/room/furniture/logic/index.ts @@ -7,4 +7,3 @@ export * from './FurnitureOneWayDoorComposer'; export * from './FurnitureRandomStateComposer'; export * from './FurnitureStackHeightComposer'; export * from './FurnitureWallMultiStateComposer'; -export * from './LoveLockStartConfirmComposer'; From 100ef54328acee085b93bab94c820e09d4e0e407 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 15 Sep 2021 22:20:10 -0500 Subject: [PATCH 030/108] fixed friendlist outgoing message names --- src/nitro/communication/NitroMessages.ts | 40 +++++++++---------- .../messages/outgoing/OutgoingHeader.ts | 24 +++++------ ...oser.ts => AcceptFriendMessageComposer.ts} | 6 +-- ...ser.ts => DeclineFriendMessageComposer.ts} | 6 +-- ...er.ts => FindNewFriendsMessageComposer.ts} | 6 +-- ...oser.ts => FollowFriendMessageComposer.ts} | 6 +-- .../messages/outgoing/friendlist/index.ts | 8 ++-- 7 files changed, 48 insertions(+), 48 deletions(-) rename src/nitro/communication/messages/outgoing/friendlist/{AcceptFriendComposer.ts => AcceptFriendMessageComposer.ts} (61%) rename src/nitro/communication/messages/outgoing/friendlist/{DeclineFriendComposer.ts => DeclineFriendMessageComposer.ts} (62%) rename src/nitro/communication/messages/outgoing/friendlist/{FindNewFriendsComposer.ts => FindNewFriendsMessageComposer.ts} (56%) rename src/nitro/communication/messages/outgoing/friendlist/{FollowFriendComposer.ts => FollowFriendMessageComposer.ts} (59%) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index ba2f7d14..db0f8af5 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -260,10 +260,10 @@ import { GetCraftingRecipeComposer } from './messages/outgoing/crafting/GetCraft import { GetCraftingRecipesAvailableComposer } from './messages/outgoing/crafting/GetCraftingRecipesAvailableComposer'; import { DesktopViewComposer } from './messages/outgoing/desktop/DesktopViewComposer'; import { FriendFurniConfirmLockMessageComposer } from './messages/outgoing/friendfurni/FriendFurniConfirmLockMessageComposer'; -import { AcceptFriendComposer } from './messages/outgoing/friendlist/AcceptFriendComposer'; -import { DeclineFriendComposer } from './messages/outgoing/friendlist/DeclineFriendComposer'; -import { FindNewFriendsComposer } from './messages/outgoing/friendlist/FindNewFriendsComposer'; -import { FollowFriendComposer } from './messages/outgoing/friendlist/FollowFriendComposer'; +import { AcceptFriendMessageComposer } from './messages/outgoing/friendlist/AcceptFriendMessageComposer'; +import { DeclineFriendMessageComposer } from './messages/outgoing/friendlist/DeclineFriendMessageComposer'; +import { FindNewFriendsMessageComposer } from './messages/outgoing/friendlist/FindNewFriendsMessageComposer'; +import { FollowFriendMessageComposer } from './messages/outgoing/friendlist/FollowFriendMessageComposer'; import { FriendListUpdateComposer } from './messages/outgoing/friendlist/FriendListUpdateComposer'; import { GetFriendRequestsComposer } from './messages/outgoing/friendlist/GetFriendRequestsComposer'; import { HabboSearchComposer } from './messages/outgoing/friendlist/HabboSearchComposer'; @@ -959,6 +959,22 @@ export class NitroMessages implements IMessageConfiguration // FRIENDFURNI this._composers.set(OutgoingHeader.FRIEND_FURNI_CONFIRM_LOCK, FriendFurniConfirmLockMessageComposer); + // FRIENDLIST + this._composers.set(OutgoingHeader.ACCEPT_FRIEND, AcceptFriendMessageComposer); + this._composers.set(OutgoingHeader.DECLINE_FRIEND, DeclineFriendMessageComposer); + this._composers.set(OutgoingHeader.FIND_NEW_FRIENDS, FindNewFriendsMessageComposer); + this._composers.set(OutgoingHeader.FOLLOW_FRIEND, FollowFriendMessageComposer); + this._composers.set(OutgoingHeader.FRIEND_LIST_UPDATE, FriendListUpdateComposer); + this._composers.set(OutgoingHeader.GET_FRIEND_REQUESTS, GetFriendRequestsComposer); + this._composers.set(OutgoingHeader.HABBO_SEARCH, HabboSearchComposer); + this._composers.set(OutgoingHeader.MESSENGER_INIT, MessengerInitComposer); + this._composers.set(OutgoingHeader.REMOVE_FRIEND, RemoveFriendComposer); + this._composers.set(OutgoingHeader.REQUEST_FRIEND, RequestFriendComposer); + this._composers.set(OutgoingHeader.MESSENGER_CHAT, SendMessageComposer); + this._composers.set(OutgoingHeader.SEND_ROOM_INVITE, SendRoomInviteComposer); + this._composers.set(OutgoingHeader.SET_RELATIONSHIP_STATUS, SetRelationshipStatusComposer); + this._composers.set(OutgoingHeader.VISIT_USER, VisitUserComposer); + // CLIENT this._composers.set(OutgoingHeader.CLIENT_PONG, ClientPongComposer); this._composers.set(OutgoingHeader.RELEASE_VERSION, ClientReleaseVersionComposer); @@ -966,22 +982,6 @@ export class NitroMessages implements IMessageConfiguration // DESKTOP this._composers.set(OutgoingHeader.DESKTOP_VIEW, DesktopViewComposer); - // FRIENDLIST - this._composers.set(OutgoingHeader.MESSENGER_ACCEPT, AcceptFriendComposer); - this._composers.set(OutgoingHeader.MESSENGER_DECLINE, DeclineFriendComposer); - this._composers.set(OutgoingHeader.FIND_FRIENDS, FindNewFriendsComposer); - this._composers.set(OutgoingHeader.MESSENGER_FOLLOW, FollowFriendComposer); - this._composers.set(OutgoingHeader.MESSENGER_UPDATES, FriendListUpdateComposer); - this._composers.set(OutgoingHeader.MESSENGER_REQUESTS, GetFriendRequestsComposer); - this._composers.set(OutgoingHeader.MESSENGER_SEARCH, HabboSearchComposer); - this._composers.set(OutgoingHeader.MESSENGER_INIT, MessengerInitComposer); - this._composers.set(OutgoingHeader.MESSENGER_REMOVE, RemoveFriendComposer); - this._composers.set(OutgoingHeader.MESSENGER_REQUEST, RequestFriendComposer); - this._composers.set(OutgoingHeader.MESSENGER_CHAT, SendMessageComposer); - this._composers.set(OutgoingHeader.MESSENGER_ROOM_INVITE, SendRoomInviteComposer); - this._composers.set(OutgoingHeader.MESSENGER_RELATIONSHIPS_UPDATE, SetRelationshipStatusComposer); - this._composers.set(OutgoingHeader.USER_VISIT, VisitUserComposer); - // GROUP this._composers.set(OutgoingHeader.GROUP_INFO, GroupInformationComposer); this._composers.set(OutgoingHeader.GROUP_REQUEST, GroupJoinComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index f490d6f3..a2d5b968 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -24,7 +24,7 @@ export class OutgoingHeader public static DESKTOP_VIEW = 105; public static GET_BUNDLE_DISCOUNT_RULESET = 223; public static EVENT_TRACKER = 3457; - public static FIND_FRIENDS = 516; + public static FIND_NEW_FRIENDS = 516; public static FURNITURE_ALIASES = 3898; public static FURNITURE_FLOOR_UPDATE = 248; public static FURNITURE_MULTISTATE = 99; @@ -76,20 +76,20 @@ export class OutgoingHeader public static ITEM_WALL_CLICK = 210; public static ITEM_WALL_UPDATE = 168; public static MARKETPLACE_CONFIG = 2597; - public static MESSENGER_ACCEPT = 137; + public static ACCEPT_FRIEND = 137; public static MESSENGER_CHAT = 3567; - public static MESSENGER_DECLINE = 2890; - public static MESSENGER_FOLLOW = 3997; + public static DECLINE_FRIEND = 2890; + public static FOLLOW_FRIEND = 3997; public static MESSENGER_FRIENDS = 1523; public static MESSENGER_INIT = 2781; public static MESSENGER_RELATIONSHIPS = 2138; - public static MESSENGER_RELATIONSHIPS_UPDATE = 3768; - public static MESSENGER_REMOVE = 1689; - public static MESSENGER_REQUEST = 3157; - public static MESSENGER_REQUESTS = 2448; - public static MESSENGER_ROOM_INVITE = 1276; - public static MESSENGER_SEARCH = 1210; - public static MESSENGER_UPDATES = 1419; + public static SET_RELATIONSHIP_STATUS = 3768; + public static REMOVE_FRIEND = 1689; + public static REQUEST_FRIEND = 3157; + public static GET_FRIEND_REQUESTS = 2448; + public static SEND_ROOM_INVITE = 1276; + public static HABBO_SEARCH = 1210; + public static FRIEND_LIST_UPDATE = 1419; public static MOD_TOOL_USER_INFO = 3295; public static NAVIGATOR_CATEGORIES = 3027; public static NAVIGATOR_INIT = 2110; @@ -187,7 +187,7 @@ export class OutgoingHeader public static GET_WARDROBE = 2742; public static SAVE_WARDROBE_OUTFIT = 800; public static USER_TAGS = 17; - public static USER_VISIT = 2970; + public static VISIT_USER = 2970; public static WIRED_ACTION_SAVE = 2281; public static WIRED_APPLY_SNAPSHOT = 3373; public static WIRED_CONDITION_SAVE = 3203; diff --git a/src/nitro/communication/messages/outgoing/friendlist/AcceptFriendComposer.ts b/src/nitro/communication/messages/outgoing/friendlist/AcceptFriendMessageComposer.ts similarity index 61% rename from src/nitro/communication/messages/outgoing/friendlist/AcceptFriendComposer.ts rename to src/nitro/communication/messages/outgoing/friendlist/AcceptFriendMessageComposer.ts index dee8bd7a..e8611e21 100644 --- a/src/nitro/communication/messages/outgoing/friendlist/AcceptFriendComposer.ts +++ b/src/nitro/communication/messages/outgoing/friendlist/AcceptFriendMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class AcceptFriendComposer implements IMessageComposer> +export class AcceptFriendMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(...userIds: number[]) { @@ -18,4 +18,4 @@ export class AcceptFriendComposer implements IMessageComposer> +export class DeclineFriendMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(removeAll: boolean, ...userIds: number[]) { @@ -18,4 +18,4 @@ export class DeclineFriendComposer implements IMessageComposer> +export class FindNewFriendsMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor() { @@ -18,4 +18,4 @@ export class FindNewFriendsComposer implements IMessageComposer> +export class FollowFriendMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(userId: number) { @@ -18,4 +18,4 @@ export class FollowFriendComposer implements IMessageComposer Date: Thu, 16 Sep 2021 13:25:30 -0400 Subject: [PATCH 031/108] Remove enum type --- .../floorplan/pixi-tilemap/RectTileLayer.ts | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/room/floorplan/pixi-tilemap/RectTileLayer.ts b/src/room/floorplan/pixi-tilemap/RectTileLayer.ts index 55819bc8..66692837 100644 --- a/src/room/floorplan/pixi-tilemap/RectTileLayer.ts +++ b/src/room/floorplan/pixi-tilemap/RectTileLayer.ts @@ -6,22 +6,23 @@ import { Constant } from './Constant'; import { RectTileGeom } from './RectTileShader'; import { TileRenderer } from './TileRenderer'; -enum PointStruct { - U = 0, - V, - X, - Y, - TileWidth, - TileHeight, - Rotate, - AnimX, - AnimY, - TextureIndex, - AnimCountX, - AnimCountY, - Alpha, - YAxis, - XAxis +class PointStruct +{ + public static U = 0; + public static V = 1; + public static X = 2; + public static Y = 3; + public static TileWidth = 4; + public static TileHeight = 5; + public static Rotate = 6; + public static AnimX = 7; + public static AnimY = 8; + public static TextureIndex = 9; + public static AnimCountX = 10; + public static AnimCountY = 11; + public static Alpha = 12; + public static YAxis = 13; + public static XAxis = 14; } export const POINT_STRUCT_SIZE_TWO = (Object.keys(PointStruct).length / 2); //export const POINT_STRUCT_SIZE = 12; From 8c1e821512525fa88cd1dd654bfb2c6a4969a95b Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 17 Sep 2021 15:00:54 -0500 Subject: [PATCH 032/108] added outgoing gift messages --- src/nitro/communication/NitroMessages.ts | 27 ++++++++++++------- .../messages/outgoing/OutgoingHeader.ts | 5 ++++ .../outgoing/gifts/GetGiftMessageComposer.ts | 23 ++++++++++++++++ .../ResetPhoneNumberStateMessageComposer.ts | 21 +++++++++++++++ ...NumberVerificationStatusMessageComposer.ts | 23 ++++++++++++++++ .../gifts/TryPhoneNumberMessageComposer.ts | 21 +++++++++++++++ .../gifts/VerifyCodeMessageComposer.ts | 21 +++++++++++++++ .../messages/outgoing/gifts/index.ts | 5 ++++ .../communication/messages/outgoing/index.ts | 1 + 9 files changed, 138 insertions(+), 9 deletions(-) create mode 100644 src/nitro/communication/messages/outgoing/gifts/GetGiftMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/gifts/ResetPhoneNumberStateMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/gifts/SetPhoneNumberVerificationStatusMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/gifts/TryPhoneNumberMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/gifts/VerifyCodeMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/gifts/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index db0f8af5..a3422bee 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; @@ -896,6 +896,14 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.CHANGE_USERNAME, ChangeUserNameMessageComposer); this._composers.set(OutgoingHeader.CHECK_USERNAME, CheckUserNameMessageComposer); + // CAMERA + this._composers.set(OutgoingHeader.REQUEST_CAMERA_CONFIGURATION, RequestCameraConfigurationComposer); + this._composers.set(OutgoingHeader.RENDER_ROOM, RenderRoomMessageComposer); + this._composers.set(OutgoingHeader.RENDER_ROOM_THUMBNAIL, RenderRoomThumbnailMessageComposer); + this._composers.set(OutgoingHeader.PURCHASE_PHOTO, PurchasePhotoMessageComposer); + this._composers.set(OutgoingHeader.PUBLISH_PHOTO, PublishPhotoMessageComposer); + this._composers.set(OutgoingHeader.PHOTO_COMPETITION, PhotoCompetitionMessageComposer); + // CAMPAIGN this._composers.set(OutgoingHeader.OPEN_CAMPAIGN_CALENDAR_DOOR, OpenCampaignCalendarDoorComposer); this._composers.set(OutgoingHeader.OPEN_CAMPAIGN_CALENDAR_DOOR_STAFF, OpenCampaignCalendarDoorAsStaffComposer); @@ -975,6 +983,15 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.SET_RELATIONSHIP_STATUS, SetRelationshipStatusComposer); this._composers.set(OutgoingHeader.VISIT_USER, VisitUserComposer); + // todo: game + + // GIFTS + this._composers.set(OutgoingHeader.GET_GIFT, GetGiftMessageComposer); + this._composers.set(OutgoingHeader.RESET_PHONE_NUMBER_STATE, ResetPhoneNumberStateMessageComposer); + this._composers.set(OutgoingHeader.SET_PHONE_NUMBER_VERIFICATION_STATUS, SetPhoneNumberVerificationStatusMessageComposer); + this._composers.set(OutgoingHeader.TRY_PHONE_NUMBER, TryPhoneNumberMessageComposer); + this._composers.set(OutgoingHeader.VERIFY_CODE, VerifyCodeMessageComposer); + // CLIENT this._composers.set(OutgoingHeader.CLIENT_PONG, ClientPongComposer); this._composers.set(OutgoingHeader.RELEASE_VERSION, ClientReleaseVersionComposer); @@ -1268,14 +1285,6 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.REJECT_QUEST, RejectQuestMessageComposer); this._composers.set(OutgoingHeader.START_CAMPAIGN, StartCampaignMessageComposer); - // CAMERA - this._composers.set(OutgoingHeader.REQUEST_CAMERA_CONFIGURATION, RequestCameraConfigurationComposer); - this._composers.set(OutgoingHeader.RENDER_ROOM, RenderRoomMessageComposer); - this._composers.set(OutgoingHeader.RENDER_ROOM_THUMBNAIL, RenderRoomThumbnailMessageComposer); - this._composers.set(OutgoingHeader.PURCHASE_PHOTO, PurchasePhotoMessageComposer); - this._composers.set(OutgoingHeader.PUBLISH_PHOTO, PublishPhotoMessageComposer); - this._composers.set(OutgoingHeader.PHOTO_COMPETITION, PhotoCompetitionMessageComposer); - // SOUNDS this._composers.set(OutgoingHeader.GET_SOUND_SETTINGS, GetSoundSettingsComposer); this._composers.set(OutgoingHeader.ADD_JUKEBOX_DISK, AddJukeboxDiskComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index a2d5b968..303e1099 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -316,4 +316,9 @@ export class OutgoingHeader public static ROOM_COMPETITION_INIT = 1334; public static SUBMIT_ROOM_TO_COMPETITION = 2595; public static VOTE_FOR_ROOM = 143; + public static GET_GIFT = 2436; + public static RESET_PHONE_NUMBER_STATE = 2741; + public static SET_PHONE_NUMBER_VERIFICATION_STATUS = 1379; + public static TRY_PHONE_NUMBER = 790; + public static VERIFY_CODE = 2721; } diff --git a/src/nitro/communication/messages/outgoing/gifts/GetGiftMessageComposer.ts b/src/nitro/communication/messages/outgoing/gifts/GetGiftMessageComposer.ts new file mode 100644 index 00000000..3406922c --- /dev/null +++ b/src/nitro/communication/messages/outgoing/gifts/GetGiftMessageComposer.ts @@ -0,0 +1,23 @@ +import { IMessageComposer } from '../../../../../core'; + +export class GetGiftMessageComposer implements IMessageComposer> +{ + public static readonly NO_ISSUE_ID = -1; + + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/gifts/ResetPhoneNumberStateMessageComposer.ts b/src/nitro/communication/messages/outgoing/gifts/ResetPhoneNumberStateMessageComposer.ts new file mode 100644 index 00000000..4c435155 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/gifts/ResetPhoneNumberStateMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class ResetPhoneNumberStateMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/gifts/SetPhoneNumberVerificationStatusMessageComposer.ts b/src/nitro/communication/messages/outgoing/gifts/SetPhoneNumberVerificationStatusMessageComposer.ts new file mode 100644 index 00000000..ec15217d --- /dev/null +++ b/src/nitro/communication/messages/outgoing/gifts/SetPhoneNumberVerificationStatusMessageComposer.ts @@ -0,0 +1,23 @@ +import { IMessageComposer } from '../../../../../core'; + +export class SetPhoneNumberVerificationStatusMessageComposer implements IMessageComposer> +{ + public static readonly NO_ISSUE_ID = -1; + + private _data: ConstructorParameters; + + constructor(k: number) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/gifts/TryPhoneNumberMessageComposer.ts b/src/nitro/communication/messages/outgoing/gifts/TryPhoneNumberMessageComposer.ts new file mode 100644 index 00000000..46285297 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/gifts/TryPhoneNumberMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class TryPhoneNumberMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: string, _arg_2: string) + { + this._data = [ k, _arg_2 ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/gifts/VerifyCodeMessageComposer.ts b/src/nitro/communication/messages/outgoing/gifts/VerifyCodeMessageComposer.ts new file mode 100644 index 00000000..89abfadb --- /dev/null +++ b/src/nitro/communication/messages/outgoing/gifts/VerifyCodeMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class VerifyCodeMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: string) + { + this._data = [ k ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/gifts/index.ts b/src/nitro/communication/messages/outgoing/gifts/index.ts new file mode 100644 index 00000000..daa097bc --- /dev/null +++ b/src/nitro/communication/messages/outgoing/gifts/index.ts @@ -0,0 +1,5 @@ +export * from './GetGiftMessageComposer'; +export * from './ResetPhoneNumberStateMessageComposer'; +export * from './SetPhoneNumberVerificationStatusMessageComposer'; +export * from './TryPhoneNumberMessageComposer'; +export * from './VerifyCodeMessageComposer'; diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index 21715cea..627693dc 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -8,6 +8,7 @@ export * from './competition'; export * from './desktop'; export * from './friendfurni'; export * from './friendlist'; +export * from './gifts'; export * from './group'; export * from './handshake'; export * from './helper'; From f0e31710b57cdb9cf223c95a69f48df5e8e45f33 Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 17 Sep 2021 17:42:30 -0500 Subject: [PATCH 033/108] added outgoing groupforum messages --- src/nitro/communication/NitroMessages.ts | 16 ++++++++- .../messages/outgoing/OutgoingHeader.ts | 15 +++++++-- .../GetForumStatsMessageComposer.ts | 21 ++++++++++++ .../GetForumsListMessageComposer.ts | 21 ++++++++++++ .../groupforums/GetMessagesMessageComposer.ts | 21 ++++++++++++ .../groupforums/GetThreadMessageComposer.ts | 21 ++++++++++++ .../groupforums/GetThreadsMessageComposer.ts | 21 ++++++++++++ .../GetUnreadForumsCountMessageComposer.ts | 21 ++++++++++++ .../ModerateMessageMessageComposer.ts | 21 ++++++++++++ .../ModerateThreadMessageComposer.ts | 21 ++++++++++++ .../groupforums/PostMessageMessageComposer.ts | 21 ++++++++++++ .../UpdateForumReadMarkerMessageComposer.ts | 33 +++++++++++++++++++ .../UpdateForumSettingsMessageComposer.ts | 21 ++++++++++++ .../UpdateThreadMessageComposer.ts | 21 ++++++++++++ .../messages/outgoing/groupforums/index.ts | 12 +++++++ .../communication/messages/outgoing/index.ts | 1 + 16 files changed, 304 insertions(+), 4 deletions(-) create mode 100644 src/nitro/communication/messages/outgoing/groupforums/GetForumStatsMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/GetForumsListMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/GetMessagesMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/GetThreadMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/GetThreadsMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/GetUnreadForumsCountMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/ModerateMessageMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/ModerateThreadMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/PostMessageMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/UpdateForumReadMarkerMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/UpdateForumSettingsMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/UpdateThreadMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/groupforums/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index a3422bee..3228a1a4 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; @@ -992,6 +992,20 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.TRY_PHONE_NUMBER, TryPhoneNumberMessageComposer); this._composers.set(OutgoingHeader.VERIFY_CODE, VerifyCodeMessageComposer); + // GROUPFORUMS + this._composers.set(OutgoingHeader.GET_FORUM_STATS, GetForumStatsMessageComposer); + this._composers.set(OutgoingHeader.GET_FORUMS_LIST, GetForumsListMessageComposer); + this._composers.set(OutgoingHeader.GET_FORUM_MESSAGES, GetMessagesMessageComposer); + this._composers.set(OutgoingHeader.GET_FORUM_THREAD, GetThreadMessageComposer); + this._composers.set(OutgoingHeader.GET_FORUM_THREADS, GetThreadsMessageComposer); + this._composers.set(OutgoingHeader.GET_UNREAD_FORUMS_COUNT, GetUnreadForumsCountMessageComposer); + this._composers.set(OutgoingHeader.FORUM_MODERATE_MESSAGE, ModerateMessageMessageComposer); + this._composers.set(OutgoingHeader.FORUM_MODERATE_THREAD, ModerateThreadMessageComposer); + this._composers.set(OutgoingHeader.FORUM_POST_MESSAGE, PostMessageMessageComposer); + this._composers.set(OutgoingHeader.UPDATE_FORUM_READ_MARKER, UpdateForumReadMarkerMessageComposer); + this._composers.set(OutgoingHeader.UPDATE_FORUM_SETTINGS, UpdateForumSettingsMessageComposer); + this._composers.set(OutgoingHeader.FORUM_UPDATE_THREAD, UpdateThreadMessageComposer); + // CLIENT this._composers.set(OutgoingHeader.CLIENT_PONG, ClientPongComposer); this._composers.set(OutgoingHeader.RELEASE_VERSION, ClientReleaseVersionComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 303e1099..009fa815 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -41,9 +41,18 @@ export class OutgoingHeader public static GROUP_ADMIN_REMOVE = 722; public static GROUP_CREATE_OPTIONS = 798; public static GROUP_FAVORITE = 3549; - public static GROUP_FORUM_INFO = 3149; - public static GROUP_FORUM_LIST = 873; - public static GROUP_FORUM_THREADS = 436; + public static GET_FORUM_STATS = 3149; + public static GET_FORUM_THREADS = 873; + public static GET_FORUMS_LIST = 436; + public static GET_FORUM_MESSAGES = 232; + public static GET_FORUM_THREAD = 3900; + public static GET_UNREAD_FORUMS_COUNT = 2908; + public static FORUM_MODERATE_MESSAGE = 286; + public static FORUM_MODERATE_THREAD = 1397; + public static FORUM_POST_MESSAGE = 3529; + public static UPDATE_FORUM_READ_MARKER = 1855; + public static UPDATE_FORUM_SETTINGS = 2214; + public static FORUM_UPDATE_THREAD = 3045; public static GROUP_INFO = 2991; public static GROUP_DELETE = 1134; public static GROUP_MEMBER_REMOVE_CONFIRM = 3593; diff --git a/src/nitro/communication/messages/outgoing/groupforums/GetForumStatsMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/GetForumStatsMessageComposer.ts new file mode 100644 index 00000000..02abbe99 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/GetForumStatsMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../..'; + +export class GetForumStatsMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number) + { + this._data = [ k ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/GetForumsListMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/GetForumsListMessageComposer.ts new file mode 100644 index 00000000..13a76085 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/GetForumsListMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../..'; + +export class GetForumsListMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number, _arg_2: number, _arg_3: number) + { + this._data = [ k, _arg_2, _arg_3 ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/GetMessagesMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/GetMessagesMessageComposer.ts new file mode 100644 index 00000000..04ba4ceb --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/GetMessagesMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../..'; + +export class GetMessagesMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number, _arg_2: number, _arg_3: number, _arg_4: number) + { + this._data = [k, _arg_2, _arg_3, _arg_4]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/GetThreadMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/GetThreadMessageComposer.ts new file mode 100644 index 00000000..e8f4d5b0 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/GetThreadMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../..'; + +export class GetThreadMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number, _arg_2: number) + { + this._data = [ k, _arg_2 ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/GetThreadsMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/GetThreadsMessageComposer.ts new file mode 100644 index 00000000..939da3fb --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/GetThreadsMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../..'; + +export class GetThreadsMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number, _arg_2: number, _arg_3: number) + { + this._data = [k, _arg_2, _arg_3 ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/GetUnreadForumsCountMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/GetUnreadForumsCountMessageComposer.ts new file mode 100644 index 00000000..022abfec --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/GetUnreadForumsCountMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class GetUnreadForumsCountMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/ModerateMessageMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/ModerateMessageMessageComposer.ts new file mode 100644 index 00000000..af2bdfec --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/ModerateMessageMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../..'; + +export class ModerateMessageMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:number, _arg_3:number, _arg_4:number) + { + this._data = [k, _arg_2, _arg_3, _arg_4]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/ModerateThreadMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/ModerateThreadMessageComposer.ts new file mode 100644 index 00000000..c1b20ce6 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/ModerateThreadMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class ModerateThreadMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:number, _arg_3:number) + { + this._data = [k, _arg_2, _arg_3]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/PostMessageMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/PostMessageMessageComposer.ts new file mode 100644 index 00000000..4f7dd9ae --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/PostMessageMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class PostMessageMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:number, _arg_3:string, _arg_4:string) + { + this._data = [k, _arg_2, _arg_3, _arg_4]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/UpdateForumReadMarkerMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/UpdateForumReadMarkerMessageComposer.ts new file mode 100644 index 00000000..b54ad930 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/UpdateForumReadMarkerMessageComposer.ts @@ -0,0 +1,33 @@ +import { IMessageComposer } from '../../../../../core'; + +export class UpdateForumReadMarkerMessageComposer implements IMessageComposer +{ + private _data: any; + + constructor(...data: UpdateForumReadMarkerEntry[]) + { + this._data = [data.length]; + data.forEach( entry => + { + this._data.push(entry.k); + this._data.push(entry._arg_2); + this._data.push(entry._arg_3); + }); + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} + +export class UpdateForumReadMarkerEntry +{ + constructor(public k:number, public _arg_2:number, public _arg_3:boolean) + {} +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/UpdateForumSettingsMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/UpdateForumSettingsMessageComposer.ts new file mode 100644 index 00000000..57235deb --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/UpdateForumSettingsMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class UpdateForumSettingsMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:number, _arg_3:number, _arg_4:number, _arg_5:number) + { + this._data = [k, _arg_2, _arg_3, _arg_4, _arg_5]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/UpdateThreadMessageComposer.ts b/src/nitro/communication/messages/outgoing/groupforums/UpdateThreadMessageComposer.ts new file mode 100644 index 00000000..b96196dd --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/UpdateThreadMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class UpdateThreadMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:number, _arg_3:boolean, _arg_4:boolean) + { + this._data = [k, _arg_2, _arg_4, _arg_3]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/groupforums/index.ts b/src/nitro/communication/messages/outgoing/groupforums/index.ts new file mode 100644 index 00000000..fc1825b2 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/groupforums/index.ts @@ -0,0 +1,12 @@ +export * from './GetForumsListMessageComposer'; +export * from './GetForumStatsMessageComposer'; +export * from './GetMessagesMessageComposer'; +export * from './GetThreadMessageComposer'; +export * from './GetThreadsMessageComposer'; +export * from './GetUnreadForumsCountMessageComposer'; +export * from './ModerateMessageMessageComposer'; +export * from './ModerateThreadMessageComposer'; +export * from './PostMessageMessageComposer'; +export * from './UpdateForumReadMarkerMessageComposer'; +export * from './UpdateForumSettingsMessageComposer'; +export * from './UpdateThreadMessageComposer'; diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index 627693dc..3e69be5a 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -10,6 +10,7 @@ export * from './friendfurni'; export * from './friendlist'; export * from './gifts'; export * from './group'; +export * from './groupforums'; export * from './handshake'; export * from './helper'; export * from './inventory'; From 13aa1158fd81ccb32af67febaff437a8ec31093a Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 17 Sep 2021 20:25:11 -0500 Subject: [PATCH 034/108] add outgoing youtube messages --- src/nitro/communication/NitroMessages.ts | 5 ++++- .../messages/outgoing/OutgoingHeader.ts | 3 +++ .../messages/outgoing/room/furniture/index.ts | 1 + ...olYoutubeDisplayPlaybackMessageComposer.ts | 21 +++++++++++++++++++ .../GetYoutubeDisplayStatusMessageComposer.ts | 21 +++++++++++++++++++ ...etYoutubeDisplayPlaylistMessageComposer.ts | 21 +++++++++++++++++++ .../outgoing/room/furniture/youtube/index.ts | 3 +++ 7 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/outgoing/room/furniture/youtube/ControlYoutubeDisplayPlaybackMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/room/furniture/youtube/GetYoutubeDisplayStatusMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/room/furniture/youtube/SetYoutubeDisplayPlaylistMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/room/furniture/youtube/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 3228a1a4..b55216e3 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; @@ -1150,6 +1150,9 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.FURNITURE_PLACE, FurniturePlaceComposer); this._composers.set(OutgoingHeader.ITEM_PAINT, FurniturePlacePaintComposer); this._composers.set(OutgoingHeader.FURNITURE_POSTIT_PLACE, FurniturePostItPlaceComposer); + this._composers.set(OutgoingHeader.CONTROL_YOUTUBE_DISPLAY_PLAYBACK, ControlYoutubeDisplayPlaybackMessageComposer); + this._composers.set(OutgoingHeader.GET_YOUTUBE_DISPLAY_STATUS, GetYoutubeDisplayStatusMessageComposer); + this._composers.set(OutgoingHeader.SET_YOUTUBE_DISPLAY_PLAYLIST, SetYoutubeDisplayPlaylistMessageComposer); // FLOOR this._composers.set(OutgoingHeader.FURNITURE_FLOOR_UPDATE, FurnitureFloorUpdateComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 009fa815..eb2bb149 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -330,4 +330,7 @@ export class OutgoingHeader public static SET_PHONE_NUMBER_VERIFICATION_STATUS = 1379; public static TRY_PHONE_NUMBER = 790; public static VERIFY_CODE = 2721; + public static CONTROL_YOUTUBE_DISPLAY_PLAYBACK = 3005; + public static GET_YOUTUBE_DISPLAY_STATUS = 336; + public static SET_YOUTUBE_DISPLAY_PLAYLIST = 2069; } diff --git a/src/nitro/communication/messages/outgoing/room/furniture/index.ts b/src/nitro/communication/messages/outgoing/room/furniture/index.ts index c3ec36cf..30c71b71 100644 --- a/src/nitro/communication/messages/outgoing/room/furniture/index.ts +++ b/src/nitro/communication/messages/outgoing/room/furniture/index.ts @@ -11,3 +11,4 @@ export * from './mannequin'; export * from './presents'; export * from './toner'; export * from './wall'; +export * from './youtube'; diff --git a/src/nitro/communication/messages/outgoing/room/furniture/youtube/ControlYoutubeDisplayPlaybackMessageComposer.ts b/src/nitro/communication/messages/outgoing/room/furniture/youtube/ControlYoutubeDisplayPlaybackMessageComposer.ts new file mode 100644 index 00000000..fa0c69d9 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/furniture/youtube/ControlYoutubeDisplayPlaybackMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../../core'; + +export class ControlYoutubeDisplayPlaybackMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number, _arg_2: number) + { + this._data = [k, _arg_2]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/furniture/youtube/GetYoutubeDisplayStatusMessageComposer.ts b/src/nitro/communication/messages/outgoing/room/furniture/youtube/GetYoutubeDisplayStatusMessageComposer.ts new file mode 100644 index 00000000..3ff94292 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/furniture/youtube/GetYoutubeDisplayStatusMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../../core'; + +export class GetYoutubeDisplayStatusMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number) + { + this._data = [ k ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/furniture/youtube/SetYoutubeDisplayPlaylistMessageComposer.ts b/src/nitro/communication/messages/outgoing/room/furniture/youtube/SetYoutubeDisplayPlaylistMessageComposer.ts new file mode 100644 index 00000000..4902b528 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/furniture/youtube/SetYoutubeDisplayPlaylistMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../..'; + +export class SetYoutubeDisplayPlaylistMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:string) + { + this._data = [k, _arg_2]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/furniture/youtube/index.ts b/src/nitro/communication/messages/outgoing/room/furniture/youtube/index.ts new file mode 100644 index 00000000..c72bc637 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/furniture/youtube/index.ts @@ -0,0 +1,3 @@ +export * from './ControlYoutubeDisplayPlaybackMessageComposer'; +export * from './GetYoutubeDisplayStatusMessageComposer'; +export * from './SetYoutubeDisplayPlaylistMessageComposer'; From 5139c12b1b75ca6743c76d090cb60554f8422cef Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 17 Sep 2021 21:43:02 -0500 Subject: [PATCH 035/108] added incoming youtube messages --- src/nitro/communication/NitroMessages.ts | 5 +- .../messages/incoming/IncomingHeader.ts | 3 ++ .../messages/incoming/room/furniture/index.ts | 1 + .../YoutubeControlVideoMessageEvent.ts | 16 ++++++ .../youtube/YoutubeDisplayPlaylistsEvent.ts | 16 ++++++ .../YoutubeDisplayVideoMessageEvent.ts | 16 ++++++ .../incoming/room/furniture/youtube/index.ts | 3 ++ .../messages/parser/room/furniture/index.ts | 1 + .../YoutubeControlVideoMessageParser.ts | 32 ++++++++++++ .../youtube/YoutubeDisplayPlaylist.ts | 28 ++++++++++ .../YoutubeDisplayPlaylistsMessageParser.ts | 46 +++++++++++++++++ .../YoutubeDisplayVideoMessageParser.ts | 51 +++++++++++++++++++ .../parser/room/furniture/youtube/index.ts | 4 ++ 13 files changed, 221 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeControlVideoMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeDisplayPlaylistsEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeDisplayVideoMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/furniture/youtube/index.ts create mode 100644 src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeControlVideoMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayPlaylist.ts create mode 100644 src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayPlaylistsMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayVideoMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/room/furniture/youtube/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index b55216e3..9f5c1df4 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent, YoutubeControlVideoMessageEvent, YoutubeDisplayPlaylistsEvent, YoutubeDisplayVideoMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; @@ -615,6 +615,9 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.USER_FURNITURE_REFRESH, FurnitureListInvalidateEvent); this._events.set(IncomingHeader.USER_FURNITURE_REMOVE, FurnitureListRemovedEvent); this._events.set(IncomingHeader.USER_FURNITURE_POSTIT_PLACED, FurniturePostItPlacedEvent); + this._events.set(IncomingHeader.YOUTUBE_CONTROL_VIDEO, YoutubeControlVideoMessageEvent); + this._events.set(IncomingHeader.YOUTUBE_DISPLAY_PLAYLISTS, YoutubeDisplayPlaylistsEvent); + this._events.set(IncomingHeader.YOUTUBE_DISPLAY_VIDEO, YoutubeDisplayVideoMessageEvent); // TRADING this._events.set(IncomingHeader.TRADE_ACCEPTED, TradingAcceptEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 736bec3a..4b398cfb 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -318,4 +318,7 @@ export class IncomingHeader public static BADGE_POINT_LIMITS = 2501; public static BADGE_REQUEST_FULFILLED = 2998; public static HELPER_TALENT_TRACK = 3406; + public static YOUTUBE_CONTROL_VIDEO = 1554; + public static YOUTUBE_DISPLAY_PLAYLISTS = 1112; + public static YOUTUBE_DISPLAY_VIDEO = 1411; } diff --git a/src/nitro/communication/messages/incoming/room/furniture/index.ts b/src/nitro/communication/messages/incoming/room/furniture/index.ts index acc01d5e..8a982371 100644 --- a/src/nitro/communication/messages/incoming/room/furniture/index.ts +++ b/src/nitro/communication/messages/incoming/room/furniture/index.ts @@ -12,3 +12,4 @@ export * from './LoveLockFurniStartEvent'; export * from './RoomDimmerPresetsMessageData'; export * from './RoomDimmerPresetsMessageEvent'; export * from './wall'; +export * from './youtube'; diff --git a/src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeControlVideoMessageEvent.ts b/src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeControlVideoMessageEvent.ts new file mode 100644 index 00000000..3c9103b0 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeControlVideoMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../../core/communication/messages/MessageEvent'; +import { YoutubeControlVideoMessageParser } from '../../../../parser/room/furniture/youtube/YoutubeControlVideoMessageParser'; + +export class YoutubeControlVideoMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, YoutubeControlVideoMessageParser); + } + + public getParser(): YoutubeControlVideoMessageParser + { + return this.parser as YoutubeControlVideoMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeDisplayPlaylistsEvent.ts b/src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeDisplayPlaylistsEvent.ts new file mode 100644 index 00000000..975e7ea8 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeDisplayPlaylistsEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../../core/communication/messages/MessageEvent'; +import { YoutubeDisplayPlaylistsMessageParser } from '../../../../parser/room/furniture/youtube/YoutubeDisplayPlaylistsMessageParser'; + +export class YoutubeDisplayPlaylistsEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, YoutubeDisplayPlaylistsMessageParser); + } + + public getParser(): YoutubeDisplayPlaylistsMessageParser + { + return this.parser as YoutubeDisplayPlaylistsMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeDisplayVideoMessageEvent.ts b/src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeDisplayVideoMessageEvent.ts new file mode 100644 index 00000000..800fe638 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/furniture/youtube/YoutubeDisplayVideoMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../../core/communication/messages/MessageEvent'; +import { YoutubeDisplayVideoMessageParser } from '../../../../parser/room/furniture/youtube/YoutubeDisplayVideoMessageParser'; + +export class YoutubeDisplayVideoMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, YoutubeDisplayVideoMessageParser); + } + + public getParser(): YoutubeDisplayVideoMessageParser + { + return this.parser as YoutubeDisplayVideoMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/furniture/youtube/index.ts b/src/nitro/communication/messages/incoming/room/furniture/youtube/index.ts new file mode 100644 index 00000000..4bb22a3b --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/furniture/youtube/index.ts @@ -0,0 +1,3 @@ +export * from './YoutubeControlVideoMessageEvent'; +export * from './YoutubeDisplayPlaylistsEvent'; +export * from './YoutubeDisplayVideoMessageEvent'; diff --git a/src/nitro/communication/messages/parser/room/furniture/index.ts b/src/nitro/communication/messages/parser/room/furniture/index.ts index 4e2216d4..458b1bf0 100644 --- a/src/nitro/communication/messages/parser/room/furniture/index.ts +++ b/src/nitro/communication/messages/parser/room/furniture/index.ts @@ -11,3 +11,4 @@ export * from './LoveLockFurniFriendConfirmedParser'; export * from './LoveLockFurniStartParser'; export * from './RoomDimmerPresetsMessageParser'; export * from './wall'; +export * from './youtube'; diff --git a/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeControlVideoMessageParser.ts b/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeControlVideoMessageParser.ts new file mode 100644 index 00000000..415860c7 --- /dev/null +++ b/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeControlVideoMessageParser.ts @@ -0,0 +1,32 @@ +import { IMessageDataWrapper } from '../../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../../core/communication/messages/IMessageParser'; + +export class YoutubeControlVideoMessageParser implements IMessageParser +{ + private _furniId: number; + private _commandId: number; + + public parse(wrapper: IMessageDataWrapper): boolean + { + this._furniId = wrapper.readInt(); + this._commandId = wrapper.readInt(); + return true; + } + + public flush(): boolean + { + this._furniId = -1; + this._commandId = -1; + return true; + } + + public get furniId(): number + { + return this._furniId; + } + + public get commandId(): number + { + return this._commandId; + } +} diff --git a/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayPlaylist.ts b/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayPlaylist.ts new file mode 100644 index 00000000..f47c5eea --- /dev/null +++ b/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayPlaylist.ts @@ -0,0 +1,28 @@ +export class YoutubeDisplayPlaylist +{ + private _video: string; + private _title: string; + private _description: string; + + constructor(k: string, _arg_2: string, _arg_3: string) + { + this._video = k; + this._title = _arg_2; + this._description = _arg_3; + } + + public get video():string + { + return this._video; + } + + public get title():string + { + return this._title; + } + + public get description():string + { + return this._description; + } +} diff --git a/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayPlaylistsMessageParser.ts b/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayPlaylistsMessageParser.ts new file mode 100644 index 00000000..c1150ecc --- /dev/null +++ b/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayPlaylistsMessageParser.ts @@ -0,0 +1,46 @@ +import { IMessageDataWrapper } from '../../../../../../../core'; +import { IMessageParser } from '../../../../../../../core/communication/messages/IMessageParser'; +import { YoutubeDisplayPlaylist } from './YoutubeDisplayPlaylist'; + +export class YoutubeDisplayPlaylistsMessageParser implements IMessageParser +{ + private _furniId:number; + private _playlists:YoutubeDisplayPlaylist[]; + private _selectedPlaylistId:string; + + flush(): boolean + { + this._furniId = -1; + this._playlists = null; + this._selectedPlaylistId = null; + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._furniId = wrapper.readInt(); + const count = wrapper.readInt(); + this._playlists = []; + for(let i = 0; i < count; i++) + { + this._playlists.push(new YoutubeDisplayPlaylist(wrapper.readString(), wrapper.readString(), wrapper.readString())); + } + this._selectedPlaylistId = wrapper.readString(); + return true; + } + + public get furniId():number + { + return this._furniId; + } + + public get playlists():YoutubeDisplayPlaylist[] + { + return this._playlists; + } + + public get selectedPlaylistId():string + { + return this._selectedPlaylistId; + } +} diff --git a/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayVideoMessageParser.ts b/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayVideoMessageParser.ts new file mode 100644 index 00000000..2edfbf22 --- /dev/null +++ b/src/nitro/communication/messages/parser/room/furniture/youtube/YoutubeDisplayVideoMessageParser.ts @@ -0,0 +1,51 @@ +import { IMessageParser } from '../../../../../../..'; +import { IMessageDataWrapper } from '../../../../../../../core'; + +export class YoutubeDisplayVideoMessageParser implements IMessageParser +{ + private _furniId:number; + private _videoId:string; + private _startAtSeconds:number; + private _endAtSeconds:number; + private _state:number; + + flush(): boolean + { + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._furniId = wrapper.readInt(); + this._videoId = wrapper.readString(); + this._startAtSeconds = wrapper.readInt(); + this._endAtSeconds = wrapper.readInt(); + this._state = wrapper.readInt(); + return true; + } + + public get furniId():number + { + return this._furniId; + } + + public get videoId():string + { + return this._videoId; + } + + public get state():number + { + return this._state; + } + + public get startAtSeconds(): number + { + return this._startAtSeconds; + } + + public get endAtSeconds(): number + { + return this._endAtSeconds; + } +} diff --git a/src/nitro/communication/messages/parser/room/furniture/youtube/index.ts b/src/nitro/communication/messages/parser/room/furniture/youtube/index.ts new file mode 100644 index 00000000..9339473c --- /dev/null +++ b/src/nitro/communication/messages/parser/room/furniture/youtube/index.ts @@ -0,0 +1,4 @@ +export * from './YoutubeControlVideoMessageParser'; +export * from './YoutubeDisplayPlaylist'; +export * from './YoutubeDisplayPlaylistsMessageParser'; +export * from './YoutubeDisplayVideoMessageParser'; From d8a4b0e24aac5a8e2091ad08e3d4882577c74c0d Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sat, 18 Sep 2021 01:58:00 -0300 Subject: [PATCH 036/108] Post-it Sticky Pole Packets --- src/nitro/communication/NitroMessages.ts | 4 +++ .../messages/incoming/IncomingHeader.ts | 3 ++- .../FurniturePostItStickyPoleOpenEvent.ts | 16 +++++++++++ .../messages/incoming/room/furniture/index.ts | 1 + .../messages/outgoing/OutgoingHeader.ts | 1 + .../FurniturePostItSaveStickyPoleComposer.ts | 21 +++++++++++++++ .../messages/outgoing/room/furniture/index.ts | 1 + .../FurniturePostItStickyPoleOpenParser.ts | 27 +++++++++++++++++++ 8 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/incoming/room/furniture/FurniturePostItStickyPoleOpenEvent.ts create mode 100644 src/nitro/communication/messages/outgoing/room/furniture/FurniturePostItSaveStickyPoleComposer.ts create mode 100644 src/nitro/communication/messages/parser/room/furniture/FurniturePostItStickyPoleOpenParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index db0f8af5..24df82a5 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -156,6 +156,7 @@ import { FurnitureFloorUpdateEvent } from './messages/incoming/room/furniture/fl import { FurnitureAliasesEvent } from './messages/incoming/room/furniture/FurnitureAliasesEvent'; import { FurnitureDataEvent } from './messages/incoming/room/furniture/FurnitureDataEvent'; import { FurnitureItemDataEvent } from './messages/incoming/room/furniture/FurnitureItemDataEvent'; +import { FurniturePostItStickyPoleOpenEvent } from './messages/incoming/room/furniture/FurniturePostItStickyPoleOpenEvent'; import { FurnitureStackHeightEvent } from './messages/incoming/room/furniture/FurnitureStackHeightEvent'; import { FurnitureState2Event } from './messages/incoming/room/furniture/FurnitureState2Event'; import { FurnitureStateEvent } from './messages/incoming/room/furniture/FurnitureStateEvent'; @@ -395,6 +396,7 @@ import { FurniturePickupComposer } from './messages/outgoing/room/furniture/Furn import { FurniturePlaceComposer } from './messages/outgoing/room/furniture/FurniturePlaceComposer'; import { FurniturePlacePaintComposer } from './messages/outgoing/room/furniture/FurniturePlacePaintComposer'; import { FurniturePostItPlaceComposer } from './messages/outgoing/room/furniture/FurniturePostItPlaceComposer'; +import { FurniturePostItSaveStickyPoleComposer } from './messages/outgoing/room/furniture/FurniturePostItSaveStickyPoleComposer'; import { FurnitureColorWheelComposer } from './messages/outgoing/room/furniture/logic/FurnitureColorWheelComposer'; import { FurnitureDiceActivateComposer } from './messages/outgoing/room/furniture/logic/FurnitureDiceActivateComposer'; import { FurnitureDiceDeactivateComposer } from './messages/outgoing/room/furniture/logic/FurnitureDiceDeactivateComposer'; @@ -710,6 +712,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.LOVELOCK_FURNI_START, LoveLockFurniStartEvent); this._events.set(IncomingHeader.OBJECTS_DATA_UPDATE, ObjectsDataUpdateEvent); this._events.set(IncomingHeader.FURNITURE_GROUP_CONTEXT_MENU_INFO, GroupFurniContextMenuInfoMessageEvent); + this._events.set(IncomingHeader.FURNITURE_POSTIT_STICKY_POLE_OPEN, FurniturePostItStickyPoleOpenEvent); // FLOOR this._events.set(IncomingHeader.FURNITURE_FLOOR_ADD, FurnitureFloorAddEvent); @@ -1119,6 +1122,7 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.FURNITURE_PLACE, FurniturePlaceComposer); this._composers.set(OutgoingHeader.ITEM_PAINT, FurniturePlacePaintComposer); this._composers.set(OutgoingHeader.FURNITURE_POSTIT_PLACE, FurniturePostItPlaceComposer); + this._composers.set(OutgoingHeader.FURNITURE_POSTIT_SAVE_STICKY_POLE, FurniturePostItSaveStickyPoleComposer); // FLOOR this._composers.set(OutgoingHeader.FURNITURE_FLOOR_UPDATE, FurnitureFloorUpdateComposer); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 736bec3a..5629cefd 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -30,7 +30,8 @@ export class IncomingHeader public static FURNITURE_FLOOR_UPDATE = 3776; public static FURNITURE_ITEMDATA = 2202; public static FURNITURE_STATE = 2376; - public static FURNITURE_GROUP_CONTEXT_MENU_INFO= 3293; + public static FURNITURE_GROUP_CONTEXT_MENU_INFO = 3293; + public static FURNITURE_POSTIT_STICKY_POLE_OPEN = 2366; public static GAME_CENTER_ACHIEVEMENTS = 2265; public static GAME_CENTER_GAME_LIST = 222; public static GAME_CENTER_STATUS = 2893; diff --git a/src/nitro/communication/messages/incoming/room/furniture/FurniturePostItStickyPoleOpenEvent.ts b/src/nitro/communication/messages/incoming/room/furniture/FurniturePostItStickyPoleOpenEvent.ts new file mode 100644 index 00000000..6d723b02 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/furniture/FurniturePostItStickyPoleOpenEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { FurniturePostItStickyPoleOpenParser } from '../../../parser/room/furniture/FurniturePostItStickyPoleOpenParser'; + +export class FurniturePostItStickyPoleOpenEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, FurniturePostItStickyPoleOpenParser); + } + + public getParser(): FurniturePostItStickyPoleOpenParser + { + return this.parser as FurniturePostItStickyPoleOpenParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/furniture/index.ts b/src/nitro/communication/messages/incoming/room/furniture/index.ts index acc01d5e..d9abe072 100644 --- a/src/nitro/communication/messages/incoming/room/furniture/index.ts +++ b/src/nitro/communication/messages/incoming/room/furniture/index.ts @@ -2,6 +2,7 @@ export * from './floor'; export * from './FurnitureAliasesEvent'; export * from './FurnitureDataEvent'; export * from './FurnitureItemDataEvent'; +export * from './FurniturePostItStickyPoleOpenEvent'; export * from './FurnitureStackHeightEvent'; export * from './FurnitureState2Event'; export * from './FurnitureStateEvent'; diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index a2d5b968..10f6e193 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -31,6 +31,7 @@ export class OutgoingHeader public static FURNITURE_PICKUP = 3456; public static FURNITURE_PLACE = 1258; public static FURNITURE_POSTIT_PLACE = 2248; + public static FURNITURE_POSTIT_SAVE_STICKY_POLE = 3283; public static FURNITURE_RANDOMSTATE = 3617; public static FURNITURE_WALL_MULTISTATE = 210; public static FURNITURE_WALL_UPDATE = 168; diff --git a/src/nitro/communication/messages/outgoing/room/furniture/FurniturePostItSaveStickyPoleComposer.ts b/src/nitro/communication/messages/outgoing/room/furniture/FurniturePostItSaveStickyPoleComposer.ts new file mode 100644 index 00000000..162b446e --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/furniture/FurniturePostItSaveStickyPoleComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class FurniturePostItSaveStickyPoleComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(itemId: number, wallLocation: string, color: string, text: string) + { + this._data = [ itemId, wallLocation, color, text ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/furniture/index.ts b/src/nitro/communication/messages/outgoing/room/furniture/index.ts index c3ec36cf..975a4663 100644 --- a/src/nitro/communication/messages/outgoing/room/furniture/index.ts +++ b/src/nitro/communication/messages/outgoing/room/furniture/index.ts @@ -6,6 +6,7 @@ export * from './FurniturePickupComposer'; export * from './FurniturePlaceComposer'; export * from './FurniturePlacePaintComposer'; export * from './FurniturePostItPlaceComposer'; +export * from './FurniturePostItSaveStickyPoleComposer'; export * from './logic'; export * from './mannequin'; export * from './presents'; diff --git a/src/nitro/communication/messages/parser/room/furniture/FurniturePostItStickyPoleOpenParser.ts b/src/nitro/communication/messages/parser/room/furniture/FurniturePostItStickyPoleOpenParser.ts new file mode 100644 index 00000000..e44c05a4 --- /dev/null +++ b/src/nitro/communication/messages/parser/room/furniture/FurniturePostItStickyPoleOpenParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; + +export class FurniturePostItStickyPoleOpenParser implements IMessageParser +{ + private _itemId: number; + + public flush(): boolean + { + this._itemId = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._itemId = parseInt(wrapper.readString()); + + return true; + } + + public get furnitureId(): number + { + return this._itemId; + } +} From d377f7c6aba860e4dd9907e8b8dd8913109105f9 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sat, 18 Sep 2021 02:00:50 -0300 Subject: [PATCH 037/108] Fix --- src/nitro/communication/NitroMessages.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 770770aa..630465f9 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1156,13 +1156,10 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.FURNITURE_PLACE, FurniturePlaceComposer); this._composers.set(OutgoingHeader.ITEM_PAINT, FurniturePlacePaintComposer); this._composers.set(OutgoingHeader.FURNITURE_POSTIT_PLACE, FurniturePostItPlaceComposer); -<<<<<<< HEAD this._composers.set(OutgoingHeader.FURNITURE_POSTIT_SAVE_STICKY_POLE, FurniturePostItSaveStickyPoleComposer); -======= this._composers.set(OutgoingHeader.CONTROL_YOUTUBE_DISPLAY_PLAYBACK, ControlYoutubeDisplayPlaybackMessageComposer); this._composers.set(OutgoingHeader.GET_YOUTUBE_DISPLAY_STATUS, GetYoutubeDisplayStatusMessageComposer); this._composers.set(OutgoingHeader.SET_YOUTUBE_DISPLAY_PLAYLIST, SetYoutubeDisplayPlaylistMessageComposer); ->>>>>>> 5139c12b1b75ca6743c76d090cb60554f8422cef // FLOOR this._composers.set(OutgoingHeader.FURNITURE_FLOOR_UPDATE, FurnitureFloorUpdateComposer); From 85739666b4634aaed2f6d688a70cca199522f548 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 18 Sep 2021 04:27:20 -0400 Subject: [PATCH 038/108] Update various packets --- src/nitro/communication/NitroMessages.ts | 258 +++++++----------- .../messages/incoming/IncomingHeader.ts | 7 +- .../bots/BotAddedToInventoryEvent.ts | 6 +- .../bots/BotInventoryMessageEvent.ts | 6 +- .../incoming/bots/BotReceivedMessageEvent.ts | 16 ++ .../bots/BotRemovedFromInventoryEvent.ts | 6 +- .../incoming/{inventory => }/bots/index.ts | 2 +- .../incoming/catalog/ClubGiftSelectedEvent.ts | 8 +- .../communication/messages/incoming/index.ts | 3 +- .../inventory/bots/BotInventoryEvent.ts | 16 -- .../messages/incoming/inventory/index.ts | 1 - .../inventory/pets/PetReceivedMessageEvent.ts | 16 ++ .../messages/incoming/inventory/pets/index.ts | 1 + .../moderation/ModeratorCautionEvent.ts | 16 ++ .../moderation/UserBannedMessageEvent.ts | 16 ++ .../messages/incoming/moderation/index.ts | 2 + .../PetLevelNotificationEvent.ts | 16 ++ .../messages/incoming/notifications/index.ts | 1 + .../bots/BotAddedToInventoryParser.ts | 2 +- .../parser/{inventory => }/bots/BotData.ts | 2 +- .../bots/BotInventoryMessageParser.ts | 2 +- .../bots/BotReceivedMessageParser.ts | 4 +- .../bots/BotRemovedFromInventoryParser.ts | 2 +- .../parser/{inventory => }/bots/index.ts | 0 .../communication/messages/parser/index.ts | 2 + .../messages/parser/inventory/index.ts | 1 - .../PetBoughtNotificationMessageParser.ts | 31 --- .../pets/PetReceivedMessageParser.ts | 34 +++ .../messages/parser/inventory/pets/index.ts | 2 +- .../moderation/ModerationCautionParser.ts | 35 +++ .../moderation/UserBannedMessageParser.ts | 27 ++ .../messages/parser/moderation/index.ts | 2 + .../parser/modtool/ModtoolCFHTopicsParser.ts | 1 + .../PetLevelNotificationParser.ts | 52 ++++ .../messages/parser/notifications/index.ts | 1 + src/nitro/room/IGetImageListener.ts | 4 +- src/nitro/room/preview/RoomPreviewer.ts | 3 +- src/nitro/session/IRoomSession.ts | 2 +- src/nitro/session/RoomSession.ts | 9 +- 39 files changed, 377 insertions(+), 238 deletions(-) rename src/nitro/communication/messages/incoming/{inventory => }/bots/BotAddedToInventoryEvent.ts (51%) rename src/nitro/communication/messages/incoming/{inventory => }/bots/BotInventoryMessageEvent.ts (51%) create mode 100644 src/nitro/communication/messages/incoming/bots/BotReceivedMessageEvent.ts rename src/nitro/communication/messages/incoming/{inventory => }/bots/BotRemovedFromInventoryEvent.ts (52%) rename src/nitro/communication/messages/incoming/{inventory => }/bots/index.ts (75%) delete mode 100644 src/nitro/communication/messages/incoming/inventory/bots/BotInventoryEvent.ts create mode 100644 src/nitro/communication/messages/incoming/inventory/pets/PetReceivedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/moderation/ModeratorCautionEvent.ts create mode 100644 src/nitro/communication/messages/incoming/moderation/UserBannedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/notifications/PetLevelNotificationEvent.ts rename src/nitro/communication/messages/parser/{inventory => }/bots/BotAddedToInventoryParser.ts (97%) rename src/nitro/communication/messages/parser/{inventory => }/bots/BotData.ts (93%) rename src/nitro/communication/messages/parser/{inventory => }/bots/BotInventoryMessageParser.ts (97%) rename src/nitro/communication/messages/parser/{inventory => }/bots/BotReceivedMessageParser.ts (89%) rename src/nitro/communication/messages/parser/{inventory => }/bots/BotRemovedFromInventoryParser.ts (96%) rename src/nitro/communication/messages/parser/{inventory => }/bots/index.ts (100%) delete mode 100644 src/nitro/communication/messages/parser/inventory/pets/PetBoughtNotificationMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/inventory/pets/PetReceivedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/moderation/ModerationCautionParser.ts create mode 100644 src/nitro/communication/messages/parser/moderation/UserBannedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/moderation/index.ts create mode 100644 src/nitro/communication/messages/parser/notifications/PetLevelNotificationParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index db0f8af5..0ee0d2ad 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,6 +1,7 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetUserSongDisksMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetTargetedOfferStateComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; +import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; import { CameraPurchaseOKMessageEvent } from './messages/incoming/camera/CameraPurchaseOKMessageEvent'; @@ -34,6 +35,7 @@ import { InstantMessageErrorEvent } from './messages/incoming/friendlist/Instant import { MessageErrorEvent } from './messages/incoming/friendlist/MessageErrorEvent'; import { MessengerInitEvent } from './messages/incoming/friendlist/MessengerInitEvent'; import { MiniMailNewMessageEvent } from './messages/incoming/friendlist/MiniMailNewMessageEvent'; +import { MiniMailUnreadCountEvent } from './messages/incoming/friendlist/MiniMailUnreadCountEvent'; import { NewConsoleMessageEvent } from './messages/incoming/friendlist/NewConsoleMessageEvent'; import { NewFriendRequestEvent } from './messages/incoming/friendlist/NewFriendRequestEvent'; import { RoomInviteErrorEvent } from './messages/incoming/friendlist/RoomInviteErrorEvent'; @@ -57,9 +59,6 @@ import { AvatarEffectAddedEvent } from './messages/incoming/inventory/avatareffe import { AvatarEffectExpiredEvent } from './messages/incoming/inventory/avatareffect/AvatarEffectExpiredEvent'; import { AvatarEffectsEvent } from './messages/incoming/inventory/avatareffect/AvatarEffectsEvent'; import { BadgesEvent } from './messages/incoming/inventory/badges/BadgesEvent'; -import { BotAddedToInventoryEvent } from './messages/incoming/inventory/bots/BotAddedToInventoryEvent'; -import { BotInventoryMessageEvent } from './messages/incoming/inventory/bots/BotInventoryMessageEvent'; -import { BotRemovedFromInventoryEvent } from './messages/incoming/inventory/bots/BotRemovedFromInventoryEvent'; import { FigureSetIdsMessageEvent } from './messages/incoming/inventory/clothes/FigureSetIdsMessageEvent'; import { FurnitureListAddOrUpdateEvent } from './messages/incoming/inventory/furni/FurnitureListAddOrUpdateEvent'; import { FurnitureListEvent } from './messages/incoming/inventory/furni/FurnitureListEvent'; @@ -69,6 +68,7 @@ import { FurniturePostItPlacedEvent } from './messages/incoming/inventory/furni/ import { PresentOpenedMessageEvent } from './messages/incoming/inventory/furni/gifts/PresentOpenedMessageEvent'; import { PetAddedToInventoryEvent } from './messages/incoming/inventory/pets/PetAddedToInventoryEvent'; import { PetInventoryEvent } from './messages/incoming/inventory/pets/PetInventoryEvent'; +import { PetReceivedMessageEvent } from './messages/incoming/inventory/pets/PetReceivedMessageEvent'; import { PetRemovedFromInventory } from './messages/incoming/inventory/pets/PetRemovedFromInventoryEvent'; import { TradingAcceptEvent } from './messages/incoming/inventory/trading/TradingAcceptEvent'; import { TradingCloseEvent } from './messages/incoming/inventory/trading/TradingCloseEvent'; @@ -90,6 +90,8 @@ import { MarketplaceItemStatsEvent } from './messages/incoming/marketplace/Marke import { MarketplaceMakeOfferResult } from './messages/incoming/marketplace/MarketplaceMakeOfferResult'; import { MarketPlaceOffersEvent } from './messages/incoming/marketplace/MarketplaceOffersEvent'; import { MarketplaceOwnOffersEvent } from './messages/incoming/marketplace/MarketplaceOwnOffersEvent'; +import { UserBannedMessageEvent } from './messages/incoming/moderation'; +import { ModeratorCautionEvent } from './messages/incoming/moderation/ModeratorCautionEvent'; import { ModtoolCallForHelpTopicsEvent } from './messages/incoming/modtool/ModtoolCallForHelpTopicsEvent'; import { ModtoolMainEvent } from './messages/incoming/modtool/ModtoolMainEvent'; import { ModtoolReceivedRoomsUserEvent } from './messages/incoming/modtool/ModtoolReceivedRoomsUserEvent'; @@ -109,10 +111,10 @@ import { NavigatorSearchEvent } from './messages/incoming/navigator/NavigatorSea import { NavigatorSettingsEvent } from './messages/incoming/navigator/NavigatorSettingsEvent'; import { BotErrorEvent } from './messages/incoming/notifications/BotErrorEvent'; import { HabboBroadcastMessageEvent } from './messages/incoming/notifications/HabboBroadcastMessageEvent'; -import { HotelWillShutdownEvent } from './messages/incoming/notifications/HotelWillShutdownEvent'; import { ModeratorMessageEvent } from './messages/incoming/notifications/ModeratorMessageEvent'; import { MOTDNotificationEvent } from './messages/incoming/notifications/MOTDNotificationEvent'; import { NotificationDialogMessageEvent } from './messages/incoming/notifications/NotificationDialogMessageEvent'; +import { PetLevelNotificationEvent } from './messages/incoming/notifications/PetLevelNotificationEvent'; import { PetPlacingErrorEvent } from './messages/incoming/notifications/PetPlacingErrorEvent'; import { UnseenItemsEvent } from './messages/incoming/notifications/UnseenItemsEvent'; import { CommunityGoalEarnedPrizesMessageEvent } from './messages/incoming/quest/CommunityGoalEarnedPrizesMessageEvent'; @@ -454,7 +456,6 @@ import { UserSettingsOldChatComposer } from './messages/outgoing/user/settings/U import { UserSettingsRoomInvitesComposer } from './messages/outgoing/user/settings/UserSettingsRoomInvitesComposer'; import { UserSettingsSoundComposer } from './messages/outgoing/user/settings/UserSettingsSoundComposer'; import { UserRespectComposer } from './messages/outgoing/user/UserRespectComposer'; -import { MiniMailUnreadCountParser } from './messages/parser/friendlist/MiniMailUnreadCountParser'; export class NitroMessages implements IMessageConfiguration { @@ -484,15 +485,18 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.HOTEL_WILL_CLOSE_MINUTES, HotelWillCloseInMinutesEvent); this._events.set(IncomingHeader.HOTEL_MAINTENANCE, MaintenanceStatusMessageEvent); - - this._events.set(IncomingHeader.GENERIC_ERROR, GenericErrorEvent); - // AVATAR this._events.set(IncomingHeader.USER_CHANGE_NAME, ChangeUserNameResultMessageEvent); this._events.set(IncomingHeader.CHECK_USER_NAME, CheckUserNameResultMessageEvent); this._events.set(IncomingHeader.USER_FIGURE, FigureUpdateEvent); this._events.set(IncomingHeader.USER_OUTFITS, WardrobeMessageEvent); + // BOTS + this._events.set(IncomingHeader.ADD_BOT_TO_INVENTORY, BotAddedToInventoryEvent); + this._events.set(IncomingHeader.USER_BOTS, BotInventoryMessageEvent); + this._events.set(IncomingHeader.BOT_RECEIVED, BotReceivedMessageEvent); + this._events.set(IncomingHeader.REMOVE_BOT_FROM_INVENTORY, BotRemovedFromInventoryEvent); + // CALL FOR HELP this._events.set(IncomingHeader.CFH_SANCTION, CfhSanctionMessageEvent); this._events.set(IncomingHeader.CFH_TOPICS, CfhTopicsInitEvent); @@ -543,9 +547,8 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.REDEEM_VOUCHER_ERROR, VoucherRedeemErrorMessageEvent); this._events.set(IncomingHeader.REDEEM_VOUCHER_OK, VoucherRedeemOkMessageEvent); - - this._events.set(IncomingHeader.GROUP_LIST, GuildMembershipsMessageEvent); - this._events.set(IncomingHeader.CATALOG_APPROVE_NAME_RESULT, ApproveNameMessageEvent); + // CLIENT + this._events.set(IncomingHeader.CLIENT_PING, ClientPingEvent); // COMPETITION this._events.set(IncomingHeader.COMPETITION_ENTRY_SUBMIT, CompetitionEntrySubmitResultEvent); @@ -555,8 +558,11 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.COMPETITION_NO_OWNED_ROOMS, NoOwnedRoomsAlertMessageEvent); this._events.set(IncomingHeader.COMPETITION_SECONDS_UNTIL, SecondsUntilMessageEvent); - // CLIENT - this._events.set(IncomingHeader.CLIENT_PING, ClientPingEvent); + // CRAFTING + this._events.set(IncomingHeader.CRAFTABLE_PRODUCTS, CraftableProductsEvent); + this._events.set(IncomingHeader.CRAFTING_RECIPE, CraftingRecipeEvent); + this._events.set(IncomingHeader.CRAFTING_RECIPES_AVAILABLE, CraftingRecipesAvailableEvent); + this._events.set(IncomingHeader.CRAFTING_RESULT, CraftingResultEvent); // DESKTOP this._events.set(IncomingHeader.DESKTOP_VIEW, DesktopViewEvent); @@ -574,12 +580,15 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.MESSENGER_MESSAGE_ERROR, MessageErrorEvent); this._events.set(IncomingHeader.MESSENGER_INIT, MessengerInitEvent); this._events.set(IncomingHeader.MESSENGER_MINIMAIL_NEW, MiniMailNewMessageEvent); - this._events.set(IncomingHeader.MESSENGER_MINIMAIL_COUNT, MiniMailUnreadCountParser); + this._events.set(IncomingHeader.MESSENGER_MINIMAIL_COUNT, MiniMailUnreadCountEvent); this._events.set(IncomingHeader.MESSENGER_CHAT, NewConsoleMessageEvent); this._events.set(IncomingHeader.MESSENGER_REQUEST, NewFriendRequestEvent); this._events.set(IncomingHeader.MESSENGER_INVITE_ERROR, RoomInviteErrorEvent); this._events.set(IncomingHeader.MESSENGER_INVITE, RoomInviteEvent); + // GAMES + this._events.set(IncomingHeader.LOAD_GAME_URL, LoadGameUrlEvent); + // GROUP this._events.set(IncomingHeader.GROUP_INFO, GroupInformationEvent); this._events.set(IncomingHeader.GROUP_MEMBER_REMOVE_CONFIRM, GroupConfirmMemberRemoveEvent); @@ -592,31 +601,31 @@ export class NitroMessages implements IMessageConfiguration // HELP this._events.set(IncomingHeader.CFH_RESULT_MESSAGE, CallForHelpResultMessageEvent); + this._events.set(IncomingHeader.HELPER_TALENT_TRACK, TalentTrackEvent); // INVENTORY - - // ACHIEVEMENTS this._events.set(IncomingHeader.ACHIEVEMENT_PROGRESSED, AchievementEvent); this._events.set(IncomingHeader.ACHIEVEMENT_LIST, AchievementsEvent); this._events.set(IncomingHeader.USER_ACHIEVEMENT_SCORE,AchievementsScoreEvent); - - // EFFECTS this._events.set(IncomingHeader.USER_EFFECT_ACTIVATE, AvatarEffectActivatedEvent); this._events.set(IncomingHeader.USER_EFFECT_LIST_ADD, AvatarEffectAddedEvent); this._events.set(IncomingHeader.USER_EFFECT_LIST_REMOVE, AvatarEffectExpiredEvent); this._events.set(IncomingHeader.USER_EFFECT_LIST, AvatarEffectsEvent); - - // CLOTHES + this._events.set(IncomingHeader.USER_BADGES, BadgesEvent); + this._events.set(IncomingHeader.USER_BADGES_ADD, BadgeReceivedEvent); + this._events.set(IncomingHeader.BADGE_POINT_LIMITS, BadgePointLimitsEvent); + this._events.set(IncomingHeader.BADGE_REQUEST_FULFILLED, IsBadgeRequestFulfilledEvent); this._events.set(IncomingHeader.USER_CLOTHING, FigureSetIdsMessageEvent); - - // FURNITURE this._events.set(IncomingHeader.USER_FURNITURE_ADD, FurnitureListAddOrUpdateEvent); this._events.set(IncomingHeader.USER_FURNITURE, FurnitureListEvent); this._events.set(IncomingHeader.USER_FURNITURE_REFRESH, FurnitureListInvalidateEvent); this._events.set(IncomingHeader.USER_FURNITURE_REMOVE, FurnitureListRemovedEvent); this._events.set(IncomingHeader.USER_FURNITURE_POSTIT_PLACED, FurniturePostItPlacedEvent); - - // TRADING + this._events.set(IncomingHeader.USER_PETS, PetInventoryEvent); + this._events.set(IncomingHeader.USER_PET_REMOVE, PetRemovedFromInventory); + this._events.set(IncomingHeader.USER_PET_ADD, PetAddedToInventoryEvent); + this._events.set(IncomingHeader.PET_RECEIVED, PetReceivedMessageEvent); + this._events.set(IncomingHeader.PET_PLACING_ERROR, PetPlacingErrorEvent); this._events.set(IncomingHeader.TRADE_ACCEPTED, TradingAcceptEvent); this._events.set(IncomingHeader.TRADE_CLOSED, TradingCloseEvent); this._events.set(IncomingHeader.TRADE_COMPLETED, TradingCompletedEvent); @@ -628,10 +637,32 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.TRADE_OTHER_NOT_ALLOWED, TradingOtherNotAllowedEvent); this._events.set(IncomingHeader.TRADE_YOU_NOT_ALLOWED, TradingYouAreNotAllowedEvent); + // LANDING VIEW + this._events.set(IncomingHeader.COMMUNITY_GOAL_VOTE_EVENT, CommunityGoalVoteMessageEvent); + this._events.set(IncomingHeader.PROMO_ARTICLES, PromoArticlesMessageEvent); + + // MARKETPLACE + this._events.set(IncomingHeader.MARKETPLACE_AFTER_ORDER_STATUS, MarketplaceBuyOfferResultEvent); + this._events.set(IncomingHeader.MARKETPLACE_CANCEL_SALE, MarketplaceCancelOfferResultEvent); + this._events.set(IncomingHeader.MARKETPLACE_SELL_ITEM, MarketplaceCanMakeOfferResult); + this._events.set(IncomingHeader.MARKETPLACE_CONFIG, MarketplaceConfigurationEvent); + this._events.set(IncomingHeader.MARKETPLACE_ITEM_STATS, MarketplaceItemStatsEvent); + this._events.set(IncomingHeader.MARKETPLACE_ITEM_POSTED, MarketplaceMakeOfferResult); + this._events.set(IncomingHeader.MARKETPLACE_ITEMS_SEARCHED, MarketPlaceOffersEvent); + this._events.set(IncomingHeader.MARKETPLACE_OWN_ITEMS, MarketplaceOwnOffersEvent); + + // MODERATION + this._events.set(IncomingHeader.MARKETPLACE_OWN_ITEMS, UserBannedMessageEvent); + this._events.set(IncomingHeader.MODERATION_CAUTION, ModeratorCautionEvent); + // MODTOOL this._events.set(IncomingHeader.MODTOOL_ROOM_INFO, ModtoolRoomInfoEvent); this._events.set(IncomingHeader.MODTOOL_USER_CHATLOG, ModtoolUserChatlogEvent); this._events.set(IncomingHeader.MODTOOL_ROOM_CHATLOG, ModtoolRoomChatlogEvent); + this._events.set(IncomingHeader.MODERATION_USER_INFO, ModtoolUserInfoEvent); + this._events.set(IncomingHeader.MODERATION_TOPICS, ModtoolCallForHelpTopicsEvent); + this._events.set(IncomingHeader.MODERATION_TOOL, ModtoolMainEvent); + this._events.set(IncomingHeader.MODTOOL_VISITED_ROOMS_USER, ModtoolReceivedRoomsUserEvent); // MYSTERY BOX this._events.set(IncomingHeader.MYSTERY_BOX_KEYS, MysteryBoxKeysEvent); @@ -653,31 +684,38 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.MOTD_MESSAGES, MOTDNotificationEvent); this._events.set(IncomingHeader.NOTIFICATION_LIST, NotificationDialogMessageEvent); this._events.set(IncomingHeader.UNSEEN_ITEMS, UnseenItemsEvent); - this._events.set(IncomingHeader.HOTEL_WILL_SHUTDOWN, HotelWillShutdownEvent); this._events.set(IncomingHeader.ACHIEVEMENT_NOTIFICATION, AchievementNotificationMessageEvent); this._events.set(IncomingHeader.INFO_FEED_ENABLE, InfoFeedEnableMessageEvent); this._events.set(IncomingHeader.CLUB_GIFT_NOTIFICATION, ClubGiftNotificationEvent); this._events.set(IncomingHeader.MODERATOR_MESSAGE, ModeratorMessageEvent); this._events.set(IncomingHeader.ACTIVITY_POINT_NOTIFICATION, ActivityPointNotificationMessageEvent); + this._events.set(IncomingHeader.BOT_ERROR, BotErrorEvent); + this._events.set(IncomingHeader.PET_LEVEL_NOTIFICATION, PetLevelNotificationEvent); + + // QUEST + this._events.set(IncomingHeader.COMMUNITY_GOAL_EARNED_PRIZES, CommunityGoalEarnedPrizesMessageEvent); + this._events.set(IncomingHeader.COMMUNITY_GOAL_PROGRESS, CommunityGoalProgressMessageEvent); + this._events.set(IncomingHeader.CONCURRENT_USERS_GOAL_PROGRESS, ConcurrentUsersGoalProgressMessageEvent); + this._events.set(IncomingHeader.QUEST_DAILY, QuestDailyMessageEvent); + this._events.set(IncomingHeader.QUEST_CANCELLED, QuestCancelledMessageEvent); + this._events.set(IncomingHeader.QUEST_COMPLETED, QuestCompletedMessageEvent); + this._events.set(IncomingHeader.COMMUNITY_GOAL_HALL_OF_FAME, CommunityGoalHallOfFameMessageEvent); + this._events.set(IncomingHeader.EPIC_POPUP, EpicPopupMessageEvent); + this._events.set(IncomingHeader.SEASONAL_QUESTS, SeasonalQuestsMessageEvent); + this._events.set(IncomingHeader.QUESTS, QuestsMessageEvent); + this._events.set(IncomingHeader.QUEST, QuestMessageEvent); // ROOM - - // ACCESS this._events.set(IncomingHeader.ROOM_ENTER_ERROR, RoomEnterErrorEvent); this._events.set(IncomingHeader.ROOM_ENTER, RoomEnterEvent); this._events.set(IncomingHeader.ROOM_FORWARD, RoomForwardEvent); - - // DOORBELL this._events.set(IncomingHeader.ROOM_DOORBELL, RoomDoorbellEvent); this._events.set(IncomingHeader.ROOM_DOORBELL_ACCEPTED, RoomDoorbellAcceptedEvent); this._events.set(IncomingHeader.ROOM_DOORBELL_REJECTED, RoomDoorbellRejectedEvent); - - // RIGHTS this._events.set(IncomingHeader.ROOM_RIGHTS_CLEAR, RoomRightsClearEvent); this._events.set(IncomingHeader.ROOM_RIGHTS_OWNER, RoomRightsOwnerEvent); this._events.set(IncomingHeader.ROOM_RIGHTS, RoomRightsEvent); - - // DATA + this._events.set(IncomingHeader.BOT_COMMAND_CONFIGURATION, BotCommandConfigurationEvent); this._events.set(IncomingHeader.ROOM_SETTINGS_CHAT, RoomChatSettingsEvent); this._events.set(IncomingHeader.ROOM_INFO, RoomInfoEvent); this._events.set(IncomingHeader.ROOM_INFO_OWNER, RoomInfoOwnerEvent); @@ -688,16 +726,16 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.ROOM_SETTINGS_UPDATED, RoomSettingsUpdatedEvent); this._events.set(IncomingHeader.ROOM_RIGHTS_LIST, RoomUsersWithRightsEvent); this._events.set(IncomingHeader.ROOM_BAN_LIST, RoomBannedUsersEvent); - - // ENGINE this._events.set(IncomingHeader.ROOM_ROLLING, ObjectsRollingEvent); this._events.set(IncomingHeader.ROOM_CREATED, RoomCreatedEvent); - - // BOTS - this._events.set(IncomingHeader.BOT_COMMAND_CONFIGURATION, BotCommandConfigurationEvent); - this._events.set(IncomingHeader.BOT_ERROR, BotErrorEvent); - - // FURNITURE + this._events.set(IncomingHeader.FURNITURE_FLOOR_ADD, FurnitureFloorAddEvent); + this._events.set(IncomingHeader.FURNITURE_FLOOR, FurnitureFloorEvent); + this._events.set(IncomingHeader.FURNITURE_FLOOR_REMOVE, FurnitureFloorRemoveEvent); + this._events.set(IncomingHeader.FURNITURE_FLOOR_UPDATE, FurnitureFloorUpdateEvent); + this._events.set(IncomingHeader.ITEM_WALL_ADD, FurnitureWallAddEvent); + this._events.set(IncomingHeader.ITEM_WALL, FurnitureWallEvent); + this._events.set(IncomingHeader.ITEM_WALL_REMOVE, FurnitureWallRemoveEvent); + this._events.set(IncomingHeader.ITEM_WALL_UPDATE, FurnitureWallUpdateEvent); this._events.set(IncomingHeader.FURNITURE_ALIASES, FurnitureAliasesEvent); this._events.set(IncomingHeader.FURNITURE_DATA, FurnitureDataEvent); this._events.set(IncomingHeader.FURNITURE_ITEMDATA, FurnitureItemDataEvent); @@ -710,20 +748,6 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.LOVELOCK_FURNI_START, LoveLockFurniStartEvent); this._events.set(IncomingHeader.OBJECTS_DATA_UPDATE, ObjectsDataUpdateEvent); this._events.set(IncomingHeader.FURNITURE_GROUP_CONTEXT_MENU_INFO, GroupFurniContextMenuInfoMessageEvent); - - // FLOOR - this._events.set(IncomingHeader.FURNITURE_FLOOR_ADD, FurnitureFloorAddEvent); - this._events.set(IncomingHeader.FURNITURE_FLOOR, FurnitureFloorEvent); - this._events.set(IncomingHeader.FURNITURE_FLOOR_REMOVE, FurnitureFloorRemoveEvent); - this._events.set(IncomingHeader.FURNITURE_FLOOR_UPDATE, FurnitureFloorUpdateEvent); - - // WALL - this._events.set(IncomingHeader.ITEM_WALL_ADD, FurnitureWallAddEvent); - this._events.set(IncomingHeader.ITEM_WALL, FurnitureWallEvent); - this._events.set(IncomingHeader.ITEM_WALL_REMOVE, FurnitureWallRemoveEvent); - this._events.set(IncomingHeader.ITEM_WALL_UPDATE, FurnitureWallUpdateEvent); - - // MAPPING this._events.set(IncomingHeader.ROOM_MODEL_DOOR, RoomDoorEvent); this._events.set(IncomingHeader.ROOM_HEIGHT_MAP, RoomHeightMapEvent); this._events.set(IncomingHeader.ROOM_HEIGHT_MAP_UPDATE, RoomHeightMapUpdateEvent); @@ -732,16 +756,10 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.ROOM_PAINT, RoomPaintEvent); this._events.set(IncomingHeader.ROOM_THICKNESS, RoomThicknessEvent); this._events.set(IncomingHeader.ROOM_MODEL_BLOCKED_TILES, RoomBlockedTilesEvent); - - // PET this._events.set(IncomingHeader.PET_FIGURE_UPDATE, PetFigureUpdateEvent); this._events.set(IncomingHeader.PET_INFO, PetInfoEvent); this._events.set(IncomingHeader.PET_EXPERIENCE, PetExperienceEvent); - - // SESSION this._events.set(IncomingHeader.PLAYING_GAME, YouArePlayingGameEvent); - - // UNIT this._events.set(IncomingHeader.UNIT_DANCE, RoomUnitDanceEvent); this._events.set(IncomingHeader.UNIT_EFFECT, RoomUnitEffectEvent); this._events.set(IncomingHeader.UNIT, RoomUnitEvent); @@ -753,8 +771,6 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.UNIT_REMOVE, RoomUnitRemoveEvent); this._events.set(IncomingHeader.UNIT_STATUS, RoomUnitStatusEvent); this._events.set(IncomingHeader.HAND_ITEM_RECEIVED, RoomUnitHandItemReceivedEvent); - - // CHAT this._events.set(IncomingHeader.FLOOD_CONTROL, FloodControlEvent); this._events.set(IncomingHeader.REMAINING_MUTE, RemainingMuteEvent); this._events.set(IncomingHeader.UNIT_CHAT, RoomUnitChatEvent); @@ -775,98 +791,6 @@ export class NitroMessages implements IMessageConfiguration // SECURITY this._events.set(IncomingHeader.AUTHENTICATED, AuthenticatedEvent); - // USER - this._events.set(IncomingHeader.IN_CLIENT_LINK, InClientLinkEvent); - this._events.set(IncomingHeader.USER_IGNORED, IgnoredUsersEvent); - this._events.set(IncomingHeader.USER_IGNORED_RESULT, IgnoreResultEvent); - this._events.set(IncomingHeader.USER_RESPECT, RespectReceivedEvent); - - // BADGES - this._events.set(IncomingHeader.USER_BADGES, BadgesEvent); - this._events.set(IncomingHeader.USER_BADGES_ADD, BadgeReceivedEvent); - this._events.set(IncomingHeader.BADGE_POINT_LIMITS, BadgePointLimitsEvent); - this._events.set(IncomingHeader.BADGE_REQUEST_FULFILLED, IsBadgeRequestFulfilledEvent); - - // ACCESS - this._events.set(IncomingHeader.USER_PERKS, UserPerksEvent); - this._events.set(IncomingHeader.USER_PERMISSIONS, UserPermissionsEvent); - - // DATA - this._events.set(IncomingHeader.USER_BADGES_CURRENT, UserCurrentBadgesEvent); - this._events.set(IncomingHeader.USER_INFO, UserInfoEvent); - this._events.set(IncomingHeader.UNIT_CHANGE_NAME, UserNameChangeMessageEvent); - this._events.set(IncomingHeader.USER_SETTINGS, UserSettingsEvent); - this._events.set(IncomingHeader.USER_PROFILE, UserProfileEvent); - this._events.set(IncomingHeader.MESSENGER_RELATIONSHIPS, RelationshipStatusInfoEvent); - - // GIFTS - this._events.set(IncomingHeader.GIFT_OPENED, PresentOpenedMessageEvent); - - // INVENTORY - - // BOTS - this._events.set(IncomingHeader.USER_BOTS, BotInventoryMessageEvent); - this._events.set(IncomingHeader.REMOVE_BOT_FROM_INVENTORY, BotRemovedFromInventoryEvent); - this._events.set(IncomingHeader.ADD_BOT_TO_INVENTORY, BotAddedToInventoryEvent); - - // CURRENCY - this._events.set(IncomingHeader.USER_CREDITS, UserCreditsEvent); - this._events.set(IncomingHeader.USER_CURRENCY, UserCurrencyEvent); - - // SUBSCRIPTION - this._events.set(IncomingHeader.USER_SUBSCRIPTION, UserSubscriptionEvent); - - // GAMES - this._events.set(IncomingHeader.LOAD_GAME_URL, LoadGameUrlEvent); - - // WARDROBE - this._events.set(IncomingHeader.USER_WARDROBE_PAGE, UserWardrobePageEvent); - - // PETS - this._events.set(IncomingHeader.USER_PETS, PetInventoryEvent); - this._events.set(IncomingHeader.USER_PET_REMOVE, PetRemovedFromInventory); - this._events.set(IncomingHeader.USER_PET_ADD, PetAddedToInventoryEvent); - this._events.set(IncomingHeader.PET_PLACING_ERROR, PetPlacingErrorEvent); - - // MOD TOOL - this._events.set(IncomingHeader.MODERATION_USER_INFO, ModtoolUserInfoEvent); - this._events.set(IncomingHeader.MODERATION_TOPICS, ModtoolCallForHelpTopicsEvent); - this._events.set(IncomingHeader.MODERATION_TOOL, ModtoolMainEvent); - this._events.set(IncomingHeader.MODTOOL_VISITED_ROOMS_USER, ModtoolReceivedRoomsUserEvent); - - // MARKETPLACE - this._events.set(IncomingHeader.MARKETPLACE_AFTER_ORDER_STATUS, MarketplaceBuyOfferResultEvent); - this._events.set(IncomingHeader.MARKETPLACE_CANCEL_SALE, MarketplaceCancelOfferResultEvent); - this._events.set(IncomingHeader.MARKETPLACE_SELL_ITEM, MarketplaceCanMakeOfferResult); - this._events.set(IncomingHeader.MARKETPLACE_CONFIG, MarketplaceConfigurationEvent); - this._events.set(IncomingHeader.MARKETPLACE_ITEM_STATS, MarketplaceItemStatsEvent); - this._events.set(IncomingHeader.MARKETPLACE_ITEM_POSTED, MarketplaceMakeOfferResult); - this._events.set(IncomingHeader.MARKETPLACE_ITEMS_SEARCHED, MarketPlaceOffersEvent); - this._events.set(IncomingHeader.MARKETPLACE_OWN_ITEMS, MarketplaceOwnOffersEvent); - - // LANDING VIEW - this._events.set(IncomingHeader.COMMUNITY_GOAL_VOTE_EVENT, CommunityGoalVoteMessageEvent); - this._events.set(IncomingHeader.PROMO_ARTICLES, PromoArticlesMessageEvent); - - // QUESTS - this._events.set(IncomingHeader.COMMUNITY_GOAL_EARNED_PRIZES, CommunityGoalEarnedPrizesMessageEvent); - this._events.set(IncomingHeader.COMMUNITY_GOAL_PROGRESS, CommunityGoalProgressMessageEvent); - this._events.set(IncomingHeader.CONCURRENT_USERS_GOAL_PROGRESS, ConcurrentUsersGoalProgressMessageEvent); - this._events.set(IncomingHeader.QUEST_DAILY, QuestDailyMessageEvent); - this._events.set(IncomingHeader.QUEST_CANCELLED, QuestCancelledMessageEvent); - this._events.set(IncomingHeader.QUEST_COMPLETED, QuestCompletedMessageEvent); - this._events.set(IncomingHeader.COMMUNITY_GOAL_HALL_OF_FAME, CommunityGoalHallOfFameMessageEvent); - this._events.set(IncomingHeader.EPIC_POPUP, EpicPopupMessageEvent); - this._events.set(IncomingHeader.SEASONAL_QUESTS, SeasonalQuestsMessageEvent); - this._events.set(IncomingHeader.QUESTS, QuestsMessageEvent); - this._events.set(IncomingHeader.QUEST, QuestMessageEvent); - - // CRAFTING - this._events.set(IncomingHeader.CRAFTABLE_PRODUCTS, CraftableProductsEvent); - this._events.set(IncomingHeader.CRAFTING_RECIPE, CraftingRecipeEvent); - this._events.set(IncomingHeader.CRAFTING_RECIPES_AVAILABLE, CraftingRecipesAvailableEvent); - this._events.set(IncomingHeader.CRAFTING_RESULT, CraftingResultEvent); - // SOUNDS this._events.set(IncomingHeader.JUKEBOX_PLAYLIST_FULL, JukeboxPlayListFullMessageEvent); this._events.set(IncomingHeader.JUKEBOX_SONG_DISKS, JukeboxSongDisksMessageEvent); @@ -877,8 +801,28 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.TRAX_SONG_INFO, TraxSongInfoMessageEvent); this._events.set(IncomingHeader.USER_SONG_DISKS_INVENTORY, UserSongDisksInventoryMessageEvent); - // HELPER - this._events.set(IncomingHeader.HELPER_TALENT_TRACK, TalentTrackEvent); + // USER + this._events.set(IncomingHeader.IN_CLIENT_LINK, InClientLinkEvent); + this._events.set(IncomingHeader.USER_IGNORED, IgnoredUsersEvent); + this._events.set(IncomingHeader.USER_IGNORED_RESULT, IgnoreResultEvent); + this._events.set(IncomingHeader.USER_RESPECT, RespectReceivedEvent); + this._events.set(IncomingHeader.USER_PERKS, UserPerksEvent); + this._events.set(IncomingHeader.USER_PERMISSIONS, UserPermissionsEvent); + this._events.set(IncomingHeader.USER_BADGES_CURRENT, UserCurrentBadgesEvent); + this._events.set(IncomingHeader.USER_INFO, UserInfoEvent); + this._events.set(IncomingHeader.UNIT_CHANGE_NAME, UserNameChangeMessageEvent); + this._events.set(IncomingHeader.USER_SETTINGS, UserSettingsEvent); + this._events.set(IncomingHeader.USER_PROFILE, UserProfileEvent); + this._events.set(IncomingHeader.MESSENGER_RELATIONSHIPS, RelationshipStatusInfoEvent); + this._events.set(IncomingHeader.GIFT_OPENED, PresentOpenedMessageEvent); + this._events.set(IncomingHeader.USER_CREDITS, UserCreditsEvent); + this._events.set(IncomingHeader.USER_CURRENCY, UserCurrencyEvent); + this._events.set(IncomingHeader.USER_SUBSCRIPTION, UserSubscriptionEvent); + this._events.set(IncomingHeader.USER_WARDROBE_PAGE, UserWardrobePageEvent); + + this._events.set(IncomingHeader.GENERIC_ERROR, GenericErrorEvent); + this._events.set(IncomingHeader.GROUP_LIST, GuildMembershipsMessageEvent); + this._events.set(IncomingHeader.CATALOG_APPROVE_NAME_RESULT, ApproveNameMessageEvent); } private registerComposers(): void diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 736bec3a..4fa3e630 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -168,7 +168,6 @@ export class IncomingHeader public static USER_BADGES = 717; public static USER_BADGES_ADD = 2493; public static USER_BADGES_CURRENT = 1087; - public static USER_BOT_ADD = 1352; public static USER_BOT_REMOVE = 233; public static USER_BOTS = 3086; public static USER_CHANGE_NAME = 118; @@ -221,7 +220,6 @@ export class IncomingHeader public static LOVELOCK_FURNI_FINISHED = 770; public static GIFT_RECEIVER_NOT_FOUND = 1517; public static GIFT_OPENED = 56; - public static HOTEL_WILL_SHUTDOWN = 1050; public static FLOOD_CONTROL = 566; public static REMAINING_MUTE = 826; public static USER_EFFECT_LIST = 340; @@ -318,4 +316,9 @@ export class IncomingHeader public static BADGE_POINT_LIMITS = 2501; public static BADGE_REQUEST_FULFILLED = 2998; public static HELPER_TALENT_TRACK = 3406; + public static USER_BANNED = 1683; + public static BOT_RECEIVED = 3684; + public static PET_LEVEL_NOTIFICATION = 859; + public static PET_RECEIVED = 1111; + public static MODERATION_CAUTION = 1890; } diff --git a/src/nitro/communication/messages/incoming/inventory/bots/BotAddedToInventoryEvent.ts b/src/nitro/communication/messages/incoming/bots/BotAddedToInventoryEvent.ts similarity index 51% rename from src/nitro/communication/messages/incoming/inventory/bots/BotAddedToInventoryEvent.ts rename to src/nitro/communication/messages/incoming/bots/BotAddedToInventoryEvent.ts index 926163a0..710d708e 100644 --- a/src/nitro/communication/messages/incoming/inventory/bots/BotAddedToInventoryEvent.ts +++ b/src/nitro/communication/messages/incoming/bots/BotAddedToInventoryEvent.ts @@ -1,6 +1,6 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { BotAddedToInventoryParser } from '../../../parser/inventory/bots/BotAddedToInventoryParser'; +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { BotAddedToInventoryParser } from '../../parser/bots/BotAddedToInventoryParser'; export class BotAddedToInventoryEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/inventory/bots/BotInventoryMessageEvent.ts b/src/nitro/communication/messages/incoming/bots/BotInventoryMessageEvent.ts similarity index 51% rename from src/nitro/communication/messages/incoming/inventory/bots/BotInventoryMessageEvent.ts rename to src/nitro/communication/messages/incoming/bots/BotInventoryMessageEvent.ts index 15538d67..a1473591 100644 --- a/src/nitro/communication/messages/incoming/inventory/bots/BotInventoryMessageEvent.ts +++ b/src/nitro/communication/messages/incoming/bots/BotInventoryMessageEvent.ts @@ -1,6 +1,6 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { BotInventoryMessageParser } from '../../../parser/inventory/bots/BotInventoryMessageParser'; +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { BotInventoryMessageParser } from '../../parser/bots/BotInventoryMessageParser'; export class BotInventoryMessageEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/bots/BotReceivedMessageEvent.ts b/src/nitro/communication/messages/incoming/bots/BotReceivedMessageEvent.ts new file mode 100644 index 00000000..2a1d77a6 --- /dev/null +++ b/src/nitro/communication/messages/incoming/bots/BotReceivedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { BotReceivedMessageParser } from '../../parser/bots/BotReceivedMessageParser'; + +export class BotReceivedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, BotReceivedMessageParser); + } + + public getParser(): BotReceivedMessageParser + { + return this.parser as BotReceivedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/inventory/bots/BotRemovedFromInventoryEvent.ts b/src/nitro/communication/messages/incoming/bots/BotRemovedFromInventoryEvent.ts similarity index 52% rename from src/nitro/communication/messages/incoming/inventory/bots/BotRemovedFromInventoryEvent.ts rename to src/nitro/communication/messages/incoming/bots/BotRemovedFromInventoryEvent.ts index b0742936..ffe8fdc7 100644 --- a/src/nitro/communication/messages/incoming/inventory/bots/BotRemovedFromInventoryEvent.ts +++ b/src/nitro/communication/messages/incoming/bots/BotRemovedFromInventoryEvent.ts @@ -1,6 +1,6 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { BotRemovedFromInventoryParser } from '../../../parser/inventory/bots/BotRemovedFromInventoryParser'; +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { BotRemovedFromInventoryParser } from '../../parser/bots/BotRemovedFromInventoryParser'; export class BotRemovedFromInventoryEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/inventory/bots/index.ts b/src/nitro/communication/messages/incoming/bots/index.ts similarity index 75% rename from src/nitro/communication/messages/incoming/inventory/bots/index.ts rename to src/nitro/communication/messages/incoming/bots/index.ts index c89ec936..dde10bf2 100644 --- a/src/nitro/communication/messages/incoming/inventory/bots/index.ts +++ b/src/nitro/communication/messages/incoming/bots/index.ts @@ -1,4 +1,4 @@ export * from './BotAddedToInventoryEvent'; -export * from './BotInventoryEvent'; export * from './BotInventoryMessageEvent'; +export * from './BotReceivedMessageEvent'; export * from './BotRemovedFromInventoryEvent'; diff --git a/src/nitro/communication/messages/incoming/catalog/ClubGiftSelectedEvent.ts b/src/nitro/communication/messages/incoming/catalog/ClubGiftSelectedEvent.ts index d9ed2588..da108e45 100644 --- a/src/nitro/communication/messages/incoming/catalog/ClubGiftSelectedEvent.ts +++ b/src/nitro/communication/messages/incoming/catalog/ClubGiftSelectedEvent.ts @@ -1,16 +1,16 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ClubGiftInfoParser } from '../../parser'; +import { ClubGiftSelectedParser } from '../../parser'; export class ClubGiftSelectedEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { - super(callBack, ClubGiftInfoParser); + super(callBack, ClubGiftSelectedParser); } - public getParser(): ClubGiftInfoParser + public getParser(): ClubGiftSelectedParser { - return this.parser as ClubGiftInfoParser; + return this.parser as ClubGiftSelectedParser; } } diff --git a/src/nitro/communication/messages/incoming/index.ts b/src/nitro/communication/messages/incoming/index.ts index f1552983..39f22de2 100644 --- a/src/nitro/communication/messages/incoming/index.ts +++ b/src/nitro/communication/messages/incoming/index.ts @@ -1,6 +1,7 @@ export * from './advertisement'; export * from './availability'; export * from './avatar'; +export * from './bots'; export * from './camera'; export * from './catalog'; export * from './client'; @@ -15,7 +16,6 @@ export * from './inventory'; export * from './inventory/achievements'; export * from './inventory/avatareffect'; export * from './inventory/badges'; -export * from './inventory/bots'; export * from './inventory/clothes'; export * from './inventory/furni'; export * from './inventory/furni/gifts'; @@ -23,6 +23,7 @@ export * from './inventory/pets'; export * from './inventory/trading'; export * from './landingview'; export * from './marketplace'; +export * from './moderation'; export * from './modtool'; export * from './mysterybox'; export * from './navigator'; diff --git a/src/nitro/communication/messages/incoming/inventory/bots/BotInventoryEvent.ts b/src/nitro/communication/messages/incoming/inventory/bots/BotInventoryEvent.ts deleted file mode 100644 index e5452974..00000000 --- a/src/nitro/communication/messages/incoming/inventory/bots/BotInventoryEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { BotInventoryParser } from '../../../parser/inventory/bots/BotReceivedMessageParser'; - -export class BotInventoryEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, BotInventoryParser); - } - - public getParser(): BotInventoryParser - { - return this.parser as BotInventoryParser; - } -} diff --git a/src/nitro/communication/messages/incoming/inventory/index.ts b/src/nitro/communication/messages/incoming/inventory/index.ts index 54d73f27..6146ac07 100644 --- a/src/nitro/communication/messages/incoming/inventory/index.ts +++ b/src/nitro/communication/messages/incoming/inventory/index.ts @@ -1,7 +1,6 @@ export * from './achievements'; export * from './avatareffect'; export * from './badges'; -export * from './bots'; export * from './clothes'; export * from './furni'; export * from './pets'; diff --git a/src/nitro/communication/messages/incoming/inventory/pets/PetReceivedMessageEvent.ts b/src/nitro/communication/messages/incoming/inventory/pets/PetReceivedMessageEvent.ts new file mode 100644 index 00000000..cfa6603b --- /dev/null +++ b/src/nitro/communication/messages/incoming/inventory/pets/PetReceivedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { PetReceivedMessageParser } from '../../../parser/inventory/pets/PetReceivedMessageParser'; + +export class PetReceivedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, PetReceivedMessageParser); + } + + public getParser(): PetReceivedMessageParser + { + return this.parser as PetReceivedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/inventory/pets/index.ts b/src/nitro/communication/messages/incoming/inventory/pets/index.ts index 6e171c0d..3ed03eb2 100644 --- a/src/nitro/communication/messages/incoming/inventory/pets/index.ts +++ b/src/nitro/communication/messages/incoming/inventory/pets/index.ts @@ -1,3 +1,4 @@ export * from './PetAddedToInventoryEvent'; export * from './PetInventoryEvent'; +export * from './PetReceivedMessageEvent'; export * from './PetRemovedFromInventoryEvent'; diff --git a/src/nitro/communication/messages/incoming/moderation/ModeratorCautionEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModeratorCautionEvent.ts new file mode 100644 index 00000000..9b14a0b9 --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/ModeratorCautionEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ModerationCautionParser } from '../../parser/moderation'; + +export class ModeratorCautionEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ModerationCautionParser); + } + + public getParser(): ModerationCautionParser + { + return this.parser as ModerationCautionParser; + } +} diff --git a/src/nitro/communication/messages/incoming/moderation/UserBannedMessageEvent.ts b/src/nitro/communication/messages/incoming/moderation/UserBannedMessageEvent.ts new file mode 100644 index 00000000..e30f5cd7 --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/UserBannedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { UserBannedMessageParser } from '../../parser/moderation'; + +export class UserBannedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, UserBannedMessageParser); + } + + public getParser(): UserBannedMessageParser + { + return this.parser as UserBannedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/moderation/index.ts b/src/nitro/communication/messages/incoming/moderation/index.ts index 599d890b..51e7049b 100644 --- a/src/nitro/communication/messages/incoming/moderation/index.ts +++ b/src/nitro/communication/messages/incoming/moderation/index.ts @@ -1 +1,3 @@ export * from './INamed'; +export * from './ModeratorCautionEvent'; +export * from './UserBannedMessageEvent'; diff --git a/src/nitro/communication/messages/incoming/notifications/PetLevelNotificationEvent.ts b/src/nitro/communication/messages/incoming/notifications/PetLevelNotificationEvent.ts new file mode 100644 index 00000000..ae78db32 --- /dev/null +++ b/src/nitro/communication/messages/incoming/notifications/PetLevelNotificationEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { PetLevelNotificationParser } from '../../parser/notifications/PetLevelNotificationParser'; + +export class PetLevelNotificationEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, PetLevelNotificationParser); + } + + public getParser(): PetLevelNotificationParser + { + return this.parser as PetLevelNotificationParser; + } +} diff --git a/src/nitro/communication/messages/incoming/notifications/index.ts b/src/nitro/communication/messages/incoming/notifications/index.ts index 02fc474e..59453798 100644 --- a/src/nitro/communication/messages/incoming/notifications/index.ts +++ b/src/nitro/communication/messages/incoming/notifications/index.ts @@ -9,5 +9,6 @@ export * from './InfoFeedEnableMessageEvent'; export * from './ModeratorMessageEvent'; export * from './MOTDNotificationEvent'; export * from './NotificationDialogMessageEvent'; +export * from './PetLevelNotificationEvent'; export * from './PetPlacingErrorEvent'; export * from './UnseenItemsEvent'; diff --git a/src/nitro/communication/messages/parser/inventory/bots/BotAddedToInventoryParser.ts b/src/nitro/communication/messages/parser/bots/BotAddedToInventoryParser.ts similarity index 97% rename from src/nitro/communication/messages/parser/inventory/bots/BotAddedToInventoryParser.ts rename to src/nitro/communication/messages/parser/bots/BotAddedToInventoryParser.ts index 63c4d122..e0576029 100644 --- a/src/nitro/communication/messages/parser/inventory/bots/BotAddedToInventoryParser.ts +++ b/src/nitro/communication/messages/parser/bots/BotAddedToInventoryParser.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; import { BotData } from './BotData'; export class BotAddedToInventoryParser implements IMessageParser diff --git a/src/nitro/communication/messages/parser/inventory/bots/BotData.ts b/src/nitro/communication/messages/parser/bots/BotData.ts similarity index 93% rename from src/nitro/communication/messages/parser/inventory/bots/BotData.ts rename to src/nitro/communication/messages/parser/bots/BotData.ts index 29afd162..410e51e0 100644 --- a/src/nitro/communication/messages/parser/inventory/bots/BotData.ts +++ b/src/nitro/communication/messages/parser/bots/BotData.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper } from '../../../../../../core'; +import { IMessageDataWrapper } from '../../../../../core'; export class BotData { diff --git a/src/nitro/communication/messages/parser/inventory/bots/BotInventoryMessageParser.ts b/src/nitro/communication/messages/parser/bots/BotInventoryMessageParser.ts similarity index 97% rename from src/nitro/communication/messages/parser/inventory/bots/BotInventoryMessageParser.ts rename to src/nitro/communication/messages/parser/bots/BotInventoryMessageParser.ts index e7c8e47d..7bc3a112 100644 --- a/src/nitro/communication/messages/parser/inventory/bots/BotInventoryMessageParser.ts +++ b/src/nitro/communication/messages/parser/bots/BotInventoryMessageParser.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; import { BotData } from './BotData'; export class BotInventoryMessageParser implements IMessageParser diff --git a/src/nitro/communication/messages/parser/inventory/bots/BotReceivedMessageParser.ts b/src/nitro/communication/messages/parser/bots/BotReceivedMessageParser.ts similarity index 89% rename from src/nitro/communication/messages/parser/inventory/bots/BotReceivedMessageParser.ts rename to src/nitro/communication/messages/parser/bots/BotReceivedMessageParser.ts index 27aa4527..314b7eea 100644 --- a/src/nitro/communication/messages/parser/inventory/bots/BotReceivedMessageParser.ts +++ b/src/nitro/communication/messages/parser/bots/BotReceivedMessageParser.ts @@ -1,7 +1,7 @@ -import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; import { BotData } from './BotData'; -export class BotInventoryParser implements IMessageParser +export class BotReceivedMessageParser implements IMessageParser { private _boughtAsGift: boolean; private _item: BotData; diff --git a/src/nitro/communication/messages/parser/inventory/bots/BotRemovedFromInventoryParser.ts b/src/nitro/communication/messages/parser/bots/BotRemovedFromInventoryParser.ts similarity index 96% rename from src/nitro/communication/messages/parser/inventory/bots/BotRemovedFromInventoryParser.ts rename to src/nitro/communication/messages/parser/bots/BotRemovedFromInventoryParser.ts index c8a764f9..29f31e01 100644 --- a/src/nitro/communication/messages/parser/inventory/bots/BotRemovedFromInventoryParser.ts +++ b/src/nitro/communication/messages/parser/bots/BotRemovedFromInventoryParser.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; export class BotRemovedFromInventoryParser implements IMessageParser { diff --git a/src/nitro/communication/messages/parser/inventory/bots/index.ts b/src/nitro/communication/messages/parser/bots/index.ts similarity index 100% rename from src/nitro/communication/messages/parser/inventory/bots/index.ts rename to src/nitro/communication/messages/parser/bots/index.ts diff --git a/src/nitro/communication/messages/parser/index.ts b/src/nitro/communication/messages/parser/index.ts index a50fc39b..598c2b67 100644 --- a/src/nitro/communication/messages/parser/index.ts +++ b/src/nitro/communication/messages/parser/index.ts @@ -1,6 +1,7 @@ export * from './advertisement'; export * from './availability'; export * from './avatar'; +export * from './bots'; export * from './camera'; export * from './catalog'; export * from './client'; @@ -14,6 +15,7 @@ export * from './help'; export * from './inventory'; export * from './landingview'; export * from './marketplace'; +export * from './moderation'; export * from './modtool'; export * from './mysterybox'; export * from './navigator'; diff --git a/src/nitro/communication/messages/parser/inventory/index.ts b/src/nitro/communication/messages/parser/inventory/index.ts index b2dd91f8..01f6a810 100644 --- a/src/nitro/communication/messages/parser/inventory/index.ts +++ b/src/nitro/communication/messages/parser/inventory/index.ts @@ -1,7 +1,6 @@ export * from './achievements'; export * from './avatareffect'; export * from './badges'; -export * from './bots'; export * from './clothing'; export * from './furniture'; export * from './pets'; diff --git a/src/nitro/communication/messages/parser/inventory/pets/PetBoughtNotificationMessageParser.ts b/src/nitro/communication/messages/parser/inventory/pets/PetBoughtNotificationMessageParser.ts deleted file mode 100644 index ba980978..00000000 --- a/src/nitro/communication/messages/parser/inventory/pets/PetBoughtNotificationMessageParser.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -import { PetData } from './PetData'; - -export class PetBoughtNotificationMessageParser implements IMessageParser -{ - private _gift: boolean; - private _pet: PetData; - - public flush(): boolean - { - return true; - } - - public parse(k: IMessageDataWrapper): boolean - { - this._gift = k.readBoolean(); - this._pet = new PetData(k); - - return true; - } - - public get gift(): boolean - { - return this._gift; - } - - public get pet(): PetData - { - return this._pet; - } -} diff --git a/src/nitro/communication/messages/parser/inventory/pets/PetReceivedMessageParser.ts b/src/nitro/communication/messages/parser/inventory/pets/PetReceivedMessageParser.ts new file mode 100644 index 00000000..83ad33c6 --- /dev/null +++ b/src/nitro/communication/messages/parser/inventory/pets/PetReceivedMessageParser.ts @@ -0,0 +1,34 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; +import { PetData } from './PetData'; + +export class PetReceivedMessageParser implements IMessageParser +{ + private _boughtAsGift: boolean; + private _pet: PetData; + + public flush(): boolean + { + this._boughtAsGift = false; + this._pet = null; + + return true; + } + + public parse(k: IMessageDataWrapper): boolean + { + this._boughtAsGift = k.readBoolean(); + this._pet = new PetData(k); + + return true; + } + + public get boughtAsGift(): boolean + { + return this._boughtAsGift; + } + + public get pet(): PetData + { + return this._pet; + } +} diff --git a/src/nitro/communication/messages/parser/inventory/pets/index.ts b/src/nitro/communication/messages/parser/inventory/pets/index.ts index 8a829173..a69532ac 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/index.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/index.ts @@ -3,9 +3,9 @@ export * from './ConfirmBreedingResultParser'; export * from './GoToBreedingNestFailureParser'; export * from './NestBreedingSuccessParser'; export * from './PetAddedToInventoryParser'; -export * from './PetBoughtNotificationMessageParser'; export * from './PetBreedingMessageParser'; export * from './PetData'; export * from './PetFigureDataParser'; export * from './PetInventoryParser'; +export * from './PetReceivedMessageParser'; export * from './PetRemovedFromInventoryParser'; diff --git a/src/nitro/communication/messages/parser/moderation/ModerationCautionParser.ts b/src/nitro/communication/messages/parser/moderation/ModerationCautionParser.ts new file mode 100644 index 00000000..a815a52a --- /dev/null +++ b/src/nitro/communication/messages/parser/moderation/ModerationCautionParser.ts @@ -0,0 +1,35 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class ModerationCautionParser implements IMessageParser +{ + private _message: string; + private _url: string; + + public flush(): boolean + { + this._message = ''; + this._url = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._message = wrapper.readString(); + this._url = wrapper.readString(); + + return true; + } + + public get message(): string + { + return this._message; + } + + public get url(): string + { + return this._url; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/UserBannedMessageParser.ts b/src/nitro/communication/messages/parser/moderation/UserBannedMessageParser.ts new file mode 100644 index 00000000..46d384da --- /dev/null +++ b/src/nitro/communication/messages/parser/moderation/UserBannedMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class UserBannedMessageParser implements IMessageParser +{ + private _message: string; + + public flush(): boolean + { + this._message = ''; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._message = wrapper.readString(); + + return true; + } + + public get message(): string + { + return this._message; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/index.ts b/src/nitro/communication/messages/parser/moderation/index.ts new file mode 100644 index 00000000..aead77be --- /dev/null +++ b/src/nitro/communication/messages/parser/moderation/index.ts @@ -0,0 +1,2 @@ +export * from './ModerationCautionParser'; +export * from './UserBannedMessageParser'; diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolCFHTopicsParser.ts b/src/nitro/communication/messages/parser/modtool/ModtoolCFHTopicsParser.ts index 42deee1b..4ae62e6d 100644 --- a/src/nitro/communication/messages/parser/modtool/ModtoolCFHTopicsParser.ts +++ b/src/nitro/communication/messages/parser/modtool/ModtoolCFHTopicsParser.ts @@ -4,6 +4,7 @@ import { CallForHelpCategoryData } from './utils/CallForHelpCategoryData'; export class ModtoolCFHTopicsParser implements IMessageParser { private _callForHelpCategories: CallForHelpCategoryData[]; + public flush(): boolean { return true; diff --git a/src/nitro/communication/messages/parser/notifications/PetLevelNotificationParser.ts b/src/nitro/communication/messages/parser/notifications/PetLevelNotificationParser.ts new file mode 100644 index 00000000..44b1e33f --- /dev/null +++ b/src/nitro/communication/messages/parser/notifications/PetLevelNotificationParser.ts @@ -0,0 +1,52 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; +import { PetFigureDataParser } from '../inventory/pets/PetFigureDataParser'; + +export class PetLevelNotificationParser implements IMessageParser +{ + private _petId: number; + private _petName: string; + private _level: number; + private _figureData: PetFigureDataParser; + + public flush(): boolean + { + this._petId = -1; + this._petName = null; + this._level = 0; + this._figureData = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._petId = wrapper.readInt(); + this._petName = wrapper.readString(); + this._level = wrapper.readInt(); + this._figureData = new PetFigureDataParser(wrapper); + + return true; + } + + public get petId(): number + { + return this._petId; + } + + public get petName(): string + { + return this._petName; + } + + public get level(): number + { + return this._level; + } + + public get figureData(): PetFigureDataParser + { + return this._figureData; + } +} diff --git a/src/nitro/communication/messages/parser/notifications/index.ts b/src/nitro/communication/messages/parser/notifications/index.ts index 8991fac5..3837191f 100644 --- a/src/nitro/communication/messages/parser/notifications/index.ts +++ b/src/nitro/communication/messages/parser/notifications/index.ts @@ -8,5 +8,6 @@ export * from './InfoFeedEnableMessageParser'; export * from './ModeratorMessageParser'; export * from './MOTDNotificationParser'; export * from './NotificationDialogMessageParser'; +export * from './PetLevelNotificationParser'; export * from './PetPlacingErrorEventParser'; export * from './UnseenItemsParser'; diff --git a/src/nitro/room/IGetImageListener.ts b/src/nitro/room/IGetImageListener.ts index ad2592ef..4241e62f 100644 --- a/src/nitro/room/IGetImageListener.ts +++ b/src/nitro/room/IGetImageListener.ts @@ -1,7 +1,7 @@ -import { RenderTexture } from '@pixi/core'; +import { NitroRenderTexture } from '../..'; export interface IGetImageListener { - imageReady(id: number, texture: RenderTexture, image?: HTMLImageElement): void; + imageReady(id: number, texture: NitroRenderTexture, image?: HTMLImageElement): void; imageFailed(id: number): void; } diff --git a/src/nitro/room/preview/RoomPreviewer.ts b/src/nitro/room/preview/RoomPreviewer.ts index 68cdb8c0..1f84935d 100644 --- a/src/nitro/room/preview/RoomPreviewer.ts +++ b/src/nitro/room/preview/RoomPreviewer.ts @@ -160,7 +160,8 @@ export class RoomPreviewer parser.flush(); parser.parseModel(model, wallHeight, scale); - const wallGeometry = ( this._roomEngine as IRoomCreator).getLegacyWallGeometry(this._previewRoomId); + //@ts-ignore + const wallGeometry = (this._roomEngine as IRoomCreator).getLegacyWallGeometry(this._previewRoomId); if(!wallGeometry) return; diff --git a/src/nitro/session/IRoomSession.ts b/src/nitro/session/IRoomSession.ts index 682a11b8..d4847481 100644 --- a/src/nitro/session/IRoomSession.ts +++ b/src/nitro/session/IRoomSession.ts @@ -28,7 +28,7 @@ export interface IRoomSession extends IDisposable sendBanMessage(userId: number, type: string): void; sendGiveRightsMessage(userId: number): void; sendTakeRightsMessage(userId: number): void; - updateMoodlightData(_Str_25037: number, _Str_24446: number, color: number, brightness: number, apply: boolean): void; + updateMoodlightData(id: number, effectId: number, color: number, brightness: number, apply: boolean): void; toggleMoodlightState(): void; pickupPet(id: number): void; pickupBot(id: number): void; diff --git a/src/nitro/session/RoomSession.ts b/src/nitro/session/RoomSession.ts index 3858d63e..34df6dff 100644 --- a/src/nitro/session/RoomSession.ts +++ b/src/nitro/session/RoomSession.ts @@ -225,11 +225,12 @@ export class RoomSession extends Disposable implements IRoomSession this._connection.send(new RoomTakeRightsComposer(userId)); } - public updateMoodlightData(id: number, _Str_24446: number, color: number, brightness: number, apply: boolean): void + public updateMoodlightData(id: number, effectId: number, color: number, brightness: number, apply: boolean): void { - const local6 = '000000' + color.toString(16).toUpperCase(); - const local7 = '#' + local6.substring((local6.length - 6)); - this.connection.send(new MoodlightSettingsSaveComposer(id, _Str_24446, local7, brightness, apply)); + let colorString = '000000' + color.toString(16).toUpperCase(); + colorString = '#' + colorString.substring((colorString.length - 6)); + + this.connection.send(new MoodlightSettingsSaveComposer(id, effectId, colorString, brightness, apply)); } public toggleMoodlightState(): void From 66c3d8a4f30a24392f12449248d150cf720fe3ca Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sat, 18 Sep 2021 21:33:24 -0300 Subject: [PATCH 039/108] Add NitroSpritesheet for proxy --- src/core/utils/proxy/NitroSpritesheet.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/core/utils/proxy/NitroSpritesheet.ts diff --git a/src/core/utils/proxy/NitroSpritesheet.ts b/src/core/utils/proxy/NitroSpritesheet.ts new file mode 100644 index 00000000..25fdfce7 --- /dev/null +++ b/src/core/utils/proxy/NitroSpritesheet.ts @@ -0,0 +1,4 @@ +import { Spritesheet } from '@pixi/spritesheet'; + +export class NitroSpritesheet extends Spritesheet +{} From 2c2b909f0121d03c272794f6984ea39109d4e8c9 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sat, 18 Sep 2021 21:36:04 -0300 Subject: [PATCH 040/108] Add NitroSpritesheet to index --- src/core/utils/proxy/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/utils/proxy/index.ts b/src/core/utils/proxy/index.ts index 43979ba8..b3b95d07 100644 --- a/src/core/utils/proxy/index.ts +++ b/src/core/utils/proxy/index.ts @@ -8,6 +8,7 @@ export * from './NitroPoint'; export * from './NitroRectangle'; export * from './NitroRenderTexture'; export * from './NitroSprite'; +export * from './NitroSpritesheet'; export * from './NitroTexture'; export * from './PixiApplicationProxy'; export * from './PixiInteractionEventProxy'; From 62a23cd0e21666683e6d7740a236184ca278d62d Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 24 Sep 2021 05:04:13 -0400 Subject: [PATCH 041/108] Updates --- src/nitro/ui/MouseEventType.ts | 1 + src/room/renderer/IRoomRenderingCanvas.ts | 2 +- src/room/renderer/RoomSpriteCanvas.ts | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nitro/ui/MouseEventType.ts b/src/nitro/ui/MouseEventType.ts index f7b0892e..c2bf6114 100644 --- a/src/nitro/ui/MouseEventType.ts +++ b/src/nitro/ui/MouseEventType.ts @@ -8,4 +8,5 @@ export class MouseEventType public static MOUSE_UP: string = 'mouseup'; public static ROLL_OVER: string = 'mouseover'; public static ROLL_OUT: string = 'mouseout'; + public static RIGHT_CLICK: string = 'contextmenu'; } diff --git a/src/room/renderer/IRoomRenderingCanvas.ts b/src/room/renderer/IRoomRenderingCanvas.ts index 1fc8d71f..8914a199 100644 --- a/src/room/renderer/IRoomRenderingCanvas.ts +++ b/src/room/renderer/IRoomRenderingCanvas.ts @@ -18,7 +18,7 @@ export interface IRoomRenderingCanvas skipSpriteVisibilityChecking(): void; resumeSpriteVisibilityChecking(): void; getPlaneSortableSprites(): SortableSprite[]; - handleMouseEvent(k: number, _arg_2: number, _arg_3: string, _arg_4: boolean, _arg_5: boolean, _arg_6: boolean, _arg_7: boolean): boolean; + handleMouseEvent(x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): boolean; getSortableSpriteList(): RoomObjectSpriteData[]; getDisplayAsTexture(): RenderTexture; id: number; diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index a6ce8297..d54f3075 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -948,13 +948,13 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas return didHitSprite; } - protected createMouseEvent(x: number, y: number, _arg_3: number, _arg_4: number, type: string, _arg_6: string, _arg_7: boolean, _arg_8: boolean, _arg_9: boolean, _arg_10: boolean): RoomSpriteMouseEvent + protected createMouseEvent(x: number, y: number, localX: number, localY: number, type: string, tag: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): RoomSpriteMouseEvent { const screenX: number = (x - (this._width / 2)); const screenY: number = (y - (this._height / 2)); const canvasName = `canvas_${ this._id }`; - return new RoomSpriteMouseEvent(type, ((canvasName + '_') + this._eventId), canvasName, _arg_6, screenX, screenY, _arg_3, _arg_4, _arg_8, _arg_7, _arg_9, _arg_10); + return new RoomSpriteMouseEvent(type, ((canvasName + '_') + this._eventId), canvasName, tag, screenX, screenY, localX, localY, ctrlKey, altKey, shiftKey, buttonDown); } protected bufferMouseEvent(k: RoomSpriteMouseEvent, _arg_2: string): void From c6acaff9f460de49ae47e72f92ade6f2e5eaf4f4 Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 28 Sep 2021 21:30:03 -0400 Subject: [PATCH 042/108] Fix AvatarImage.getCroppedImage() --- src/nitro/avatar/AvatarImage.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/nitro/avatar/AvatarImage.ts b/src/nitro/avatar/AvatarImage.ts index a09400d7..9593206e 100644 --- a/src/nitro/avatar/AvatarImage.ts +++ b/src/nitro/avatar/AvatarImage.ts @@ -523,12 +523,6 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener const setTypes = this.getBodyParts(setType, this._mainAction.definition.geometryType, this._mainDirection); const container = new NitroContainer(); - const sprite = new NitroSprite(Texture.EMPTY); - - sprite.width = avatarCanvas.width; - sprite.height = avatarCanvas.height; - - container.addChild(sprite); let partCount = (setTypes.length - 1); @@ -576,7 +570,9 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener partCount--; } - const image = TextureUtils.generateImage(container); + const texture = TextureUtils.generateTexture(container, new Rectangle(0, 0, avatarCanvas.width, avatarCanvas.height)); + + const image = TextureUtils.generateImage(texture); if(!image) return null; From 6a1a32efb13df7a0970a2acd2a848a452f0eb264 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 29 Sep 2021 22:42:08 -0400 Subject: [PATCH 043/108] Rename function --- src/nitro/localization/INitroLocalizationManager.ts | 2 +- src/nitro/localization/NitroLocalizationManager.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nitro/localization/INitroLocalizationManager.ts b/src/nitro/localization/INitroLocalizationManager.ts index f09140bf..909b3b9a 100644 --- a/src/nitro/localization/INitroLocalizationManager.ts +++ b/src/nitro/localization/INitroLocalizationManager.ts @@ -2,7 +2,7 @@ export interface INitroLocalizationManager extends INitroManager { getRomanNumeral(number: number): string; - getBadgeBaseAndLevel(badgeName: string): string; + getPreviousLevelBadgeId(badgeName: string): string; hasValue(key: string): boolean; getValue(key: string, doParams?: boolean): string; getValueWithParameter(key: string, parameter: string, replacement: string): string; diff --git a/src/nitro/localization/NitroLocalizationManager.ts b/src/nitro/localization/NitroLocalizationManager.ts index 7a49b926..d558b0f8 100644 --- a/src/nitro/localization/NitroLocalizationManager.ts +++ b/src/nitro/localization/NitroLocalizationManager.ts @@ -101,7 +101,7 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca return this._romanNumerals[Math.max(0, (number - 1))]; } - public getBadgeBaseAndLevel(badgeName: string): string + public getPreviousLevelBadgeId(badgeName: string): string { const badge = new BadgeBaseAndLevel(badgeName); From f7dc87f7217d0995b6884ece352af00f821ace1a Mon Sep 17 00:00:00 2001 From: dank074 Date: Mon, 11 Oct 2021 20:20:18 -0500 Subject: [PATCH 044/108] fixed doorbell packets --- src/nitro/communication/NitroMessages.ts | 3 ++- .../messages/outgoing/OutgoingHeader.ts | 1 + .../messages/outgoing/room/index.ts | 1 + .../room/session/GoToFlatMessageComposer.ts | 21 +++++++++++++++++++ .../messages/outgoing/room/session/index.ts | 1 + .../session/handler/RoomSessionHandler.ts | 5 +++-- 6 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 src/nitro/communication/messages/outgoing/room/session/GoToFlatMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/room/session/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index abbcd3d5..6dc528ae 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -1063,6 +1063,7 @@ export class NitroMessages implements IMessageConfiguration // ACCESS this._composers.set(OutgoingHeader.ROOM_ENTER, RoomEnterComposer); this._composers.set(OutgoingHeader.ROOM_DOORBELL, RoomDoorbellAccessComposer); + this._composers.set(OutgoingHeader.GO_TO_FLAT, GoToFlatMessageComposer); // ACTION this._composers.set(OutgoingHeader.ROOM_AMBASSADOR_ALERT, RoomAmbassadorAlertComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 3ca3fb5c..4a753d5d 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -334,4 +334,5 @@ export class OutgoingHeader public static CONTROL_YOUTUBE_DISPLAY_PLAYBACK = 3005; public static GET_YOUTUBE_DISPLAY_STATUS = 336; public static SET_YOUTUBE_DISPLAY_PLAYLIST = 2069; + public static GO_TO_FLAT = 685; } diff --git a/src/nitro/communication/messages/outgoing/room/index.ts b/src/nitro/communication/messages/outgoing/room/index.ts index 0e654a76..d9fd832c 100644 --- a/src/nitro/communication/messages/outgoing/room/index.ts +++ b/src/nitro/communication/messages/outgoing/room/index.ts @@ -7,4 +7,5 @@ export * from './furniture'; export * from './mapping'; export * from './RedeemItemClothingComposer'; export * from './RoomCreateComposer'; +export * from './session'; export * from './unit'; diff --git a/src/nitro/communication/messages/outgoing/room/session/GoToFlatMessageComposer.ts b/src/nitro/communication/messages/outgoing/room/session/GoToFlatMessageComposer.ts new file mode 100644 index 00000000..5fda5db4 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/session/GoToFlatMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class GoToFlatMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(roomId: number) + { + this._data = [ roomId ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/session/index.ts b/src/nitro/communication/messages/outgoing/room/session/index.ts new file mode 100644 index 00000000..63746e9f --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/session/index.ts @@ -0,0 +1 @@ +export * from './GoToFlatMessageComposer'; diff --git a/src/nitro/session/handler/RoomSessionHandler.ts b/src/nitro/session/handler/RoomSessionHandler.ts index d837cf19..dde134d4 100644 --- a/src/nitro/session/handler/RoomSessionHandler.ts +++ b/src/nitro/session/handler/RoomSessionHandler.ts @@ -4,6 +4,7 @@ import { RoomDoorbellAcceptedEvent } from '../../communication/messages/incoming import { RoomDoorbellRejectedEvent } from '../../communication/messages/incoming/room/access/doorbell/RoomDoorbellRejectedEvent'; import { RoomEnterEvent } from '../../communication/messages/incoming/room/access/RoomEnterEvent'; import { RoomModelNameEvent } from '../../communication/messages/incoming/room/mapping/RoomModelNameEvent'; +import { GoToFlatMessageComposer } from '../../communication/messages/outgoing/room/session/GoToFlatMessageComposer'; import { RoomSessionDoorbellEvent } from '../events/RoomSessionDoorbellEvent'; import { IRoomHandlerListener } from '../IRoomHandlerListener'; import { BaseHandler } from './BaseHandler'; @@ -65,7 +66,7 @@ export class RoomSessionHandler extends BaseHandler if(!username || !username.length) { - //this.connection.send(); + this.connection.send(new GoToFlatMessageComposer(this.roomId)); } else { @@ -106,4 +107,4 @@ export class RoomSessionHandler extends BaseHandler } } } -} \ No newline at end of file +} From a375dc118de1978944cc4635a082354208dff687 Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 14 Oct 2021 00:41:23 -0400 Subject: [PATCH 045/108] Rename things --- .../user/data/RelationshipStatusInfo.ts | 18 ++++++------ .../RelationshipStatusInfoMessageParser.ts | 7 ++--- .../object/logic/furniture/FurnitureLogic.ts | 2 +- .../object/visualization/room/RoomPlane.ts | 28 +++++++++---------- .../visualization/room/RoomVisualization.ts | 16 +++++------ .../cache/RoomObjectLocationCacheItem.ts | 2 +- 6 files changed, 36 insertions(+), 37 deletions(-) diff --git a/src/nitro/communication/messages/parser/user/data/RelationshipStatusInfo.ts b/src/nitro/communication/messages/parser/user/data/RelationshipStatusInfo.ts index f8ba2bd8..16b80fa4 100644 --- a/src/nitro/communication/messages/parser/user/data/RelationshipStatusInfo.ts +++ b/src/nitro/communication/messages/parser/user/data/RelationshipStatusInfo.ts @@ -3,7 +3,7 @@ import { RelationshipStatusEnum } from '../../../../../enums/RelationshipStatusE export class RelationshipStatusInfo { - private _relationshipStatusType: RelationshipStatusEnum; + private _relationshipStatusType: number; private _friendCount: number; private _randomFriendId: number; private _randomFriendName: string; @@ -19,11 +19,11 @@ export class RelationshipStatusInfo public flush(): boolean { - this._relationshipStatusType = RelationshipStatusEnum.NONE; - this._friendCount = 0; + this._relationshipStatusType = RelationshipStatusEnum.NONE; + this._friendCount = 0; this._randomFriendId = 0; - this._randomFriendFigure = null; - this._randomFriendName = null; + this._randomFriendFigure = null; + this._randomFriendName = null; return true; } @@ -32,16 +32,16 @@ export class RelationshipStatusInfo { if(!wrapper) return false; - this._relationshipStatusType = wrapper.readInt(); + this._relationshipStatusType = wrapper.readInt(); this._friendCount = wrapper.readInt(); - this._randomFriendId = wrapper.readInt(); + this._randomFriendId = wrapper.readInt(); this._randomFriendName = wrapper.readString(); - this._randomFriendFigure = wrapper.readString(); + this._randomFriendFigure = wrapper.readString(); return true; } - public get relationshipStatusType(): RelationshipStatusEnum + public get relationshipStatusType(): number { return this._relationshipStatusType; } diff --git a/src/nitro/communication/messages/parser/user/data/RelationshipStatusInfoMessageParser.ts b/src/nitro/communication/messages/parser/user/data/RelationshipStatusInfoMessageParser.ts index cdbe0860..5d86ae28 100644 --- a/src/nitro/communication/messages/parser/user/data/RelationshipStatusInfoMessageParser.ts +++ b/src/nitro/communication/messages/parser/user/data/RelationshipStatusInfoMessageParser.ts @@ -1,12 +1,11 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; import { AdvancedMap } from '../../../../../../core/utils/AdvancedMap'; -import { RelationshipStatusEnum } from '../../../../../enums/RelationshipStatusEnum'; import { RelationshipStatusInfo } from './RelationshipStatusInfo'; export class RelationshipStatusInfoMessageParser implements IMessageParser { private _userId: number; - private _relationshipStatusMap: AdvancedMap; + private _relationshipStatusMap: AdvancedMap; public flush(): boolean { @@ -20,7 +19,7 @@ export class RelationshipStatusInfoMessageParser implements IMessageParser { if(!wrapper) return false; - this._userId = wrapper.readInt(); + this._userId = wrapper.readInt(); this._relationshipStatusMap = new AdvancedMap(); const relationshipsCount = wrapper.readInt(); @@ -40,7 +39,7 @@ export class RelationshipStatusInfoMessageParser implements IMessageParser return this._userId; } - public get relationshipStatusMap(): AdvancedMap + public get relationshipStatusMap(): AdvancedMap { return this._relationshipStatusMap; } diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index bdd6b79c..f15c0571 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -122,7 +122,7 @@ export class FurnitureLogic extends MovingObjectLogic { for(const direction of directions) this._directions.push(direction); - this._directions.sort(); + this._directions.sort((a, b) => (a - b)); } } diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index 6787e07b..b1e62472 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -68,34 +68,34 @@ export class RoomPlane implements IRoomPlane private _height: number = 0; private _canBeVisible: boolean; - constructor(k: IVector3D, _arg_2: IVector3D, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: number, _arg_6: boolean, _arg_7: IVector3D[], _arg_8: number, _arg_9: number=0, _arg_10: number=0, _arg_11: number=0, _arg_12: number=0) + constructor(origin: IVector3D, location: IVector3D, leftSide: IVector3D, rightSide: IVector3D, type: number, usesMask: boolean, secondaryNormals: IVector3D[], randomSeed: number, textureOffsetX: number=0, textureOffsetY: number=0, textureMaxX: number=0, textureMaxY: number=0) { this._secondaryNormals = []; this._bitmapMasks = []; this._rectangleMasks = []; this._bitmapMasksOld = []; this._rectangleMasksOld = []; - this._randomSeed = _arg_8; + this._randomSeed = randomSeed; this._bitmapData = null; this._maskBitmapData = null; this._maskChanged = false; this._activeTexture = null; this._origin = new Vector3d(); - this._origin.assign(k); + this._origin.assign(origin); this._location = new Vector3d(); - this._location.assign(_arg_2); + this._location.assign(location); this._leftSide = new Vector3d(); - this._leftSide.assign(_arg_3); + this._leftSide.assign(leftSide); this._rightSide = new Vector3d(); - this._rightSide.assign(_arg_4); + this._rightSide.assign(rightSide); this._normal = Vector3d.crossProduct(this._leftSide, this._rightSide); if(this._normal.length > 0) { this._normal.multiply((1 / this._normal.length)); } - if(_arg_7 != null) + if(secondaryNormals != null) { - for(const entry of _arg_7) + for(const entry of secondaryNormals) { if(!entry) continue; @@ -113,7 +113,7 @@ export class RoomPlane implements IRoomPlane this._geometryUpdateId = -1; this._offset = new Point(); this._relativeDepth = 0; - this._type = _arg_5; + this._type = type; this._color = 0; this._rasterizer = null; this._canBeVisible = true; @@ -124,11 +124,11 @@ export class RoomPlane implements IRoomPlane this._cornerD = new Vector3d(); this._width = 0; this._height = 0; - this._textureOffsetX = _arg_9; - this._textureOffsetY = _arg_10; - this._textureMaxX = _arg_11; - this._textureMaxY = _arg_12; - this._useMask = _arg_6; + this._textureOffsetX = textureOffsetX; + this._textureOffsetY = textureOffsetY; + this._textureMaxX = textureMaxX; + this._textureMaxY = textureMaxY; + this._useMask = usesMask; this._uniqueId = ++RoomPlane._uniqueIdCounter; } diff --git a/src/nitro/room/object/visualization/room/RoomVisualization.ts b/src/nitro/room/object/visualization/room/RoomVisualization.ts index 6ac00fe4..3621528f 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualization.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualization.ts @@ -461,7 +461,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements const _local_4 = this.getLandscapeHeight(); let _local_5 = 0; - let _local_6 = this.object.model.getValue(RoomObjectVariable.ROOM_RANDOM_SEED); + let randomSeed = this.object.model.getValue(RoomObjectVariable.ROOM_RANDOM_SEED); let index = 0; while(index < this._roomPlaneParser.planeCount) @@ -478,17 +478,17 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements { const _local_14 = Vector3d.crossProduct(leftSide, rightSide); - _local_6 = ((_local_6 * 7613) + 517); + randomSeed = ((randomSeed * 7613) + 517); plane = null; if(planeType === RoomPlaneData.PLANE_FLOOR) { const _local_15 = ((location.x + leftSide.x) + 0.5); const _local_16 = ((location.y + rightSide.y) + 0.5); - const _local_17 = (Math.trunc(_local_15) - _local_15); - const _local_18 = (Math.trunc(_local_16) - _local_16); + const textureOffsetX = (Math.trunc(_local_15) - _local_15); + const textureOffsetY = (Math.trunc(_local_16) - _local_16); - plane = new RoomPlane(this.object.getLocation(), location, leftSide, rightSide, RoomPlane.TYPE_FLOOR, true, secondaryNormals, _local_6, -(_local_17), -(_local_18)); + plane = new RoomPlane(this.object.getLocation(), location, leftSide, rightSide, RoomPlane.TYPE_FLOOR, true, secondaryNormals, randomSeed, -(textureOffsetX), -(textureOffsetY)); if(_local_14.z !== 0) { @@ -504,7 +504,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements else if(planeType === RoomPlaneData.PLANE_WALL) { - plane = new RoomPlane(this.object.getLocation(), location, leftSide, rightSide, RoomPlane.TYPE_WALL, true, secondaryNormals, _local_6); + plane = new RoomPlane(this.object.getLocation(), location, leftSide, rightSide, RoomPlane.TYPE_WALL, true, secondaryNormals, randomSeed); if((leftSide.length < 1) || (rightSide.length < 1)) { @@ -539,7 +539,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements else if(planeType === RoomPlaneData.PLANE_LANDSCAPE) { - plane = new RoomPlane(this.object.getLocation(), location, leftSide, rightSide, RoomPlane.TYPE_LANDSCAPE, true, secondaryNormals, _local_6, _local_5, 0, _local_3, _local_4); + plane = new RoomPlane(this.object.getLocation(), location, leftSide, rightSide, RoomPlane.TYPE_LANDSCAPE, true, secondaryNormals, randomSeed, _local_5, 0, _local_3, _local_4); if(_local_14.y > 0) { @@ -564,7 +564,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements else if(planeType == RoomPlaneData.PLANE_BILLBOARD) { - plane = new RoomPlane(this.object.getLocation(), location, leftSide, rightSide, RoomPlane.TYPE_WALL, true, secondaryNormals, _local_6); + plane = new RoomPlane(this.object.getLocation(), location, leftSide, rightSide, RoomPlane.TYPE_WALL, true, secondaryNormals, randomSeed); if(((leftSide.length < 1) || (rightSide.length < 1))) { plane.hasTexture = false; diff --git a/src/room/renderer/cache/RoomObjectLocationCacheItem.ts b/src/room/renderer/cache/RoomObjectLocationCacheItem.ts index d773ff2a..d58e1d2f 100644 --- a/src/room/renderer/cache/RoomObjectLocationCacheItem.ts +++ b/src/room/renderer/cache/RoomObjectLocationCacheItem.ts @@ -95,4 +95,4 @@ export class RoomObjectLocationCacheItem { return this._locationChanged; } -} \ No newline at end of file +} From 99b6437a4adf860b22006f6becf953bf5957fec8 Mon Sep 17 00:00:00 2001 From: dank074 Date: Thu, 14 Oct 2021 00:19:56 -0500 Subject: [PATCH 046/108] fix mod chatlog parser --- .../modtool/ModtoolRoomChatlogParser.ts | 48 +------- .../parser/modtool/utils/ChatRecordData.ts | 110 ++++++++++++++++++ .../modtool/utils/ModtoolRoomChatlogLine.ts | 11 +- .../messages/parser/modtool/utils/index.ts | 1 + 4 files changed, 125 insertions(+), 45 deletions(-) create mode 100644 src/nitro/communication/messages/parser/modtool/utils/ChatRecordData.ts diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolRoomChatlogParser.ts b/src/nitro/communication/messages/parser/modtool/ModtoolRoomChatlogParser.ts index 7023fcd4..ddce381d 100644 --- a/src/nitro/communication/messages/parser/modtool/ModtoolRoomChatlogParser.ts +++ b/src/nitro/communication/messages/parser/modtool/ModtoolRoomChatlogParser.ts @@ -1,19 +1,13 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { ModtoolRoomChatlogLine } from './utils/ModtoolRoomChatlogLine'; +import { ChatRecordData } from './utils/ChatRecordData'; export class ModtoolRoomChatlogParser implements IMessageParser { - private _id: number; - private _name: string; - private _chatlogCount: number; - private _chatlogs: ModtoolRoomChatlogLine[] = []; + private _data: ChatRecordData; public flush(): boolean { - this._id = null; - this._name = null; - this._chatlogCount = 0; - this._chatlogs = []; + this._data = null; return true; } @@ -21,43 +15,13 @@ export class ModtoolRoomChatlogParser implements IMessageParser { if(!wrapper) return false; - wrapper.readByte(); - wrapper.readShort(); - wrapper.readString(); - wrapper.readByte(); - this._name = wrapper.readString(); - wrapper.readString(); - wrapper.readByte(); - this._id = wrapper.readInt(); - this._chatlogCount = wrapper.readShort(); - - for(let i = 0; i < this._chatlogCount; i++) - { - const timestamp = wrapper.readString(); - const habboId = wrapper.readInt(); - const username = wrapper.readString(); - const message = wrapper.readString(); - const boolean = wrapper.readBoolean(); - - this._chatlogs.push(new ModtoolRoomChatlogLine(timestamp, habboId, username, message, boolean)); - } + this._data = new ChatRecordData(wrapper); return true; } - public get id(): number + public get data(): ChatRecordData { - return this._id; + return this._data; } - - public get name(): string - { - return this._name; - } - - public get chatlogs(): ModtoolRoomChatlogLine[] - { - return this._chatlogs; - } - } diff --git a/src/nitro/communication/messages/parser/modtool/utils/ChatRecordData.ts b/src/nitro/communication/messages/parser/modtool/utils/ChatRecordData.ts new file mode 100644 index 00000000..129bdff4 --- /dev/null +++ b/src/nitro/communication/messages/parser/modtool/utils/ChatRecordData.ts @@ -0,0 +1,110 @@ +import { IMessageDataWrapper } from '../../../../../..'; +import { ModtoolRoomChatlogLine } from './ModtoolRoomChatlogLine'; + +export class ChatRecordData +{ + public static readonly TYPE_SIMPLE = 0; + public static readonly TYPE_ROOM_CHAT = 1; + public static readonly TYPE_IM_SESSION = 2; + public static readonly TYPE_DISCUSSION_THREAD = 3; + public static readonly TYPE_DISCUSSION_MESSAGE = 4; + public static readonly TYPE_SELFIE = 5; + public static readonly TYPE_PHOTO = 6; + + private _recordType:number; + private _context:Map; + private _chatlog:ModtoolRoomChatlogLine[]; + + constructor(wrapper: IMessageDataWrapper) + { + this._context = new Map(); + this._chatlog = []; + + this._recordType = wrapper.readByte(); + const contextCount = wrapper.readShort(); + + for(let i = 0; i < contextCount; i++) + { + const key = wrapper.readString(); + const type = wrapper.readByte(); + + switch(type) + { + case 0: + this._context.set(key, wrapper.readBoolean()); + break; + case 1: + this._context.set(key, wrapper.readInt()); + break; + case 2: + this._context.set(key, wrapper.readString()); + break; + default: + throw new Error('Unknown data type ' + type); + } + } + + const chatCount = wrapper.readShort(); + + for(let i = 0; i < chatCount; i++) + { + const timestamp = wrapper.readString(); + const habboId = wrapper.readInt(); + const username = wrapper.readString(); + const message = wrapper.readString(); + const hasHighlighting = wrapper.readBoolean(); + + this._chatlog.push(new ModtoolRoomChatlogLine(timestamp, habboId, username, message, hasHighlighting)); + } + } + + public get recordType():number + { + return this._recordType; + } + + public get context():Map + { + return this._context; + } + + public get chatlog():ModtoolRoomChatlogLine[] + { + return this._chatlog; + } + + public get roomId():number + { + return this.getInt('roomId'); + } + + public get roomName():string + { + return this._context['roomName'] as string; + } + + public get groupId():number + { + return this.getInt('groupId'); + } + + public get threadId():number + { + return this.getInt('threadId'); + } + + public get messageId(): number + { + return this.getInt('messageId'); + } + + private getInt(k:string): number + { + const value = this._context.get(k); + if(!value) + { + return 0; + } + return value as number; + } +} diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomChatlogLine.ts b/src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomChatlogLine.ts index 8a52900a..a7fdb798 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomChatlogLine.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomChatlogLine.ts @@ -6,15 +6,15 @@ export class ModtoolRoomChatlogLine implements IChatlog private readonly _habboId: number; private readonly _username: string; private readonly _message: string; - private _boolean: boolean; + private readonly _hasHighlighting: boolean; - constructor(timestamp: string, habboId: number, username: string, message: string, boolean: boolean) + constructor(timestamp: string, habboId: number, username: string, message: string, hasHighlighting: boolean) { this._timestamp = timestamp; this._habboId = habboId; this._username = username; this._message = message; - this._boolean = boolean; + this._hasHighlighting = hasHighlighting; } public get timestamp(): string @@ -36,4 +36,9 @@ export class ModtoolRoomChatlogLine implements IChatlog { return this._message; } + + public get hasHighlighting(): boolean + { + return this._hasHighlighting; + } } diff --git a/src/nitro/communication/messages/parser/modtool/utils/index.ts b/src/nitro/communication/messages/parser/modtool/utils/index.ts index 180c8620..171b01c9 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/index.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/index.ts @@ -1,4 +1,5 @@ export * from './CallForHelpCategoryData'; +export * from './ChatRecordData'; export * from './IChatlog'; export * from './IssueInfoMessageParser'; export * from './IssueMessageData'; From e4ce462c790fc84944a580c8f30c7bd3195b5862 Mon Sep 17 00:00:00 2001 From: dank074 Date: Thu, 14 Oct 2021 01:31:41 -0500 Subject: [PATCH 047/108] fix user chat log parser --- .../modtool/ModtoolUserChatlogParser.ts | 48 +++++-------------- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolUserChatlogParser.ts b/src/nitro/communication/messages/parser/modtool/ModtoolUserChatlogParser.ts index 05ac699c..845592e1 100644 --- a/src/nitro/communication/messages/parser/modtool/ModtoolUserChatlogParser.ts +++ b/src/nitro/communication/messages/parser/modtool/ModtoolUserChatlogParser.ts @@ -1,19 +1,16 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { ModtoolUserChatlogParserChatlog } from './utils/ModtoolUserChatlogParserChatlog'; -import { ModtoolUserChatlogParserVisit } from './utils/ModtoolUserChatlogParserVisit'; +import { ChatRecordData } from './utils/ChatRecordData'; export class ModtoolUserChatlogParser implements IMessageParser { - private _id: number; + private _userId: number; private _username: string; - private _size: number; - private _roomVisits: ModtoolUserChatlogParserVisit[] = []; + private _roomVisits: ChatRecordData[] = []; public flush(): boolean { - this._id = null; + this._userId = null; this._username = null; - this._size = null; this._roomVisits = []; return true; @@ -23,43 +20,20 @@ export class ModtoolUserChatlogParser implements IMessageParser { if(!wrapper) return false; - this._id = wrapper.readInt(); + this._userId = wrapper.readInt(); this._username = wrapper.readString(); - this._size = wrapper.readInt(); - for(let i = 0; i < this._size; i++) + const size = wrapper.readInt(); + for(let i = 0; i < size; i++) { - wrapper.readByte(); - wrapper.readShort(); - wrapper.readString(); - wrapper.readByte(); - const roomName = wrapper.readString(); - wrapper.readString(); - wrapper.readByte(); - const roomId = wrapper.readInt(); - - const chatlogs = []; - - const chatlogSize = wrapper.readShort(); - - for(let i = 0; i < chatlogSize; i++) - { - const timestamp = wrapper.readString(); - const userId = wrapper.readInt(); - const userName = wrapper.readString(); - const message = wrapper.readString(); - const bool = wrapper.readBoolean(); - chatlogs.push(new ModtoolUserChatlogParserChatlog(timestamp, userId, userName, message, bool)); - } - - this._roomVisits.push(new ModtoolUserChatlogParserVisit(roomName, roomId, chatlogs)); + this._roomVisits.push(new ChatRecordData(wrapper)); } return true; } - public get id(): number + public get userId(): number { - return this._id; + return this._userId; } public get username(): string @@ -67,7 +41,7 @@ export class ModtoolUserChatlogParser implements IMessageParser return this._username; } - public get roomVisits(): ModtoolUserChatlogParserVisit[] + public get roomVisits(): ChatRecordData[] { return this._roomVisits; } From bf47c40c322e0931846d701dd98077da2b79ff83 Mon Sep 17 00:00:00 2001 From: dank074 Date: Thu, 14 Oct 2021 19:02:41 -0500 Subject: [PATCH 048/108] fix getter for chatlog parser --- .../messages/parser/modtool/utils/ChatRecordData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitro/communication/messages/parser/modtool/utils/ChatRecordData.ts b/src/nitro/communication/messages/parser/modtool/utils/ChatRecordData.ts index 129bdff4..7e9d435c 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/ChatRecordData.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/ChatRecordData.ts @@ -80,7 +80,7 @@ export class ChatRecordData public get roomName():string { - return this._context['roomName'] as string; + return this._context.get('roomName') as string; } public get groupId():number From 680aee70df4730309f0b70b3d41712e7e46b4fe4 Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 15 Oct 2021 01:21:20 -0400 Subject: [PATCH 049/108] Update MovingObjectLogic --- src/nitro/room/object/logic/MovingObjectLogic.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nitro/room/object/logic/MovingObjectLogic.ts b/src/nitro/room/object/logic/MovingObjectLogic.ts index 13eef354..deba802c 100644 --- a/src/nitro/room/object/logic/MovingObjectLogic.ts +++ b/src/nitro/room/object/logic/MovingObjectLogic.ts @@ -8,6 +8,7 @@ import { RoomObjectVariable } from '../RoomObjectVariable'; export class MovingObjectLogic extends RoomObjectLogicBase { + public static UPDATE_INTERVAL: number = 500; private static TEMP_VECTOR: Vector3d = new Vector3d(); private _liftAmount: number; @@ -28,7 +29,7 @@ export class MovingObjectLogic extends RoomObjectLogicBase this._locationDelta = new Vector3d(); this._lastUpdateTime = 0; this._changeTime = 0; - this._updateInterval = 500; + this._updateInterval = MovingObjectLogic.UPDATE_INTERVAL; } protected onDispose(): void From cdffd4dff2888051a289805b31bb964d078946b3 Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 15 Oct 2021 01:24:42 -0400 Subject: [PATCH 050/108] Rename variable --- src/nitro/room/object/logic/MovingObjectLogic.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nitro/room/object/logic/MovingObjectLogic.ts b/src/nitro/room/object/logic/MovingObjectLogic.ts index deba802c..e345d58c 100644 --- a/src/nitro/room/object/logic/MovingObjectLogic.ts +++ b/src/nitro/room/object/logic/MovingObjectLogic.ts @@ -8,7 +8,7 @@ import { RoomObjectVariable } from '../RoomObjectVariable'; export class MovingObjectLogic extends RoomObjectLogicBase { - public static UPDATE_INTERVAL: number = 500; + public static UPDATE_MOVING_INTERVAL: number = 500; private static TEMP_VECTOR: Vector3d = new Vector3d(); private _liftAmount: number; @@ -29,7 +29,7 @@ export class MovingObjectLogic extends RoomObjectLogicBase this._locationDelta = new Vector3d(); this._lastUpdateTime = 0; this._changeTime = 0; - this._updateInterval = MovingObjectLogic.UPDATE_INTERVAL; + this._updateInterval = MovingObjectLogic.UPDATE_MOVING_INTERVAL; } protected onDispose(): void From d7d49e5974356e5713fb39d81107c4b475b257d1 Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 15 Oct 2021 22:28:41 -0400 Subject: [PATCH 051/108] Anoher update --- src/nitro/room/object/logic/MovingObjectLogic.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/nitro/room/object/logic/MovingObjectLogic.ts b/src/nitro/room/object/logic/MovingObjectLogic.ts index e345d58c..8ce77b34 100644 --- a/src/nitro/room/object/logic/MovingObjectLogic.ts +++ b/src/nitro/room/object/logic/MovingObjectLogic.ts @@ -17,7 +17,6 @@ export class MovingObjectLogic extends RoomObjectLogicBase private _locationDelta: Vector3d; private _lastUpdateTime: number; private _changeTime: number; - private _updateInterval: number; constructor() { @@ -29,7 +28,6 @@ export class MovingObjectLogic extends RoomObjectLogicBase this._locationDelta = new Vector3d(); this._lastUpdateTime = 0; this._changeTime = 0; - this._updateInterval = MovingObjectLogic.UPDATE_MOVING_INTERVAL; } protected onDispose(): void @@ -74,14 +72,14 @@ export class MovingObjectLogic extends RoomObjectLogicBase let difference = (this.time - this._changeTime); - if(difference === (this._updateInterval >> 1)) difference++; + if(difference === (MovingObjectLogic.UPDATE_MOVING_INTERVAL >> 1)) difference++; - if(difference > this._updateInterval) difference = this._updateInterval; + if(difference > MovingObjectLogic.UPDATE_MOVING_INTERVAL) difference = MovingObjectLogic.UPDATE_MOVING_INTERVAL; if(this._locationDelta.length > 0) { vector.assign(this._locationDelta); - vector.multiply((difference / this._updateInterval)); + vector.multiply((difference / MovingObjectLogic.UPDATE_MOVING_INTERVAL)); vector.add(this._location); } else @@ -93,7 +91,7 @@ export class MovingObjectLogic extends RoomObjectLogicBase this.object.setLocation(vector); - if(difference === this._updateInterval) + if(difference === MovingObjectLogic.UPDATE_MOVING_INTERVAL) { this._locationDelta.x = 0; this._locationDelta.y = 0; From cda1946c291ab8dfc689f24badc3f3d37356cc87 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 16 Oct 2021 15:08:47 -0400 Subject: [PATCH 052/108] Update setRoomInstanceRenderingCanvasOffset --- src/nitro/room/RoomEngine.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index cbc50fd4..419e674b 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -666,10 +666,15 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!renderingCanvas || !point) return false; - this.events.dispatchEvent(new RoomDragEvent(roomId, -(renderingCanvas.screenOffsetX - point.x), -(renderingCanvas.screenOffsetY - point.y))); + const x = ~~(point.x); + const y = ~~(point.y); - renderingCanvas.screenOffsetX = point.x; - renderingCanvas.screenOffsetY = point.y; + if((renderingCanvas.screenOffsetX === x) && (renderingCanvas.screenOffsetY === y)) return; + + this.events.dispatchEvent(new RoomDragEvent(roomId, -(renderingCanvas.screenOffsetX - x), -(renderingCanvas.screenOffsetY - y))); + + renderingCanvas.screenOffsetX = x; + renderingCanvas.screenOffsetY = y; return true; } @@ -1187,7 +1192,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } } - if(this._activeRoomIsDragged) + if(this._activeRoomWasDragged) { const renderingCanvas = this.getRoomInstanceRenderingCanvas(this._activeRoomId, 1); From 1031fb3d5990d2913ba916e6db14b680791b9f66 Mon Sep 17 00:00:00 2001 From: dank074 Date: Tue, 19 Oct 2021 18:50:23 -0500 Subject: [PATCH 053/108] fixed packet name --- src/nitro/communication/NitroMessages.ts | 4 ++-- ...mAlertComposer.ts => ModeratorActionMessageComposer.ts} | 7 ++++++- src/nitro/communication/messages/outgoing/modtool/index.ts | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) rename src/nitro/communication/messages/outgoing/modtool/{ModtoolRoomAlertComposer.ts => ModeratorActionMessageComposer.ts} (60%) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 6dc528ae..5bae44f5 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -322,6 +322,7 @@ import { TradingOpenComposer } from './messages/outgoing/inventory/trading/Tradi import { TradingUnacceptComposer } from './messages/outgoing/inventory/trading/TradingUnacceptComposer'; import { GetPromoArticlesComposer } from './messages/outgoing/landingview/GetPromoArticlesComposer'; import { CommunityGoalVoteMessageComposer } from './messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer'; +import { ModeratorActionMessageComposer } from './messages/outgoing/modtool/ModeratorActionMessageComposer'; import { ModtoolChangeRoomSettingsComposer } from './messages/outgoing/modtool/ModtoolChangeRoomSettingsComposer'; import { ModtoolEventAlertComposer } from './messages/outgoing/modtool/ModtoolEventAlertComposer'; import { ModtoolRequestRoomChatlogComposer } from './messages/outgoing/modtool/ModtoolRequestRoomChatlogComposer'; @@ -329,7 +330,6 @@ import { ModtoolRequestRoomInfoComposer } from './messages/outgoing/modtool/Modt import { ModtoolRequestUserChatlogComposer } from './messages/outgoing/modtool/ModtoolRequestUserChatlogComposer'; import { ModtoolRequestUserInfoComposer } from './messages/outgoing/modtool/ModtoolRequestUserInfoComposer'; import { ModtoolRequestUserRoomsComposer } from './messages/outgoing/modtool/ModtoolRequestUserRoomsComposer'; -import { ModtoolRoomAlertComposer } from './messages/outgoing/modtool/ModtoolRoomAlertComposer'; import { ModtoolSanctionAlertComposer } from './messages/outgoing/modtool/ModtoolSanctionAlertComposer'; import { ModtoolSanctionBanComposer } from './messages/outgoing/modtool/ModtoolSanctionBanComposer'; import { ModtoolSanctionKickComposer } from './messages/outgoing/modtool/ModtoolSanctionKickComposer'; @@ -1231,7 +1231,7 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.MODTOOL_ALERTEVENT, ModtoolEventAlertComposer); this._composers.set(OutgoingHeader.MODTOOL_SANCTION_MUTE, ModtoolSanctionMuteComposer); this._composers.set(OutgoingHeader.MODTOOL_REQUEST_USER_ROOMS, ModtoolRequestUserRoomsComposer); - this._composers.set(OutgoingHeader.MODTOOL_ROOM_ALERT, ModtoolRoomAlertComposer); + this._composers.set(OutgoingHeader.MODTOOL_ROOM_ALERT, ModeratorActionMessageComposer); // SETTINGS this._composers.set(OutgoingHeader.USER_SETTINGS_CAMERA, UserSettingsCameraFollowComposer); diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolRoomAlertComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ModeratorActionMessageComposer.ts similarity index 60% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolRoomAlertComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/ModeratorActionMessageComposer.ts index 0870af32..2a6e3c97 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolRoomAlertComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/ModeratorActionMessageComposer.ts @@ -1,7 +1,12 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ModtoolRoomAlertComposer implements IMessageComposer +export class ModeratorActionMessageComposer implements IMessageComposer { + public static readonly ACTION_ALERT = 0; + public static readonly ACTION_KICK = 1; + public static readonly ACTION_MESSAGE = 3; + public static readonly ACTION_MESSAGE_AND_SOFT_KICK = 4; + private _data: any[] = []; constructor(k: number, arg2: string, arg3: string) diff --git a/src/nitro/communication/messages/outgoing/modtool/index.ts b/src/nitro/communication/messages/outgoing/modtool/index.ts index 25263a66..5537674e 100644 --- a/src/nitro/communication/messages/outgoing/modtool/index.ts +++ b/src/nitro/communication/messages/outgoing/modtool/index.ts @@ -1,3 +1,4 @@ +export * from './ModeratorActionMessageComposer'; export * from './ModtoolChangeRoomSettingsComposer'; export * from './ModtoolEventAlertComposer'; export * from './ModtoolRequestRoomChatlogComposer'; @@ -5,7 +6,6 @@ export * from './ModtoolRequestRoomInfoComposer'; export * from './ModtoolRequestUserChatlogComposer'; export * from './ModtoolRequestUserInfoComposer'; export * from './ModtoolRequestUserRoomsComposer'; -export * from './ModtoolRoomAlertComposer'; export * from './ModtoolSanctionAlertComposer'; export * from './ModtoolSanctionBanComposer'; export * from './ModtoolSanctionKickComposer'; From 8298c2c6962fbf7d78b8aab763774346acea3859 Mon Sep 17 00:00:00 2001 From: dank074 Date: Tue, 19 Oct 2021 18:57:31 -0500 Subject: [PATCH 054/108] fix more packet names --- src/nitro/communication/NitroMessages.ts | 4 ++-- ...RoomSettingsComposer.ts => ModerateRoomMessageComposer.ts} | 4 ++-- src/nitro/communication/messages/outgoing/modtool/index.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/nitro/communication/messages/outgoing/modtool/{ModtoolChangeRoomSettingsComposer.ts => ModerateRoomMessageComposer.ts} (63%) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 5bae44f5..2edc1d38 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -322,8 +322,8 @@ import { TradingOpenComposer } from './messages/outgoing/inventory/trading/Tradi import { TradingUnacceptComposer } from './messages/outgoing/inventory/trading/TradingUnacceptComposer'; import { GetPromoArticlesComposer } from './messages/outgoing/landingview/GetPromoArticlesComposer'; import { CommunityGoalVoteMessageComposer } from './messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer'; +import { ModerateRoomMessageComposer } from './messages/outgoing/modtool/ModerateRoomMessageComposer'; import { ModeratorActionMessageComposer } from './messages/outgoing/modtool/ModeratorActionMessageComposer'; -import { ModtoolChangeRoomSettingsComposer } from './messages/outgoing/modtool/ModtoolChangeRoomSettingsComposer'; import { ModtoolEventAlertComposer } from './messages/outgoing/modtool/ModtoolEventAlertComposer'; import { ModtoolRequestRoomChatlogComposer } from './messages/outgoing/modtool/ModtoolRequestRoomChatlogComposer'; import { ModtoolRequestRoomInfoComposer } from './messages/outgoing/modtool/ModtoolRequestRoomInfoComposer'; @@ -1220,7 +1220,7 @@ export class NitroMessages implements IMessageConfiguration // MODTOOL this._composers.set(OutgoingHeader.MODTOOL_REQUEST_ROOM_INFO, ModtoolRequestRoomInfoComposer); - this._composers.set(OutgoingHeader.MODTOOL_CHANGE_ROOM_SETTINGS, ModtoolChangeRoomSettingsComposer); + this._composers.set(OutgoingHeader.MODTOOL_CHANGE_ROOM_SETTINGS, ModerateRoomMessageComposer); this._composers.set(OutgoingHeader.MODTOOL_REQUEST_USER_CHATLOG, ModtoolRequestUserChatlogComposer); this._composers.set(OutgoingHeader.MODTOOL_REQUEST_ROOM_CHATLOG, ModtoolRequestRoomChatlogComposer); this._composers.set(OutgoingHeader.MOD_TOOL_USER_INFO, ModtoolRequestUserInfoComposer); diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolChangeRoomSettingsComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ModerateRoomMessageComposer.ts similarity index 63% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolChangeRoomSettingsComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/ModerateRoomMessageComposer.ts index 168ff4eb..9e6b31c9 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolChangeRoomSettingsComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/ModerateRoomMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ModtoolChangeRoomSettingsComposer implements IMessageComposer> +export class ModerateRoomMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(roomId: number, lockDoor: number, changeTitle: number, kickUsers: number) { diff --git a/src/nitro/communication/messages/outgoing/modtool/index.ts b/src/nitro/communication/messages/outgoing/modtool/index.ts index 5537674e..904066bd 100644 --- a/src/nitro/communication/messages/outgoing/modtool/index.ts +++ b/src/nitro/communication/messages/outgoing/modtool/index.ts @@ -1,5 +1,5 @@ +export * from './ModerateRoomMessageComposer'; export * from './ModeratorActionMessageComposer'; -export * from './ModtoolChangeRoomSettingsComposer'; export * from './ModtoolEventAlertComposer'; export * from './ModtoolRequestRoomChatlogComposer'; export * from './ModtoolRequestRoomInfoComposer'; From 56bd1668752d0833063aa38c430b84eee653cdb3 Mon Sep 17 00:00:00 2001 From: dank074 Date: Tue, 19 Oct 2021 20:54:13 -0500 Subject: [PATCH 055/108] changed more packet names --- src/nitro/communication/NitroMessages.ts | 8 ++++---- .../modtool/ModeratorInitMessageEvent.ts | 16 ++++++++++++++++ .../incoming/modtool/ModtoolMainEvent.ts | 16 ---------------- .../messages/incoming/modtool/index.ts | 2 +- ...tComposer.ts => ModMessageMessageComposer.ts} | 4 +++- .../messages/outgoing/modtool/index.ts | 2 +- ...inParser.ts => ModeratorInitMessageParser.ts} | 2 +- .../messages/parser/modtool/index.ts | 2 +- 8 files changed, 27 insertions(+), 25 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/modtool/ModeratorInitMessageEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/modtool/ModtoolMainEvent.ts rename src/nitro/communication/messages/outgoing/modtool/{ModtoolEventAlertComposer.ts => ModMessageMessageComposer.ts} (80%) rename src/nitro/communication/messages/parser/modtool/{ModtoolMainParser.ts => ModeratorInitMessageParser.ts} (88%) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 2edc1d38..1cc0ec94 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -92,8 +92,8 @@ import { MarketPlaceOffersEvent } from './messages/incoming/marketplace/Marketpl import { MarketplaceOwnOffersEvent } from './messages/incoming/marketplace/MarketplaceOwnOffersEvent'; import { UserBannedMessageEvent } from './messages/incoming/moderation'; import { ModeratorCautionEvent } from './messages/incoming/moderation/ModeratorCautionEvent'; +import { ModeratorInitMessageEvent } from './messages/incoming/modtool/ModeratorInitMessageEvent'; import { ModtoolCallForHelpTopicsEvent } from './messages/incoming/modtool/ModtoolCallForHelpTopicsEvent'; -import { ModtoolMainEvent } from './messages/incoming/modtool/ModtoolMainEvent'; import { ModtoolReceivedRoomsUserEvent } from './messages/incoming/modtool/ModtoolReceivedRoomsUserEvent'; import { ModtoolRoomChatlogEvent } from './messages/incoming/modtool/ModtoolRoomChatlogEvent'; import { ModtoolRoomInfoEvent } from './messages/incoming/modtool/ModtoolRoomInfoEvent'; @@ -324,7 +324,7 @@ import { GetPromoArticlesComposer } from './messages/outgoing/landingview/GetPro import { CommunityGoalVoteMessageComposer } from './messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer'; import { ModerateRoomMessageComposer } from './messages/outgoing/modtool/ModerateRoomMessageComposer'; import { ModeratorActionMessageComposer } from './messages/outgoing/modtool/ModeratorActionMessageComposer'; -import { ModtoolEventAlertComposer } from './messages/outgoing/modtool/ModtoolEventAlertComposer'; +import { ModMessageMessageComposer } from './messages/outgoing/modtool/ModMessageMessageComposer'; import { ModtoolRequestRoomChatlogComposer } from './messages/outgoing/modtool/ModtoolRequestRoomChatlogComposer'; import { ModtoolRequestRoomInfoComposer } from './messages/outgoing/modtool/ModtoolRequestRoomInfoComposer'; import { ModtoolRequestUserChatlogComposer } from './messages/outgoing/modtool/ModtoolRequestUserChatlogComposer'; @@ -671,7 +671,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.MODTOOL_ROOM_CHATLOG, ModtoolRoomChatlogEvent); this._events.set(IncomingHeader.MODERATION_USER_INFO, ModtoolUserInfoEvent); this._events.set(IncomingHeader.MODERATION_TOPICS, ModtoolCallForHelpTopicsEvent); - this._events.set(IncomingHeader.MODERATION_TOOL, ModtoolMainEvent); + this._events.set(IncomingHeader.MODERATION_TOOL, ModeratorInitMessageEvent); this._events.set(IncomingHeader.MODTOOL_VISITED_ROOMS_USER, ModtoolReceivedRoomsUserEvent); // MYSTERY BOX @@ -1228,7 +1228,7 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.MODTOOL_SANCTION_BAN, ModtoolSanctionBanComposer); this._composers.set(OutgoingHeader.MODTOOL_SANCTION_KICK, ModtoolSanctionKickComposer); this._composers.set(OutgoingHeader.MODTOOL_SANCTION_TRADELOCK, ModtoolSanctionTradelockComposer); - this._composers.set(OutgoingHeader.MODTOOL_ALERTEVENT, ModtoolEventAlertComposer); + this._composers.set(OutgoingHeader.MODTOOL_ALERTEVENT, ModMessageMessageComposer); this._composers.set(OutgoingHeader.MODTOOL_SANCTION_MUTE, ModtoolSanctionMuteComposer); this._composers.set(OutgoingHeader.MODTOOL_REQUEST_USER_ROOMS, ModtoolRequestUserRoomsComposer); this._composers.set(OutgoingHeader.MODTOOL_ROOM_ALERT, ModeratorActionMessageComposer); diff --git a/src/nitro/communication/messages/incoming/modtool/ModeratorInitMessageEvent.ts b/src/nitro/communication/messages/incoming/modtool/ModeratorInitMessageEvent.ts new file mode 100644 index 00000000..47e64435 --- /dev/null +++ b/src/nitro/communication/messages/incoming/modtool/ModeratorInitMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ModeratorInitMessageParser } from '../../parser/modtool/ModeratorInitMessageParser'; + +export class ModeratorInitMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ModeratorInitMessageParser); + } + + public getParser(): ModeratorInitMessageParser + { + return this.parser as ModeratorInitMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/modtool/ModtoolMainEvent.ts b/src/nitro/communication/messages/incoming/modtool/ModtoolMainEvent.ts deleted file mode 100644 index 4c13a3ab..00000000 --- a/src/nitro/communication/messages/incoming/modtool/ModtoolMainEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolMainParser } from '../../parser/modtool/ModtoolMainParser'; - -export class ModtoolMainEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, ModtoolMainParser); - } - - public getParser(): ModtoolMainParser - { - return this.parser as ModtoolMainParser; - } -} diff --git a/src/nitro/communication/messages/incoming/modtool/index.ts b/src/nitro/communication/messages/incoming/modtool/index.ts index b0aa05ca..8090ab06 100644 --- a/src/nitro/communication/messages/incoming/modtool/index.ts +++ b/src/nitro/communication/messages/incoming/modtool/index.ts @@ -1,5 +1,5 @@ +export * from './ModeratorInitMessageEvent'; export * from './ModtoolCallForHelpTopicsEvent'; -export * from './ModtoolMainEvent'; export * from './ModtoolReceivedRoomsUserEvent'; export * from './ModtoolRoomChatlogEvent'; export * from './ModtoolRoomInfoEvent'; diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolEventAlertComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ModMessageMessageComposer.ts similarity index 80% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolEventAlertComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/ModMessageMessageComposer.ts index 59d71974..b4a5f2e4 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolEventAlertComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/ModMessageMessageComposer.ts @@ -1,6 +1,6 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ModtoolEventAlertComposer implements IMessageComposer +export class ModMessageMessageComposer implements IMessageComposer { private _data: any[] = []; @@ -8,6 +8,8 @@ export class ModtoolEventAlertComposer implements IMessageComposer { this._data.push(k); this._data.push(arg2); + this._data.push(''); + this._data.push(''); this._data.push(arg3); if(arg4 != -1) { diff --git a/src/nitro/communication/messages/outgoing/modtool/index.ts b/src/nitro/communication/messages/outgoing/modtool/index.ts index 904066bd..cc9df88f 100644 --- a/src/nitro/communication/messages/outgoing/modtool/index.ts +++ b/src/nitro/communication/messages/outgoing/modtool/index.ts @@ -1,6 +1,6 @@ export * from './ModerateRoomMessageComposer'; export * from './ModeratorActionMessageComposer'; -export * from './ModtoolEventAlertComposer'; +export * from './ModMessageMessageComposer'; export * from './ModtoolRequestRoomChatlogComposer'; export * from './ModtoolRequestRoomInfoComposer'; export * from './ModtoolRequestUserChatlogComposer'; diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolMainParser.ts b/src/nitro/communication/messages/parser/modtool/ModeratorInitMessageParser.ts similarity index 88% rename from src/nitro/communication/messages/parser/modtool/ModtoolMainParser.ts rename to src/nitro/communication/messages/parser/modtool/ModeratorInitMessageParser.ts index e8329d33..602d4d00 100644 --- a/src/nitro/communication/messages/parser/modtool/ModtoolMainParser.ts +++ b/src/nitro/communication/messages/parser/modtool/ModeratorInitMessageParser.ts @@ -1,7 +1,7 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; import { ModeratorInitData } from './utils/ModeratorInitData'; -export class ModtoolMainParser implements IMessageParser +export class ModeratorInitMessageParser implements IMessageParser { private _data: ModeratorInitData = null; public flush(): boolean diff --git a/src/nitro/communication/messages/parser/modtool/index.ts b/src/nitro/communication/messages/parser/modtool/index.ts index 98b61ea2..ca72f417 100644 --- a/src/nitro/communication/messages/parser/modtool/index.ts +++ b/src/nitro/communication/messages/parser/modtool/index.ts @@ -1,5 +1,5 @@ +export * from './ModeratorInitMessageParser'; export * from './ModtoolCFHTopicsParser'; -export * from './ModtoolMainParser'; export * from './ModtoolRoomChatlogParser'; export * from './ModtoolRoomInfoParser'; export * from './ModtoolRoomUsersParser'; From ae74c0354d7e8a274053028f75be2507ffd0c092 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 20 Oct 2021 01:19:14 -0400 Subject: [PATCH 056/108] Rename packet --- src/nitro/communication/NitroMessages.ts | 4 ++-- .../{FurnitureState2Event.ts => DiceValueMessageEvent.ts} | 2 +- .../messages/incoming/room/furniture/index.ts | 2 +- src/nitro/room/RoomMessageHandler.ts | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) rename src/nitro/communication/messages/incoming/room/furniture/{FurnitureState2Event.ts => DiceValueMessageEvent.ts} (85%) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 6dc528ae..711644c7 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -151,6 +151,7 @@ import { RoomUsersWithRightsEvent } from './messages/incoming/room/data/RoomUser import { ObjectsDataUpdateEvent } from './messages/incoming/room/engine/ObjectsDataUpdateEvent'; import { ObjectsRollingEvent } from './messages/incoming/room/engine/ObjectsRollingEvent'; import { RoomCreatedEvent } from './messages/incoming/room/engine/RoomCreatedEvent'; +import { DiceValueMessageEvent } from './messages/incoming/room/furniture/DiceValueMessageEvent'; import { FurnitureFloorAddEvent } from './messages/incoming/room/furniture/floor/FurnitureFloorAddEvent'; import { FurnitureFloorEvent } from './messages/incoming/room/furniture/floor/FurnitureFloorEvent'; import { FurnitureFloorRemoveEvent } from './messages/incoming/room/furniture/floor/FurnitureFloorRemoveEvent'; @@ -160,7 +161,6 @@ import { FurnitureDataEvent } from './messages/incoming/room/furniture/Furniture import { FurnitureItemDataEvent } from './messages/incoming/room/furniture/FurnitureItemDataEvent'; import { FurniturePostItStickyPoleOpenEvent } from './messages/incoming/room/furniture/FurniturePostItStickyPoleOpenEvent'; import { FurnitureStackHeightEvent } from './messages/incoming/room/furniture/FurnitureStackHeightEvent'; -import { FurnitureState2Event } from './messages/incoming/room/furniture/FurnitureState2Event'; import { FurnitureStateEvent } from './messages/incoming/room/furniture/FurnitureStateEvent'; import { GroupFurniContextMenuInfoMessageEvent } from './messages/incoming/room/furniture/GroupFurniContextMenuInfoMessageEvent'; import { LoveLockFurniFinishedEvent } from './messages/incoming/room/furniture/LoveLockFurniFinishedEvent'; @@ -752,7 +752,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.ITEM_STACK_HELPER, FurnitureStackHeightEvent); this._events.set(IncomingHeader.FURNITURE_STATE, FurnitureStateEvent); this._events.set(IncomingHeader.ITEM_DIMMER_SETTINGS, RoomDimmerPresetsEvent); - this._events.set(IncomingHeader.FURNITURE_STATE_2, FurnitureState2Event); + this._events.set(IncomingHeader.FURNITURE_STATE_2, DiceValueMessageEvent); this._events.set(IncomingHeader.LOVELOCK_FURNI_FINISHED, LoveLockFurniFinishedEvent); this._events.set(IncomingHeader.LOVELOCK_FURNI_FRIEND_COMFIRMED, LoveLockFurniFriendConfirmedEvent); this._events.set(IncomingHeader.LOVELOCK_FURNI_START, LoveLockFurniStartEvent); diff --git a/src/nitro/communication/messages/incoming/room/furniture/FurnitureState2Event.ts b/src/nitro/communication/messages/incoming/room/furniture/DiceValueMessageEvent.ts similarity index 85% rename from src/nitro/communication/messages/incoming/room/furniture/FurnitureState2Event.ts rename to src/nitro/communication/messages/incoming/room/furniture/DiceValueMessageEvent.ts index 799edab6..4b331398 100644 --- a/src/nitro/communication/messages/incoming/room/furniture/FurnitureState2Event.ts +++ b/src/nitro/communication/messages/incoming/room/furniture/DiceValueMessageEvent.ts @@ -2,7 +2,7 @@ import { IMessageEvent } from '../../../../../../core/communication/messages/IMe import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; import { FurnitureState2Parser } from '../../../parser/room/furniture/FurnitureState2Parser'; -export class FurnitureState2Event extends MessageEvent implements IMessageEvent +export class DiceValueMessageEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { diff --git a/src/nitro/communication/messages/incoming/room/furniture/index.ts b/src/nitro/communication/messages/incoming/room/furniture/index.ts index 83bfaddb..be7d5cb1 100644 --- a/src/nitro/communication/messages/incoming/room/furniture/index.ts +++ b/src/nitro/communication/messages/incoming/room/furniture/index.ts @@ -1,10 +1,10 @@ +export * from './DiceValueMessageEvent'; export * from './floor'; export * from './FurnitureAliasesEvent'; export * from './FurnitureDataEvent'; export * from './FurnitureItemDataEvent'; export * from './FurniturePostItStickyPoleOpenEvent'; export * from './FurnitureStackHeightEvent'; -export * from './FurnitureState2Event'; export * from './FurnitureStateEvent'; export * from './GroupFurniContextMenuInfoMessageEvent'; export * from './LoveLockFurniFinishedEvent'; diff --git a/src/nitro/room/RoomMessageHandler.ts b/src/nitro/room/RoomMessageHandler.ts index 6c81e86a..d7477081 100644 --- a/src/nitro/room/RoomMessageHandler.ts +++ b/src/nitro/room/RoomMessageHandler.ts @@ -5,6 +5,7 @@ import { Vector3d } from '../../room/utils/Vector3d'; import { PetType } from '../avatar/pets/PetType'; import { ObjectsDataUpdateEvent, PetExperienceEvent } from '../communication'; import { ObjectsRollingEvent } from '../communication/messages/incoming/room/engine/ObjectsRollingEvent'; +import { DiceValueMessageEvent } from '../communication/messages/incoming/room/furniture/DiceValueMessageEvent'; import { FurnitureFloorAddEvent } from '../communication/messages/incoming/room/furniture/floor/FurnitureFloorAddEvent'; import { FurnitureFloorEvent } from '../communication/messages/incoming/room/furniture/floor/FurnitureFloorEvent'; import { FurnitureFloorRemoveEvent } from '../communication/messages/incoming/room/furniture/floor/FurnitureFloorRemoveEvent'; @@ -12,7 +13,6 @@ import { FurnitureFloorUpdateEvent } from '../communication/messages/incoming/ro import { FurnitureAliasesEvent } from '../communication/messages/incoming/room/furniture/FurnitureAliasesEvent'; import { FurnitureDataEvent } from '../communication/messages/incoming/room/furniture/FurnitureDataEvent'; import { FurnitureItemDataEvent } from '../communication/messages/incoming/room/furniture/FurnitureItemDataEvent'; -import { FurnitureState2Event } from '../communication/messages/incoming/room/furniture/FurnitureState2Event'; import { FurnitureStateEvent } from '../communication/messages/incoming/room/furniture/FurnitureStateEvent'; import { FurnitureWallAddEvent } from '../communication/messages/incoming/room/furniture/wall/FurnitureWallAddEvent'; import { FurnitureWallEvent } from '../communication/messages/incoming/room/furniture/wall/FurnitureWallEvent'; @@ -144,7 +144,7 @@ export class RoomMessageHandler extends Disposable this._connection.addMessageEvent(new PetFigureUpdateEvent(this.onPetFigureUpdateEvent.bind(this))); this._connection.addMessageEvent(new PetExperienceEvent(this.onPetExperienceEvent.bind(this))); this._connection.addMessageEvent(new YouArePlayingGameEvent(this.onYouArePlayingGameEvent.bind(this))); - this._connection.addMessageEvent(new FurnitureState2Event(this.onFurnitureState2Event.bind(this))); + this._connection.addMessageEvent(new DiceValueMessageEvent(this.onDiceValueMessageEvent.bind(this))); this._connection.addMessageEvent(new IgnoreResultEvent(this.onIgnoreResultEvent.bind(this))); } @@ -645,9 +645,9 @@ export class RoomMessageHandler extends Disposable this._roomCreator.updateRoomObjectFloor(this._currentRoomId, parser.itemId, null, null, parser.state, new LegacyDataType()); } - private onFurnitureState2Event(event: FurnitureState2Event): void + private onDiceValueMessageEvent(event: DiceValueMessageEvent): void { - if(!(event instanceof FurnitureState2Event) || !event.connection || !this._roomCreator) return; + if(!(event instanceof DiceValueMessageEvent) || !event.connection || !this._roomCreator) return; const parser = event.getParser(); From 595f39f9bf301986585b6c7ceacc99bc7a9410a1 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 20 Oct 2021 01:19:43 -0400 Subject: [PATCH 057/108] Update color converter --- src/room/utils/ColorConverter.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/room/utils/ColorConverter.ts b/src/room/utils/ColorConverter.ts index 2c86a4dd..88c80b68 100644 --- a/src/room/utils/ColorConverter.ts +++ b/src/room/utils/ColorConverter.ts @@ -14,11 +14,26 @@ export class ColorConverter return out; } + public static hex2rgba(hex: number, out: Array | Float32Array = []): Array | Float32Array + { + out[0] = ((hex >> 16) & 0xFF) / 255; + out[1] = ((hex >> 8) & 0xFF) / 255; + out[2] = (hex & 0xFF) / 255; + out[3] = (hex & 0xFF); + + return out; + } + public static rgb2hex(rgb: number[] | Float32Array): number { return (((rgb[0] * 255) << 16) + ((rgb[1] * 255) << 8) + (rgb[2] * 255 | 0)); } + public static rgba2hex(rgb: number[] | Float32Array): number + { + return (((rgb[0] * 255) << 16) + ((rgb[1] * 255) << 8) + (rgb[2] * 255 | 0) + (rgb[3] | 0)); + } + public static rgbStringToHex(rgb: string): string { const extracted = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); From 01ac63c96457bf7e8206f191ca688738c031ff08 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 20 Oct 2021 14:53:45 -0500 Subject: [PATCH 058/108] added outgoing mod tool packets --- src/nitro/communication/NitroMessages.ts | 51 +++++++++++-------- .../messages/outgoing/OutgoingHeader.ts | 8 +++ .../CloseIssueDefaultActionMessageComposer.ts | 21 ++++++++ .../modtool/CloseIssuesMessageComposer.ts | 22 ++++++++ .../modtool/DefaultSanctionMessageComposer.ts | 26 ++++++++++ .../modtool/GetCfhChatlogMessageComposer.ts | 22 ++++++++ ...=> GetModeratorRoomInfoMessageComposer.ts} | 4 +- ...=> GetModeratorUserInfoMessageComposer.ts} | 4 +- ...er.ts => GetRoomChatlogMessageComposer.ts} | 4 +- ...ser.ts => GetRoomVisitsMessageComposer.ts} | 4 +- ...er.ts => GetUserChatlogMessageComposer.ts} | 4 +- ...Composer.ts => ModAlertMessageComposer.ts} | 11 ++-- ...anComposer.ts => ModBanMessageComposer.ts} | 14 +++-- ...kComposer.ts => ModKickMessageComposer.ts} | 12 ++--- .../modtool/ModMessageMessageComposer.ts | 3 +- ...tComposer.ts => ModMuteMessageComposer.ts} | 11 ++-- .../modtool/ModToolPreferencesComposer.ts | 21 ++++++++ .../modtool/ModToolSanctionComposer.ts | 21 ++++++++ ...er.ts => ModTradingLockMessageComposer.ts} | 13 +++-- .../modtool/PickIssuesMessageComposer.ts | 21 ++++++++ .../modtool/ReleaseIssuesMessageComposer.ts | 21 ++++++++ .../messages/outgoing/modtool/index.ts | 28 ++++++---- .../parser/modtool/utils/IssueMessageData.ts | 3 +- 23 files changed, 273 insertions(+), 76 deletions(-) create mode 100644 src/nitro/communication/messages/outgoing/modtool/CloseIssueDefaultActionMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/modtool/CloseIssuesMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/modtool/DefaultSanctionMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/modtool/GetCfhChatlogMessageComposer.ts rename src/nitro/communication/messages/outgoing/modtool/{ModtoolRequestRoomInfoComposer.ts => GetModeratorRoomInfoMessageComposer.ts} (56%) rename src/nitro/communication/messages/outgoing/modtool/{ModtoolRequestUserChatlogComposer.ts => GetModeratorUserInfoMessageComposer.ts} (56%) rename src/nitro/communication/messages/outgoing/modtool/{ModtoolRequestRoomChatlogComposer.ts => GetRoomChatlogMessageComposer.ts} (59%) rename src/nitro/communication/messages/outgoing/modtool/{ModtoolRequestUserRoomsComposer.ts => GetRoomVisitsMessageComposer.ts} (57%) rename src/nitro/communication/messages/outgoing/modtool/{ModtoolRequestUserInfoComposer.ts => GetUserChatlogMessageComposer.ts} (58%) rename src/nitro/communication/messages/outgoing/modtool/{ModtoolSanctionMuteComposer.ts => ModAlertMessageComposer.ts} (51%) rename src/nitro/communication/messages/outgoing/modtool/{ModtoolSanctionBanComposer.ts => ModBanMessageComposer.ts} (54%) rename src/nitro/communication/messages/outgoing/modtool/{ModtoolSanctionKickComposer.ts => ModKickMessageComposer.ts} (52%) rename src/nitro/communication/messages/outgoing/modtool/{ModtoolSanctionAlertComposer.ts => ModMuteMessageComposer.ts} (53%) create mode 100644 src/nitro/communication/messages/outgoing/modtool/ModToolPreferencesComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/modtool/ModToolSanctionComposer.ts rename src/nitro/communication/messages/outgoing/modtool/{ModtoolSanctionTradelockComposer.ts => ModTradingLockMessageComposer.ts} (50%) create mode 100644 src/nitro/communication/messages/outgoing/modtool/PickIssuesMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/modtool/ReleaseIssuesMessageComposer.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 1cc0ec94..b2b6c1a7 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -322,19 +322,20 @@ import { TradingOpenComposer } from './messages/outgoing/inventory/trading/Tradi import { TradingUnacceptComposer } from './messages/outgoing/inventory/trading/TradingUnacceptComposer'; import { GetPromoArticlesComposer } from './messages/outgoing/landingview/GetPromoArticlesComposer'; import { CommunityGoalVoteMessageComposer } from './messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer'; +import { DefaultSanctionMessageComposer } from './messages/outgoing/modtool/DefaultSanctionMessageComposer'; +import { GetModeratorRoomInfoMessageComposer } from './messages/outgoing/modtool/GetModeratorRoomInfoMessageComposer'; +import { GetModeratorUserInfoMessageComposer } from './messages/outgoing/modtool/GetModeratorUserInfoMessageComposer'; +import { GetRoomChatlogMessageComposer } from './messages/outgoing/modtool/GetRoomChatlogMessageComposer'; +import { GetRoomVisitsMessageComposer } from './messages/outgoing/modtool/GetRoomVisitsMessageComposer'; +import { GetUserChatlogMessageComposer } from './messages/outgoing/modtool/GetUserChatlogMessageComposer'; +import { ModAlertMessageComposer } from './messages/outgoing/modtool/ModAlertMessageComposer'; +import { ModBanMessageComposer } from './messages/outgoing/modtool/ModBanMessageComposer'; import { ModerateRoomMessageComposer } from './messages/outgoing/modtool/ModerateRoomMessageComposer'; import { ModeratorActionMessageComposer } from './messages/outgoing/modtool/ModeratorActionMessageComposer'; +import { ModKickMessageComposer } from './messages/outgoing/modtool/ModKickMessageComposer'; import { ModMessageMessageComposer } from './messages/outgoing/modtool/ModMessageMessageComposer'; -import { ModtoolRequestRoomChatlogComposer } from './messages/outgoing/modtool/ModtoolRequestRoomChatlogComposer'; -import { ModtoolRequestRoomInfoComposer } from './messages/outgoing/modtool/ModtoolRequestRoomInfoComposer'; -import { ModtoolRequestUserChatlogComposer } from './messages/outgoing/modtool/ModtoolRequestUserChatlogComposer'; -import { ModtoolRequestUserInfoComposer } from './messages/outgoing/modtool/ModtoolRequestUserInfoComposer'; -import { ModtoolRequestUserRoomsComposer } from './messages/outgoing/modtool/ModtoolRequestUserRoomsComposer'; -import { ModtoolSanctionAlertComposer } from './messages/outgoing/modtool/ModtoolSanctionAlertComposer'; -import { ModtoolSanctionBanComposer } from './messages/outgoing/modtool/ModtoolSanctionBanComposer'; -import { ModtoolSanctionKickComposer } from './messages/outgoing/modtool/ModtoolSanctionKickComposer'; -import { ModtoolSanctionMuteComposer } from './messages/outgoing/modtool/ModtoolSanctionMuteComposer'; -import { ModtoolSanctionTradelockComposer } from './messages/outgoing/modtool/ModtoolSanctionTradelockComposer'; +import { ModMuteMessageComposer } from './messages/outgoing/modtool/ModMuteMessageComposer'; +import { ModTradingLockMessageComposer } from './messages/outgoing/modtool/ModTradingLockMessageComposer'; import { ConvertGlobalRoomIdMessageComposer } from './messages/outgoing/navigator/ConvertGlobalRoomIdComposer'; import { NavigatorCategoriesComposer } from './messages/outgoing/navigator/NavigatorCategoriesComposer'; import { NavigatorCategoryListModeComposer } from './messages/outgoing/navigator/NavigatorCategoryListModeComposer'; @@ -1219,19 +1220,27 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.USER_SUBSCRIPTION, UserSubscriptionComposer); // MODTOOL - this._composers.set(OutgoingHeader.MODTOOL_REQUEST_ROOM_INFO, ModtoolRequestRoomInfoComposer); + this._composers.set(OutgoingHeader.MODTOOL_REQUEST_ROOM_INFO, GetModeratorRoomInfoMessageComposer); this._composers.set(OutgoingHeader.MODTOOL_CHANGE_ROOM_SETTINGS, ModerateRoomMessageComposer); - this._composers.set(OutgoingHeader.MODTOOL_REQUEST_USER_CHATLOG, ModtoolRequestUserChatlogComposer); - this._composers.set(OutgoingHeader.MODTOOL_REQUEST_ROOM_CHATLOG, ModtoolRequestRoomChatlogComposer); - this._composers.set(OutgoingHeader.MOD_TOOL_USER_INFO, ModtoolRequestUserInfoComposer); - this._composers.set(OutgoingHeader.MODTOOL_SANCTION_ALERT, ModtoolSanctionAlertComposer); - this._composers.set(OutgoingHeader.MODTOOL_SANCTION_BAN, ModtoolSanctionBanComposer); - this._composers.set(OutgoingHeader.MODTOOL_SANCTION_KICK, ModtoolSanctionKickComposer); - this._composers.set(OutgoingHeader.MODTOOL_SANCTION_TRADELOCK, ModtoolSanctionTradelockComposer); + this._composers.set(OutgoingHeader.MODTOOL_REQUEST_USER_CHATLOG, GetUserChatlogMessageComposer); + this._composers.set(OutgoingHeader.MODTOOL_REQUEST_ROOM_CHATLOG, GetRoomChatlogMessageComposer); + this._composers.set(OutgoingHeader.MOD_TOOL_USER_INFO, GetModeratorUserInfoMessageComposer); + this._composers.set(OutgoingHeader.MODTOOL_SANCTION_ALERT, ModAlertMessageComposer); + this._composers.set(OutgoingHeader.MODTOOL_SANCTION_BAN, ModBanMessageComposer); + this._composers.set(OutgoingHeader.MODTOOL_SANCTION_KICK, ModKickMessageComposer); + this._composers.set(OutgoingHeader.MODTOOL_SANCTION_TRADELOCK, ModTradingLockMessageComposer); this._composers.set(OutgoingHeader.MODTOOL_ALERTEVENT, ModMessageMessageComposer); - this._composers.set(OutgoingHeader.MODTOOL_SANCTION_MUTE, ModtoolSanctionMuteComposer); - this._composers.set(OutgoingHeader.MODTOOL_REQUEST_USER_ROOMS, ModtoolRequestUserRoomsComposer); + this._composers.set(OutgoingHeader.MODTOOL_SANCTION_MUTE, ModMuteMessageComposer); + this._composers.set(OutgoingHeader.MODTOOL_REQUEST_USER_ROOMS, GetRoomVisitsMessageComposer); this._composers.set(OutgoingHeader.MODTOOL_ROOM_ALERT, ModeratorActionMessageComposer); + this._composers.set(OutgoingHeader.CLOSE_ISSUE_DEFAULT_ACTION, CloseIssueDefaultActionMessageComposer); + this._composers.set(OutgoingHeader.CLOSE_ISSUES, CloseIssuesMessageComposer); + this._composers.set(OutgoingHeader.DEFAULT_SANCTION, DefaultSanctionMessageComposer); + this._composers.set(OutgoingHeader.GET_CFH_CHATLOG, GetCfhChatlogMessageComposer); + this._composers.set(OutgoingHeader.MODTOOL_PREFERENCES, ModToolPreferencesComposer); + this._composers.set(OutgoingHeader.MODTOOL_SANCTION, ModToolSanctionComposer); + this._composers.set(OutgoingHeader.PICK_ISSUES, PickIssuesMessageComposer); + this._composers.set(OutgoingHeader.RELEASE_ISSUES, ReleaseIssuesMessageComposer); // SETTINGS this._composers.set(OutgoingHeader.USER_SETTINGS_CAMERA, UserSettingsCameraFollowComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 4a753d5d..87de70dd 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -229,6 +229,14 @@ export class OutgoingHeader public static MODTOOL_SANCTION_MUTE = 1945; public static MODTOOL_REQUEST_USER_ROOMS = 3526; public static MODTOOL_ROOM_ALERT = 3842; + public static MODTOOL_PREFERENCES = 31; + public static CLOSE_ISSUE_DEFAULT_ACTION = 2717; + public static CLOSE_ISSUES = 2067; + public static DEFAULT_SANCTION = 1681; + public static GET_CFH_CHATLOG = 211; + public static MODTOOL_SANCTION = 1392; + public static PICK_ISSUES = 15; + public static RELEASE_ISSUES = 1572; public static CONVERT_GLOBAL_ROOM_ID = 314; public static REQUEST_SELL_ITEM = 848; public static REQUEST_MARKETPLACE_ITEM_STATS = 3288; diff --git a/src/nitro/communication/messages/outgoing/modtool/CloseIssueDefaultActionMessageComposer.ts b/src/nitro/communication/messages/outgoing/modtool/CloseIssueDefaultActionMessageComposer.ts new file mode 100644 index 00000000..33f481e5 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/modtool/CloseIssueDefaultActionMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class CloseIssueDefaultActionMessageComposer implements IMessageComposer +{ + private _data: number[]; + + constructor(k: number, issueIds: number[], _arg_2: number) + { + this._data = [ k, issueIds.length, ...issueIds, _arg_2 ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/modtool/CloseIssuesMessageComposer.ts b/src/nitro/communication/messages/outgoing/modtool/CloseIssuesMessageComposer.ts new file mode 100644 index 00000000..c707dd56 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/modtool/CloseIssuesMessageComposer.ts @@ -0,0 +1,22 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + + +export class CloseIssuesMessageComposer implements IMessageComposer +{ + private _data: number[]; + + constructor(issueIds: number[], _arg_2: number) + { + this._data = [ _arg_2, issueIds.length, ...issueIds]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/modtool/DefaultSanctionMessageComposer.ts b/src/nitro/communication/messages/outgoing/modtool/DefaultSanctionMessageComposer.ts new file mode 100644 index 00000000..dee107e6 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/modtool/DefaultSanctionMessageComposer.ts @@ -0,0 +1,26 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; +import { ModBanMessageComposer } from './ModBanMessageComposer'; + +export class DefaultSanctionMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:number, _arg_3:string, _arg_4:number = -1) + { + this._data = [k, _arg_2, _arg_3]; + if(_arg_4 != ModBanMessageComposer.NO_ISSUE_ID) + { + this._data.push(_arg_4); + } + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/modtool/GetCfhChatlogMessageComposer.ts b/src/nitro/communication/messages/outgoing/modtool/GetCfhChatlogMessageComposer.ts new file mode 100644 index 00000000..ad124466 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/modtool/GetCfhChatlogMessageComposer.ts @@ -0,0 +1,22 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + + +export class GetCfhChatlogMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolRequestRoomInfoComposer.ts b/src/nitro/communication/messages/outgoing/modtool/GetModeratorRoomInfoMessageComposer.ts similarity index 56% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolRequestRoomInfoComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/GetModeratorRoomInfoMessageComposer.ts index 1dbd40d0..e6d04fb4 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolRequestRoomInfoComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/GetModeratorRoomInfoMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ModtoolRequestRoomInfoComposer implements IMessageComposer> +export class GetModeratorRoomInfoMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(roomId: number) { diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolRequestUserChatlogComposer.ts b/src/nitro/communication/messages/outgoing/modtool/GetModeratorUserInfoMessageComposer.ts similarity index 56% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolRequestUserChatlogComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/GetModeratorUserInfoMessageComposer.ts index b1634684..631ddcd6 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolRequestUserChatlogComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/GetModeratorUserInfoMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ModtoolRequestUserChatlogComposer implements IMessageComposer> +export class GetModeratorUserInfoMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(userId: number) { diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolRequestRoomChatlogComposer.ts b/src/nitro/communication/messages/outgoing/modtool/GetRoomChatlogMessageComposer.ts similarity index 59% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolRequestRoomChatlogComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/GetRoomChatlogMessageComposer.ts index 3a87a54e..94fea2e7 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolRequestRoomChatlogComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/GetRoomChatlogMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ModtoolRequestRoomChatlogComposer implements IMessageComposer> +export class GetRoomChatlogMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(roomId: number, useless: number = 0) { diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolRequestUserRoomsComposer.ts b/src/nitro/communication/messages/outgoing/modtool/GetRoomVisitsMessageComposer.ts similarity index 57% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolRequestUserRoomsComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/GetRoomVisitsMessageComposer.ts index ed99c4cc..f4719fa4 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolRequestUserRoomsComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/GetRoomVisitsMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ModtoolRequestUserRoomsComposer implements IMessageComposer> +export class GetRoomVisitsMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(k: number) { diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolRequestUserInfoComposer.ts b/src/nitro/communication/messages/outgoing/modtool/GetUserChatlogMessageComposer.ts similarity index 58% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolRequestUserInfoComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/GetUserChatlogMessageComposer.ts index c29f16fb..015c32ff 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolRequestUserInfoComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/GetUserChatlogMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ModtoolRequestUserInfoComposer implements IMessageComposer> +export class GetUserChatlogMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(userId: number) { diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionMuteComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ModAlertMessageComposer.ts similarity index 51% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionMuteComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/ModAlertMessageComposer.ts index b6a67e69..0bbb1b35 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionMuteComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/ModAlertMessageComposer.ts @@ -1,15 +1,14 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; +import { ModBanMessageComposer } from './ModBanMessageComposer'; -export class ModtoolSanctionMuteComposer implements IMessageComposer +export class ModAlertMessageComposer implements IMessageComposer> { - private _data: any[] = []; + private _data: ConstructorParameters; constructor(k: number, arg2: string, arg3: number, arg4: number = -1) { - this._data.push(k); - this._data.push(arg2); - this._data.push(arg3); - if(arg4 != -1) + this._data = [k, arg2, arg3]; + if(arg4 != ModBanMessageComposer.NO_ISSUE_ID) { this._data.push(arg4); } diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionBanComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ModBanMessageComposer.ts similarity index 54% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionBanComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/ModBanMessageComposer.ts index 9e0b50cb..2340e70b 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionBanComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/ModBanMessageComposer.ts @@ -1,17 +1,15 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ModtoolSanctionBanComposer implements IMessageComposer +export class ModBanMessageComposer implements IMessageComposer> { - private _data: any[] = []; + public static readonly NO_ISSUE_ID = -1; + + private _data: ConstructorParameters; constructor(k: number, arg2: string, arg3: number, arg4: number, arg5: boolean, arg6: number = -1) { - this._data.push(k); - this._data.push(arg2); - this._data.push(arg3); - this._data.push(arg4); - this._data.push(arg5); - if(arg6 != -1) + this._data = [k, arg2, arg3, arg4, arg5]; + if(arg6 != ModBanMessageComposer.NO_ISSUE_ID) { this._data.push(arg6); } diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionKickComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ModKickMessageComposer.ts similarity index 52% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionKickComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/ModKickMessageComposer.ts index 1b5bd86d..bdb77231 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionKickComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/ModKickMessageComposer.ts @@ -1,15 +1,15 @@ +import { ModBanMessageComposer } from '..'; import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ModtoolSanctionKickComposer implements IMessageComposer +export class ModKickMessageComposer implements IMessageComposer> { - private _data: any[] = []; + private _data: ConstructorParameters; constructor(k: number, arg2: string, arg3: number, arg4: number = -1) { - this._data.push(k); - this._data.push(arg2); - this._data.push(arg3); - if(arg4 != -1) + this._data = [k, arg2, arg3]; + + if(arg4 != ModBanMessageComposer.NO_ISSUE_ID) { this._data.push(arg4); } diff --git a/src/nitro/communication/messages/outgoing/modtool/ModMessageMessageComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ModMessageMessageComposer.ts index b4a5f2e4..154bc350 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModMessageMessageComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/ModMessageMessageComposer.ts @@ -1,4 +1,5 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; +import { ModBanMessageComposer } from './ModBanMessageComposer'; export class ModMessageMessageComposer implements IMessageComposer { @@ -11,7 +12,7 @@ export class ModMessageMessageComposer implements IMessageComposer this._data.push(''); this._data.push(''); this._data.push(arg3); - if(arg4 != -1) + if(arg4 != ModBanMessageComposer.NO_ISSUE_ID) { this._data.push(arg4); } diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionAlertComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ModMuteMessageComposer.ts similarity index 53% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionAlertComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/ModMuteMessageComposer.ts index 0bb5ee24..b60c1b0a 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionAlertComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/ModMuteMessageComposer.ts @@ -1,15 +1,14 @@ +import { ModBanMessageComposer } from '.'; import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ModtoolSanctionAlertComposer implements IMessageComposer +export class ModMuteMessageComposer implements IMessageComposer> { - private _data: any[] = []; + private _data: ConstructorParameters; constructor(k: number, arg2: string, arg3: number, arg4: number = -1) { - this._data.push(k); - this._data.push(arg2); - this._data.push(arg3); - if(arg4 != -1) + this._data = [k, arg2, arg3]; + if(arg4 != ModBanMessageComposer.NO_ISSUE_ID) { this._data.push(arg4); } diff --git a/src/nitro/communication/messages/outgoing/modtool/ModToolPreferencesComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ModToolPreferencesComposer.ts new file mode 100644 index 00000000..4adfc84d --- /dev/null +++ b/src/nitro/communication/messages/outgoing/modtool/ModToolPreferencesComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class ModToolPreferencesComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:number, _arg_3:number, _arg_4:number) + { + this._data = [k, _arg_2, _arg_3, _arg_4]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/modtool/ModToolSanctionComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ModToolSanctionComposer.ts new file mode 100644 index 00000000..efc2d781 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/modtool/ModToolSanctionComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class ModToolSanctionComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:number, _arg_3:number) + { + this._data = [k, _arg_2, _arg_3]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionTradelockComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ModTradingLockMessageComposer.ts similarity index 50% rename from src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionTradelockComposer.ts rename to src/nitro/communication/messages/outgoing/modtool/ModTradingLockMessageComposer.ts index bf7c0616..12ecfd43 100644 --- a/src/nitro/communication/messages/outgoing/modtool/ModtoolSanctionTradelockComposer.ts +++ b/src/nitro/communication/messages/outgoing/modtool/ModTradingLockMessageComposer.ts @@ -1,16 +1,15 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; +import { ModBanMessageComposer } from './ModBanMessageComposer'; -export class ModtoolSanctionTradelockComposer implements IMessageComposer +export class ModTradingLockMessageComposer implements IMessageComposer> { - private _data: any[] = []; + private _data: ConstructorParameters; constructor(k: number, arg2: string, arg3: number, arg4: number, arg5: number = -1) { - this._data.push(k); - this._data.push(arg2); - this._data.push(arg3); - this._data.push(arg4); - if(arg5 != -1) + this._data = [ k, arg2, arg3, arg4 ]; + + if(arg5 != ModBanMessageComposer.NO_ISSUE_ID) { this._data.push(arg5); } diff --git a/src/nitro/communication/messages/outgoing/modtool/PickIssuesMessageComposer.ts b/src/nitro/communication/messages/outgoing/modtool/PickIssuesMessageComposer.ts new file mode 100644 index 00000000..b731b870 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/modtool/PickIssuesMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class PickIssuesMessageComposer implements IMessageComposer +{ + private _data: any; + + constructor(k:number[], _arg_2:boolean, _arg_3:number, _arg_4:string) + { + this._data = [k.length, ...k, _arg_2, _arg_3, _arg_4]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/modtool/ReleaseIssuesMessageComposer.ts b/src/nitro/communication/messages/outgoing/modtool/ReleaseIssuesMessageComposer.ts new file mode 100644 index 00000000..272ef328 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/modtool/ReleaseIssuesMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class ReleaseIssuesMessageComposer implements IMessageComposer +{ + private _data: number[]; + + constructor(k: number[]) + { + this._data = [k.length, ...k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/modtool/index.ts b/src/nitro/communication/messages/outgoing/modtool/index.ts index cc9df88f..6f357620 100644 --- a/src/nitro/communication/messages/outgoing/modtool/index.ts +++ b/src/nitro/communication/messages/outgoing/modtool/index.ts @@ -1,13 +1,21 @@ +export * from './CloseIssueDefaultActionMessageComposer'; +export * from './CloseIssuesMessageComposer'; +export * from './DefaultSanctionMessageComposer'; +export * from './GetCfhChatlogMessageComposer'; +export * from './GetModeratorRoomInfoMessageComposer'; +export * from './GetModeratorUserInfoMessageComposer'; +export * from './GetRoomChatlogMessageComposer'; +export * from './GetRoomVisitsMessageComposer'; +export * from './GetUserChatlogMessageComposer'; +export * from './ModAlertMessageComposer'; +export * from './ModBanMessageComposer'; export * from './ModerateRoomMessageComposer'; export * from './ModeratorActionMessageComposer'; +export * from './ModKickMessageComposer'; export * from './ModMessageMessageComposer'; -export * from './ModtoolRequestRoomChatlogComposer'; -export * from './ModtoolRequestRoomInfoComposer'; -export * from './ModtoolRequestUserChatlogComposer'; -export * from './ModtoolRequestUserInfoComposer'; -export * from './ModtoolRequestUserRoomsComposer'; -export * from './ModtoolSanctionAlertComposer'; -export * from './ModtoolSanctionBanComposer'; -export * from './ModtoolSanctionKickComposer'; -export * from './ModtoolSanctionMuteComposer'; -export * from './ModtoolSanctionTradelockComposer'; +export * from './ModMuteMessageComposer'; +export * from './ModToolPreferencesComposer'; +export * from './ModToolSanctionComposer'; +export * from './ModTradingLockMessageComposer'; +export * from './PickIssuesMessageComposer'; +export * from './ReleaseIssuesMessageComposer'; diff --git a/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts b/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts index a779a5ef..54277789 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts @@ -1,3 +1,4 @@ +import { Nitro } from '../../../../../Nitro'; import { PatternMatchData } from './PatternMatchData'; export class IssueMessageData @@ -43,7 +44,7 @@ export class IssueMessageData this._message = _arg_14; this._chatRecordId = _arg_15; this._patterns = _arg_16; - this._creationTimeInMilliseconds = 0; //getTimer(); + this._creationTimeInMilliseconds = Nitro.instance.time; //getTimer() } public get issueId(): number From bfb5684436249e5bbfe8be656a7073af94cb9ccc Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 20 Oct 2021 15:31:56 -0500 Subject: [PATCH 059/108] moved packets around --- src/nitro/communication/NitroMessages.ts | 37 +++++++-------- .../incoming/moderation/CfhChatlogData.ts | 45 +++++++++++++++++++ .../ModeratorInitMessageEvent.ts | 2 +- .../ModtoolCallForHelpTopicsEvent.ts | 2 +- .../ModtoolReceivedRoomsUserEvent.ts | 2 +- .../ModtoolRoomChatlogEvent.ts | 2 +- .../ModtoolRoomInfoEvent.ts | 2 +- .../ModtoolUserChatlogEvent.ts | 2 +- .../ModtoolUserInfoEvent.ts | 2 +- .../messages/incoming/moderation/index.ts | 8 ++++ .../messages/incoming/modtool/index.ts | 7 --- .../communication/messages/outgoing/index.ts | 2 +- .../CloseIssueDefaultActionMessageComposer.ts | 0 .../CloseIssuesMessageComposer.ts | 0 .../DefaultSanctionMessageComposer.ts | 0 .../GetCfhChatlogMessageComposer.ts | 0 .../GetModeratorRoomInfoMessageComposer.ts | 0 .../GetModeratorUserInfoMessageComposer.ts | 0 .../GetRoomChatlogMessageComposer.ts | 0 .../GetRoomVisitsMessageComposer.ts | 0 .../GetUserChatlogMessageComposer.ts | 0 .../ModAlertMessageComposer.ts | 0 .../ModBanMessageComposer.ts | 0 .../ModKickMessageComposer.ts | 0 .../ModMessageMessageComposer.ts | 0 .../ModMuteMessageComposer.ts | 0 .../ModToolPreferencesComposer.ts | 0 .../ModToolSanctionComposer.ts | 0 .../ModTradingLockMessageComposer.ts | 0 .../ModerateRoomMessageComposer.ts | 0 .../ModeratorActionMessageComposer.ts | 0 .../PickIssuesMessageComposer.ts | 0 .../ReleaseIssuesMessageComposer.ts | 0 .../outgoing/{modtool => moderation}/index.ts | 0 .../ModeratorInitMessageParser.ts | 0 .../ModtoolCFHTopicsParser.ts | 0 .../ModtoolRoomChatlogParser.ts | 0 .../ModtoolRoomInfoParser.ts | 0 .../ModtoolRoomUsersParser.ts | 0 .../ModtoolUserChatlogParser.ts | 0 .../ModtoolUserInfoParser.ts | 0 .../messages/parser/moderation/index.ts | 8 ++++ .../utils/CallForHelpCategoryData.ts | 0 .../utils/ChatRecordData.ts | 0 .../{modtool => moderation}/utils/IChatlog.ts | 0 .../utils/IssueInfoMessageParser.ts | 0 .../utils/IssueMessageData.ts | 0 .../utils/ModeratorInitData.ts | 0 .../utils/ModeratorUserInfoData.ts | 0 .../utils/ModtoolRoomChatlogLine.ts | 0 .../utils/ModtoolRoomVisitedData.ts | 0 .../utils/ModtoolUserChatlogParserChatlog.ts | 0 .../utils/ModtoolUserChatlogParserVisit.ts | 0 .../utils/PatternMatchData.ts | 0 .../utils/RoomVisitData.ts | 0 .../{modtool => moderation}/utils/index.ts | 0 .../messages/parser/modtool/index.ts | 8 ---- 57 files changed, 84 insertions(+), 45 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts rename src/nitro/communication/messages/incoming/{modtool => moderation}/ModeratorInitMessageEvent.ts (83%) rename src/nitro/communication/messages/incoming/{modtool => moderation}/ModtoolCallForHelpTopicsEvent.ts (84%) rename src/nitro/communication/messages/incoming/{modtool => moderation}/ModtoolReceivedRoomsUserEvent.ts (84%) rename src/nitro/communication/messages/incoming/{modtool => moderation}/ModtoolRoomChatlogEvent.ts (83%) rename src/nitro/communication/messages/incoming/{modtool => moderation}/ModtoolRoomInfoEvent.ts (84%) rename src/nitro/communication/messages/incoming/{modtool => moderation}/ModtoolUserChatlogEvent.ts (83%) rename src/nitro/communication/messages/incoming/{modtool => moderation}/ModtoolUserInfoEvent.ts (84%) delete mode 100644 src/nitro/communication/messages/incoming/modtool/index.ts rename src/nitro/communication/messages/outgoing/{modtool => moderation}/CloseIssueDefaultActionMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/CloseIssuesMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/DefaultSanctionMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/GetCfhChatlogMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/GetModeratorRoomInfoMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/GetModeratorUserInfoMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/GetRoomChatlogMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/GetRoomVisitsMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/GetUserChatlogMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/ModAlertMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/ModBanMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/ModKickMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/ModMessageMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/ModMuteMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/ModToolPreferencesComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/ModToolSanctionComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/ModTradingLockMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/ModerateRoomMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/ModeratorActionMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/PickIssuesMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/ReleaseIssuesMessageComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{modtool => moderation}/index.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/ModeratorInitMessageParser.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/ModtoolCFHTopicsParser.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/ModtoolRoomChatlogParser.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/ModtoolRoomInfoParser.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/ModtoolRoomUsersParser.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/ModtoolUserChatlogParser.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/ModtoolUserInfoParser.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/CallForHelpCategoryData.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/ChatRecordData.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/IChatlog.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/IssueInfoMessageParser.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/IssueMessageData.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/ModeratorInitData.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/ModeratorUserInfoData.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/ModtoolRoomChatlogLine.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/ModtoolRoomVisitedData.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/ModtoolUserChatlogParserChatlog.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/ModtoolUserChatlogParserVisit.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/PatternMatchData.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/RoomVisitData.ts (100%) rename src/nitro/communication/messages/parser/{modtool => moderation}/utils/index.ts (100%) delete mode 100644 src/nitro/communication/messages/parser/modtool/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index f35011ce..383843c0 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -90,15 +90,8 @@ import { MarketplaceItemStatsEvent } from './messages/incoming/marketplace/Marke import { MarketplaceMakeOfferResult } from './messages/incoming/marketplace/MarketplaceMakeOfferResult'; import { MarketPlaceOffersEvent } from './messages/incoming/marketplace/MarketplaceOffersEvent'; import { MarketplaceOwnOffersEvent } from './messages/incoming/marketplace/MarketplaceOwnOffersEvent'; -import { UserBannedMessageEvent } from './messages/incoming/moderation'; +import { ModeratorInitMessageEvent, ModtoolCallForHelpTopicsEvent, ModtoolReceivedRoomsUserEvent, ModtoolRoomChatlogEvent, ModtoolRoomInfoEvent, ModtoolUserChatlogEvent, ModtoolUserInfoEvent, UserBannedMessageEvent } from './messages/incoming/moderation'; import { ModeratorCautionEvent } from './messages/incoming/moderation/ModeratorCautionEvent'; -import { ModeratorInitMessageEvent } from './messages/incoming/modtool/ModeratorInitMessageEvent'; -import { ModtoolCallForHelpTopicsEvent } from './messages/incoming/modtool/ModtoolCallForHelpTopicsEvent'; -import { ModtoolReceivedRoomsUserEvent } from './messages/incoming/modtool/ModtoolReceivedRoomsUserEvent'; -import { ModtoolRoomChatlogEvent } from './messages/incoming/modtool/ModtoolRoomChatlogEvent'; -import { ModtoolRoomInfoEvent } from './messages/incoming/modtool/ModtoolRoomInfoEvent'; -import { ModtoolUserChatlogEvent } from './messages/incoming/modtool/ModtoolUserChatlogEvent'; -import { ModtoolUserInfoEvent } from './messages/incoming/modtool/ModtoolUserInfoEvent'; import { NavigatorCategoriesEvent } from './messages/incoming/navigator/NavigatorCategoriesEvent'; import { NavigatorCollapsedEvent } from './messages/incoming/navigator/NavigatorCollapsedEvent'; import { NavigatorEventCategoriesEvent } from './messages/incoming/navigator/NavigatorEventCategoriesEvent'; @@ -322,20 +315,20 @@ import { TradingOpenComposer } from './messages/outgoing/inventory/trading/Tradi import { TradingUnacceptComposer } from './messages/outgoing/inventory/trading/TradingUnacceptComposer'; import { GetPromoArticlesComposer } from './messages/outgoing/landingview/GetPromoArticlesComposer'; import { CommunityGoalVoteMessageComposer } from './messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer'; -import { DefaultSanctionMessageComposer } from './messages/outgoing/modtool/DefaultSanctionMessageComposer'; -import { GetModeratorRoomInfoMessageComposer } from './messages/outgoing/modtool/GetModeratorRoomInfoMessageComposer'; -import { GetModeratorUserInfoMessageComposer } from './messages/outgoing/modtool/GetModeratorUserInfoMessageComposer'; -import { GetRoomChatlogMessageComposer } from './messages/outgoing/modtool/GetRoomChatlogMessageComposer'; -import { GetRoomVisitsMessageComposer } from './messages/outgoing/modtool/GetRoomVisitsMessageComposer'; -import { GetUserChatlogMessageComposer } from './messages/outgoing/modtool/GetUserChatlogMessageComposer'; -import { ModAlertMessageComposer } from './messages/outgoing/modtool/ModAlertMessageComposer'; -import { ModBanMessageComposer } from './messages/outgoing/modtool/ModBanMessageComposer'; -import { ModerateRoomMessageComposer } from './messages/outgoing/modtool/ModerateRoomMessageComposer'; -import { ModeratorActionMessageComposer } from './messages/outgoing/modtool/ModeratorActionMessageComposer'; -import { ModKickMessageComposer } from './messages/outgoing/modtool/ModKickMessageComposer'; -import { ModMessageMessageComposer } from './messages/outgoing/modtool/ModMessageMessageComposer'; -import { ModMuteMessageComposer } from './messages/outgoing/modtool/ModMuteMessageComposer'; -import { ModTradingLockMessageComposer } from './messages/outgoing/modtool/ModTradingLockMessageComposer'; +import { DefaultSanctionMessageComposer } from './messages/outgoing/moderation/DefaultSanctionMessageComposer'; +import { GetModeratorRoomInfoMessageComposer } from './messages/outgoing/moderation/GetModeratorRoomInfoMessageComposer'; +import { GetModeratorUserInfoMessageComposer } from './messages/outgoing/moderation/GetModeratorUserInfoMessageComposer'; +import { GetRoomChatlogMessageComposer } from './messages/outgoing/moderation/GetRoomChatlogMessageComposer'; +import { GetRoomVisitsMessageComposer } from './messages/outgoing/moderation/GetRoomVisitsMessageComposer'; +import { GetUserChatlogMessageComposer } from './messages/outgoing/moderation/GetUserChatlogMessageComposer'; +import { ModAlertMessageComposer } from './messages/outgoing/moderation/ModAlertMessageComposer'; +import { ModBanMessageComposer } from './messages/outgoing/moderation/ModBanMessageComposer'; +import { ModerateRoomMessageComposer } from './messages/outgoing/moderation/ModerateRoomMessageComposer'; +import { ModeratorActionMessageComposer } from './messages/outgoing/moderation/ModeratorActionMessageComposer'; +import { ModKickMessageComposer } from './messages/outgoing/moderation/ModKickMessageComposer'; +import { ModMessageMessageComposer } from './messages/outgoing/moderation/ModMessageMessageComposer'; +import { ModMuteMessageComposer } from './messages/outgoing/moderation/ModMuteMessageComposer'; +import { ModTradingLockMessageComposer } from './messages/outgoing/moderation/ModTradingLockMessageComposer'; import { ConvertGlobalRoomIdMessageComposer } from './messages/outgoing/navigator/ConvertGlobalRoomIdComposer'; import { NavigatorCategoriesComposer } from './messages/outgoing/navigator/NavigatorCategoriesComposer'; import { NavigatorCategoryListModeComposer } from './messages/outgoing/navigator/NavigatorCategoryListModeComposer'; diff --git a/src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts b/src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts new file mode 100644 index 00000000..7ad3fe72 --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts @@ -0,0 +1,45 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { ChatRecordData } from '../../parser/moderation/utils/ChatRecordData'; + +export class CfhChatlogData +{ + private _callId: number; + private _callerUserId: number; + private _reportedUserId: number; + private _chatRecordId: number; + private _chatRecord: ChatRecordData + + constructor(k:IMessageDataWrapper) + { + this._callId = k.readInt(); + this._callerUserId = k.readInt(); + this._reportedUserId = k.readInt(); + this._chatRecordId = k.readInt(); + this._chatRecord = new ChatRecordData(k); + } + + public get callId(): number + { + return this._callId; + } + + public get callerUserId(): number + { + return this._callerUserId; + } + + public get reportedUserId(): number + { + return this._reportedUserId; + } + + public get chatRecordId(): number + { + return this._chatRecordId; + } + + public get chatRecord(): ChatRecordData + { + return this._chatRecord; + } +} diff --git a/src/nitro/communication/messages/incoming/modtool/ModeratorInitMessageEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModeratorInitMessageEvent.ts similarity index 83% rename from src/nitro/communication/messages/incoming/modtool/ModeratorInitMessageEvent.ts rename to src/nitro/communication/messages/incoming/moderation/ModeratorInitMessageEvent.ts index 47e64435..141f13a8 100644 --- a/src/nitro/communication/messages/incoming/modtool/ModeratorInitMessageEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModeratorInitMessageEvent.ts @@ -1,6 +1,6 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModeratorInitMessageParser } from '../../parser/modtool/ModeratorInitMessageParser'; +import { ModeratorInitMessageParser } from '../../parser/moderation/ModeratorInitMessageParser'; export class ModeratorInitMessageEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/modtool/ModtoolCallForHelpTopicsEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolCallForHelpTopicsEvent.ts similarity index 84% rename from src/nitro/communication/messages/incoming/modtool/ModtoolCallForHelpTopicsEvent.ts rename to src/nitro/communication/messages/incoming/moderation/ModtoolCallForHelpTopicsEvent.ts index 76d9094b..876056f5 100644 --- a/src/nitro/communication/messages/incoming/modtool/ModtoolCallForHelpTopicsEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModtoolCallForHelpTopicsEvent.ts @@ -1,6 +1,6 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolCFHTopicsParser } from '../../parser/modtool/ModtoolCFHTopicsParser'; +import { ModtoolCFHTopicsParser } from '../../parser/moderation/ModtoolCFHTopicsParser'; export class ModtoolCallForHelpTopicsEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/modtool/ModtoolReceivedRoomsUserEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolReceivedRoomsUserEvent.ts similarity index 84% rename from src/nitro/communication/messages/incoming/modtool/ModtoolReceivedRoomsUserEvent.ts rename to src/nitro/communication/messages/incoming/moderation/ModtoolReceivedRoomsUserEvent.ts index 3122afbb..579f01fb 100644 --- a/src/nitro/communication/messages/incoming/modtool/ModtoolReceivedRoomsUserEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModtoolReceivedRoomsUserEvent.ts @@ -1,6 +1,6 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolRoomUsersParser } from '../../parser/modtool/ModtoolRoomUsersParser'; +import { ModtoolRoomUsersParser } from '../../parser/moderation/ModtoolRoomUsersParser'; export class ModtoolReceivedRoomsUserEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/modtool/ModtoolRoomChatlogEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolRoomChatlogEvent.ts similarity index 83% rename from src/nitro/communication/messages/incoming/modtool/ModtoolRoomChatlogEvent.ts rename to src/nitro/communication/messages/incoming/moderation/ModtoolRoomChatlogEvent.ts index 1747c21c..a7eb2c5d 100644 --- a/src/nitro/communication/messages/incoming/modtool/ModtoolRoomChatlogEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModtoolRoomChatlogEvent.ts @@ -1,6 +1,6 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolRoomChatlogParser } from '../../parser/modtool/ModtoolRoomChatlogParser'; +import { ModtoolRoomChatlogParser } from '../../parser/moderation/ModtoolRoomChatlogParser'; export class ModtoolRoomChatlogEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/modtool/ModtoolRoomInfoEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolRoomInfoEvent.ts similarity index 84% rename from src/nitro/communication/messages/incoming/modtool/ModtoolRoomInfoEvent.ts rename to src/nitro/communication/messages/incoming/moderation/ModtoolRoomInfoEvent.ts index 5e451978..5679bf6f 100644 --- a/src/nitro/communication/messages/incoming/modtool/ModtoolRoomInfoEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModtoolRoomInfoEvent.ts @@ -1,6 +1,6 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolRoomInfoParser } from '../../parser/modtool/ModtoolRoomInfoParser'; +import { ModtoolRoomInfoParser } from '../../parser/moderation/ModtoolRoomInfoParser'; export class ModtoolRoomInfoEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/modtool/ModtoolUserChatlogEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolUserChatlogEvent.ts similarity index 83% rename from src/nitro/communication/messages/incoming/modtool/ModtoolUserChatlogEvent.ts rename to src/nitro/communication/messages/incoming/moderation/ModtoolUserChatlogEvent.ts index 97553c7c..506de604 100644 --- a/src/nitro/communication/messages/incoming/modtool/ModtoolUserChatlogEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModtoolUserChatlogEvent.ts @@ -1,6 +1,6 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolUserChatlogParser } from '../../parser/modtool/ModtoolUserChatlogParser'; +import { ModtoolUserChatlogParser } from '../../parser/moderation/ModtoolUserChatlogParser'; export class ModtoolUserChatlogEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/modtool/ModtoolUserInfoEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolUserInfoEvent.ts similarity index 84% rename from src/nitro/communication/messages/incoming/modtool/ModtoolUserInfoEvent.ts rename to src/nitro/communication/messages/incoming/moderation/ModtoolUserInfoEvent.ts index cd1eaa75..c605ad94 100644 --- a/src/nitro/communication/messages/incoming/modtool/ModtoolUserInfoEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModtoolUserInfoEvent.ts @@ -1,6 +1,6 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolUserInfoParser } from '../../parser/modtool/ModtoolUserInfoParser'; +import { ModtoolUserInfoParser } from '../../parser/moderation/ModtoolUserInfoParser'; export class ModtoolUserInfoEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/moderation/index.ts b/src/nitro/communication/messages/incoming/moderation/index.ts index 51e7049b..0d911104 100644 --- a/src/nitro/communication/messages/incoming/moderation/index.ts +++ b/src/nitro/communication/messages/incoming/moderation/index.ts @@ -1,3 +1,11 @@ +export * from './CfhChatlogData'; export * from './INamed'; export * from './ModeratorCautionEvent'; +export * from './ModeratorInitMessageEvent'; +export * from './ModtoolCallForHelpTopicsEvent'; +export * from './ModtoolReceivedRoomsUserEvent'; +export * from './ModtoolRoomChatlogEvent'; +export * from './ModtoolRoomInfoEvent'; +export * from './ModtoolUserChatlogEvent'; +export * from './ModtoolUserInfoEvent'; export * from './UserBannedMessageEvent'; diff --git a/src/nitro/communication/messages/incoming/modtool/index.ts b/src/nitro/communication/messages/incoming/modtool/index.ts deleted file mode 100644 index 8090ab06..00000000 --- a/src/nitro/communication/messages/incoming/modtool/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './ModeratorInitMessageEvent'; -export * from './ModtoolCallForHelpTopicsEvent'; -export * from './ModtoolReceivedRoomsUserEvent'; -export * from './ModtoolRoomChatlogEvent'; -export * from './ModtoolRoomInfoEvent'; -export * from './ModtoolUserChatlogEvent'; -export * from './ModtoolUserInfoEvent'; diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index 3e69be5a..851f55be 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -16,7 +16,7 @@ export * from './helper'; export * from './inventory'; export * from './landingview'; export * from './marketplace'; -export * from './modtool'; +export * from './moderation'; export * from './navigator'; export * from './OutgoingHeader'; export * from './pet'; diff --git a/src/nitro/communication/messages/outgoing/modtool/CloseIssueDefaultActionMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/CloseIssueDefaultActionMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/CloseIssueDefaultActionMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/CloseIssueDefaultActionMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/CloseIssuesMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/CloseIssuesMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/CloseIssuesMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/CloseIssuesMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/DefaultSanctionMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/DefaultSanctionMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/DefaultSanctionMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/DefaultSanctionMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/GetCfhChatlogMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/GetCfhChatlogMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/GetCfhChatlogMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/GetCfhChatlogMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/GetModeratorRoomInfoMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/GetModeratorRoomInfoMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/GetModeratorRoomInfoMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/GetModeratorRoomInfoMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/GetModeratorUserInfoMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/GetModeratorUserInfoMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/GetModeratorUserInfoMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/GetModeratorUserInfoMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/GetRoomChatlogMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/GetRoomChatlogMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/GetRoomChatlogMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/GetRoomChatlogMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/GetRoomVisitsMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/GetRoomVisitsMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/GetRoomVisitsMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/GetRoomVisitsMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/GetUserChatlogMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/GetUserChatlogMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/GetUserChatlogMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/GetUserChatlogMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/ModAlertMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ModAlertMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/ModAlertMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/ModAlertMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/ModBanMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ModBanMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/ModBanMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/ModBanMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/ModKickMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ModKickMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/ModKickMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/ModKickMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/ModMessageMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ModMessageMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/ModMessageMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/ModMessageMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/ModMuteMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ModMuteMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/ModMuteMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/ModMuteMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/ModToolPreferencesComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ModToolPreferencesComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/ModToolPreferencesComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/ModToolPreferencesComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/ModToolSanctionComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ModToolSanctionComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/ModToolSanctionComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/ModToolSanctionComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/ModTradingLockMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ModTradingLockMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/ModTradingLockMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/ModTradingLockMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/ModerateRoomMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ModerateRoomMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/ModerateRoomMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/ModerateRoomMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/ModeratorActionMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ModeratorActionMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/ModeratorActionMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/ModeratorActionMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/PickIssuesMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/PickIssuesMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/PickIssuesMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/PickIssuesMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/ReleaseIssuesMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ReleaseIssuesMessageComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/ReleaseIssuesMessageComposer.ts rename to src/nitro/communication/messages/outgoing/moderation/ReleaseIssuesMessageComposer.ts diff --git a/src/nitro/communication/messages/outgoing/modtool/index.ts b/src/nitro/communication/messages/outgoing/moderation/index.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/modtool/index.ts rename to src/nitro/communication/messages/outgoing/moderation/index.ts diff --git a/src/nitro/communication/messages/parser/modtool/ModeratorInitMessageParser.ts b/src/nitro/communication/messages/parser/moderation/ModeratorInitMessageParser.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/ModeratorInitMessageParser.ts rename to src/nitro/communication/messages/parser/moderation/ModeratorInitMessageParser.ts diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolCFHTopicsParser.ts b/src/nitro/communication/messages/parser/moderation/ModtoolCFHTopicsParser.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/ModtoolCFHTopicsParser.ts rename to src/nitro/communication/messages/parser/moderation/ModtoolCFHTopicsParser.ts diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolRoomChatlogParser.ts b/src/nitro/communication/messages/parser/moderation/ModtoolRoomChatlogParser.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/ModtoolRoomChatlogParser.ts rename to src/nitro/communication/messages/parser/moderation/ModtoolRoomChatlogParser.ts diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolRoomInfoParser.ts b/src/nitro/communication/messages/parser/moderation/ModtoolRoomInfoParser.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/ModtoolRoomInfoParser.ts rename to src/nitro/communication/messages/parser/moderation/ModtoolRoomInfoParser.ts diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolRoomUsersParser.ts b/src/nitro/communication/messages/parser/moderation/ModtoolRoomUsersParser.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/ModtoolRoomUsersParser.ts rename to src/nitro/communication/messages/parser/moderation/ModtoolRoomUsersParser.ts diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolUserChatlogParser.ts b/src/nitro/communication/messages/parser/moderation/ModtoolUserChatlogParser.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/ModtoolUserChatlogParser.ts rename to src/nitro/communication/messages/parser/moderation/ModtoolUserChatlogParser.ts diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts b/src/nitro/communication/messages/parser/moderation/ModtoolUserInfoParser.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts rename to src/nitro/communication/messages/parser/moderation/ModtoolUserInfoParser.ts diff --git a/src/nitro/communication/messages/parser/moderation/index.ts b/src/nitro/communication/messages/parser/moderation/index.ts index aead77be..b2cbe03c 100644 --- a/src/nitro/communication/messages/parser/moderation/index.ts +++ b/src/nitro/communication/messages/parser/moderation/index.ts @@ -1,2 +1,10 @@ export * from './ModerationCautionParser'; +export * from './ModeratorInitMessageParser'; +export * from './ModtoolCFHTopicsParser'; +export * from './ModtoolRoomChatlogParser'; +export * from './ModtoolRoomInfoParser'; +export * from './ModtoolRoomUsersParser'; +export * from './ModtoolUserChatlogParser'; +export * from './ModtoolUserInfoParser'; export * from './UserBannedMessageParser'; +export * from './utils'; diff --git a/src/nitro/communication/messages/parser/modtool/utils/CallForHelpCategoryData.ts b/src/nitro/communication/messages/parser/moderation/utils/CallForHelpCategoryData.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/CallForHelpCategoryData.ts rename to src/nitro/communication/messages/parser/moderation/utils/CallForHelpCategoryData.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/ChatRecordData.ts b/src/nitro/communication/messages/parser/moderation/utils/ChatRecordData.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/ChatRecordData.ts rename to src/nitro/communication/messages/parser/moderation/utils/ChatRecordData.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/IChatlog.ts b/src/nitro/communication/messages/parser/moderation/utils/IChatlog.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/IChatlog.ts rename to src/nitro/communication/messages/parser/moderation/utils/IChatlog.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser.ts b/src/nitro/communication/messages/parser/moderation/utils/IssueInfoMessageParser.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser.ts rename to src/nitro/communication/messages/parser/moderation/utils/IssueInfoMessageParser.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts b/src/nitro/communication/messages/parser/moderation/utils/IssueMessageData.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts rename to src/nitro/communication/messages/parser/moderation/utils/IssueMessageData.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData.ts b/src/nitro/communication/messages/parser/moderation/utils/ModeratorInitData.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData.ts rename to src/nitro/communication/messages/parser/moderation/utils/ModeratorInitData.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts b/src/nitro/communication/messages/parser/moderation/utils/ModeratorUserInfoData.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts rename to src/nitro/communication/messages/parser/moderation/utils/ModeratorUserInfoData.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomChatlogLine.ts b/src/nitro/communication/messages/parser/moderation/utils/ModtoolRoomChatlogLine.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomChatlogLine.ts rename to src/nitro/communication/messages/parser/moderation/utils/ModtoolRoomChatlogLine.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomVisitedData.ts b/src/nitro/communication/messages/parser/moderation/utils/ModtoolRoomVisitedData.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomVisitedData.ts rename to src/nitro/communication/messages/parser/moderation/utils/ModtoolRoomVisitedData.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModtoolUserChatlogParserChatlog.ts b/src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserChatlog.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/ModtoolUserChatlogParserChatlog.ts rename to src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserChatlog.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModtoolUserChatlogParserVisit.ts b/src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserVisit.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/ModtoolUserChatlogParserVisit.ts rename to src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserVisit.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData.ts b/src/nitro/communication/messages/parser/moderation/utils/PatternMatchData.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/PatternMatchData.ts rename to src/nitro/communication/messages/parser/moderation/utils/PatternMatchData.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/RoomVisitData.ts b/src/nitro/communication/messages/parser/moderation/utils/RoomVisitData.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/RoomVisitData.ts rename to src/nitro/communication/messages/parser/moderation/utils/RoomVisitData.ts diff --git a/src/nitro/communication/messages/parser/modtool/utils/index.ts b/src/nitro/communication/messages/parser/moderation/utils/index.ts similarity index 100% rename from src/nitro/communication/messages/parser/modtool/utils/index.ts rename to src/nitro/communication/messages/parser/moderation/utils/index.ts diff --git a/src/nitro/communication/messages/parser/modtool/index.ts b/src/nitro/communication/messages/parser/modtool/index.ts deleted file mode 100644 index ca72f417..00000000 --- a/src/nitro/communication/messages/parser/modtool/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from './ModeratorInitMessageParser'; -export * from './ModtoolCFHTopicsParser'; -export * from './ModtoolRoomChatlogParser'; -export * from './ModtoolRoomInfoParser'; -export * from './ModtoolRoomUsersParser'; -export * from './ModtoolUserChatlogParser'; -export * from './ModtoolUserInfoParser'; -export * from './utils'; From 909febebce818bae82a1b2f6bb935b16a2e7339e Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 20 Oct 2021 17:44:44 -0500 Subject: [PATCH 060/108] fixed more packets --- src/nitro/communication/NitroMessages.ts | 12 +-- .../messages/incoming/IncomingHeader.ts | 2 +- .../help}/CallForHelpCategoryData.ts | 2 +- .../incoming/help/CfhTopicsInitEvent.ts | 16 ++++ .../messages/incoming/help/index.ts | 2 + .../incoming/moderation/CfhChatlogData.ts | 2 +- .../incoming/moderation/CfhChatlogEvent.ts | 16 ++++ .../moderation}/ChatRecordData.ts | 10 +- .../moderation/ChatlineData.ts} | 3 +- .../moderation/ModeratorRoomInfoEvent.ts | 16 ++++ .../moderation}/ModeratorUserInfoData.ts | 2 +- .../ModtoolCallForHelpTopicsEvent.ts | 16 ---- .../ModtoolReceivedRoomsUserEvent.ts | 16 ---- .../moderation/ModtoolRoomChatlogEvent.ts | 8 +- .../moderation/ModtoolRoomInfoEvent.ts | 16 ---- .../moderation/ModtoolUserChatlogEvent.ts | 8 +- .../moderation/ModtoolUserInfoEvent.ts | 8 +- .../messages/incoming/moderation/RoomData.ts | 65 +++++++++++++ .../incoming/moderation/RoomModerationData.ts | 73 +++++++++++++++ .../moderation}/RoomVisitData.ts | 2 +- .../moderation/RoomVisitsData.ts} | 5 +- .../incoming/moderation/RoomVisitsEvent.ts | 16 ++++ .../messages/incoming/moderation/index.ts | 13 ++- .../CfhTopicsInitMessageParser.ts} | 4 +- .../messages/parser/help/index.ts | 1 + .../moderation/CfhChatlogMessageParser.ts | 29 ++++++ .../moderation/IssueDeletedMessageParser.ts | 23 +++++ .../{utils => }/IssueInfoMessageParser.ts | 2 +- .../{utils => }/IssueMessageData.ts | 2 +- .../IssuePickFailedMessageParser.ts | 51 +++++++++++ .../ModeratorActionResultMessageParser.ts | 33 +++++++ .../{utils => }/ModeratorInitData.ts | 2 +- .../moderation/ModeratorInitMessageParser.ts | 2 +- .../moderation/ModeratorMessageParser.ts | 36 ++++++++ .../ModeratorRoomInfoMessageParser.ts | 28 ++++++ .../ModeratorToolPreferencesMessageParser.ts | 48 ++++++++++ ...r.ts => ModeratorUserInfoMessageParser.ts} | 7 +- .../moderation/ModtoolRoomInfoParser.ts | 91 ------------------- .../moderation/ModtoolRoomUsersParser.ts | 22 ----- .../{utils => }/PatternMatchData.ts | 4 +- ...gParser.ts => RoomChatlogMessageParser.ts} | 4 +- .../moderation/RoomVisitsMessageParser.ts | 23 +++++ ...gParser.ts => UserChatlogMessageParser.ts} | 4 +- .../messages/parser/moderation/index.ts | 22 +++-- .../parser/moderation/utils/IChatlog.ts | 7 -- .../utils/ModtoolUserChatlogParserChatlog.ts | 44 --------- .../utils/ModtoolUserChatlogParserVisit.ts | 31 ------- .../messages/parser/moderation/utils/index.ts | 13 --- 48 files changed, 545 insertions(+), 317 deletions(-) rename src/nitro/communication/messages/{parser/moderation/utils => incoming/help}/CallForHelpCategoryData.ts (93%) create mode 100644 src/nitro/communication/messages/incoming/help/CfhTopicsInitEvent.ts create mode 100644 src/nitro/communication/messages/incoming/moderation/CfhChatlogEvent.ts rename src/nitro/communication/messages/{parser/moderation/utils => incoming/moderation}/ChatRecordData.ts (88%) rename src/nitro/communication/messages/{parser/moderation/utils/ModtoolRoomChatlogLine.ts => incoming/moderation/ChatlineData.ts} (90%) create mode 100644 src/nitro/communication/messages/incoming/moderation/ModeratorRoomInfoEvent.ts rename src/nitro/communication/messages/{parser/moderation/utils => incoming/moderation}/ModeratorUserInfoData.ts (98%) delete mode 100644 src/nitro/communication/messages/incoming/moderation/ModtoolCallForHelpTopicsEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/moderation/ModtoolReceivedRoomsUserEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/moderation/ModtoolRoomInfoEvent.ts create mode 100644 src/nitro/communication/messages/incoming/moderation/RoomData.ts create mode 100644 src/nitro/communication/messages/incoming/moderation/RoomModerationData.ts rename src/nitro/communication/messages/{parser/moderation/utils => incoming/moderation}/RoomVisitData.ts (91%) rename src/nitro/communication/messages/{parser/moderation/utils/ModtoolRoomVisitedData.ts => incoming/moderation/RoomVisitsData.ts} (88%) create mode 100644 src/nitro/communication/messages/incoming/moderation/RoomVisitsEvent.ts rename src/nitro/communication/messages/parser/{moderation/ModtoolCFHTopicsParser.ts => help/CfhTopicsInitMessageParser.ts} (81%) create mode 100644 src/nitro/communication/messages/parser/moderation/CfhChatlogMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/moderation/IssueDeletedMessageParser.ts rename src/nitro/communication/messages/parser/moderation/{utils => }/IssueInfoMessageParser.ts (99%) rename src/nitro/communication/messages/parser/moderation/{utils => }/IssueMessageData.ts (98%) create mode 100644 src/nitro/communication/messages/parser/moderation/IssuePickFailedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/moderation/ModeratorActionResultMessageParser.ts rename src/nitro/communication/messages/parser/moderation/{utils => }/ModeratorInitData.ts (98%) create mode 100644 src/nitro/communication/messages/parser/moderation/ModeratorMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/moderation/ModeratorRoomInfoMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/moderation/ModeratorToolPreferencesMessageParser.ts rename src/nitro/communication/messages/parser/moderation/{ModtoolUserInfoParser.ts => ModeratorUserInfoMessageParser.ts} (75%) delete mode 100644 src/nitro/communication/messages/parser/moderation/ModtoolRoomInfoParser.ts delete mode 100644 src/nitro/communication/messages/parser/moderation/ModtoolRoomUsersParser.ts rename src/nitro/communication/messages/parser/moderation/{utils => }/PatternMatchData.ts (85%) rename src/nitro/communication/messages/parser/moderation/{ModtoolRoomChatlogParser.ts => RoomChatlogMessageParser.ts} (76%) create mode 100644 src/nitro/communication/messages/parser/moderation/RoomVisitsMessageParser.ts rename src/nitro/communication/messages/parser/moderation/{ModtoolUserChatlogParser.ts => UserChatlogMessageParser.ts} (87%) delete mode 100644 src/nitro/communication/messages/parser/moderation/utils/IChatlog.ts delete mode 100644 src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserChatlog.ts delete mode 100644 src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserVisit.ts delete mode 100644 src/nitro/communication/messages/parser/moderation/utils/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 383843c0..36d4570c 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -90,7 +90,7 @@ import { MarketplaceItemStatsEvent } from './messages/incoming/marketplace/Marke import { MarketplaceMakeOfferResult } from './messages/incoming/marketplace/MarketplaceMakeOfferResult'; import { MarketPlaceOffersEvent } from './messages/incoming/marketplace/MarketplaceOffersEvent'; import { MarketplaceOwnOffersEvent } from './messages/incoming/marketplace/MarketplaceOwnOffersEvent'; -import { ModeratorInitMessageEvent, ModtoolCallForHelpTopicsEvent, ModtoolReceivedRoomsUserEvent, ModtoolRoomChatlogEvent, ModtoolRoomInfoEvent, ModtoolUserChatlogEvent, ModtoolUserInfoEvent, UserBannedMessageEvent } from './messages/incoming/moderation'; +import { CfhChatlogEvent, ModeratorInitMessageEvent, ModeratorRoomInfoEvent, ModtoolRoomChatlogEvent, ModtoolUserChatlogEvent, ModtoolUserInfoEvent, RoomVisitsEvent, UserBannedMessageEvent } from './messages/incoming/moderation'; import { ModeratorCautionEvent } from './messages/incoming/moderation/ModeratorCautionEvent'; import { NavigatorCategoriesEvent } from './messages/incoming/navigator/NavigatorCategoriesEvent'; import { NavigatorCollapsedEvent } from './messages/incoming/navigator/NavigatorCollapsedEvent'; @@ -656,17 +656,15 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.MARKETPLACE_OWN_ITEMS, MarketplaceOwnOffersEvent); // MODERATION - this._events.set(IncomingHeader.MARKETPLACE_OWN_ITEMS, UserBannedMessageEvent); + this._events.set(IncomingHeader.USER_BANNED, UserBannedMessageEvent); this._events.set(IncomingHeader.MODERATION_CAUTION, ModeratorCautionEvent); - - // MODTOOL - this._events.set(IncomingHeader.MODTOOL_ROOM_INFO, ModtoolRoomInfoEvent); + this._events.set(IncomingHeader.MODTOOL_ROOM_INFO, ModeratorRoomInfoEvent); this._events.set(IncomingHeader.MODTOOL_USER_CHATLOG, ModtoolUserChatlogEvent); this._events.set(IncomingHeader.MODTOOL_ROOM_CHATLOG, ModtoolRoomChatlogEvent); this._events.set(IncomingHeader.MODERATION_USER_INFO, ModtoolUserInfoEvent); - this._events.set(IncomingHeader.MODERATION_TOPICS, ModtoolCallForHelpTopicsEvent); this._events.set(IncomingHeader.MODERATION_TOOL, ModeratorInitMessageEvent); - this._events.set(IncomingHeader.MODTOOL_VISITED_ROOMS_USER, ModtoolReceivedRoomsUserEvent); + this._events.set(IncomingHeader.MODTOOL_VISITED_ROOMS_USER, RoomVisitsEvent); + this._events.set(IncomingHeader.CFH_CHATLOG, CfhChatlogEvent); // MYSTERY BOX this._events.set(IncomingHeader.MYSTERY_BOX_KEYS, MysteryBoxKeysEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index e27aa584..0193214d 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -83,7 +83,6 @@ export class IncomingHeader public static MESSENGER_UPDATE = 2800; public static MODERATION_REPORT_DISABLED = 1651; public static MODERATION_TOOL = 2696; - public static MODERATION_TOPICS = 325; public static MODERATION_USER_INFO = 2866; public static MOTD_MESSAGES = 2035; public static NAVIGATOR_CATEGORIES = 1562; @@ -216,6 +215,7 @@ export class IncomingHeader public static MODTOOL_ROOM_INFO = 1333; public static MODTOOL_USER_CHATLOG = 3377; public static MODTOOL_ROOM_CHATLOG = 3434; + public static CFH_CHATLOG = 607; public static LOVELOCK_FURNI_START = 3753; public static LOVELOCK_FURNI_FRIEND_COMFIRMED = 382; public static LOVELOCK_FURNI_FINISHED = 770; diff --git a/src/nitro/communication/messages/parser/moderation/utils/CallForHelpCategoryData.ts b/src/nitro/communication/messages/incoming/help/CallForHelpCategoryData.ts similarity index 93% rename from src/nitro/communication/messages/parser/moderation/utils/CallForHelpCategoryData.ts rename to src/nitro/communication/messages/incoming/help/CallForHelpCategoryData.ts index f6e85a27..f82e6dd2 100644 --- a/src/nitro/communication/messages/parser/moderation/utils/CallForHelpCategoryData.ts +++ b/src/nitro/communication/messages/incoming/help/CallForHelpCategoryData.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper } from '../../../../../../core'; +import { IMessageDataWrapper } from '../../../../../core'; export class CallForHelpCategoryData { diff --git a/src/nitro/communication/messages/incoming/help/CfhTopicsInitEvent.ts b/src/nitro/communication/messages/incoming/help/CfhTopicsInitEvent.ts new file mode 100644 index 00000000..730a8197 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/CfhTopicsInitEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CfhTopicsInitMessageParser } from '../../parser/help/CfhTopicsInitMessageParser'; + +export class CfhTopicsInitEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CfhTopicsInitMessageParser); + } + + public getParser(): CfhTopicsInitMessageParser + { + return this.parser as CfhTopicsInitMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/index.ts b/src/nitro/communication/messages/incoming/help/index.ts index b0bcb133..af7e99c6 100644 --- a/src/nitro/communication/messages/incoming/help/index.ts +++ b/src/nitro/communication/messages/incoming/help/index.ts @@ -1,2 +1,4 @@ +export * from './CallForHelpCategoryData'; export * from './CallForHelpResultMessageEvent'; +export * from './CfhTopicsInitEvent'; export * from './TalentTrackEvent'; diff --git a/src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts b/src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts index 7ad3fe72..e3e54692 100644 --- a/src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts +++ b/src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts @@ -1,5 +1,5 @@ import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; -import { ChatRecordData } from '../../parser/moderation/utils/ChatRecordData'; +import { ChatRecordData } from './ChatRecordData'; export class CfhChatlogData { diff --git a/src/nitro/communication/messages/incoming/moderation/CfhChatlogEvent.ts b/src/nitro/communication/messages/incoming/moderation/CfhChatlogEvent.ts new file mode 100644 index 00000000..f6abdf5a --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/CfhChatlogEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CfhChatlogMessageParser } from '../../parser/moderation/CfhChatlogMessageParser'; + +export class CfhChatlogEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CfhChatlogMessageParser); + } + + public getParser(): CfhChatlogMessageParser + { + return this.parser as CfhChatlogMessageParser; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/utils/ChatRecordData.ts b/src/nitro/communication/messages/incoming/moderation/ChatRecordData.ts similarity index 88% rename from src/nitro/communication/messages/parser/moderation/utils/ChatRecordData.ts rename to src/nitro/communication/messages/incoming/moderation/ChatRecordData.ts index 7e9d435c..d1a66382 100644 --- a/src/nitro/communication/messages/parser/moderation/utils/ChatRecordData.ts +++ b/src/nitro/communication/messages/incoming/moderation/ChatRecordData.ts @@ -1,5 +1,5 @@ -import { IMessageDataWrapper } from '../../../../../..'; -import { ModtoolRoomChatlogLine } from './ModtoolRoomChatlogLine'; +import { IMessageDataWrapper } from '../../../../..'; +import { ChatlineData } from './ChatlineData'; export class ChatRecordData { @@ -13,7 +13,7 @@ export class ChatRecordData private _recordType:number; private _context:Map; - private _chatlog:ModtoolRoomChatlogLine[]; + private _chatlog:ChatlineData[]; constructor(wrapper: IMessageDataWrapper) { @@ -54,7 +54,7 @@ export class ChatRecordData const message = wrapper.readString(); const hasHighlighting = wrapper.readBoolean(); - this._chatlog.push(new ModtoolRoomChatlogLine(timestamp, habboId, username, message, hasHighlighting)); + this._chatlog.push(new ChatlineData(timestamp, habboId, username, message, hasHighlighting)); } } @@ -68,7 +68,7 @@ export class ChatRecordData return this._context; } - public get chatlog():ModtoolRoomChatlogLine[] + public get chatlog():ChatlineData[] { return this._chatlog; } diff --git a/src/nitro/communication/messages/parser/moderation/utils/ModtoolRoomChatlogLine.ts b/src/nitro/communication/messages/incoming/moderation/ChatlineData.ts similarity index 90% rename from src/nitro/communication/messages/parser/moderation/utils/ModtoolRoomChatlogLine.ts rename to src/nitro/communication/messages/incoming/moderation/ChatlineData.ts index a7fdb798..a0145b5f 100644 --- a/src/nitro/communication/messages/parser/moderation/utils/ModtoolRoomChatlogLine.ts +++ b/src/nitro/communication/messages/incoming/moderation/ChatlineData.ts @@ -1,6 +1,5 @@ -import { IChatlog } from './IChatlog'; -export class ModtoolRoomChatlogLine implements IChatlog +export class ChatlineData { private readonly _timestamp: string; private readonly _habboId: number; diff --git a/src/nitro/communication/messages/incoming/moderation/ModeratorRoomInfoEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModeratorRoomInfoEvent.ts new file mode 100644 index 00000000..b70e209a --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/ModeratorRoomInfoEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ModeratorRoomInfoMessageParser } from '../../parser/moderation/ModeratorRoomInfoMessageParser'; + +export class ModeratorRoomInfoEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ModeratorRoomInfoMessageParser); + } + + public getParser(): ModeratorRoomInfoMessageParser + { + return this.parser as ModeratorRoomInfoMessageParser; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/utils/ModeratorUserInfoData.ts b/src/nitro/communication/messages/incoming/moderation/ModeratorUserInfoData.ts similarity index 98% rename from src/nitro/communication/messages/parser/moderation/utils/ModeratorUserInfoData.ts rename to src/nitro/communication/messages/incoming/moderation/ModeratorUserInfoData.ts index e3348336..1d67048f 100644 --- a/src/nitro/communication/messages/parser/moderation/utils/ModeratorUserInfoData.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModeratorUserInfoData.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper } from '../../../../../../core'; +import { IMessageDataWrapper } from '../../../../../core'; export class ModeratorUserInfoData { diff --git a/src/nitro/communication/messages/incoming/moderation/ModtoolCallForHelpTopicsEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolCallForHelpTopicsEvent.ts deleted file mode 100644 index 876056f5..00000000 --- a/src/nitro/communication/messages/incoming/moderation/ModtoolCallForHelpTopicsEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolCFHTopicsParser } from '../../parser/moderation/ModtoolCFHTopicsParser'; - -export class ModtoolCallForHelpTopicsEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, ModtoolCFHTopicsParser); - } - - public getParser(): ModtoolCFHTopicsParser - { - return this.parser as ModtoolCFHTopicsParser; - } -} diff --git a/src/nitro/communication/messages/incoming/moderation/ModtoolReceivedRoomsUserEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolReceivedRoomsUserEvent.ts deleted file mode 100644 index 579f01fb..00000000 --- a/src/nitro/communication/messages/incoming/moderation/ModtoolReceivedRoomsUserEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolRoomUsersParser } from '../../parser/moderation/ModtoolRoomUsersParser'; - -export class ModtoolReceivedRoomsUserEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, ModtoolRoomUsersParser); - } - - public getParser(): ModtoolRoomUsersParser - { - return this.parser as ModtoolRoomUsersParser; - } -} diff --git a/src/nitro/communication/messages/incoming/moderation/ModtoolRoomChatlogEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolRoomChatlogEvent.ts index a7eb2c5d..905ff1b2 100644 --- a/src/nitro/communication/messages/incoming/moderation/ModtoolRoomChatlogEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModtoolRoomChatlogEvent.ts @@ -1,16 +1,16 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolRoomChatlogParser } from '../../parser/moderation/ModtoolRoomChatlogParser'; +import { RoomChatlogMessageParser } from '../../parser/moderation/RoomChatlogMessageParser'; export class ModtoolRoomChatlogEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { - super(callBack, ModtoolRoomChatlogParser); + super(callBack, RoomChatlogMessageParser); } - public getParser(): ModtoolRoomChatlogParser + public getParser(): RoomChatlogMessageParser { - return this.parser as ModtoolRoomChatlogParser; + return this.parser as RoomChatlogMessageParser; } } diff --git a/src/nitro/communication/messages/incoming/moderation/ModtoolRoomInfoEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolRoomInfoEvent.ts deleted file mode 100644 index 5679bf6f..00000000 --- a/src/nitro/communication/messages/incoming/moderation/ModtoolRoomInfoEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolRoomInfoParser } from '../../parser/moderation/ModtoolRoomInfoParser'; - -export class ModtoolRoomInfoEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, ModtoolRoomInfoParser); - } - - public getParser(): ModtoolRoomInfoParser - { - return this.parser as ModtoolRoomInfoParser; - } -} diff --git a/src/nitro/communication/messages/incoming/moderation/ModtoolUserChatlogEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolUserChatlogEvent.ts index 506de604..6189b612 100644 --- a/src/nitro/communication/messages/incoming/moderation/ModtoolUserChatlogEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModtoolUserChatlogEvent.ts @@ -1,16 +1,16 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolUserChatlogParser } from '../../parser/moderation/ModtoolUserChatlogParser'; +import { UserChatlogMessageParser } from '../../parser/moderation/UserChatlogMessageParser'; export class ModtoolUserChatlogEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { - super(callBack, ModtoolUserChatlogParser); + super(callBack, UserChatlogMessageParser); } - public getParser(): ModtoolUserChatlogParser + public getParser(): UserChatlogMessageParser { - return this.parser as ModtoolUserChatlogParser; + return this.parser as UserChatlogMessageParser; } } diff --git a/src/nitro/communication/messages/incoming/moderation/ModtoolUserInfoEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModtoolUserInfoEvent.ts index c605ad94..66948248 100644 --- a/src/nitro/communication/messages/incoming/moderation/ModtoolUserInfoEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModtoolUserInfoEvent.ts @@ -1,16 +1,16 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModtoolUserInfoParser } from '../../parser/moderation/ModtoolUserInfoParser'; +import { ModeratorUserInfoMessageParser } from '../../parser/moderation/ModeratorUserInfoMessageParser'; export class ModtoolUserInfoEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { - super(callBack, ModtoolUserInfoParser); + super(callBack, ModeratorUserInfoMessageParser); } - public getParser(): ModtoolUserInfoParser + public getParser(): ModeratorUserInfoMessageParser { - return this.parser as ModtoolUserInfoParser; + return this.parser as ModeratorUserInfoMessageParser; } } diff --git a/src/nitro/communication/messages/incoming/moderation/RoomData.ts b/src/nitro/communication/messages/incoming/moderation/RoomData.ts new file mode 100644 index 00000000..7d990d64 --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/RoomData.ts @@ -0,0 +1,65 @@ +import { IDisposable } from '../../../../../core/common/disposable/IDisposable'; +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; + +export class RoomData implements IDisposable +{ + private _exists:boolean; + private _name:string; + private _desc:string; + private _tags:string[]; + private _disposed:boolean; + + constructor(k:IMessageDataWrapper) + { + this._tags = []; + this._exists = k.readBoolean(); + if(!this.exists) + { + return; + } + this._name = k.readString(); + this._desc = k.readString(); + + const tagCount = k.readInt(); + + for(let i = 0; i < tagCount; i++) + { + this._tags.push(k.readString()); + } + } + + public get name():string + { + return this._name; + } + + public get desc():string + { + return this._desc; + } + + public get tags():string[] + { + return this._tags; + } + + public get exists():boolean + { + return this._exists; + } + + public get disposed():boolean + { + return this._disposed; + } + + public dispose():void + { + if(this._disposed) + { + return; + } + this._disposed = true; + this._tags = null; + } +} diff --git a/src/nitro/communication/messages/incoming/moderation/RoomModerationData.ts b/src/nitro/communication/messages/incoming/moderation/RoomModerationData.ts new file mode 100644 index 00000000..354b31e3 --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/RoomModerationData.ts @@ -0,0 +1,73 @@ +import { IDisposable } from '../../../../../core/common/disposable/IDisposable'; +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { RoomData } from './RoomData'; + +export class RoomModerationData implements IDisposable +{ + private _flatId:number; + private _userCount:number; + private _ownerInRoom:boolean; + private _ownerId:number; + private _ownerName:string; + private _room:RoomData; + private _disposed:boolean; + + constructor(k:IMessageDataWrapper) + { + this._flatId = k.readInt(); + this._userCount = k.readInt(); + this._ownerInRoom = k.readBoolean(); + this._ownerId = k.readInt(); + this._ownerName = k.readString(); + this._room = new RoomData(k); + } + + public get flatId():number + { + return this._flatId; + } + + public get userCount():number + { + return this._userCount; + } + + public get ownerInRoom():boolean + { + return this._ownerInRoom; + } + + public get ownerId():number + { + return this._ownerId; + } + + public get ownerName():string + { + return this._ownerName; + } + + public get room():RoomData + { + return this._room; + } + + public get disposed():boolean + { + return this._disposed; + } + + public dispose():void + { + if(this._disposed) + { + return; + } + this._disposed = true; + if(this._room != null) + { + this._room.dispose(); + this._room = null; + } + } +} diff --git a/src/nitro/communication/messages/parser/moderation/utils/RoomVisitData.ts b/src/nitro/communication/messages/incoming/moderation/RoomVisitData.ts similarity index 91% rename from src/nitro/communication/messages/parser/moderation/utils/RoomVisitData.ts rename to src/nitro/communication/messages/incoming/moderation/RoomVisitData.ts index c69288de..f1026f8a 100644 --- a/src/nitro/communication/messages/parser/moderation/utils/RoomVisitData.ts +++ b/src/nitro/communication/messages/incoming/moderation/RoomVisitData.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper } from '../../../../../../core'; +import { IMessageDataWrapper } from '../../../../../core'; export class RoomVisitData { diff --git a/src/nitro/communication/messages/parser/moderation/utils/ModtoolRoomVisitedData.ts b/src/nitro/communication/messages/incoming/moderation/RoomVisitsData.ts similarity index 88% rename from src/nitro/communication/messages/parser/moderation/utils/ModtoolRoomVisitedData.ts rename to src/nitro/communication/messages/incoming/moderation/RoomVisitsData.ts index 9791c1f3..cc72cb10 100644 --- a/src/nitro/communication/messages/parser/moderation/utils/ModtoolRoomVisitedData.ts +++ b/src/nitro/communication/messages/incoming/moderation/RoomVisitsData.ts @@ -1,8 +1,7 @@ -import { IMessageDataWrapper } from '../../../../../../core'; +import { IMessageDataWrapper } from '../../../../../core'; import { RoomVisitData } from './RoomVisitData'; - -export class ModtoolRoomVisitedData +export class RoomVisitsData { private _userId: number; private _userName: string; diff --git a/src/nitro/communication/messages/incoming/moderation/RoomVisitsEvent.ts b/src/nitro/communication/messages/incoming/moderation/RoomVisitsEvent.ts new file mode 100644 index 00000000..29ff7201 --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/RoomVisitsEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { RoomVisitsMessageParser } from '../../parser/moderation/RoomVisitsMessageParser'; + +export class RoomVisitsEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, RoomVisitsMessageParser); + } + + public getParser(): RoomVisitsMessageParser + { + return this.parser as RoomVisitsMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/moderation/index.ts b/src/nitro/communication/messages/incoming/moderation/index.ts index 0d911104..d98947c4 100644 --- a/src/nitro/communication/messages/incoming/moderation/index.ts +++ b/src/nitro/communication/messages/incoming/moderation/index.ts @@ -1,11 +1,18 @@ export * from './CfhChatlogData'; +export * from './CfhChatlogEvent'; +export * from './ChatlineData'; +export * from './ChatRecordData'; export * from './INamed'; export * from './ModeratorCautionEvent'; export * from './ModeratorInitMessageEvent'; -export * from './ModtoolCallForHelpTopicsEvent'; -export * from './ModtoolReceivedRoomsUserEvent'; +export * from './ModeratorRoomInfoEvent'; +export * from './ModeratorUserInfoData'; export * from './ModtoolRoomChatlogEvent'; -export * from './ModtoolRoomInfoEvent'; export * from './ModtoolUserChatlogEvent'; export * from './ModtoolUserInfoEvent'; +export * from './RoomData'; +export * from './RoomModerationData'; +export * from './RoomVisitData'; +export * from './RoomVisitsData'; +export * from './RoomVisitsEvent'; export * from './UserBannedMessageEvent'; diff --git a/src/nitro/communication/messages/parser/moderation/ModtoolCFHTopicsParser.ts b/src/nitro/communication/messages/parser/help/CfhTopicsInitMessageParser.ts similarity index 81% rename from src/nitro/communication/messages/parser/moderation/ModtoolCFHTopicsParser.ts rename to src/nitro/communication/messages/parser/help/CfhTopicsInitMessageParser.ts index 4ae62e6d..03e7a6e1 100644 --- a/src/nitro/communication/messages/parser/moderation/ModtoolCFHTopicsParser.ts +++ b/src/nitro/communication/messages/parser/help/CfhTopicsInitMessageParser.ts @@ -1,7 +1,7 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { CallForHelpCategoryData } from './utils/CallForHelpCategoryData'; +import { CallForHelpCategoryData } from '../../incoming/help/CallForHelpCategoryData'; -export class ModtoolCFHTopicsParser implements IMessageParser +export class CfhTopicsInitMessageParser implements IMessageParser { private _callForHelpCategories: CallForHelpCategoryData[]; diff --git a/src/nitro/communication/messages/parser/help/index.ts b/src/nitro/communication/messages/parser/help/index.ts index 66126c4c..a7967304 100644 --- a/src/nitro/communication/messages/parser/help/index.ts +++ b/src/nitro/communication/messages/parser/help/index.ts @@ -1,3 +1,4 @@ export * from './CallForHelpResultMessageParser'; +export * from './CfhTopicsInitMessageParser'; export * from './common'; export * from './TalentTrackParser'; diff --git a/src/nitro/communication/messages/parser/moderation/CfhChatlogMessageParser.ts b/src/nitro/communication/messages/parser/moderation/CfhChatlogMessageParser.ts new file mode 100644 index 00000000..9cf8106f --- /dev/null +++ b/src/nitro/communication/messages/parser/moderation/CfhChatlogMessageParser.ts @@ -0,0 +1,29 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; +import { CfhChatlogData } from '../../incoming/moderation/CfhChatlogData'; + +export class CfhChatlogMessageParser implements IMessageParser +{ + private _data: CfhChatlogData; + + public flush(): boolean + { + this._data = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._data = new CfhChatlogData(wrapper); + + return true; + } + + public get data(): CfhChatlogData + { + return this._data; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/IssueDeletedMessageParser.ts b/src/nitro/communication/messages/parser/moderation/IssueDeletedMessageParser.ts new file mode 100644 index 00000000..69525294 --- /dev/null +++ b/src/nitro/communication/messages/parser/moderation/IssueDeletedMessageParser.ts @@ -0,0 +1,23 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class IssueDeletedMessageParser implements IMessageParser +{ + private _issueId: number; + + public flush():boolean + { + return true; + } + + public parse(k:IMessageDataWrapper):boolean + { + this._issueId = parseInt(k.readString()); + return true; + } + + public get issueId(): number + { + return this._issueId; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/utils/IssueInfoMessageParser.ts b/src/nitro/communication/messages/parser/moderation/IssueInfoMessageParser.ts similarity index 99% rename from src/nitro/communication/messages/parser/moderation/utils/IssueInfoMessageParser.ts rename to src/nitro/communication/messages/parser/moderation/IssueInfoMessageParser.ts index 677fe3be..98cd9c6e 100644 --- a/src/nitro/communication/messages/parser/moderation/utils/IssueInfoMessageParser.ts +++ b/src/nitro/communication/messages/parser/moderation/IssueInfoMessageParser.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; import { IssueMessageData } from './IssueMessageData'; import { PatternMatchData } from './PatternMatchData'; diff --git a/src/nitro/communication/messages/parser/moderation/utils/IssueMessageData.ts b/src/nitro/communication/messages/parser/moderation/IssueMessageData.ts similarity index 98% rename from src/nitro/communication/messages/parser/moderation/utils/IssueMessageData.ts rename to src/nitro/communication/messages/parser/moderation/IssueMessageData.ts index 54277789..fd6d7b47 100644 --- a/src/nitro/communication/messages/parser/moderation/utils/IssueMessageData.ts +++ b/src/nitro/communication/messages/parser/moderation/IssueMessageData.ts @@ -1,4 +1,4 @@ -import { Nitro } from '../../../../../Nitro'; +import { Nitro } from '../../../../Nitro'; import { PatternMatchData } from './PatternMatchData'; export class IssueMessageData diff --git a/src/nitro/communication/messages/parser/moderation/IssuePickFailedMessageParser.ts b/src/nitro/communication/messages/parser/moderation/IssuePickFailedMessageParser.ts new file mode 100644 index 00000000..8e7adbeb --- /dev/null +++ b/src/nitro/communication/messages/parser/moderation/IssuePickFailedMessageParser.ts @@ -0,0 +1,51 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; +import { IssueMessageData } from './IssueMessageData'; + +export class IssuePickFailedMessageParser implements IMessageParser +{ + private _issues: IssueMessageData[]; + private _retryEnabled: boolean; + private _retryCount: number; + + public flush(): boolean + { + this._issues = null; + return true; + } + + public parse(k: IMessageDataWrapper): boolean + { + this._issues = []; + + const count = k.readInt(); + + for(let i = 0; i < count; i++) + { + const _local_4 = k.readInt(); + const _local_5 = k.readInt(); + const _local_6 = k.readString(); + const _local_7 = new IssueMessageData(_local_4, 0, 0, 0, 0, 0, 0, 0, null, 0, null, _local_5, _local_6, null, 0, []); + this._issues.push(_local_7); + } + + this._retryEnabled = k.readBoolean(); + this._retryCount = k.readInt(); + return true; + } + + public get issues(): IssueMessageData[] + { + return this._issues; + } + + public get retryEnabled(): boolean + { + return this._retryEnabled; + } + + public get retryCount(): number + { + return this._retryCount; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/ModeratorActionResultMessageParser.ts b/src/nitro/communication/messages/parser/moderation/ModeratorActionResultMessageParser.ts new file mode 100644 index 00000000..1c618b69 --- /dev/null +++ b/src/nitro/communication/messages/parser/moderation/ModeratorActionResultMessageParser.ts @@ -0,0 +1,33 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class ModeratorActionResultMessageParser implements IMessageParser +{ + private _userId:number; + private _success:boolean; + + public flush(): boolean + { + this._userId = -1; + this._success = false; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + this._userId = wrapper.readInt(); + this._success = wrapper.readBoolean(); + return true; + } + + public get userId():number + { + return this._userId; + } + + public get success():boolean + { + return this._success; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/utils/ModeratorInitData.ts b/src/nitro/communication/messages/parser/moderation/ModeratorInitData.ts similarity index 98% rename from src/nitro/communication/messages/parser/moderation/utils/ModeratorInitData.ts rename to src/nitro/communication/messages/parser/moderation/ModeratorInitData.ts index aa0e944b..215780ab 100644 --- a/src/nitro/communication/messages/parser/moderation/utils/ModeratorInitData.ts +++ b/src/nitro/communication/messages/parser/moderation/ModeratorInitData.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper } from '../../../../../../core'; +import { IMessageDataWrapper } from '../../../../../core'; import { IssueInfoMessageParser } from './IssueInfoMessageParser'; import { IssueMessageData } from './IssueMessageData'; diff --git a/src/nitro/communication/messages/parser/moderation/ModeratorInitMessageParser.ts b/src/nitro/communication/messages/parser/moderation/ModeratorInitMessageParser.ts index 602d4d00..90825f0d 100644 --- a/src/nitro/communication/messages/parser/moderation/ModeratorInitMessageParser.ts +++ b/src/nitro/communication/messages/parser/moderation/ModeratorInitMessageParser.ts @@ -1,5 +1,5 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { ModeratorInitData } from './utils/ModeratorInitData'; +import { ModeratorInitData } from './ModeratorInitData'; export class ModeratorInitMessageParser implements IMessageParser { diff --git a/src/nitro/communication/messages/parser/moderation/ModeratorMessageParser.ts b/src/nitro/communication/messages/parser/moderation/ModeratorMessageParser.ts new file mode 100644 index 00000000..bd442b34 --- /dev/null +++ b/src/nitro/communication/messages/parser/moderation/ModeratorMessageParser.ts @@ -0,0 +1,36 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class ModeratorMessageParser implements IMessageParser +{ + private _message:string; + private _url:string; + + public flush(): boolean + { + this._message = ''; + this._url = ''; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._message = wrapper.readString(); + this._url = wrapper.readString(); + + return true; + } + + public get message():string + { + return this._message; + } + + public get url():string + { + return this._url; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/ModeratorRoomInfoMessageParser.ts b/src/nitro/communication/messages/parser/moderation/ModeratorRoomInfoMessageParser.ts new file mode 100644 index 00000000..8d8ea6cc --- /dev/null +++ b/src/nitro/communication/messages/parser/moderation/ModeratorRoomInfoMessageParser.ts @@ -0,0 +1,28 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; +import { RoomModerationData } from '../../incoming/moderation/RoomModerationData'; + +export class ModeratorRoomInfoMessageParser implements IMessageParser +{ + private _data:RoomModerationData; + + public flush(): boolean + { + this._data = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._data = new RoomModerationData(wrapper); + + return true; + } + + public get data():RoomModerationData + { + return this._data; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/ModeratorToolPreferencesMessageParser.ts b/src/nitro/communication/messages/parser/moderation/ModeratorToolPreferencesMessageParser.ts new file mode 100644 index 00000000..e38707fd --- /dev/null +++ b/src/nitro/communication/messages/parser/moderation/ModeratorToolPreferencesMessageParser.ts @@ -0,0 +1,48 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class ModeratorToolPreferencesMessageParser implements IMessageParser +{ + private _windowX:number; + private _windowY:number; + private _windowWidth:number; + private _windowHeight:number; + + public flush():boolean + { + this._windowX = 0; + this._windowY = 0; + this._windowWidth = 0; + this._windowHeight = 0; + return true; + } + + public parse(k:IMessageDataWrapper):boolean + { + this._windowX = k.readInt(); + this._windowY = k.readInt(); + this._windowWidth = k.readInt(); + this._windowHeight = k.readInt(); + return true; + } + + public get windowX(): number + { + return this._windowX; + } + + public get windowY(): number + { + return this._windowY; + } + + public get windowWidth(): number + { + return this._windowWidth; + } + + public get windowHeight(): number + { + return this._windowHeight; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/ModtoolUserInfoParser.ts b/src/nitro/communication/messages/parser/moderation/ModeratorUserInfoMessageParser.ts similarity index 75% rename from src/nitro/communication/messages/parser/moderation/ModtoolUserInfoParser.ts rename to src/nitro/communication/messages/parser/moderation/ModeratorUserInfoMessageParser.ts index 217582ca..e5055f0a 100644 --- a/src/nitro/communication/messages/parser/moderation/ModtoolUserInfoParser.ts +++ b/src/nitro/communication/messages/parser/moderation/ModeratorUserInfoMessageParser.ts @@ -1,7 +1,7 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { ModeratorUserInfoData } from './utils/ModeratorUserInfoData'; +import { ModeratorUserInfoData } from '../../incoming/moderation/ModeratorUserInfoData'; -export class ModtoolUserInfoParser implements IMessageParser +export class ModeratorUserInfoMessageParser implements IMessageParser { private _data: ModeratorUserInfoData; @@ -25,7 +25,4 @@ export class ModtoolUserInfoParser implements IMessageParser { return this._data; } - - - } diff --git a/src/nitro/communication/messages/parser/moderation/ModtoolRoomInfoParser.ts b/src/nitro/communication/messages/parser/moderation/ModtoolRoomInfoParser.ts deleted file mode 100644 index 04037d06..00000000 --- a/src/nitro/communication/messages/parser/moderation/ModtoolRoomInfoParser.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; - -export class ModtoolRoomInfoParser implements IMessageParser -{ - private _id: number; - private _playerAmount: number; - private _ownerInRoom: boolean; - private _ownerId: number; - private _ownerName: string; - private _name: string; - private _description: string; - private _tags: string[]; - - public flush(): boolean - { - this._id = null; - this._playerAmount = 0; - this._ownerInRoom = false; - this._ownerId = 0; - this._ownerName = null; - this._name = null; - this._description = null; - this._tags = []; - - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - if(!wrapper) return false; - - this._id = wrapper.readInt(); - this._playerAmount = wrapper.readInt(); - this._ownerInRoom = wrapper.readBoolean(); - this._ownerId = wrapper.readInt(); - this._ownerName = wrapper.readString(); - wrapper.readBoolean(); - this._name = wrapper.readString(); - this._description = wrapper.readString(); - const tagsTotal = wrapper.readInt(); - - this._tags = []; - - for(let i = 0; i < tagsTotal; i++) - { - this._tags.push(wrapper.readString()); - } - - return true; - } - - public get id(): number - { - return this._id; - } - - public get playerAmount(): number - { - return this._playerAmount; - } - - public get ownerInRoom(): boolean - { - return this._ownerInRoom; - } - - public get ownerId(): number - { - return this._ownerId; - } - - public get ownerName(): string - { - return this._ownerName; - } - - public get name(): string - { - return this._name; - } - - public get description(): string - { - return this._description; - } - - public get tags(): string[] - { - return this._tags; - } -} diff --git a/src/nitro/communication/messages/parser/moderation/ModtoolRoomUsersParser.ts b/src/nitro/communication/messages/parser/moderation/ModtoolRoomUsersParser.ts deleted file mode 100644 index 4c346a2e..00000000 --- a/src/nitro/communication/messages/parser/moderation/ModtoolRoomUsersParser.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { ModtoolRoomVisitedData } from './utils/ModtoolRoomVisitedData'; - -export class ModtoolRoomUsersParser implements IMessageParser -{ - private _data: ModtoolRoomVisitedData; - public flush(): boolean - { - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - this._data = new ModtoolRoomVisitedData(wrapper); - return true; - } - - public get data(): ModtoolRoomVisitedData - { - return this._data; - } -} diff --git a/src/nitro/communication/messages/parser/moderation/utils/PatternMatchData.ts b/src/nitro/communication/messages/parser/moderation/PatternMatchData.ts similarity index 85% rename from src/nitro/communication/messages/parser/moderation/utils/PatternMatchData.ts rename to src/nitro/communication/messages/parser/moderation/PatternMatchData.ts index a6dd425c..a73a2d74 100644 --- a/src/nitro/communication/messages/parser/moderation/utils/PatternMatchData.ts +++ b/src/nitro/communication/messages/parser/moderation/PatternMatchData.ts @@ -1,5 +1,5 @@ -import { IMessageDataWrapper } from '../../../../../../core'; -import { IDisposable } from '../../../../../../core/common/disposable/IDisposable'; +import { IMessageDataWrapper } from '../../../../../core'; +import { IDisposable } from '../../../../../core/common/disposable/IDisposable'; export class PatternMatchData implements IDisposable { diff --git a/src/nitro/communication/messages/parser/moderation/ModtoolRoomChatlogParser.ts b/src/nitro/communication/messages/parser/moderation/RoomChatlogMessageParser.ts similarity index 76% rename from src/nitro/communication/messages/parser/moderation/ModtoolRoomChatlogParser.ts rename to src/nitro/communication/messages/parser/moderation/RoomChatlogMessageParser.ts index ddce381d..499fbd7b 100644 --- a/src/nitro/communication/messages/parser/moderation/ModtoolRoomChatlogParser.ts +++ b/src/nitro/communication/messages/parser/moderation/RoomChatlogMessageParser.ts @@ -1,7 +1,7 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { ChatRecordData } from './utils/ChatRecordData'; +import { ChatRecordData } from '../../incoming/moderation/ChatRecordData'; -export class ModtoolRoomChatlogParser implements IMessageParser +export class RoomChatlogMessageParser implements IMessageParser { private _data: ChatRecordData; diff --git a/src/nitro/communication/messages/parser/moderation/RoomVisitsMessageParser.ts b/src/nitro/communication/messages/parser/moderation/RoomVisitsMessageParser.ts new file mode 100644 index 00000000..7671829f --- /dev/null +++ b/src/nitro/communication/messages/parser/moderation/RoomVisitsMessageParser.ts @@ -0,0 +1,23 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; +import { RoomVisitsData } from '../../incoming/moderation/RoomVisitsData'; + +export class RoomVisitsMessageParser implements IMessageParser +{ + private _data: RoomVisitsData; + + public flush(): boolean + { + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + this._data = new RoomVisitsData(wrapper); + return true; + } + + public get data(): RoomVisitsData + { + return this._data; + } +} diff --git a/src/nitro/communication/messages/parser/moderation/ModtoolUserChatlogParser.ts b/src/nitro/communication/messages/parser/moderation/UserChatlogMessageParser.ts similarity index 87% rename from src/nitro/communication/messages/parser/moderation/ModtoolUserChatlogParser.ts rename to src/nitro/communication/messages/parser/moderation/UserChatlogMessageParser.ts index 845592e1..a1251d89 100644 --- a/src/nitro/communication/messages/parser/moderation/ModtoolUserChatlogParser.ts +++ b/src/nitro/communication/messages/parser/moderation/UserChatlogMessageParser.ts @@ -1,7 +1,7 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { ChatRecordData } from './utils/ChatRecordData'; +import { ChatRecordData } from '../../incoming/moderation/ChatRecordData'; -export class ModtoolUserChatlogParser implements IMessageParser +export class UserChatlogMessageParser implements IMessageParser { private _userId: number; private _username: string; diff --git a/src/nitro/communication/messages/parser/moderation/index.ts b/src/nitro/communication/messages/parser/moderation/index.ts index b2cbe03c..9dac902e 100644 --- a/src/nitro/communication/messages/parser/moderation/index.ts +++ b/src/nitro/communication/messages/parser/moderation/index.ts @@ -1,10 +1,18 @@ +export * from './CfhChatlogMessageParser'; +export * from './IssueDeletedMessageParser'; +export * from './IssueInfoMessageParser'; +export * from './IssueMessageData'; +export * from './IssuePickFailedMessageParser'; export * from './ModerationCautionParser'; +export * from './ModeratorActionResultMessageParser'; +export * from './ModeratorInitData'; export * from './ModeratorInitMessageParser'; -export * from './ModtoolCFHTopicsParser'; -export * from './ModtoolRoomChatlogParser'; -export * from './ModtoolRoomInfoParser'; -export * from './ModtoolRoomUsersParser'; -export * from './ModtoolUserChatlogParser'; -export * from './ModtoolUserInfoParser'; +export * from './ModeratorMessageParser'; +export * from './ModeratorRoomInfoMessageParser'; +export * from './ModeratorToolPreferencesMessageParser'; +export * from './ModeratorUserInfoMessageParser'; +export * from './PatternMatchData'; +export * from './RoomChatlogMessageParser'; +export * from './RoomVisitsMessageParser'; export * from './UserBannedMessageParser'; -export * from './utils'; +export * from './UserChatlogMessageParser'; diff --git a/src/nitro/communication/messages/parser/moderation/utils/IChatlog.ts b/src/nitro/communication/messages/parser/moderation/utils/IChatlog.ts deleted file mode 100644 index d14b401b..00000000 --- a/src/nitro/communication/messages/parser/moderation/utils/IChatlog.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface IChatlog -{ - timestamp: string; - userId: number; - userName: string; - message: string; -} diff --git a/src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserChatlog.ts b/src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserChatlog.ts deleted file mode 100644 index 30e450d9..00000000 --- a/src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserChatlog.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { IChatlog } from './IChatlog'; - -export class ModtoolUserChatlogParserChatlog implements IChatlog -{ - private readonly _timestamp: string; - private readonly _userId: number; - private readonly _userName: string; - private readonly _message: string; - private readonly _bool: boolean; - - constructor(timestamp: string, userId: number, userName: string, message: string, bool: boolean) - { - this._timestamp = timestamp; - this._userId = userId; - this._userName = userName; - this._message = message; - this._bool = bool; - } - - public get timestamp(): string - { - return this._timestamp; - } - - public get userId(): number - { - return this._userId; - } - - public get userName(): string - { - return this._userName; - } - - public get message(): string - { - return this._message; - } - - public get bool(): boolean - { - return this._bool; - } -} diff --git a/src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserVisit.ts b/src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserVisit.ts deleted file mode 100644 index 0b684a85..00000000 --- a/src/nitro/communication/messages/parser/moderation/utils/ModtoolUserChatlogParserVisit.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ModtoolUserChatlogParserChatlog } from './ModtoolUserChatlogParserChatlog'; -import { IChatlog } from './IChatlog'; - -export class ModtoolUserChatlogParserVisit -{ - private readonly _roomName: string; - private readonly _roomId: number; - private readonly _chatlogs: IChatlog[]; - - constructor(roomName: string, roomId: number, chatlogs: IChatlog[]) - { - this._roomName = roomName; - this._roomId = roomId; - this._chatlogs = chatlogs; - } - - public get roomName(): string - { - return this._roomName; - } - - public get roomId(): number - { - return this._roomId; - } - - public get chatlogs(): IChatlog[] - { - return this._chatlogs; - } -} diff --git a/src/nitro/communication/messages/parser/moderation/utils/index.ts b/src/nitro/communication/messages/parser/moderation/utils/index.ts deleted file mode 100644 index 171b01c9..00000000 --- a/src/nitro/communication/messages/parser/moderation/utils/index.ts +++ /dev/null @@ -1,13 +0,0 @@ -export * from './CallForHelpCategoryData'; -export * from './ChatRecordData'; -export * from './IChatlog'; -export * from './IssueInfoMessageParser'; -export * from './IssueMessageData'; -export * from './ModeratorInitData'; -export * from './ModeratorUserInfoData'; -export * from './ModtoolRoomChatlogLine'; -export * from './ModtoolRoomVisitedData'; -export * from './ModtoolUserChatlogParserChatlog'; -export * from './ModtoolUserChatlogParserVisit'; -export * from './PatternMatchData'; -export * from './RoomVisitData'; From 51d91121af70a61cabfc861c37a3a77ba2c57c11 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 20 Oct 2021 19:25:57 -0500 Subject: [PATCH 061/108] finished moderation packets --- src/nitro/communication/NitroMessages.ts | 12 ++++--- .../messages/incoming/IncomingHeader.ts | 6 +++- .../moderation/IssueDeletedMessageEvent.ts | 16 +++++++++ .../moderation/IssueInfoMessageEvent.ts | 16 +++++++++ .../moderation/IssuePickFailedMessageEvent.ts | 16 +++++++++ .../ModeratorActionResultMessageEvent.ts | 16 +++++++++ ...InfoEvent.ts => ModeratorUserInfoEvent.ts} | 2 +- ...oomChatlogEvent.ts => RoomChatlogEvent.ts} | 2 +- .../incoming/moderation/UserChatlogData.ts | 35 +++++++++++++++++++ ...serChatlogEvent.ts => UserChatlogEvent.ts} | 2 +- .../messages/incoming/moderation/index.ts | 11 ++++-- .../moderation/UserChatlogMessageParser.ts | 33 ++++------------- 12 files changed, 129 insertions(+), 38 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/moderation/IssueDeletedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/moderation/IssueInfoMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/moderation/IssuePickFailedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/moderation/ModeratorActionResultMessageEvent.ts rename src/nitro/communication/messages/incoming/moderation/{ModtoolUserInfoEvent.ts => ModeratorUserInfoEvent.ts} (86%) rename src/nitro/communication/messages/incoming/moderation/{ModtoolRoomChatlogEvent.ts => RoomChatlogEvent.ts} (85%) create mode 100644 src/nitro/communication/messages/incoming/moderation/UserChatlogData.ts rename src/nitro/communication/messages/incoming/moderation/{ModtoolUserChatlogEvent.ts => UserChatlogEvent.ts} (85%) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 36d4570c..ba8949e3 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -90,7 +90,7 @@ import { MarketplaceItemStatsEvent } from './messages/incoming/marketplace/Marke import { MarketplaceMakeOfferResult } from './messages/incoming/marketplace/MarketplaceMakeOfferResult'; import { MarketPlaceOffersEvent } from './messages/incoming/marketplace/MarketplaceOffersEvent'; import { MarketplaceOwnOffersEvent } from './messages/incoming/marketplace/MarketplaceOwnOffersEvent'; -import { CfhChatlogEvent, ModeratorInitMessageEvent, ModeratorRoomInfoEvent, ModtoolRoomChatlogEvent, ModtoolUserChatlogEvent, ModtoolUserInfoEvent, RoomVisitsEvent, UserBannedMessageEvent } from './messages/incoming/moderation'; +import { CfhChatlogEvent, IssueDeletedMessageEvent, IssueInfoMessageEvent, IssuePickFailedMessageEvent, ModeratorActionResultMessageEvent, ModeratorInitMessageEvent, ModeratorRoomInfoEvent, ModeratorUserInfoEvent, RoomChatlogEvent, RoomVisitsEvent, UserBannedMessageEvent, UserChatlogEvent } from './messages/incoming/moderation'; import { ModeratorCautionEvent } from './messages/incoming/moderation/ModeratorCautionEvent'; import { NavigatorCategoriesEvent } from './messages/incoming/navigator/NavigatorCategoriesEvent'; import { NavigatorCollapsedEvent } from './messages/incoming/navigator/NavigatorCollapsedEvent'; @@ -659,12 +659,16 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.USER_BANNED, UserBannedMessageEvent); this._events.set(IncomingHeader.MODERATION_CAUTION, ModeratorCautionEvent); this._events.set(IncomingHeader.MODTOOL_ROOM_INFO, ModeratorRoomInfoEvent); - this._events.set(IncomingHeader.MODTOOL_USER_CHATLOG, ModtoolUserChatlogEvent); - this._events.set(IncomingHeader.MODTOOL_ROOM_CHATLOG, ModtoolRoomChatlogEvent); - this._events.set(IncomingHeader.MODERATION_USER_INFO, ModtoolUserInfoEvent); + this._events.set(IncomingHeader.MODTOOL_USER_CHATLOG, UserChatlogEvent); + this._events.set(IncomingHeader.MODTOOL_ROOM_CHATLOG, RoomChatlogEvent); + this._events.set(IncomingHeader.MODERATION_USER_INFO, ModeratorUserInfoEvent); this._events.set(IncomingHeader.MODERATION_TOOL, ModeratorInitMessageEvent); this._events.set(IncomingHeader.MODTOOL_VISITED_ROOMS_USER, RoomVisitsEvent); this._events.set(IncomingHeader.CFH_CHATLOG, CfhChatlogEvent); + this._events.set(IncomingHeader.ISSUE_DELETED, IssueDeletedMessageEvent); + this._events.set(IncomingHeader.ISSUE_INFO, IssueInfoMessageEvent); + this._events.set(IncomingHeader.ISSUE_PICK_FAILED, IssuePickFailedMessageEvent); + this._events.set(IncomingHeader.MODERATOR_ACTION_RESULT, ModeratorActionResultMessageEvent); // MYSTERY BOX this._events.set(IncomingHeader.MYSTERY_BOX_KEYS, MysteryBoxKeysEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 0193214d..1e2f36ea 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -215,6 +215,11 @@ export class IncomingHeader public static MODTOOL_ROOM_INFO = 1333; public static MODTOOL_USER_CHATLOG = 3377; public static MODTOOL_ROOM_CHATLOG = 3434; + public static MODTOOL_VISITED_ROOMS_USER = 1752; + public static MODERATOR_ACTION_RESULT = 2335; + public static ISSUE_DELETED = 3192; + public static ISSUE_INFO = 3609; + public static ISSUE_PICK_FAILED = 3150; public static CFH_CHATLOG = 607; public static LOVELOCK_FURNI_START = 3753; public static LOVELOCK_FURNI_FRIEND_COMFIRMED = 382; @@ -230,7 +235,6 @@ export class IncomingHeader public static CLUB_GIFT_INFO = 619; public static REDEEM_VOUCHER_ERROR = 714; public static REDEEM_VOUCHER_OK = 3336; - public static MODTOOL_VISITED_ROOMS_USER = 1752; public static IN_CLIENT_LINK = 2023; public static BOT_COMMAND_CONFIGURATION = 1618; public static HAND_ITEM_RECEIVED = 354; diff --git a/src/nitro/communication/messages/incoming/moderation/IssueDeletedMessageEvent.ts b/src/nitro/communication/messages/incoming/moderation/IssueDeletedMessageEvent.ts new file mode 100644 index 00000000..a284b936 --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/IssueDeletedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { IssueDeletedMessageParser } from '../../parser/moderation/IssueDeletedMessageParser'; + +export class IssueDeletedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, IssueDeletedMessageParser); + } + + public getParser(): IssueDeletedMessageParser + { + return this.parser as IssueDeletedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/moderation/IssueInfoMessageEvent.ts b/src/nitro/communication/messages/incoming/moderation/IssueInfoMessageEvent.ts new file mode 100644 index 00000000..c0333171 --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/IssueInfoMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { IssueInfoMessageParser } from '../../parser/moderation/IssueInfoMessageParser'; + +export class IssueInfoMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, IssueInfoMessageParser); + } + + public getParser(): IssueInfoMessageParser + { + return this.parser as IssueInfoMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/moderation/IssuePickFailedMessageEvent.ts b/src/nitro/communication/messages/incoming/moderation/IssuePickFailedMessageEvent.ts new file mode 100644 index 00000000..23dfcc91 --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/IssuePickFailedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { IssuePickFailedMessageParser } from '../../parser/moderation/IssuePickFailedMessageParser'; + +export class IssuePickFailedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, IssuePickFailedMessageParser); + } + + public getParser(): IssuePickFailedMessageParser + { + return this.parser as IssuePickFailedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/moderation/ModeratorActionResultMessageEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModeratorActionResultMessageEvent.ts new file mode 100644 index 00000000..67aecfad --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/ModeratorActionResultMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ModeratorActionResultMessageParser } from '../../parser/moderation/ModeratorActionResultMessageParser'; + +export class ModeratorActionResultMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ModeratorActionResultMessageParser); + } + + public getParser(): ModeratorActionResultMessageParser + { + return this.parser as ModeratorActionResultMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/moderation/ModtoolUserInfoEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModeratorUserInfoEvent.ts similarity index 86% rename from src/nitro/communication/messages/incoming/moderation/ModtoolUserInfoEvent.ts rename to src/nitro/communication/messages/incoming/moderation/ModeratorUserInfoEvent.ts index 66948248..2da99427 100644 --- a/src/nitro/communication/messages/incoming/moderation/ModtoolUserInfoEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModeratorUserInfoEvent.ts @@ -2,7 +2,7 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessa import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; import { ModeratorUserInfoMessageParser } from '../../parser/moderation/ModeratorUserInfoMessageParser'; -export class ModtoolUserInfoEvent extends MessageEvent implements IMessageEvent +export class ModeratorUserInfoEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { diff --git a/src/nitro/communication/messages/incoming/moderation/ModtoolRoomChatlogEvent.ts b/src/nitro/communication/messages/incoming/moderation/RoomChatlogEvent.ts similarity index 85% rename from src/nitro/communication/messages/incoming/moderation/ModtoolRoomChatlogEvent.ts rename to src/nitro/communication/messages/incoming/moderation/RoomChatlogEvent.ts index 905ff1b2..791a2b30 100644 --- a/src/nitro/communication/messages/incoming/moderation/ModtoolRoomChatlogEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/RoomChatlogEvent.ts @@ -2,7 +2,7 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessa import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; import { RoomChatlogMessageParser } from '../../parser/moderation/RoomChatlogMessageParser'; -export class ModtoolRoomChatlogEvent extends MessageEvent implements IMessageEvent +export class RoomChatlogEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { diff --git a/src/nitro/communication/messages/incoming/moderation/UserChatlogData.ts b/src/nitro/communication/messages/incoming/moderation/UserChatlogData.ts new file mode 100644 index 00000000..4092c712 --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/UserChatlogData.ts @@ -0,0 +1,35 @@ +import { IMessageDataWrapper } from '../../../../..'; +import { ChatRecordData } from './ChatRecordData'; + +export class UserChatlogData +{ + private _userId: number; + private _username: string; + private _roomChatlogs: ChatRecordData[] = []; + + constructor(wrapper: IMessageDataWrapper) + { + this._userId = wrapper.readInt(); + this._username = wrapper.readString(); + const size = wrapper.readInt(); + for(let i = 0; i < size; i++) + { + this._roomChatlogs.push(new ChatRecordData(wrapper)); + } + } + + public get userId(): number + { + return this._userId; + } + + public get username(): string + { + return this._username; + } + + public get roomChatlogs(): ChatRecordData[] + { + return this._roomChatlogs; + } +} diff --git a/src/nitro/communication/messages/incoming/moderation/ModtoolUserChatlogEvent.ts b/src/nitro/communication/messages/incoming/moderation/UserChatlogEvent.ts similarity index 85% rename from src/nitro/communication/messages/incoming/moderation/ModtoolUserChatlogEvent.ts rename to src/nitro/communication/messages/incoming/moderation/UserChatlogEvent.ts index 6189b612..2413b2e7 100644 --- a/src/nitro/communication/messages/incoming/moderation/ModtoolUserChatlogEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/UserChatlogEvent.ts @@ -2,7 +2,7 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessa import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; import { UserChatlogMessageParser } from '../../parser/moderation/UserChatlogMessageParser'; -export class ModtoolUserChatlogEvent extends MessageEvent implements IMessageEvent +export class UserChatlogEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { diff --git a/src/nitro/communication/messages/incoming/moderation/index.ts b/src/nitro/communication/messages/incoming/moderation/index.ts index d98947c4..35c0383b 100644 --- a/src/nitro/communication/messages/incoming/moderation/index.ts +++ b/src/nitro/communication/messages/incoming/moderation/index.ts @@ -3,16 +3,21 @@ export * from './CfhChatlogEvent'; export * from './ChatlineData'; export * from './ChatRecordData'; export * from './INamed'; +export * from './IssueDeletedMessageEvent'; +export * from './IssueInfoMessageEvent'; +export * from './IssuePickFailedMessageEvent'; +export * from './ModeratorActionResultMessageEvent'; export * from './ModeratorCautionEvent'; export * from './ModeratorInitMessageEvent'; export * from './ModeratorRoomInfoEvent'; export * from './ModeratorUserInfoData'; -export * from './ModtoolRoomChatlogEvent'; -export * from './ModtoolUserChatlogEvent'; -export * from './ModtoolUserInfoEvent'; +export * from './ModeratorUserInfoEvent'; +export * from './RoomChatlogEvent'; export * from './RoomData'; export * from './RoomModerationData'; export * from './RoomVisitData'; export * from './RoomVisitsData'; export * from './RoomVisitsEvent'; export * from './UserBannedMessageEvent'; +export * from './UserChatlogData'; +export * from './UserChatlogEvent'; diff --git a/src/nitro/communication/messages/parser/moderation/UserChatlogMessageParser.ts b/src/nitro/communication/messages/parser/moderation/UserChatlogMessageParser.ts index a1251d89..0b4515d0 100644 --- a/src/nitro/communication/messages/parser/moderation/UserChatlogMessageParser.ts +++ b/src/nitro/communication/messages/parser/moderation/UserChatlogMessageParser.ts @@ -1,17 +1,13 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { ChatRecordData } from '../../incoming/moderation/ChatRecordData'; +import { UserChatlogData } from '../../incoming/moderation/UserChatlogData'; export class UserChatlogMessageParser implements IMessageParser { - private _userId: number; - private _username: string; - private _roomVisits: ChatRecordData[] = []; + private _data:UserChatlogData; public flush(): boolean { - this._userId = null; - this._username = null; - this._roomVisits = []; + this._data = null; return true; } @@ -20,30 +16,13 @@ export class UserChatlogMessageParser implements IMessageParser { if(!wrapper) return false; - this._userId = wrapper.readInt(); - this._username = wrapper.readString(); - const size = wrapper.readInt(); - for(let i = 0; i < size; i++) - { - this._roomVisits.push(new ChatRecordData(wrapper)); - } + this._data = new UserChatlogData(wrapper); return true; } - public get userId(): number + public get data():UserChatlogData { - return this._userId; + return this._data; } - - public get username(): string - { - return this._username; - } - - public get roomVisits(): ChatRecordData[] - { - return this._roomVisits; - } - } From 82f6fb86b2c09cca1c09efebfc3c90e09e555809 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 20 Oct 2021 19:42:31 -0500 Subject: [PATCH 062/108] oops missed some stuff --- src/nitro/communication/NitroMessages.ts | 5 ++- .../communication/messages/incoming/index.ts | 1 - .../ModeratorMessageEvent.ts | 2 +- .../messages/incoming/moderation/index.ts | 1 + .../messages/incoming/notifications/index.ts | 1 - .../callforhelp/CfhTopicsInitMessageParser.ts | 2 +- .../communication/messages/parser/index.ts | 1 - .../notifications/ModeratorMessageParser.ts | 35 ------------------- .../messages/parser/notifications/index.ts | 1 - 9 files changed, 5 insertions(+), 44 deletions(-) rename src/nitro/communication/messages/incoming/{notifications => moderation}/ModeratorMessageEvent.ts (83%) delete mode 100644 src/nitro/communication/messages/parser/notifications/ModeratorMessageParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index ba8949e3..52a759af 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -90,7 +90,7 @@ import { MarketplaceItemStatsEvent } from './messages/incoming/marketplace/Marke import { MarketplaceMakeOfferResult } from './messages/incoming/marketplace/MarketplaceMakeOfferResult'; import { MarketPlaceOffersEvent } from './messages/incoming/marketplace/MarketplaceOffersEvent'; import { MarketplaceOwnOffersEvent } from './messages/incoming/marketplace/MarketplaceOwnOffersEvent'; -import { CfhChatlogEvent, IssueDeletedMessageEvent, IssueInfoMessageEvent, IssuePickFailedMessageEvent, ModeratorActionResultMessageEvent, ModeratorInitMessageEvent, ModeratorRoomInfoEvent, ModeratorUserInfoEvent, RoomChatlogEvent, RoomVisitsEvent, UserBannedMessageEvent, UserChatlogEvent } from './messages/incoming/moderation'; +import { CfhChatlogEvent, IssueDeletedMessageEvent, IssueInfoMessageEvent, IssuePickFailedMessageEvent, ModeratorActionResultMessageEvent, ModeratorInitMessageEvent, ModeratorMessageEvent, ModeratorRoomInfoEvent, ModeratorUserInfoEvent, RoomChatlogEvent, RoomVisitsEvent, UserBannedMessageEvent, UserChatlogEvent } from './messages/incoming/moderation'; import { ModeratorCautionEvent } from './messages/incoming/moderation/ModeratorCautionEvent'; import { NavigatorCategoriesEvent } from './messages/incoming/navigator/NavigatorCategoriesEvent'; import { NavigatorCollapsedEvent } from './messages/incoming/navigator/NavigatorCollapsedEvent'; @@ -104,7 +104,6 @@ import { NavigatorSearchEvent } from './messages/incoming/navigator/NavigatorSea import { NavigatorSettingsEvent } from './messages/incoming/navigator/NavigatorSettingsEvent'; import { BotErrorEvent } from './messages/incoming/notifications/BotErrorEvent'; import { HabboBroadcastMessageEvent } from './messages/incoming/notifications/HabboBroadcastMessageEvent'; -import { ModeratorMessageEvent } from './messages/incoming/notifications/ModeratorMessageEvent'; import { MOTDNotificationEvent } from './messages/incoming/notifications/MOTDNotificationEvent'; import { NotificationDialogMessageEvent } from './messages/incoming/notifications/NotificationDialogMessageEvent'; import { PetLevelNotificationEvent } from './messages/incoming/notifications/PetLevelNotificationEvent'; @@ -669,6 +668,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.ISSUE_INFO, IssueInfoMessageEvent); this._events.set(IncomingHeader.ISSUE_PICK_FAILED, IssuePickFailedMessageEvent); this._events.set(IncomingHeader.MODERATOR_ACTION_RESULT, ModeratorActionResultMessageEvent); + this._events.set(IncomingHeader.MODERATOR_MESSAGE, ModeratorMessageEvent); // MYSTERY BOX this._events.set(IncomingHeader.MYSTERY_BOX_KEYS, MysteryBoxKeysEvent); @@ -693,7 +693,6 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.ACHIEVEMENT_NOTIFICATION, AchievementNotificationMessageEvent); this._events.set(IncomingHeader.INFO_FEED_ENABLE, InfoFeedEnableMessageEvent); this._events.set(IncomingHeader.CLUB_GIFT_NOTIFICATION, ClubGiftNotificationEvent); - this._events.set(IncomingHeader.MODERATOR_MESSAGE, ModeratorMessageEvent); this._events.set(IncomingHeader.ACTIVITY_POINT_NOTIFICATION, ActivityPointNotificationMessageEvent); this._events.set(IncomingHeader.BOT_ERROR, BotErrorEvent); this._events.set(IncomingHeader.PET_LEVEL_NOTIFICATION, PetLevelNotificationEvent); diff --git a/src/nitro/communication/messages/incoming/index.ts b/src/nitro/communication/messages/incoming/index.ts index 39f22de2..351fbb79 100644 --- a/src/nitro/communication/messages/incoming/index.ts +++ b/src/nitro/communication/messages/incoming/index.ts @@ -24,7 +24,6 @@ export * from './inventory/trading'; export * from './landingview'; export * from './marketplace'; export * from './moderation'; -export * from './modtool'; export * from './mysterybox'; export * from './navigator'; export * from './notifications'; diff --git a/src/nitro/communication/messages/incoming/notifications/ModeratorMessageEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModeratorMessageEvent.ts similarity index 83% rename from src/nitro/communication/messages/incoming/notifications/ModeratorMessageEvent.ts rename to src/nitro/communication/messages/incoming/moderation/ModeratorMessageEvent.ts index 3e6f1c67..58103ccf 100644 --- a/src/nitro/communication/messages/incoming/notifications/ModeratorMessageEvent.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModeratorMessageEvent.ts @@ -1,6 +1,6 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ModeratorMessageParser } from '../../parser/notifications/ModeratorMessageParser'; +import { ModeratorMessageParser } from '../../parser/moderation/ModeratorMessageParser'; export class ModeratorMessageEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/moderation/index.ts b/src/nitro/communication/messages/incoming/moderation/index.ts index 35c0383b..3427e82c 100644 --- a/src/nitro/communication/messages/incoming/moderation/index.ts +++ b/src/nitro/communication/messages/incoming/moderation/index.ts @@ -9,6 +9,7 @@ export * from './IssuePickFailedMessageEvent'; export * from './ModeratorActionResultMessageEvent'; export * from './ModeratorCautionEvent'; export * from './ModeratorInitMessageEvent'; +export * from './ModeratorMessageEvent'; export * from './ModeratorRoomInfoEvent'; export * from './ModeratorUserInfoData'; export * from './ModeratorUserInfoEvent'; diff --git a/src/nitro/communication/messages/incoming/notifications/index.ts b/src/nitro/communication/messages/incoming/notifications/index.ts index 59453798..467abb76 100644 --- a/src/nitro/communication/messages/incoming/notifications/index.ts +++ b/src/nitro/communication/messages/incoming/notifications/index.ts @@ -6,7 +6,6 @@ export * from './ClubGiftNotificationEvent'; export * from './HabboBroadcastMessageEvent'; export * from './HotelWillShutdownEvent'; export * from './InfoFeedEnableMessageEvent'; -export * from './ModeratorMessageEvent'; export * from './MOTDNotificationEvent'; export * from './NotificationDialogMessageEvent'; export * from './PetLevelNotificationEvent'; diff --git a/src/nitro/communication/messages/parser/callforhelp/CfhTopicsInitMessageParser.ts b/src/nitro/communication/messages/parser/callforhelp/CfhTopicsInitMessageParser.ts index f2ef9856..87884dbc 100644 --- a/src/nitro/communication/messages/parser/callforhelp/CfhTopicsInitMessageParser.ts +++ b/src/nitro/communication/messages/parser/callforhelp/CfhTopicsInitMessageParser.ts @@ -1,5 +1,5 @@ import { IMessageDataWrapper } from '../../../../../core'; -import { CallForHelpCategoryData } from '../modtool'; +import { CallForHelpCategoryData } from '../../incoming/callforhelp/CallForHelpCategoryData'; import { IMessageParser } from './../../../../../core'; export class CfhTopicsInitMessageParser implements IMessageParser diff --git a/src/nitro/communication/messages/parser/index.ts b/src/nitro/communication/messages/parser/index.ts index 598c2b67..8cac1987 100644 --- a/src/nitro/communication/messages/parser/index.ts +++ b/src/nitro/communication/messages/parser/index.ts @@ -16,7 +16,6 @@ export * from './inventory'; export * from './landingview'; export * from './marketplace'; export * from './moderation'; -export * from './modtool'; export * from './mysterybox'; export * from './navigator'; export * from './notifications'; diff --git a/src/nitro/communication/messages/parser/notifications/ModeratorMessageParser.ts b/src/nitro/communication/messages/parser/notifications/ModeratorMessageParser.ts deleted file mode 100644 index 5ef14012..00000000 --- a/src/nitro/communication/messages/parser/notifications/ModeratorMessageParser.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; - -export class ModeratorMessageParser implements IMessageParser -{ - private _message: string; - private _link: string; - - public flush(): boolean - { - this._message = null; - this._link = null; - - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - if(!wrapper) return false; - - this._message = wrapper.readString(); - this._link = wrapper.readString(); - - return true; - } - - public get message(): string - { - return this._message; - } - - public get link(): string - { - return this._link; - } -} diff --git a/src/nitro/communication/messages/parser/notifications/index.ts b/src/nitro/communication/messages/parser/notifications/index.ts index 3837191f..3716cd8d 100644 --- a/src/nitro/communication/messages/parser/notifications/index.ts +++ b/src/nitro/communication/messages/parser/notifications/index.ts @@ -5,7 +5,6 @@ export * from './ClubGiftNotificationParser'; export * from './HabboBroadcastMessageParser'; export * from './HotelWillShutdownParser'; export * from './InfoFeedEnableMessageParser'; -export * from './ModeratorMessageParser'; export * from './MOTDNotificationParser'; export * from './NotificationDialogMessageParser'; export * from './PetLevelNotificationParser'; From 80906ebc239345ab299608527c3c91a8feef0306 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 20 Oct 2021 19:49:47 -0500 Subject: [PATCH 063/108] resolve name conflicts --- .../messages/incoming/moderation/ChatlineData.ts | 1 - .../incoming/moderation/{RoomData.ts => ModRoomData.ts} | 2 +- .../messages/incoming/moderation/RoomModerationData.ts | 8 ++++---- .../communication/messages/incoming/moderation/index.ts | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) rename src/nitro/communication/messages/incoming/moderation/{RoomData.ts => ModRoomData.ts} (96%) diff --git a/src/nitro/communication/messages/incoming/moderation/ChatlineData.ts b/src/nitro/communication/messages/incoming/moderation/ChatlineData.ts index a0145b5f..32432b7f 100644 --- a/src/nitro/communication/messages/incoming/moderation/ChatlineData.ts +++ b/src/nitro/communication/messages/incoming/moderation/ChatlineData.ts @@ -1,4 +1,3 @@ - export class ChatlineData { private readonly _timestamp: string; diff --git a/src/nitro/communication/messages/incoming/moderation/RoomData.ts b/src/nitro/communication/messages/incoming/moderation/ModRoomData.ts similarity index 96% rename from src/nitro/communication/messages/incoming/moderation/RoomData.ts rename to src/nitro/communication/messages/incoming/moderation/ModRoomData.ts index 7d990d64..9fef6466 100644 --- a/src/nitro/communication/messages/incoming/moderation/RoomData.ts +++ b/src/nitro/communication/messages/incoming/moderation/ModRoomData.ts @@ -1,7 +1,7 @@ import { IDisposable } from '../../../../../core/common/disposable/IDisposable'; import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; -export class RoomData implements IDisposable +export class ModRoomData implements IDisposable { private _exists:boolean; private _name:string; diff --git a/src/nitro/communication/messages/incoming/moderation/RoomModerationData.ts b/src/nitro/communication/messages/incoming/moderation/RoomModerationData.ts index 354b31e3..1a7950c5 100644 --- a/src/nitro/communication/messages/incoming/moderation/RoomModerationData.ts +++ b/src/nitro/communication/messages/incoming/moderation/RoomModerationData.ts @@ -1,6 +1,6 @@ import { IDisposable } from '../../../../../core/common/disposable/IDisposable'; import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; -import { RoomData } from './RoomData'; +import { ModRoomData } from './ModRoomData'; export class RoomModerationData implements IDisposable { @@ -9,7 +9,7 @@ export class RoomModerationData implements IDisposable private _ownerInRoom:boolean; private _ownerId:number; private _ownerName:string; - private _room:RoomData; + private _room:ModRoomData; private _disposed:boolean; constructor(k:IMessageDataWrapper) @@ -19,7 +19,7 @@ export class RoomModerationData implements IDisposable this._ownerInRoom = k.readBoolean(); this._ownerId = k.readInt(); this._ownerName = k.readString(); - this._room = new RoomData(k); + this._room = new ModRoomData(k); } public get flatId():number @@ -47,7 +47,7 @@ export class RoomModerationData implements IDisposable return this._ownerName; } - public get room():RoomData + public get room():ModRoomData { return this._room; } diff --git a/src/nitro/communication/messages/incoming/moderation/index.ts b/src/nitro/communication/messages/incoming/moderation/index.ts index 3427e82c..22c4cfea 100644 --- a/src/nitro/communication/messages/incoming/moderation/index.ts +++ b/src/nitro/communication/messages/incoming/moderation/index.ts @@ -13,8 +13,8 @@ export * from './ModeratorMessageEvent'; export * from './ModeratorRoomInfoEvent'; export * from './ModeratorUserInfoData'; export * from './ModeratorUserInfoEvent'; +export * from './ModRoomData'; export * from './RoomChatlogEvent'; -export * from './RoomData'; export * from './RoomModerationData'; export * from './RoomVisitData'; export * from './RoomVisitsData'; From 80cb55ea2c28c65f0c3394b4b1f35c3d2f0243e5 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 20 Oct 2021 23:02:20 -0500 Subject: [PATCH 064/108] missed a message --- src/nitro/communication/NitroMessages.ts | 3 ++- .../messages/incoming/IncomingHeader.ts | 1 + .../moderation/ModeratorToolPreferencesEvent.ts | 16 ++++++++++++++++ .../messages/incoming/moderation/index.ts | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/incoming/moderation/ModeratorToolPreferencesEvent.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 52a759af..0a3f2956 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -90,7 +90,7 @@ import { MarketplaceItemStatsEvent } from './messages/incoming/marketplace/Marke import { MarketplaceMakeOfferResult } from './messages/incoming/marketplace/MarketplaceMakeOfferResult'; import { MarketPlaceOffersEvent } from './messages/incoming/marketplace/MarketplaceOffersEvent'; import { MarketplaceOwnOffersEvent } from './messages/incoming/marketplace/MarketplaceOwnOffersEvent'; -import { CfhChatlogEvent, IssueDeletedMessageEvent, IssueInfoMessageEvent, IssuePickFailedMessageEvent, ModeratorActionResultMessageEvent, ModeratorInitMessageEvent, ModeratorMessageEvent, ModeratorRoomInfoEvent, ModeratorUserInfoEvent, RoomChatlogEvent, RoomVisitsEvent, UserBannedMessageEvent, UserChatlogEvent } from './messages/incoming/moderation'; +import { CfhChatlogEvent, IssueDeletedMessageEvent, IssueInfoMessageEvent, IssuePickFailedMessageEvent, ModeratorActionResultMessageEvent, ModeratorInitMessageEvent, ModeratorMessageEvent, ModeratorRoomInfoEvent, ModeratorToolPreferencesEvent, ModeratorUserInfoEvent, RoomChatlogEvent, RoomVisitsEvent, UserBannedMessageEvent, UserChatlogEvent } from './messages/incoming/moderation'; import { ModeratorCautionEvent } from './messages/incoming/moderation/ModeratorCautionEvent'; import { NavigatorCategoriesEvent } from './messages/incoming/navigator/NavigatorCategoriesEvent'; import { NavigatorCollapsedEvent } from './messages/incoming/navigator/NavigatorCollapsedEvent'; @@ -669,6 +669,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.ISSUE_PICK_FAILED, IssuePickFailedMessageEvent); this._events.set(IncomingHeader.MODERATOR_ACTION_RESULT, ModeratorActionResultMessageEvent); this._events.set(IncomingHeader.MODERATOR_MESSAGE, ModeratorMessageEvent); + this._events.set(IncomingHeader.MODERATOR_TOOL_PREFERENCES, ModeratorToolPreferencesEvent); // MYSTERY BOX this._events.set(IncomingHeader.MYSTERY_BOX_KEYS, MysteryBoxKeysEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 1e2f36ea..713f9102 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -221,6 +221,7 @@ export class IncomingHeader public static ISSUE_INFO = 3609; public static ISSUE_PICK_FAILED = 3150; public static CFH_CHATLOG = 607; + public static MODERATOR_TOOL_PREFERENCES = 1576; public static LOVELOCK_FURNI_START = 3753; public static LOVELOCK_FURNI_FRIEND_COMFIRMED = 382; public static LOVELOCK_FURNI_FINISHED = 770; diff --git a/src/nitro/communication/messages/incoming/moderation/ModeratorToolPreferencesEvent.ts b/src/nitro/communication/messages/incoming/moderation/ModeratorToolPreferencesEvent.ts new file mode 100644 index 00000000..3dd6f913 --- /dev/null +++ b/src/nitro/communication/messages/incoming/moderation/ModeratorToolPreferencesEvent.ts @@ -0,0 +1,16 @@ +import { ModeratorToolPreferencesMessageParser } from '../..'; +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; + +export class ModeratorToolPreferencesEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ModeratorToolPreferencesMessageParser); + } + + public getParser(): ModeratorToolPreferencesMessageParser + { + return this.parser as ModeratorToolPreferencesMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/moderation/index.ts b/src/nitro/communication/messages/incoming/moderation/index.ts index 22c4cfea..34640aef 100644 --- a/src/nitro/communication/messages/incoming/moderation/index.ts +++ b/src/nitro/communication/messages/incoming/moderation/index.ts @@ -11,6 +11,7 @@ export * from './ModeratorCautionEvent'; export * from './ModeratorInitMessageEvent'; export * from './ModeratorMessageEvent'; export * from './ModeratorRoomInfoEvent'; +export * from './ModeratorToolPreferencesEvent'; export * from './ModeratorUserInfoData'; export * from './ModeratorUserInfoEvent'; export * from './ModRoomData'; From 9637be200815232a691614ca25504b3a4b5c26fe Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 20 Oct 2021 23:35:02 -0500 Subject: [PATCH 065/108] removed duplicate packets --- .../incoming/help/CallForHelpCategoryData.ts | 44 ------------------- .../incoming/help/CfhTopicsInitEvent.ts | 16 ------- .../messages/incoming/help/index.ts | 2 - .../communication/messages/incoming/index.ts | 1 + .../parser/help/CfhTopicsInitMessageParser.ts | 31 ------------- .../messages/parser/help/index.ts | 1 - 6 files changed, 1 insertion(+), 94 deletions(-) delete mode 100644 src/nitro/communication/messages/incoming/help/CallForHelpCategoryData.ts delete mode 100644 src/nitro/communication/messages/incoming/help/CfhTopicsInitEvent.ts delete mode 100644 src/nitro/communication/messages/parser/help/CfhTopicsInitMessageParser.ts diff --git a/src/nitro/communication/messages/incoming/help/CallForHelpCategoryData.ts b/src/nitro/communication/messages/incoming/help/CallForHelpCategoryData.ts deleted file mode 100644 index f82e6dd2..00000000 --- a/src/nitro/communication/messages/incoming/help/CallForHelpCategoryData.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../core'; - -export class CallForHelpCategoryData -{ - private _name: string; - private _topics: CallForHelpTopicData[]; - - constructor(wrapper: IMessageDataWrapper) - { - this._topics = []; - this._name = wrapper.readString(); - const count = wrapper.readInt(); - let i = 0; - while(i < count) - { - const name = wrapper.readString(); - const id = wrapper.readInt(); - const unknown = wrapper.readString(); - this._topics.push({ - name, - id, - consequence: unknown - }); - i++; - } - - } - - public get topics(): CallForHelpTopicData[] - { - return this._topics; - } - - public get name(): string - { - return this._name; - } -} - -interface CallForHelpTopicData { - name: string; - id: number; - consequence: string; -} diff --git a/src/nitro/communication/messages/incoming/help/CfhTopicsInitEvent.ts b/src/nitro/communication/messages/incoming/help/CfhTopicsInitEvent.ts deleted file mode 100644 index 730a8197..00000000 --- a/src/nitro/communication/messages/incoming/help/CfhTopicsInitEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { CfhTopicsInitMessageParser } from '../../parser/help/CfhTopicsInitMessageParser'; - -export class CfhTopicsInitEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, CfhTopicsInitMessageParser); - } - - public getParser(): CfhTopicsInitMessageParser - { - return this.parser as CfhTopicsInitMessageParser; - } -} diff --git a/src/nitro/communication/messages/incoming/help/index.ts b/src/nitro/communication/messages/incoming/help/index.ts index af7e99c6..b0bcb133 100644 --- a/src/nitro/communication/messages/incoming/help/index.ts +++ b/src/nitro/communication/messages/incoming/help/index.ts @@ -1,4 +1,2 @@ -export * from './CallForHelpCategoryData'; export * from './CallForHelpResultMessageEvent'; -export * from './CfhTopicsInitEvent'; export * from './TalentTrackEvent'; diff --git a/src/nitro/communication/messages/incoming/index.ts b/src/nitro/communication/messages/incoming/index.ts index 351fbb79..68200572 100644 --- a/src/nitro/communication/messages/incoming/index.ts +++ b/src/nitro/communication/messages/incoming/index.ts @@ -2,6 +2,7 @@ export * from './advertisement'; export * from './availability'; export * from './avatar'; export * from './bots'; +export * from './callforhelp'; export * from './camera'; export * from './catalog'; export * from './client'; diff --git a/src/nitro/communication/messages/parser/help/CfhTopicsInitMessageParser.ts b/src/nitro/communication/messages/parser/help/CfhTopicsInitMessageParser.ts deleted file mode 100644 index 03e7a6e1..00000000 --- a/src/nitro/communication/messages/parser/help/CfhTopicsInitMessageParser.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { CallForHelpCategoryData } from '../../incoming/help/CallForHelpCategoryData'; - -export class CfhTopicsInitMessageParser implements IMessageParser -{ - private _callForHelpCategories: CallForHelpCategoryData[]; - - public flush(): boolean - { - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - this._callForHelpCategories = []; - const count = wrapper.readInt(); - let i = 0; - while(i < count) - { - this._callForHelpCategories.push(new CallForHelpCategoryData(wrapper)); - i++; - } - - return true; - } - - public get callForHelpCategories(): CallForHelpCategoryData[] - { - return this._callForHelpCategories; - } -} diff --git a/src/nitro/communication/messages/parser/help/index.ts b/src/nitro/communication/messages/parser/help/index.ts index a7967304..66126c4c 100644 --- a/src/nitro/communication/messages/parser/help/index.ts +++ b/src/nitro/communication/messages/parser/help/index.ts @@ -1,4 +1,3 @@ export * from './CallForHelpResultMessageParser'; -export * from './CfhTopicsInitMessageParser'; export * from './common'; export * from './TalentTrackParser'; From 82af0976bfec077327686dd5ea6d94521ee800c5 Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 20 Oct 2021 23:40:14 -0500 Subject: [PATCH 066/108] fixed dumb --- .../messages/incoming/callforhelp/CallForHelpCategoryData.ts | 2 +- .../messages/incoming/callforhelp/CallForHelpTopicData.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts b/src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts index 6f3bee4c..5ed8dd07 100644 --- a/src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts +++ b/src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts @@ -19,7 +19,7 @@ export class CallForHelpCategoryData implements INamed, IDisposable { this._topics.push(new CallForHelpTopicData(wrapper)); - count++; + count--; } } diff --git a/src/nitro/communication/messages/incoming/callforhelp/CallForHelpTopicData.ts b/src/nitro/communication/messages/incoming/callforhelp/CallForHelpTopicData.ts index 29bb124d..c41c3630 100644 --- a/src/nitro/communication/messages/incoming/callforhelp/CallForHelpTopicData.ts +++ b/src/nitro/communication/messages/incoming/callforhelp/CallForHelpTopicData.ts @@ -24,7 +24,7 @@ export class CallForHelpTopicData implements INamed return this._id; } - public get _Str_26337(): string + public get consequence(): string { return this._consequence; } From e9eca8cb525505ccaecfeed30c72384429de3aa6 Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 21 Oct 2021 23:19:15 -0400 Subject: [PATCH 067/108] Add packet --- src/nitro/communication/NitroMessages.ts | 3 +++ .../messages/incoming/IncomingHeader.ts | 1 + .../CallForHelpDisabledNotifyMessageEvent.ts | 16 ++++++++++++ .../messages/incoming/help/index.ts | 1 + .../CallForHelpDisabledNotifyMessageParser.ts | 25 +++++++++++++++++++ .../messages/parser/help/index.ts | 1 + 6 files changed, 47 insertions(+) create mode 100644 src/nitro/communication/messages/incoming/help/CallForHelpDisabledNotifyMessageEvent.ts create mode 100644 src/nitro/communication/messages/parser/help/CallForHelpDisabledNotifyMessageParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 52a759af..0711255f 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -49,6 +49,7 @@ import { GroupInformationEvent } from './messages/incoming/group/GroupInformatio import { GroupMembersEvent } from './messages/incoming/group/GroupMembersEvent'; import { GroupPurchasedEvent } from './messages/incoming/group/GroupPurchasedEvent'; import { GroupSettingsEvent } from './messages/incoming/group/GroupSettingsEvent'; +import { CallForHelpDisabledNotifyMessageEvent } from './messages/incoming/help/CallForHelpDisabledNotifyMessageEvent'; import { CallForHelpResultMessageEvent } from './messages/incoming/help/CallForHelpResultMessageEvent'; import { IncomingHeader } from './messages/incoming/IncomingHeader'; import { AchievementEvent } from './messages/incoming/inventory/achievements/AchievementEvent'; @@ -598,9 +599,11 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.GROUP_BADGES, GroupBadgesEvent); // HELP + this._events.set(IncomingHeader.CFH_DISABLED_NOTIFY, CallForHelpDisabledNotifyMessageEvent); this._events.set(IncomingHeader.CFH_RESULT_MESSAGE, CallForHelpResultMessageEvent); this._events.set(IncomingHeader.HELPER_TALENT_TRACK, TalentTrackEvent); + // INVENTORY this._events.set(IncomingHeader.ACHIEVEMENT_PROGRESSED, AchievementEvent); this._events.set(IncomingHeader.ACHIEVEMENT_LIST, AchievementsEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 1e2f36ea..743c08be 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -329,4 +329,5 @@ export class IncomingHeader public static YOUTUBE_CONTROL_VIDEO = 1554; public static YOUTUBE_DISPLAY_PLAYLISTS = 1112; public static YOUTUBE_DISPLAY_VIDEO = 1411; + public static CFH_DISABLED_NOTIFY = 1651; } diff --git a/src/nitro/communication/messages/incoming/help/CallForHelpDisabledNotifyMessageEvent.ts b/src/nitro/communication/messages/incoming/help/CallForHelpDisabledNotifyMessageEvent.ts new file mode 100644 index 00000000..2f7ca860 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/CallForHelpDisabledNotifyMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CallForHelpDisabledNotifyMessageParser } from '../../parser/help/CallForHelpDisabledNotifyMessageParser'; + +export class CallForHelpDisabledNotifyMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CallForHelpDisabledNotifyMessageParser); + } + + public getParser(): CallForHelpDisabledNotifyMessageParser + { + return this.parser as CallForHelpDisabledNotifyMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/index.ts b/src/nitro/communication/messages/incoming/help/index.ts index af7e99c6..69515651 100644 --- a/src/nitro/communication/messages/incoming/help/index.ts +++ b/src/nitro/communication/messages/incoming/help/index.ts @@ -1,4 +1,5 @@ export * from './CallForHelpCategoryData'; +export * from './CallForHelpDisabledNotifyMessageEvent'; export * from './CallForHelpResultMessageEvent'; export * from './CfhTopicsInitEvent'; export * from './TalentTrackEvent'; diff --git a/src/nitro/communication/messages/parser/help/CallForHelpDisabledNotifyMessageParser.ts b/src/nitro/communication/messages/parser/help/CallForHelpDisabledNotifyMessageParser.ts new file mode 100644 index 00000000..2b115b54 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/CallForHelpDisabledNotifyMessageParser.ts @@ -0,0 +1,25 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class CallForHelpDisabledNotifyMessageParser implements IMessageParser +{ + private _infoUrl: string; + + public flush(): boolean + { + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._infoUrl = wrapper.readString(); + + return true; + } + + public get infoUrl(): string + { + return this._infoUrl; + } +} diff --git a/src/nitro/communication/messages/parser/help/index.ts b/src/nitro/communication/messages/parser/help/index.ts index a7967304..e379a40f 100644 --- a/src/nitro/communication/messages/parser/help/index.ts +++ b/src/nitro/communication/messages/parser/help/index.ts @@ -1,3 +1,4 @@ +export * from './CallForHelpDisabledNotifyMessageParser'; export * from './CallForHelpResultMessageParser'; export * from './CfhTopicsInitMessageParser'; export * from './common'; From cccd20db89ef2c386ca3cbeb6d79df6b94c0d01a Mon Sep 17 00:00:00 2001 From: dank074 Date: Sun, 24 Oct 2021 20:00:45 -0500 Subject: [PATCH 068/108] update packets --- src/nitro/communication/NitroMessages.ts | 9 ++-- .../messages/outgoing/OutgoingHeader.ts | 2 +- .../help/CallForHelpMessageComposer.ts | 21 +++++++++ .../messages/outgoing/help/index.ts | 1 + .../communication/messages/outgoing/index.ts | 3 +- .../GetCfhChatlogMessageComposer.ts | 4 +- .../{helper => talent}/TalentTrackComposer.ts | 0 .../outgoing/{helper => talent}/index.ts | 0 .../moderation/IssueInfoMessageParser.ts | 47 ++++++++++--------- .../parser/moderation/IssueMessageData.ts | 37 ++++++++------- 10 files changed, 78 insertions(+), 46 deletions(-) create mode 100644 src/nitro/communication/messages/outgoing/help/CallForHelpMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/index.ts rename src/nitro/communication/messages/outgoing/{helper => talent}/TalentTrackComposer.ts (100%) rename src/nitro/communication/messages/outgoing/{helper => talent}/index.ts (100%) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 46edb675..4bf20d3b 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -295,7 +295,6 @@ import { GroupSettingsComposer } from './messages/outgoing/group/GroupSettingsCo import { AuthenticationMessageComposer } from './messages/outgoing/handshake/AuthenticationMessageComposer'; import { InfoRetrieveBaseMessageComposer } from './messages/outgoing/handshake/InfoRetrieveBaseMessageComposer'; import { SecurityTicketComposer } from './messages/outgoing/handshake/SecurityTicketComposer'; -import { TalentTrackComposer } from './messages/outgoing/helper/TalentTrackComposer'; import { RequestBadgesComposer } from './messages/outgoing/inventory/badges/RequestBadgesComposer'; import { SetActivatedBadgesComposer } from './messages/outgoing/inventory/badges/SetActivatedBadgesComposer'; import { GetBotInventoryComposer } from './messages/outgoing/inventory/bots/GetBotInventoryComposer'; @@ -437,6 +436,7 @@ import { UpdateActionMessageComposer } from './messages/outgoing/roomevents/Upda import { UpdateConditionMessageComposer } from './messages/outgoing/roomevents/UpdateConditionMessageComposer'; import { UpdateTriggerMessageComposer } from './messages/outgoing/roomevents/UpdateTriggerMessageComposer'; import { GetSoundSettingsComposer } from './messages/outgoing/sound/GetSoundSettingsComposer'; +import { TalentTrackComposer } from './messages/outgoing/talent/TalentTrackComposer'; import { CatalogGroupsComposer } from './messages/outgoing/user/CatalogGroupsComposer'; import { GetIgnoredUsersComposer } from './messages/outgoing/user/data/GetIgnoredUsersComposer'; import { IgnoreUserComposer } from './messages/outgoing/user/data/IgnoreUserComposer'; @@ -962,6 +962,9 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.UPDATE_FORUM_SETTINGS, UpdateForumSettingsMessageComposer); this._composers.set(OutgoingHeader.FORUM_UPDATE_THREAD, UpdateThreadMessageComposer); + // HELP + this._composers.set(OutgoingHeader.CALL_FOR_HELP, CallForHelpMessageComposer); + // CLIENT this._composers.set(OutgoingHeader.CLIENT_PONG, ClientPongComposer); this._composers.set(OutgoingHeader.RELEASE_VERSION, ClientReleaseVersionComposer); @@ -1279,7 +1282,7 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.GET_USER_SONG_DISKS, GetUserSongDisksMessageComposer); this._composers.set(OutgoingHeader.REMOVE_JUKEBOX_DISK, RemoveJukeboxDiskComposer); - // HELPER + // TALENT this._composers.set(OutgoingHeader.HELPER_TALENT_TRACK, TalentTrackComposer); } diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 87de70dd..2be04f88 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -118,7 +118,7 @@ export class OutgoingHeader public static PET_MOVE = 3449; public static RECYCLER_PRIZES = 398; public static RELEASE_VERSION = 4000; - public static REPORT = 1691; + public static CALL_FOR_HELP = 1691; public static ROOM_AMBASSADOR_ALERT = 2996; public static ROOM_BAN_GIVE = 1477; public static ROOM_BAN_LIST = 2267; diff --git a/src/nitro/communication/messages/outgoing/help/CallForHelpMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/CallForHelpMessageComposer.ts new file mode 100644 index 00000000..eaf20e1b --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/CallForHelpMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class CallForHelpMessageComposer implements IMessageComposer +{ + private _data: any; + + constructor(message:string, topicIndex:number, reportedUserId:number, reportedRoomId:number, chatEntries:(string|number)[]) + { + this._data = [message, topicIndex, reportedUserId, reportedRoomId, chatEntries.length / 2, ...chatEntries]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/index.ts b/src/nitro/communication/messages/outgoing/help/index.ts new file mode 100644 index 00000000..7f5349c9 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/index.ts @@ -0,0 +1 @@ +export * from './CallForHelpMessageComposer'; diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index 851f55be..7cc0a193 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -12,7 +12,7 @@ export * from './gifts'; export * from './group'; export * from './groupforums'; export * from './handshake'; -export * from './helper'; +export * from './help'; export * from './inventory'; export * from './landingview'; export * from './marketplace'; @@ -24,4 +24,5 @@ export * from './quest'; export * from './room'; export * from './roomevents'; export * from './sound'; +export * from './talent'; export * from './user'; diff --git a/src/nitro/communication/messages/outgoing/moderation/GetCfhChatlogMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/GetCfhChatlogMessageComposer.ts index ad124466..5e2ad992 100644 --- a/src/nitro/communication/messages/outgoing/moderation/GetCfhChatlogMessageComposer.ts +++ b/src/nitro/communication/messages/outgoing/moderation/GetCfhChatlogMessageComposer.ts @@ -5,9 +5,9 @@ export class GetCfhChatlogMessageComposer implements IMessageComposer; - constructor(k: number) + constructor(issueId: number) { - this._data = [k]; + this._data = [issueId]; } public getMessageArray() diff --git a/src/nitro/communication/messages/outgoing/helper/TalentTrackComposer.ts b/src/nitro/communication/messages/outgoing/talent/TalentTrackComposer.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/helper/TalentTrackComposer.ts rename to src/nitro/communication/messages/outgoing/talent/TalentTrackComposer.ts diff --git a/src/nitro/communication/messages/outgoing/helper/index.ts b/src/nitro/communication/messages/outgoing/talent/index.ts similarity index 100% rename from src/nitro/communication/messages/outgoing/helper/index.ts rename to src/nitro/communication/messages/outgoing/talent/index.ts diff --git a/src/nitro/communication/messages/parser/moderation/IssueInfoMessageParser.ts b/src/nitro/communication/messages/parser/moderation/IssueInfoMessageParser.ts index 98cd9c6e..564748cb 100644 --- a/src/nitro/communication/messages/parser/moderation/IssueInfoMessageParser.ts +++ b/src/nitro/communication/messages/parser/moderation/IssueInfoMessageParser.ts @@ -20,30 +20,33 @@ export class IssueInfoMessageParser implements IMessageParser public parse(k:IMessageDataWrapper): boolean { - const _local_2: number = k.readInt(); - const _local_3: number = k.readInt(); - const _local_4: number = k.readInt(); - const _local_5: number = k.readInt(); - const _local_6: number = k.readInt(); - const _local_7: number = k.readInt(); - const _local_8: number = k.readInt(); - const _local_9: number = k.readInt(); - const _local_10: string = k.readString(); - const _local_11: number = k.readInt(); - const _local_12: string = k.readString(); - const _local_13: number = k.readInt(); - const _local_14: string = k.readString(); - const _local_15: string = k.readString(); - const _local_16: number = k.readInt(); - const _local_17: number = k.readInt(); - const _local_18:PatternMatchData[] = []; - let _local_19 = 0; - while(_local_19 < _local_17) + const issueId: number = k.readInt(); + const state: number = k.readInt(); + const categoryId: number = k.readInt(); + const reportedCategoryId: number = k.readInt(); + const issueAgeInMs: number = k.readInt(); + const priority: number = k.readInt(); + const groupingId: number = k.readInt(); + const reporterUserId: number = k.readInt(); + const reporterUsername: string = k.readString(); + const reportedUserId: number = k.readInt(); + const reportedUsername: string = k.readString(); + const pickerUserId: number = k.readInt(); + const pickerUsername: string = k.readString(); + const message: string = k.readString(); + const chatRecordId: number = k.readInt(); + + const patternsCount: number = k.readInt(); + const patterns:PatternMatchData[] = []; + + for(let i = 0; i < patternsCount; i++) { - _local_18.push(new PatternMatchData(k)); - _local_19++; + patterns.push(new PatternMatchData(k)); } - this._issueData = new IssueMessageData(_local_2, _local_3, _local_4, _local_5, _local_6, _local_7, _local_8, _local_9, _local_10, _local_11, _local_12, _local_13, _local_14, _local_15, _local_16, _local_18); + + this._issueData = new IssueMessageData(issueId, state, categoryId, reportedCategoryId, issueAgeInMs, + priority, groupingId, reporterUserId, reporterUsername, reportedUserId, reportedUsername, + pickerUserId, pickerUsername, message, chatRecordId, patterns); return true; } } diff --git a/src/nitro/communication/messages/parser/moderation/IssueMessageData.ts b/src/nitro/communication/messages/parser/moderation/IssueMessageData.ts index fd6d7b47..b4897653 100644 --- a/src/nitro/communication/messages/parser/moderation/IssueMessageData.ts +++ b/src/nitro/communication/messages/parser/moderation/IssueMessageData.ts @@ -26,24 +26,27 @@ export class IssueMessageData private _disposed: boolean = false; private _creationTimeInMilliseconds: number; - constructor(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number, _arg_6: number, _arg_7: number, _arg_8: number, _arg_9: string, _arg_10: number, _arg_11: string, _arg_12: number, _arg_13: string, _arg_14: string, _arg_15: number, _arg_16:PatternMatchData[]) + constructor(issueId: number, state: number, categoryId: number, reportedCategoryId: number, + issueAgeinMs: number, priority: number, groupingId: number, reporterUserId: number, reporterUsername: string, + reportedUserId: number, reportedUsername: string, pickerUserId: number, pickerUsername: string, message: string, + chatRecordId: number, patterns:PatternMatchData[]) { - this._issueId = k; - this._state = _arg_2; - this._categoryId = _arg_3; - this._reportedCategoryId = _arg_4; - this._issueAgeInMilliseconds = _arg_5; - this._priority = _arg_6; - this._groupingId = _arg_7; - this._reporterUserId = _arg_8; - this._reporterUserName = _arg_9; - this._reportedUserId = _arg_10; - this._reportedUserName = _arg_11; - this._pickerUserId = _arg_12; - this._pickerUserName = _arg_13; - this._message = _arg_14; - this._chatRecordId = _arg_15; - this._patterns = _arg_16; + this._issueId = issueId; + this._state = state; + this._categoryId = categoryId; + this._reportedCategoryId = reportedCategoryId; + this._issueAgeInMilliseconds = issueAgeinMs; + this._priority = priority; + this._groupingId = groupingId; + this._reporterUserId = reporterUserId; + this._reporterUserName = reporterUsername; + this._reportedUserId = reportedUserId; + this._reportedUserName = reportedUsername; + this._pickerUserId = pickerUserId; + this._pickerUserName = pickerUsername; + this._message = message; + this._chatRecordId = chatRecordId; + this._patterns = patterns; this._creationTimeInMilliseconds = Nitro.instance.time; //getTimer() } From 22425e9b605164bff4c2b41ddea88df0a0fa8301 Mon Sep 17 00:00:00 2001 From: dank074 Date: Sun, 24 Oct 2021 20:58:41 -0500 Subject: [PATCH 069/108] fix dumb stuff --- .../messages/incoming/callforhelp/CallForHelpCategoryData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts b/src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts index 5ed8dd07..45611642 100644 --- a/src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts +++ b/src/nitro/communication/messages/incoming/callforhelp/CallForHelpCategoryData.ts @@ -41,7 +41,7 @@ export class CallForHelpCategoryData implements INamed, IDisposable return this._name; } - public get _Str_14841(): CallForHelpTopicData[] + public get topics(): CallForHelpTopicData[] { return this._topics; } From 28316de30f27e55ac1c049886f074e3a15cbf491 Mon Sep 17 00:00:00 2001 From: dank074 Date: Tue, 26 Oct 2021 00:37:13 -0500 Subject: [PATCH 070/108] changes --- .../messages/incoming/moderation/CfhChatlogData.ts | 8 ++++---- .../outgoing/moderation/CloseIssuesMessageComposer.ts | 9 ++++++--- .../outgoing/moderation/PickIssuesMessageComposer.ts | 4 ++-- .../outgoing/moderation/ReleaseIssuesMessageComposer.ts | 4 ++-- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts b/src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts index e3e54692..b2c9d38e 100644 --- a/src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts +++ b/src/nitro/communication/messages/incoming/moderation/CfhChatlogData.ts @@ -3,7 +3,7 @@ import { ChatRecordData } from './ChatRecordData'; export class CfhChatlogData { - private _callId: number; + private _issueId: number; private _callerUserId: number; private _reportedUserId: number; private _chatRecordId: number; @@ -11,16 +11,16 @@ export class CfhChatlogData constructor(k:IMessageDataWrapper) { - this._callId = k.readInt(); + this._issueId = k.readInt(); this._callerUserId = k.readInt(); this._reportedUserId = k.readInt(); this._chatRecordId = k.readInt(); this._chatRecord = new ChatRecordData(k); } - public get callId(): number + public get issueId(): number { - return this._callId; + return this._issueId; } public get callerUserId(): number diff --git a/src/nitro/communication/messages/outgoing/moderation/CloseIssuesMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/CloseIssuesMessageComposer.ts index c707dd56..d1261740 100644 --- a/src/nitro/communication/messages/outgoing/moderation/CloseIssuesMessageComposer.ts +++ b/src/nitro/communication/messages/outgoing/moderation/CloseIssuesMessageComposer.ts @@ -1,13 +1,16 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; - export class CloseIssuesMessageComposer implements IMessageComposer { + public static readonly RESOLUTION_USELESS = 1; + public static readonly RESOLUTION_ABUSIVE = 2; + public static readonly RESOLUTION_RESOLVED = 3; + private _data: number[]; - constructor(issueIds: number[], _arg_2: number) + constructor(issueIds: number[], resolutionType: number) { - this._data = [ _arg_2, issueIds.length, ...issueIds]; + this._data = [ resolutionType, issueIds.length, ...issueIds]; } public getMessageArray() diff --git a/src/nitro/communication/messages/outgoing/moderation/PickIssuesMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/PickIssuesMessageComposer.ts index b731b870..a05955e0 100644 --- a/src/nitro/communication/messages/outgoing/moderation/PickIssuesMessageComposer.ts +++ b/src/nitro/communication/messages/outgoing/moderation/PickIssuesMessageComposer.ts @@ -4,9 +4,9 @@ export class PickIssuesMessageComposer implements IMessageComposer { private _data: any; - constructor(k:number[], _arg_2:boolean, _arg_3:number, _arg_4:string) + constructor(issueIds:number[], retryEnabled:boolean, retryCount:number, message:string) { - this._data = [k.length, ...k, _arg_2, _arg_3, _arg_4]; + this._data = [issueIds.length, ...issueIds, retryEnabled, retryCount, message]; } public getMessageArray() diff --git a/src/nitro/communication/messages/outgoing/moderation/ReleaseIssuesMessageComposer.ts b/src/nitro/communication/messages/outgoing/moderation/ReleaseIssuesMessageComposer.ts index 272ef328..a6f3c92a 100644 --- a/src/nitro/communication/messages/outgoing/moderation/ReleaseIssuesMessageComposer.ts +++ b/src/nitro/communication/messages/outgoing/moderation/ReleaseIssuesMessageComposer.ts @@ -4,9 +4,9 @@ export class ReleaseIssuesMessageComposer implements IMessageComposer { private _data: number[]; - constructor(k: number[]) + constructor(issueIds: number[]) { - this._data = [k.length, ...k]; + this._data = [issueIds.length, ...issueIds]; } public getMessageArray() From 12f2a7613a1e454787ed023dab283fd41207a092 Mon Sep 17 00:00:00 2001 From: dank074 Date: Tue, 26 Oct 2021 20:07:46 -0500 Subject: [PATCH 071/108] updated outgoing layout packets --- src/nitro/communication/NitroMessages.ts | 18 +++++++++--------- .../messages/outgoing/OutgoingHeader.ts | 4 ++-- .../messages/outgoing/room/index.ts | 2 +- .../GetOccupiedTilesMessageComposer.ts} | 6 +++--- .../GetRoomEntryDataMessageComposer.ts} | 6 +++--- .../GetRoomEntryTileMessageComposer.ts} | 6 +++--- .../UpdateFloorPropertiesMessageComposer.ts} | 6 +++--- .../messages/outgoing/room/layout/index.ts | 4 ++++ .../messages/outgoing/room/mapping/index.ts | 4 ---- src/nitro/room/RoomMessageHandler.ts | 6 +++--- 10 files changed, 31 insertions(+), 31 deletions(-) rename src/nitro/communication/messages/outgoing/room/{mapping/RoomBlockedTilesComposer.ts => layout/GetOccupiedTilesMessageComposer.ts} (56%) rename src/nitro/communication/messages/outgoing/room/{mapping/RoomDoorSettingsComposer.ts => layout/GetRoomEntryDataMessageComposer.ts} (56%) rename src/nitro/communication/messages/outgoing/room/{mapping/RoomModelComposer.ts => layout/GetRoomEntryTileMessageComposer.ts} (56%) rename src/nitro/communication/messages/outgoing/room/{mapping/RoomModelSaveComposer.ts => layout/UpdateFloorPropertiesMessageComposer.ts} (67%) create mode 100644 src/nitro/communication/messages/outgoing/room/layout/index.ts delete mode 100644 src/nitro/communication/messages/outgoing/room/mapping/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 4bf20d3b..d3cc3e77 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -409,10 +409,10 @@ import { FurnitureMannequinSaveNameComposer } from './messages/outgoing/room/fur import { OpenPresentComposer } from './messages/outgoing/room/furniture/presents/OpenPresentComposer'; import { ApplyTonerComposer } from './messages/outgoing/room/furniture/toner/ApplyTonerComposer'; import { FurnitureWallUpdateComposer } from './messages/outgoing/room/furniture/wall/FurnitureWallUpdateComposer'; -import { RoomBlockedTilesComposer } from './messages/outgoing/room/mapping/RoomBlockedTilesComposer'; -import { RoomDoorSettingsComposer } from './messages/outgoing/room/mapping/RoomDoorSettingsComposer'; -import { RoomModelComposer } from './messages/outgoing/room/mapping/RoomModelComposer'; -import { RoomModelSaveComposer } from './messages/outgoing/room/mapping/RoomModelSaveComposer'; +import { GetOccupiedTilesMessageComposer } from './messages/outgoing/room/layout/GetOccupiedTilesMessageComposer'; +import { GetRoomEntryDataMessageComposer } from './messages/outgoing/room/layout/GetRoomEntryDataMessageComposer'; +import { GetRoomEntryTileMessageComposer } from './messages/outgoing/room/layout/GetRoomEntryTileMessageComposer'; +import { UpdateFloorPropertiesMessageComposer } from './messages/outgoing/room/layout/UpdateFloorPropertiesMessageComposer'; import { RedeemItemClothingComposer } from './messages/outgoing/room/RedeemItemClothingComposer'; import { RoomCreateComposer } from './messages/outgoing/room/RoomCreateComposer'; import { RoomUnitChatComposer } from './messages/outgoing/room/unit/chat/RoomUnitChatComposer'; @@ -1141,11 +1141,11 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.ITEM_EXCHANGE_REDEEM, FurnitureExchangeComposer); this._composers.set(OutgoingHeader.ITEM_CLOTHING_REDEEM, RedeemItemClothingComposer); - // MAPPING - this._composers.set(OutgoingHeader.ROOM_MODEL, RoomModelComposer); - this._composers.set(OutgoingHeader.ROOM_MODEL_BLOCKED_TILES, RoomBlockedTilesComposer); - this._composers.set(OutgoingHeader.ROOM_MODEL_DOOR, RoomDoorSettingsComposer); - this._composers.set(OutgoingHeader.ROOM_MODEL_SAVE, RoomModelSaveComposer); + // LAYOUT + this._composers.set(OutgoingHeader.ROOM_MODEL, GetRoomEntryDataMessageComposer); + this._composers.set(OutgoingHeader.GET_OCCUPIED_TILES, GetOccupiedTilesMessageComposer); + this._composers.set(OutgoingHeader.GET_ROOM_ENTRY_TILE, GetRoomEntryTileMessageComposer); + this._composers.set(OutgoingHeader.ROOM_MODEL_SAVE, UpdateFloorPropertiesMessageComposer); // UNIT this._composers.set(OutgoingHeader.UNIT_ACTION, RoomUnitActionComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 2be04f88..d0459988 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -133,8 +133,8 @@ export class OutgoingHeader public static ROOM_KICK = 1320; public static ROOM_LIKE = 3582; public static ROOM_MODEL = 2300; - public static ROOM_MODEL_BLOCKED_TILES = 1687; - public static ROOM_MODEL_DOOR = 3559; + public static GET_OCCUPIED_TILES = 1687; + public static GET_ROOM_ENTRY_TILE = 3559; public static ROOM_MODEL_SAVE = 875; public static ROOM_MUTE = 3637; public static ROOM_MUTE_USER = 3485; diff --git a/src/nitro/communication/messages/outgoing/room/index.ts b/src/nitro/communication/messages/outgoing/room/index.ts index d9fd832c..047a28e1 100644 --- a/src/nitro/communication/messages/outgoing/room/index.ts +++ b/src/nitro/communication/messages/outgoing/room/index.ts @@ -4,7 +4,7 @@ export * from './bots'; export * from './data'; export * from './engine'; export * from './furniture'; -export * from './mapping'; +export * from './layout'; export * from './RedeemItemClothingComposer'; export * from './RoomCreateComposer'; export * from './session'; diff --git a/src/nitro/communication/messages/outgoing/room/mapping/RoomBlockedTilesComposer.ts b/src/nitro/communication/messages/outgoing/room/layout/GetOccupiedTilesMessageComposer.ts similarity index 56% rename from src/nitro/communication/messages/outgoing/room/mapping/RoomBlockedTilesComposer.ts rename to src/nitro/communication/messages/outgoing/room/layout/GetOccupiedTilesMessageComposer.ts index f55d5f9f..fa1983b5 100644 --- a/src/nitro/communication/messages/outgoing/room/mapping/RoomBlockedTilesComposer.ts +++ b/src/nitro/communication/messages/outgoing/room/layout/GetOccupiedTilesMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; -export class RoomBlockedTilesComposer implements IMessageComposer> +export class GetOccupiedTilesMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor() { @@ -18,4 +18,4 @@ export class RoomBlockedTilesComposer implements IMessageComposer> +export class GetRoomEntryDataMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor() { @@ -18,4 +18,4 @@ export class RoomDoorSettingsComposer implements IMessageComposer> +export class GetRoomEntryTileMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor() { @@ -18,4 +18,4 @@ export class RoomModelComposer implements IMessageComposer> +export class UpdateFloorPropertiesMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(model: string, doorX: number, doorY: number, doorDirection: number, thicknessWall: number, thicknessFloor: number, wallHeight: number) { @@ -18,4 +18,4 @@ export class RoomModelSaveComposer implements IMessageComposer Date: Sun, 31 Oct 2021 15:38:56 -0500 Subject: [PATCH 072/108] floor packet changes + tilemap library added --- package.json | 1 + src/core/utils/proxy/index.ts | 1 + src/core/utils/proxy/tilemap/NitroTilemap.ts | 6 + src/core/utils/proxy/tilemap/index.ts | 2 + src/nitro/Plugins.ts | 2 + src/nitro/communication/NitroMessages.ts | 16 +- .../room/mapping/FloorHeightMapEvent.ts | 16 + .../room/mapping/RoomBlockedTilesEvent.ts | 16 - .../incoming/room/mapping/RoomDoorEvent.ts | 16 - .../room/mapping/RoomEntryTileMessageEvent.ts | 16 + .../incoming/room/mapping/RoomModelEvent.ts | 16 - .../mapping/RoomOccupiedTilesMessageEvent.ts | 16 + .../room/mapping/RoomThicknessEvent.ts | 16 - .../mapping/RoomVisualizationSettingsEvent.ts | 16 + .../messages/incoming/room/mapping/index.ts | 8 +- ...rser.ts => FloorHeightMapMessageParser.ts} | 2 +- ...arser.ts => RoomEntryTileMessageParser.ts} | 2 +- ...r.ts => RoomOccupiedTilesMessageParser.ts} | 2 +- ....ts => RoomVisualizationSettingsParser.ts} | 2 +- .../messages/parser/room/mapping/index.ts | 8 +- src/nitro/room/RoomMessageHandler.ts | 30 +- src/nitro/room/preview/RoomPreviewer.ts | 8 +- src/room/floorplan/index.ts | 1 - .../pixi-tilemap/CanvasTileRenderer.ts | 22 - .../pixi-tilemap/CompositeRectTileLayer.ts | 287 ---------- src/room/floorplan/pixi-tilemap/Constant.ts | 11 - .../pixi-tilemap/MultiTextureResource.ts | 68 --- .../floorplan/pixi-tilemap/RectTileLayer.ts | 495 ------------------ .../floorplan/pixi-tilemap/RectTileShader.ts | 111 ---- .../floorplan/pixi-tilemap/TileRenderer.ts | 166 ------ src/room/floorplan/pixi-tilemap/index.ts | 8 - .../floorplan/pixi-tilemap/shaderGenerator.ts | 57 -- src/room/index.ts | 1 - 33 files changed, 115 insertions(+), 1330 deletions(-) create mode 100644 src/core/utils/proxy/tilemap/NitroTilemap.ts create mode 100644 src/core/utils/proxy/tilemap/index.ts create mode 100644 src/nitro/communication/messages/incoming/room/mapping/FloorHeightMapEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/room/mapping/RoomBlockedTilesEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/room/mapping/RoomDoorEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/mapping/RoomEntryTileMessageEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/room/mapping/RoomModelEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/mapping/RoomOccupiedTilesMessageEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/room/mapping/RoomThicknessEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/mapping/RoomVisualizationSettingsEvent.ts rename src/nitro/communication/messages/parser/room/mapping/{RoomModelParser.ts => FloorHeightMapMessageParser.ts} (98%) rename src/nitro/communication/messages/parser/room/mapping/{RoomDoorParser.ts => RoomEntryTileMessageParser.ts} (92%) rename src/nitro/communication/messages/parser/room/mapping/{RoomBlockedTilesParser.ts => RoomOccupiedTilesMessageParser.ts} (91%) rename src/nitro/communication/messages/parser/room/mapping/{RoomThicknessParser.ts => RoomVisualizationSettingsParser.ts} (94%) delete mode 100644 src/room/floorplan/index.ts delete mode 100644 src/room/floorplan/pixi-tilemap/CanvasTileRenderer.ts delete mode 100644 src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts delete mode 100644 src/room/floorplan/pixi-tilemap/Constant.ts delete mode 100644 src/room/floorplan/pixi-tilemap/MultiTextureResource.ts delete mode 100644 src/room/floorplan/pixi-tilemap/RectTileLayer.ts delete mode 100644 src/room/floorplan/pixi-tilemap/RectTileShader.ts delete mode 100644 src/room/floorplan/pixi-tilemap/TileRenderer.ts delete mode 100644 src/room/floorplan/pixi-tilemap/index.ts delete mode 100644 src/room/floorplan/pixi-tilemap/shaderGenerator.ts diff --git a/package.json b/package.json index ace00f84..229ebcbf 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "@pixi/canvas-renderer": "^6.1.0", "@pixi/extract": "^6.1.0", "@pixi/filter-adjustment": "^4.1.3", + "@pixi/tilemap": "^3.2.2", "pako": "^2.0.4", "pixi.js": "^6.1.0", "tslib": "^2.3.0" diff --git a/src/core/utils/proxy/index.ts b/src/core/utils/proxy/index.ts index b3b95d07..594d75f3 100644 --- a/src/core/utils/proxy/index.ts +++ b/src/core/utils/proxy/index.ts @@ -13,3 +13,4 @@ export * from './NitroTexture'; export * from './PixiApplicationProxy'; export * from './PixiInteractionEventProxy'; export * from './PixiLoaderProxy'; +export * from './tilemap'; diff --git a/src/core/utils/proxy/tilemap/NitroTilemap.ts b/src/core/utils/proxy/tilemap/NitroTilemap.ts new file mode 100644 index 00000000..00477776 --- /dev/null +++ b/src/core/utils/proxy/tilemap/NitroTilemap.ts @@ -0,0 +1,6 @@ +import { Tilemap } from '@pixi/tilemap'; + +export class NitroTilemap extends Tilemap +{ + +} diff --git a/src/core/utils/proxy/tilemap/index.ts b/src/core/utils/proxy/tilemap/index.ts new file mode 100644 index 00000000..d14e1ff8 --- /dev/null +++ b/src/core/utils/proxy/tilemap/index.ts @@ -0,0 +1,2 @@ +export { POINT_STRUCT_SIZE } from '@pixi/tilemap'; +export * from './NitroTilemap'; diff --git a/src/nitro/Plugins.ts b/src/nitro/Plugins.ts index a630cc61..fd7ae350 100644 --- a/src/nitro/Plugins.ts +++ b/src/nitro/Plugins.ts @@ -12,6 +12,7 @@ import { TilingSpriteRenderer } from '@pixi/sprite-tiling'; import { SpritesheetLoader } from '@pixi/spritesheet'; import { BitmapFontLoader } from '@pixi/text-bitmap'; import { TickerPlugin } from '@pixi/ticker'; +import { TileRenderer } from '@pixi/tilemap'; Renderer.registerPlugin('accessibility', AccessibilityManager); Renderer.registerPlugin('extract', Extract); @@ -20,6 +21,7 @@ Renderer.registerPlugin('particle', ParticleRenderer); Renderer.registerPlugin('prepare', Prepare); Renderer.registerPlugin('batch', BatchRenderer); Renderer.registerPlugin('tilingSprite', TilingSpriteRenderer); +Renderer.registerPlugin('tilemap', TileRenderer); Loader.registerPlugin(BitmapFontLoader); Loader.registerPlugin(CompressedTextureLoader); diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index d3cc3e77..e9dd2af4 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -167,14 +167,14 @@ import { FurnitureWallUpdateEvent } from './messages/incoming/room/furniture/wal import { YoutubeControlVideoMessageEvent } from './messages/incoming/room/furniture/youtube/YoutubeControlVideoMessageEvent'; import { YoutubeDisplayPlaylistsEvent } from './messages/incoming/room/furniture/youtube/YoutubeDisplayPlaylistsEvent'; import { YoutubeDisplayVideoMessageEvent } from './messages/incoming/room/furniture/youtube/YoutubeDisplayVideoMessageEvent'; -import { RoomBlockedTilesEvent } from './messages/incoming/room/mapping/RoomBlockedTilesEvent'; -import { RoomDoorEvent } from './messages/incoming/room/mapping/RoomDoorEvent'; +import { FloorHeightMapEvent } from './messages/incoming/room/mapping/FloorHeightMapEvent'; +import { RoomEntryTileMessageEvent } from './messages/incoming/room/mapping/RoomEntryTileMessageEvent'; import { RoomHeightMapEvent } from './messages/incoming/room/mapping/RoomHeightMapEvent'; import { RoomHeightMapUpdateEvent } from './messages/incoming/room/mapping/RoomHeightMapUpdateEvent'; -import { RoomModelEvent } from './messages/incoming/room/mapping/RoomModelEvent'; import { RoomModelNameEvent } from './messages/incoming/room/mapping/RoomModelNameEvent'; +import { RoomOccupiedTilesMessageEvent } from './messages/incoming/room/mapping/RoomOccupiedTilesMessageEvent'; import { RoomPaintEvent } from './messages/incoming/room/mapping/RoomPaintEvent'; -import { RoomThicknessEvent } from './messages/incoming/room/mapping/RoomThicknessEvent'; +import { RoomVisualizationSettingsEvent } from './messages/incoming/room/mapping/RoomVisualizationSettingsEvent'; import { PetFigureUpdateEvent } from './messages/incoming/room/pet/PetFigureUpdateEvent'; import { PetInfoEvent } from './messages/incoming/room/pet/PetInfoEvent'; import { YouArePlayingGameEvent } from './messages/incoming/room/session/YouArePlayingGameEvent'; @@ -760,14 +760,14 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.FURNITURE_POSTIT_STICKY_POLE_OPEN, FurniturePostItStickyPoleOpenEvent); // MAPPING - this._events.set(IncomingHeader.ROOM_MODEL_DOOR, RoomDoorEvent); + this._events.set(IncomingHeader.ROOM_MODEL_DOOR, RoomEntryTileMessageEvent); this._events.set(IncomingHeader.ROOM_HEIGHT_MAP, RoomHeightMapEvent); this._events.set(IncomingHeader.ROOM_HEIGHT_MAP_UPDATE, RoomHeightMapUpdateEvent); - this._events.set(IncomingHeader.ROOM_MODEL, RoomModelEvent); + this._events.set(IncomingHeader.ROOM_MODEL, FloorHeightMapEvent); this._events.set(IncomingHeader.ROOM_MODEL_NAME, RoomModelNameEvent); this._events.set(IncomingHeader.ROOM_PAINT, RoomPaintEvent); - this._events.set(IncomingHeader.ROOM_THICKNESS, RoomThicknessEvent); - this._events.set(IncomingHeader.ROOM_MODEL_BLOCKED_TILES, RoomBlockedTilesEvent); + this._events.set(IncomingHeader.ROOM_THICKNESS, RoomVisualizationSettingsEvent); + this._events.set(IncomingHeader.ROOM_MODEL_BLOCKED_TILES, RoomOccupiedTilesMessageEvent); this._events.set(IncomingHeader.PET_FIGURE_UPDATE, PetFigureUpdateEvent); this._events.set(IncomingHeader.PET_INFO, PetInfoEvent); this._events.set(IncomingHeader.PET_EXPERIENCE, PetExperienceEvent); diff --git a/src/nitro/communication/messages/incoming/room/mapping/FloorHeightMapEvent.ts b/src/nitro/communication/messages/incoming/room/mapping/FloorHeightMapEvent.ts new file mode 100644 index 00000000..3d063798 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/mapping/FloorHeightMapEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { FloorHeightMapMessageParser } from '../../../parser/room/mapping/FloorHeightMapMessageParser'; + +export class FloorHeightMapEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, FloorHeightMapMessageParser); + } + + public getParser(): FloorHeightMapMessageParser + { + return this.parser as FloorHeightMapMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/mapping/RoomBlockedTilesEvent.ts b/src/nitro/communication/messages/incoming/room/mapping/RoomBlockedTilesEvent.ts deleted file mode 100644 index dcdec600..00000000 --- a/src/nitro/communication/messages/incoming/room/mapping/RoomBlockedTilesEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { RoomBlockedTilesParser } from '../../../parser/room/mapping/RoomBlockedTilesParser'; - -export class RoomBlockedTilesEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, RoomBlockedTilesParser); - } - - public getParser(): RoomBlockedTilesParser - { - return this.parser as RoomBlockedTilesParser; - } -} diff --git a/src/nitro/communication/messages/incoming/room/mapping/RoomDoorEvent.ts b/src/nitro/communication/messages/incoming/room/mapping/RoomDoorEvent.ts deleted file mode 100644 index 7e3433e8..00000000 --- a/src/nitro/communication/messages/incoming/room/mapping/RoomDoorEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { RoomDoorParser } from '../../../parser/room/mapping/RoomDoorParser'; - -export class RoomDoorEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, RoomDoorParser); - } - - public getParser(): RoomDoorParser - { - return this.parser as RoomDoorParser; - } -} diff --git a/src/nitro/communication/messages/incoming/room/mapping/RoomEntryTileMessageEvent.ts b/src/nitro/communication/messages/incoming/room/mapping/RoomEntryTileMessageEvent.ts new file mode 100644 index 00000000..2e8edb9b --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/mapping/RoomEntryTileMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { RoomEntryTileMessageParser } from '../../../parser/room/mapping/RoomEntryTileMessageParser'; + +export class RoomEntryTileMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, RoomEntryTileMessageParser); + } + + public getParser(): RoomEntryTileMessageParser + { + return this.parser as RoomEntryTileMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/mapping/RoomModelEvent.ts b/src/nitro/communication/messages/incoming/room/mapping/RoomModelEvent.ts deleted file mode 100644 index f236b419..00000000 --- a/src/nitro/communication/messages/incoming/room/mapping/RoomModelEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { RoomModelParser } from '../../../parser/room/mapping/RoomModelParser'; - -export class RoomModelEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, RoomModelParser); - } - - public getParser(): RoomModelParser - { - return this.parser as RoomModelParser; - } -} diff --git a/src/nitro/communication/messages/incoming/room/mapping/RoomOccupiedTilesMessageEvent.ts b/src/nitro/communication/messages/incoming/room/mapping/RoomOccupiedTilesMessageEvent.ts new file mode 100644 index 00000000..c37a591b --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/mapping/RoomOccupiedTilesMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { RoomOccupiedTilesMessageParser } from '../../../parser/room/mapping/RoomOccupiedTilesMessageParser'; + +export class RoomOccupiedTilesMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, RoomOccupiedTilesMessageParser); + } + + public getParser(): RoomOccupiedTilesMessageParser + { + return this.parser as RoomOccupiedTilesMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/mapping/RoomThicknessEvent.ts b/src/nitro/communication/messages/incoming/room/mapping/RoomThicknessEvent.ts deleted file mode 100644 index f5df9b3f..00000000 --- a/src/nitro/communication/messages/incoming/room/mapping/RoomThicknessEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { RoomThicknessParser } from '../../../parser/room/mapping/RoomThicknessParser'; - -export class RoomThicknessEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, RoomThicknessParser); - } - - public getParser(): RoomThicknessParser - { - return this.parser as RoomThicknessParser; - } -} diff --git a/src/nitro/communication/messages/incoming/room/mapping/RoomVisualizationSettingsEvent.ts b/src/nitro/communication/messages/incoming/room/mapping/RoomVisualizationSettingsEvent.ts new file mode 100644 index 00000000..82e7b4cf --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/mapping/RoomVisualizationSettingsEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { RoomVisualizationSettingsParser } from '../../../parser/room/mapping/RoomVisualizationSettingsParser'; + +export class RoomVisualizationSettingsEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, RoomVisualizationSettingsParser); + } + + public getParser(): RoomVisualizationSettingsParser + { + return this.parser as RoomVisualizationSettingsParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/mapping/index.ts b/src/nitro/communication/messages/incoming/room/mapping/index.ts index a47f592e..038f1df4 100644 --- a/src/nitro/communication/messages/incoming/room/mapping/index.ts +++ b/src/nitro/communication/messages/incoming/room/mapping/index.ts @@ -1,8 +1,8 @@ -export * from './RoomBlockedTilesEvent'; -export * from './RoomDoorEvent'; +export * from './FloorHeightMapEvent'; +export * from './RoomEntryTileMessageEvent'; export * from './RoomHeightMapEvent'; export * from './RoomHeightMapUpdateEvent'; -export * from './RoomModelEvent'; export * from './RoomModelNameEvent'; +export * from './RoomOccupiedTilesMessageEvent'; export * from './RoomPaintEvent'; -export * from './RoomThicknessEvent'; +export * from './RoomVisualizationSettingsEvent'; diff --git a/src/nitro/communication/messages/parser/room/mapping/RoomModelParser.ts b/src/nitro/communication/messages/parser/room/mapping/FloorHeightMapMessageParser.ts similarity index 98% rename from src/nitro/communication/messages/parser/room/mapping/RoomModelParser.ts rename to src/nitro/communication/messages/parser/room/mapping/FloorHeightMapMessageParser.ts index bde2694f..a86b29e4 100644 --- a/src/nitro/communication/messages/parser/room/mapping/RoomModelParser.ts +++ b/src/nitro/communication/messages/parser/room/mapping/FloorHeightMapMessageParser.ts @@ -1,7 +1,7 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; import { RoomPlaneParser } from '../../../../../room/object/RoomPlaneParser'; -export class RoomModelParser implements IMessageParser +export class FloorHeightMapMessageParser implements IMessageParser { private _model: string; private _width: number; diff --git a/src/nitro/communication/messages/parser/room/mapping/RoomDoorParser.ts b/src/nitro/communication/messages/parser/room/mapping/RoomEntryTileMessageParser.ts similarity index 92% rename from src/nitro/communication/messages/parser/room/mapping/RoomDoorParser.ts rename to src/nitro/communication/messages/parser/room/mapping/RoomEntryTileMessageParser.ts index 43338aec..2407027f 100644 --- a/src/nitro/communication/messages/parser/room/mapping/RoomDoorParser.ts +++ b/src/nitro/communication/messages/parser/room/mapping/RoomEntryTileMessageParser.ts @@ -1,6 +1,6 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -export class RoomDoorParser implements IMessageParser +export class RoomEntryTileMessageParser implements IMessageParser { private _x: number; private _y: number; diff --git a/src/nitro/communication/messages/parser/room/mapping/RoomBlockedTilesParser.ts b/src/nitro/communication/messages/parser/room/mapping/RoomOccupiedTilesMessageParser.ts similarity index 91% rename from src/nitro/communication/messages/parser/room/mapping/RoomBlockedTilesParser.ts rename to src/nitro/communication/messages/parser/room/mapping/RoomOccupiedTilesMessageParser.ts index 3a07dccb..4881df21 100644 --- a/src/nitro/communication/messages/parser/room/mapping/RoomBlockedTilesParser.ts +++ b/src/nitro/communication/messages/parser/room/mapping/RoomOccupiedTilesMessageParser.ts @@ -1,6 +1,6 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -export class RoomBlockedTilesParser implements IMessageParser +export class RoomOccupiedTilesMessageParser implements IMessageParser { private _blockedTilesMap: boolean[][]; diff --git a/src/nitro/communication/messages/parser/room/mapping/RoomThicknessParser.ts b/src/nitro/communication/messages/parser/room/mapping/RoomVisualizationSettingsParser.ts similarity index 94% rename from src/nitro/communication/messages/parser/room/mapping/RoomThicknessParser.ts rename to src/nitro/communication/messages/parser/room/mapping/RoomVisualizationSettingsParser.ts index f682e1fa..899b5b90 100644 --- a/src/nitro/communication/messages/parser/room/mapping/RoomThicknessParser.ts +++ b/src/nitro/communication/messages/parser/room/mapping/RoomVisualizationSettingsParser.ts @@ -1,6 +1,6 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -export class RoomThicknessParser implements IMessageParser +export class RoomVisualizationSettingsParser implements IMessageParser { private _hideWalls: boolean; private _thicknessWall: number; diff --git a/src/nitro/communication/messages/parser/room/mapping/index.ts b/src/nitro/communication/messages/parser/room/mapping/index.ts index 3b6c2914..155d6846 100644 --- a/src/nitro/communication/messages/parser/room/mapping/index.ts +++ b/src/nitro/communication/messages/parser/room/mapping/index.ts @@ -1,8 +1,8 @@ -export * from './RoomBlockedTilesParser'; -export * from './RoomDoorParser'; +export * from './FloorHeightMapMessageParser'; +export * from './RoomEntryTileMessageParser'; export * from './RoomHeightMapParser'; export * from './RoomHeightMapUpdateParser'; export * from './RoomModelNameParser'; -export * from './RoomModelParser'; +export * from './RoomOccupiedTilesMessageParser'; export * from './RoomPaintParser'; -export * from './RoomThicknessParser'; +export * from './RoomVisualizationSettingsParser'; diff --git a/src/nitro/room/RoomMessageHandler.ts b/src/nitro/room/RoomMessageHandler.ts index c85824aa..b9e06c38 100644 --- a/src/nitro/room/RoomMessageHandler.ts +++ b/src/nitro/room/RoomMessageHandler.ts @@ -18,13 +18,13 @@ import { FurnitureWallAddEvent } from '../communication/messages/incoming/room/f import { FurnitureWallEvent } from '../communication/messages/incoming/room/furniture/wall/FurnitureWallEvent'; import { FurnitureWallRemoveEvent } from '../communication/messages/incoming/room/furniture/wall/FurnitureWallRemoveEvent'; import { FurnitureWallUpdateEvent } from '../communication/messages/incoming/room/furniture/wall/FurnitureWallUpdateEvent'; -import { RoomDoorEvent } from '../communication/messages/incoming/room/mapping/RoomDoorEvent'; +import { FloorHeightMapEvent } from '../communication/messages/incoming/room/mapping/FloorHeightMapEvent'; +import { RoomEntryTileMessageEvent } from '../communication/messages/incoming/room/mapping/RoomEntryTileMessageEvent'; import { RoomHeightMapEvent } from '../communication/messages/incoming/room/mapping/RoomHeightMapEvent'; import { RoomHeightMapUpdateEvent } from '../communication/messages/incoming/room/mapping/RoomHeightMapUpdateEvent'; -import { RoomModelEvent } from '../communication/messages/incoming/room/mapping/RoomModelEvent'; import { RoomModelNameEvent } from '../communication/messages/incoming/room/mapping/RoomModelNameEvent'; import { RoomPaintEvent } from '../communication/messages/incoming/room/mapping/RoomPaintEvent'; -import { RoomThicknessEvent } from '../communication/messages/incoming/room/mapping/RoomThicknessEvent'; +import { RoomVisualizationSettingsEvent } from '../communication/messages/incoming/room/mapping/RoomVisualizationSettingsEvent'; import { PetFigureUpdateEvent } from '../communication/messages/incoming/room/pet/PetFigureUpdateEvent'; import { YouArePlayingGameEvent } from '../communication/messages/incoming/room/session/YouArePlayingGameEvent'; import { RoomUnitChatEvent } from '../communication/messages/incoming/room/unit/chat/RoomUnitChatEvent'; @@ -47,7 +47,7 @@ import { FurnitureAliasesComposer } from '../communication/messages/outgoing/roo import { GetRoomEntryDataMessageComposer } from '../communication/messages/outgoing/room/layout/GetRoomEntryDataMessageComposer'; import { FurnitureFloorDataParser } from '../communication/messages/parser/room/furniture/floor/FurnitureFloorDataParser'; import { FurnitureWallDataParser } from '../communication/messages/parser/room/furniture/wall/FurnitureWallDataParser'; -import { RoomDoorParser } from '../communication/messages/parser/room/mapping/RoomDoorParser'; +import { RoomEntryTileMessageParser } from '../communication/messages/parser/room/mapping/RoomEntryTileMessageParser'; import { IRoomCreator } from './IRoomCreator'; import { LegacyDataType } from './object/data/type/LegacyDataType'; import { RoomObjectUserType } from './object/RoomObjectUserType'; @@ -63,7 +63,7 @@ export class RoomMessageHandler extends Disposable private _connection: IConnection; private _roomCreator: IRoomCreator; private _planeParser: RoomPlaneParser; - private _latestEntryTileEvent: RoomDoorEvent; + private _latestEntryTileEvent: RoomEntryTileMessageEvent; private _currentRoomId: number; private _ownUserId: number; @@ -108,11 +108,11 @@ export class RoomMessageHandler extends Disposable this._connection.addMessageEvent(new UserInfoEvent(this.onUserInfoEvent.bind(this))); this._connection.addMessageEvent(new RoomModelNameEvent(this.onRoomModelNameEvent.bind(this))); this._connection.addMessageEvent(new RoomPaintEvent(this.onRoomPaintEvent.bind(this))); - this._connection.addMessageEvent(new RoomModelEvent(this.onRoomModelEvent.bind(this))); + this._connection.addMessageEvent(new FloorHeightMapEvent(this.onRoomModelEvent.bind(this))); this._connection.addMessageEvent(new RoomHeightMapEvent(this.onRoomHeightMapEvent.bind(this))); this._connection.addMessageEvent(new RoomHeightMapUpdateEvent(this.onRoomHeightMapUpdateEvent.bind(this))); - this._connection.addMessageEvent(new RoomThicknessEvent(this.onRoomThicknessEvent.bind(this))); - this._connection.addMessageEvent(new RoomDoorEvent(this.onRoomDoorEvent.bind(this))); + this._connection.addMessageEvent(new RoomVisualizationSettingsEvent(this.onRoomThicknessEvent.bind(this))); + this._connection.addMessageEvent(new RoomEntryTileMessageEvent(this.onRoomDoorEvent.bind(this))); this._connection.addMessageEvent(new ObjectsRollingEvent(this.onRoomRollingEvent.bind(this))); this._connection.addMessageEvent(new ObjectsDataUpdateEvent(this.onObjectsDataUpdateEvent.bind(this))); this._connection.addMessageEvent(new FurnitureAliasesEvent(this.onFurnitureAliasesEvent.bind(this))); @@ -220,9 +220,9 @@ export class RoomMessageHandler extends Disposable } } - private onRoomModelEvent(event: RoomModelEvent): void + private onRoomModelEvent(event: FloorHeightMapEvent): void { - if(!(event instanceof RoomModelEvent) || !event.connection || !this._roomCreator) return; + if(!(event instanceof FloorHeightMapEvent) || !event.connection || !this._roomCreator) return; const parser = event.getParser(); @@ -239,7 +239,7 @@ export class RoomMessageHandler extends Disposable this._planeParser.initializeTileMap(width, height); - let entryTile: RoomDoorParser = null; + let entryTile: RoomEntryTileMessageParser = null; if(this._latestEntryTileEvent) entryTile = this._latestEntryTileEvent.getParser(); @@ -387,9 +387,9 @@ export class RoomMessageHandler extends Disposable this._roomCreator.refreshTileObjectMap(this._currentRoomId, 'RoomMessageHandler.onRoomHeightMapUpdateEvent()'); } - private onRoomThicknessEvent(event: RoomThicknessEvent): void + private onRoomThicknessEvent(event: RoomVisualizationSettingsEvent): void { - if(!(event instanceof RoomThicknessEvent)) return; + if(!(event instanceof RoomVisualizationSettingsEvent)) return; const parser = event.getParser(); @@ -407,9 +407,9 @@ export class RoomMessageHandler extends Disposable } } - private onRoomDoorEvent(event: RoomDoorEvent): void + private onRoomDoorEvent(event: RoomEntryTileMessageEvent): void { - if(!(event instanceof RoomDoorEvent)) return; + if(!(event instanceof RoomEntryTileMessageEvent)) return; this._latestEntryTileEvent = event; } diff --git a/src/nitro/room/preview/RoomPreviewer.ts b/src/nitro/room/preview/RoomPreviewer.ts index 1f84935d..1dbefffa 100644 --- a/src/nitro/room/preview/RoomPreviewer.ts +++ b/src/nitro/room/preview/RoomPreviewer.ts @@ -8,8 +8,8 @@ import { IRoomRenderingCanvas } from '../../../room/renderer/IRoomRenderingCanva import { IVector3D } from '../../../room/utils/IVector3D'; import { RoomId } from '../../../room/utils/RoomId'; import { Vector3d } from '../../../room/utils/Vector3d'; -import { RoomDoorParser } from '../../communication/messages/parser/room/mapping/RoomDoorParser'; -import { RoomModelParser } from '../../communication/messages/parser/room/mapping/RoomModelParser'; +import { FloorHeightMapMessageParser } from '../../communication/messages/parser/room/mapping/FloorHeightMapMessageParser'; +import { RoomEntryTileMessageParser } from '../../communication/messages/parser/room/mapping/RoomEntryTileMessageParser'; import { Nitro } from '../../Nitro'; import { RoomEngineEvent } from '../events/RoomEngineEvent'; import { RoomEngineObjectEvent } from '../events/RoomEngineObjectEvent'; @@ -155,7 +155,7 @@ export class RoomPreviewer public updatePreviewModel(model: string, wallHeight: number, scale: boolean = true): void { - const parser = new RoomModelParser(); + const parser = new FloorHeightMapMessageParser(); parser.flush(); parser.parseModel(model, wallHeight, scale); @@ -172,7 +172,7 @@ export class RoomPreviewer this._planeParser.initializeTileMap(width, height); - const entryTile: RoomDoorParser = null; + const entryTile: RoomEntryTileMessageParser = null; let doorX = -1; let doorY = -1; diff --git a/src/room/floorplan/index.ts b/src/room/floorplan/index.ts deleted file mode 100644 index f4352cef..00000000 --- a/src/room/floorplan/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './pixi-tilemap'; diff --git a/src/room/floorplan/pixi-tilemap/CanvasTileRenderer.ts b/src/room/floorplan/pixi-tilemap/CanvasTileRenderer.ts deleted file mode 100644 index 8d490134..00000000 --- a/src/room/floorplan/pixi-tilemap/CanvasTileRenderer.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { CanvasRenderer } from '@pixi/canvas-renderer'; -import { IRendererPlugin } from '@pixi/core'; - -export class CanvasTileRenderer implements IRendererPlugin -{ - renderer: CanvasRenderer; - tileAnim = [0, 0]; - dontUseTransform = false; - - constructor(renderer: CanvasRenderer, options: any = null) - { - this.renderer = renderer; - this.tileAnim = [0, 0]; - } - - public destroy(): void - { - - } -} - -CanvasRenderer.registerPlugin('tilemap', CanvasTileRenderer); diff --git a/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts b/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts deleted file mode 100644 index 60cab12c..00000000 --- a/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts +++ /dev/null @@ -1,287 +0,0 @@ -import { Renderer, Resource, Texture } from '@pixi/core'; -import { Container } from '@pixi/display'; -import { Matrix } from '@pixi/math'; -import { Constant } from './Constant'; -import { RectTileLayer } from './RectTileLayer'; - -export class CompositeRectTileLayer extends Container -{ - constructor(zIndex?: number, bitmaps?: Texture[], texPerChild?: number, alpha?: number) - { - super(); - // eslint-disable-next-line prefer-spread,prefer-rest-params - this.initialize.apply(this, arguments); - } - - z: number; - modificationMarker = 0; - shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]); - _globalMat: Matrix = null; - _lastLayer: RectTileLayer = null; - - texPerChild: number; - - initialize(zIndex?: number, bitmaps?: Array, texPerChild?: number, alpha?: number) - { - if(texPerChild as any === true) - { - //old format, ignore it! - texPerChild = 0; - } - this.z = this.zIndex = zIndex; - this.alpha = alpha ?? 1.0; - this.texPerChild = texPerChild || Constant.boundCountPerBuffer * Constant.maxTextures; - if(bitmaps) - { - this.setBitmaps(bitmaps); - } - } - - setBitmaps(bitmaps: Array) - { - for(let i=0;i 5.2.1, it does not exist there.'); - } - } - const texPerChild = this.texPerChild; - const len1 = this.children.length; - const len2 = Math.ceil(bitmaps.length / texPerChild); - let i: number; - for(i = 0; i < len1; i++) - { - (this.children[i] as RectTileLayer).textures = bitmaps.slice(i * texPerChild, (i + 1) * texPerChild); - } - for(i = len1; i < len2; i++) - { - const layer = new RectTileLayer(this.zIndex, bitmaps.slice(i * texPerChild, (i + 1) * texPerChild)); - layer.compositeParent = true; - layer.offsetX = Constant.boundSize; - layer.offsetY = Constant.boundSize; - this.addChild(layer); - } - } - - clear() - { - for(let i = 0; i < this.children.length; i++) - { - (this.children[i] as RectTileLayer).clear(); - } - this.modificationMarker = 0; - } - - addRect(textureIndex: number, u: number, v: number, x: number, y: number, tileWidth: number, tileHeight: number, animX?: number, animY?: number, rotate?: number, animWidth?: number, animHeight?: number, alpha?: number): this - { - const childIndex: number = textureIndex / this.texPerChild >> 0; - const textureId: number = textureIndex % this.texPerChild; - - if(this.children[childIndex] && (this.children[childIndex] as RectTileLayer).textures) - { - this._lastLayer = (this.children[childIndex] as RectTileLayer); - const tileAlpha = this.worldAlpha * (alpha ?? 1.0); - this._lastLayer.addRect(textureId, u, v, x, y, tileWidth, tileHeight, animX, animY, rotate, animWidth, animHeight, tileAlpha); - } - else - { - this._lastLayer = null; - } - - return this; - } - - tileRotate(rotate: number): this - { - if(this._lastLayer) - { - this._lastLayer.tileRotate(rotate); - } - return this; - } - - tileAnimX(offset: number, count: number): this - { - if(this._lastLayer) - { - this._lastLayer.tileAnimX(offset, count); - } - return this; - } - - tileAnimY(offset: number, count: number): this - { - if(this._lastLayer) - { - this._lastLayer.tileAnimY(offset, count); - } - return this; - } - - addFrame(texture_: Texture | string | number, x: number, y: number, animX?: number, animY?: number, animWidth?: number, animHeight?: number, alpha?: number, yaxis?: number, xaxis?: number): this - { - let texture: Texture; - let layer: RectTileLayer = null; - let ind = 0; - const children = this.children; - - this._lastLayer = null; - if(typeof texture_ === 'number') - { - const childIndex = texture_ / this.texPerChild >> 0; - layer = children[childIndex] as RectTileLayer; - - if(!layer) - { - layer = children[0] as RectTileLayer; - if(!layer) - { - return this; - } - ind = 0; - } - else - { - ind = texture_ % this.texPerChild; - } - - texture = layer.textures[ind]; - } - else - { - if(typeof texture_ === 'string') - { - texture = Texture.from(texture_); - } - else - { - texture = texture_ as Texture; - } - - for(let i = 0; i < children.length; i++) - { - const child = children[i] as RectTileLayer; - const tex = child.textures; - for(let j = 0; j < tex.length; j++) - { - if(tex[j].baseTexture === texture.baseTexture) - { - layer = child; - ind = j; - break; - } - } - if(layer) - { - break; - } - } - - if(!layer) - { - for(let i = 0; i < children.length; i++) - { - const child = children[i] as RectTileLayer; - if(child.textures.length < this.texPerChild) - { - layer = child; - ind = child.textures.length; - child.textures.push(texture); - break; - } - } - if(!layer) - { - layer = new RectTileLayer(this.zIndex, texture); - layer.compositeParent = true; - layer.offsetX = Constant.boundSize; - layer.offsetY = Constant.boundSize; - this.addChild(layer); - ind = 0; - } - } - } - - this._lastLayer = layer; - const tileAlpha = this.worldAlpha * (alpha?? 1.0); - layer.addRect(ind, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate, animWidth, animHeight, tileAlpha, yaxis, xaxis); - return this; - } - - // renderCanvas(renderer: CanvasRenderer) - // { - // if(!this.visible || this.worldAlpha <= 0 || !this.renderable) - // { - // return; - // } - // const plugin = renderer.plugins.tilemap; - // if(!plugin.dontUseTransform) - // { - // const wt = this.worldTransform; - // renderer.context.setTransform( - // wt.a, - // wt.b, - // wt.c, - // wt.d, - // wt.tx * renderer.resolution, - // wt.ty * renderer.resolution - // ); - // } - // const layers = this.children; - // for(let i = 0; i < layers.length; i++) - // { - // (layers[i] as RectTileLayer).renderCanvasCore(renderer); - // } - // } - - render(renderer: Renderer) - { - if(!this.visible || this.worldAlpha <= 0 || !this.renderable) - { - return; - } - const plugin = (renderer.plugins as any)['tilemap']; - const shader = plugin.getShader(); - renderer.batch.setObjectRenderer(plugin); - //TODO: dont create new array, please - this._globalMat = shader.uniforms.projTransMatrix; - renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform); - shader.uniforms.shadowColor = this.shadowColor; - shader.uniforms.animationFrame = plugin.tileAnim; - renderer.shader.bind(shader, false); - const layers = this.children; - for(let i = 0; i < layers.length; i++) - { - (layers[i] as RectTileLayer).renderWebGLCore(renderer, plugin); - } - } - - isModified(anim: boolean) - { - const layers = this.children; - if(this.modificationMarker !== layers.length) - { - return true; - } - for(let i = 0; i < layers.length; i++) - { - if((layers[i] as RectTileLayer).isModified(anim)) - { - return true; - } - } - return false; - } - - clearModify() - { - const layers = this.children; - this.modificationMarker = layers.length; - for(let i = 0; i < layers.length; i++) - { - (layers[i] as RectTileLayer).clearModify(); - } - } -} diff --git a/src/room/floorplan/pixi-tilemap/Constant.ts b/src/room/floorplan/pixi-tilemap/Constant.ts deleted file mode 100644 index 103b2199..00000000 --- a/src/room/floorplan/pixi-tilemap/Constant.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { SCALE_MODES } from '@pixi/constants'; - -export const Constant = { - maxTextures: 16, - bufferSize: 2048, - boundSize: 1024, - boundCountPerBuffer: 1, - use32bitIndex: false, - SCALE_MODE: SCALE_MODES.LINEAR, - DO_CLEAR: true -}; diff --git a/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts b/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts deleted file mode 100644 index 1b14b354..00000000 --- a/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { BaseTexture, GLTexture, IAutoDetectOptions, Renderer, Resource, Texture } from '@pixi/core'; -import { Sprite } from '@pixi/sprite'; -import { NitroSprite } from '../../../core'; - -export interface IMultiTextureOptions { - boundCountPerBuffer: number; - boundSize: number; - bufferSize: number; - DO_CLEAR?: boolean; -} - -export class MultiTextureResource extends Resource -{ - constructor(options: IMultiTextureOptions) - { - super(options.bufferSize, options.bufferSize); - - const bounds = this.boundSprites; - const dirties = this.dirties; - this.boundSize = options.boundSize; - for(let j = 0; j < options.boundCountPerBuffer; j++) - { - const spr = new NitroSprite(); - spr.position.x = options.boundSize * (j & 1); - spr.position.y = options.boundSize * (j >> 1); - bounds.push(spr); - dirties.push(0); - } - this.DO_CLEAR = !!options.DO_CLEAR; - } - - DO_CLEAR = false; - boundSize: number = 0; - _clearBuffer: Uint8Array = null; - - bind(baseTexture: BaseTexture) - { - if(this.baseTex) - { - throw new Error('Only one baseTexture is allowed for this resource!'); - } - this.baseTex = baseTexture; - super.bind(baseTexture); - } - - baseTex: BaseTexture = null; - boundSprites: Array = []; - dirties: Array = []; - - setTexture(ind: number, texture: Texture) - { - const spr = this.boundSprites[ind]; - if(spr.texture.baseTexture === texture.baseTexture) - { - return; - } - spr.texture = texture; - this.baseTex.update(); - this.dirties[ind] = (this.baseTex as any).dirtyId; - } - - // required ??? - public upload(renderer: Renderer, baseTexture: BaseTexture, glTexture: GLTexture): boolean - { - return false; - } - -} diff --git a/src/room/floorplan/pixi-tilemap/RectTileLayer.ts b/src/room/floorplan/pixi-tilemap/RectTileLayer.ts deleted file mode 100644 index 66692837..00000000 --- a/src/room/floorplan/pixi-tilemap/RectTileLayer.ts +++ /dev/null @@ -1,495 +0,0 @@ -import { DRAW_MODES } from '@pixi/constants'; -import { Renderer, Resource, Texture } from '@pixi/core'; -import { Bounds, Container } from '@pixi/display'; -import { groupD8, Matrix, Rectangle } from '@pixi/math'; -import { Constant } from './Constant'; -import { RectTileGeom } from './RectTileShader'; -import { TileRenderer } from './TileRenderer'; - -class PointStruct -{ - public static U = 0; - public static V = 1; - public static X = 2; - public static Y = 3; - public static TileWidth = 4; - public static TileHeight = 5; - public static Rotate = 6; - public static AnimX = 7; - public static AnimY = 8; - public static TextureIndex = 9; - public static AnimCountX = 10; - public static AnimCountY = 11; - public static Alpha = 12; - public static YAxis = 13; - public static XAxis = 14; -} -export const POINT_STRUCT_SIZE_TWO = (Object.keys(PointStruct).length / 2); -//export const POINT_STRUCT_SIZE = 12; -export class RectTileLayer extends Container -{ - constructor(zIndex: number, texture: Texture | Texture[]) - { - super(); - this.initialize(zIndex, texture); - } - - //zIndex = 0; - modificationMarker = 0; - _$_localBounds = new Bounds(); - shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]); - _globalMat: Matrix = null; - - pointsBuf: Array = []; - hasAnim = false; - textures: Array; - - offsetX = 0; - offsetY = 0; - compositeParent = false; - - initialize(zIndex: number, textures: Texture | Array) - { - if(!textures) - { - textures = []; - } - else if(!(textures instanceof Array) && (textures as Texture).baseTexture) - { - textures = [textures as Texture]; - } - this.textures = textures as Array; - this.zIndex = zIndex; - // this.visible = false; - } - - clear() - { - this.pointsBuf.length = 0; - this.modificationMarker = 0; - this._$_localBounds.clear(); - this.hasAnim = false; - } - - addFrame(texture_: Texture | string | number, x: number, y: number, animX: number, animY: number) - { - let texture: Texture; - let textureIndex = 0; - - if(typeof texture_ === 'number') - { - textureIndex = texture_; - texture = this.textures[textureIndex]; - } - else - { - if(typeof texture_ === 'string') - { - texture = Texture.from(texture_); - } - else - { - texture = texture_ as Texture; - } - - let found = false; - const textureList = this.textures; - for(let i = 0; i < textureList.length; i++) - { - if(textureList[i].baseTexture === texture.baseTexture) - { - textureIndex = i; - found = true; - break; - } - } - - if(!found) - { - // textureIndex = this.textures.length; - // this.textures.push(texture); - return false; - } - } - - this.addRect(textureIndex, texture.frame.x, texture.frame.y, x, y, texture.orig.width, texture.orig.height, animX, animY, texture.rotate); - return true; - } - - addRect(textureIndex: number, u: number, v: number, x: number, y: number, tileWidth: number, tileHeight: number, - animX: number = 0, animY: number = 0, rotate: number = 0, animCountX: number = 1024, animCountY: number = 1024, alpha: number = 1, yaxis?: number, xaxis?: number): this - { - const pb = this.pointsBuf; - this.hasAnim = this.hasAnim || animX > 0 || animY > 0; - pb.push(u); - pb.push(v); - pb.push(x); - pb.push(y); - pb.push(tileWidth); - pb.push(tileHeight); - pb.push(rotate); - pb.push(animX | 0); - pb.push(animY | 0); - pb.push(textureIndex); - pb.push(animCountX); - pb.push(animCountY); - pb.push(alpha); - pb.push(yaxis); - pb.push(xaxis); - - this._$_localBounds.addFramePad(x, y, x+tileWidth, y+tileHeight, 0, 0); - - return this; - } - - tileRotate(rotate: number) - { - const pb = this.pointsBuf; - pb[pb.length - (POINT_STRUCT_SIZE_TWO - PointStruct.TextureIndex)] = rotate; - } - - tileAnimX(offset: number, count: number) - { - const pb = this.pointsBuf; - - pb[pb.length - (POINT_STRUCT_SIZE_TWO - PointStruct.AnimX)] = offset; - pb[pb.length - (POINT_STRUCT_SIZE_TWO - PointStruct.AnimCountX)] = count; - } - - tileAnimY(offset: number, count: number) - { - const pb = this.pointsBuf; - - pb[pb.length - (POINT_STRUCT_SIZE_TWO - PointStruct.AnimY)] = offset; - pb[pb.length - (POINT_STRUCT_SIZE_TWO - PointStruct.AnimCountY)] = count; - } - - tileAlpha(alpha: number) - { - const pb = this.pointsBuf; - pb[pb.length - (POINT_STRUCT_SIZE_TWO - PointStruct.Alpha)] = alpha; - } - - // renderCanvas(renderer: any) - // { - // const plugin = renderer.plugins.tilemap; - // if(!plugin.dontUseTransform) - // { - // const wt = this.worldTransform; - // renderer.context.setTransform( - // wt.a, - // wt.b, - // wt.c, - // wt.d, - // wt.tx * renderer.resolution, - // wt.ty * renderer.resolution - // ); - // } - // this.renderCanvasCore(renderer); - // } - - renderCanvasCore(renderer: any) - { - if(this.textures.length === 0) return; - const points = this.pointsBuf; - renderer.context.fillStyle = '#000000'; - for(let i = 0, n = points.length; i < n; i += POINT_STRUCT_SIZE_TWO) - { - let x1 = points[i + PointStruct.U], y1 = points[i + PointStruct.V]; - const x2 = points[i + PointStruct.X], y2 = points[i + PointStruct.Y]; - const w = points[i + PointStruct.TileWidth]; - const h = points[i + PointStruct.TileHeight]; - const rotate = points[i + PointStruct.Rotate]; - x1 += points[i + PointStruct.AnimX] * renderer.plugins.tilemap.tileAnim[0]; - y1 += points[i + PointStruct.AnimY] * renderer.plugins.tilemap.tileAnim[1]; - const textureIndex = points[i + PointStruct.TextureIndex]; - const alpha = points[i + PointStruct.Alpha]; - // canvas does not work with rotate yet - if(textureIndex >= 0) - { - renderer.context.globalAlpha = alpha; - renderer.context.drawImage((this.textures[textureIndex].baseTexture as any).getDrawableSource(), x1, y1, w, h, x2, y2, w, h); - } - else - { - renderer.context.globalAlpha = 0.5; - renderer.context.fillRect(x2, y2, w, h); - renderer.context.globalAlpha = 1; - } - renderer.context.globalAlpha = 1; - } - } - - vbId = 0; - vb: RectTileGeom = null; - vbBuffer: ArrayBuffer = null; - vbArray: Float32Array = null; - vbInts: Uint32Array = null; - - destroyVb() - { - if(this.vb) - { - this.vb.destroy(); - this.vb = null; - } - } - - render(renderer: Renderer) - { - const plugin = (renderer.plugins as any)['tilemap']; - const shader = plugin.getShader(); - renderer.batch.setObjectRenderer(plugin); - this._globalMat = shader.uniforms.projTransMatrix; - renderer.globalUniforms.uniforms.projectionMatrix.copyTo(this._globalMat).append(this.worldTransform); - shader.uniforms.shadowColor = this.shadowColor; - shader.uniforms.animationFrame = plugin.tileAnim; - this.renderWebGLCore(renderer, plugin); - } - - renderWebGLCore(renderer: Renderer, plugin: TileRenderer) - { - const points = this.pointsBuf; - if(points.length === 0) return; - const rectsCount = points.length / POINT_STRUCT_SIZE_TWO; - - const shader = plugin.getShader(); - const textures = this.textures; - if(textures.length === 0) return; - - plugin.bindTextures(renderer, shader, textures); - renderer.shader.bind(shader, false); - - //lost context! recover! - let vb = this.vb; - if(!vb) - { - vb = plugin.createVb(); - this.vb = vb; - this.vbId = (vb as any).id; - this.vbBuffer = null; - this.modificationMarker = 0; - } - - plugin.checkIndexBuffer(rectsCount, vb); - const boundCountPerBuffer = Constant.boundCountPerBuffer; - - const vertexBuf = vb.getBuffer('aVertexPosition'); - //if layer was changed, re-upload vertices - const vertices = rectsCount * vb.vertPerQuad; - if(vertices === 0) return; - if(this.modificationMarker !== vertices) - { - this.modificationMarker = vertices; - const vs = vb.stride * vertices; - if(!this.vbBuffer || this.vbBuffer.byteLength < vs) - { - //!@#$ happens, need resize - let bk = vb.stride; - while(bk < vs) - { - bk *= 2; - } - this.vbBuffer = new ArrayBuffer(bk); - this.vbArray = new Float32Array(this.vbBuffer); - this.vbInts = new Uint32Array(this.vbBuffer); - vertexBuf.update(this.vbBuffer); - } - - const arr = this.vbArray, ints = this.vbInts; - //upload vertices! - let sz = 0; - //let tint = 0xffffffff; - let textureId = 0; - let shiftU: number = this.offsetX; - let shiftV: number = this.offsetY; - - //let tint = 0xffffffff; - const tint = -1; - - - for(let i = 0; i < points.length; i += POINT_STRUCT_SIZE_TWO) - { - const eps = 0.5; - if(this.compositeParent) - { - const textureIndex = points[i + PointStruct.TextureIndex]; - if(boundCountPerBuffer > 1) - { - //TODO: what if its more than 4? - textureId = (textureIndex >> 2); - shiftU = this.offsetX * (textureIndex & 1); - shiftV = this.offsetY * ((textureIndex >> 1) & 1); - } - else - { - textureId = textureIndex; - shiftU = 0; - shiftV = 0; - } - } - const x = points[i + PointStruct.X], y = points[i + PointStruct.Y]; - const w = points[i + PointStruct.TileWidth], h = points[i + PointStruct.TileHeight]; - const u = points[i + PointStruct.U] + shiftU, v = points[i + PointStruct.V] + shiftV; - let rotate = points[i + PointStruct.Rotate]; - - const animX = points[i + PointStruct.AnimX], animY = points[i + PointStruct.AnimY]; - const animWidth = points[i + PointStruct.AnimCountX] || 1024, animHeight = points[i + PointStruct.AnimCountY] || 1024; - const animXEncoded = animX + (animWidth * 2048); - const animYEncoded = animY + (animHeight * 2048); - const alpha = points[i + PointStruct.Alpha]; - - let u0: number, v0: number, u1: number, v1: number, u2: number, v2: number, u3: number, v3: number; - if(rotate === 0) - { - u0 = u; - v0 = v; - u1 = u + w; - v1 = v; - u2 = u + w; - v2 = v + h; - u3 = u; - v3 = v + h; - } - else - { - let w2 = w / 2; - let h2 = h / 2; - if(rotate % 4 !== 0) - { - w2 = h / 2; - h2 = w / 2; - } - const cX = u + w2; - const cY = v + h2; - - rotate = groupD8.add(rotate, groupD8.NW); - u0 = cX + (w2 * groupD8.uX(rotate)); - v0 = cY + (h2 * groupD8.uY(rotate)); - - rotate = groupD8.add(rotate, 2); // rotate 90 degrees clockwise - u1 = cX + (w2 * groupD8.uX(rotate)); - v1 = cY + (h2 * groupD8.uY(rotate)); - - rotate = groupD8.add(rotate, 2); - u2 = cX + (w2 * groupD8.uX(rotate)); - v2 = cY + (h2 * groupD8.uY(rotate)); - - rotate = groupD8.add(rotate, 2); - u3 = cX + (w2 * groupD8.uX(rotate)); - v3 = cY + (h2 * groupD8.uY(rotate)); - } - - const test= true; - arr[sz++] = x; - arr[sz++] = y; - arr[sz++] = u0; - arr[sz++] = v0; - arr[sz++] = u + eps; - arr[sz++] = v + eps; - arr[sz++] = u + w - eps; - arr[sz++] = v + h - eps; - arr[sz++] = animXEncoded; - arr[sz++] = animYEncoded; - arr[sz++] = textureId; - - if(test) - { - arr[sz++] = alpha; - } - arr[sz++] = x + w; - arr[sz++] = y; - arr[sz++] = u1; - arr[sz++] = v1; - arr[sz++] = u + eps; - arr[sz++] = v + eps; - arr[sz++] = u + w - eps; - arr[sz++] = v + h - eps; - arr[sz++] = animXEncoded; - arr[sz++] = animYEncoded; - arr[sz++] = textureId; - if(test) - { - arr[sz++] = alpha; - } - - - arr[sz++] = x + w; - arr[sz++] = y + h; - arr[sz++] = u2; - arr[sz++] = v2; - arr[sz++] = u + eps; - arr[sz++] = v + eps; - arr[sz++] = u + w - eps; - arr[sz++] = v + h - eps; - arr[sz++] = animXEncoded; - arr[sz++] = animYEncoded; - arr[sz++] = textureId; - if(test) - { - arr[sz++] = alpha; - } - - arr[sz++] = x; - arr[sz++] = y + h; - arr[sz++] = u3; - arr[sz++] = v3; - arr[sz++] = u + eps; - arr[sz++] = v + eps; - arr[sz++] = u + w - eps; - arr[sz++] = v + h - eps; - arr[sz++] = animXEncoded; - arr[sz++] = animYEncoded; - arr[sz++] = textureId; - if(test) - { - arr[sz++] = alpha; - } - } - - vertexBuf.update(arr); - } - - (renderer.geometry as any).bind(vb, shader); - renderer.geometry.draw(DRAW_MODES.TRIANGLES, rectsCount * 6, 0); - } - - isModified(anim: boolean) - { - if(this.modificationMarker !== this.pointsBuf.length || - anim && this.hasAnim) - { - return true; - } - return false; - } - - clearModify() - { - this.modificationMarker = this.pointsBuf.length; - } - - protected _calculateBounds(): void - { - const { minX, minY, maxX, maxY } = this._$_localBounds; - - this._bounds.addFrame(this.transform, minX, minY, maxX, maxY); - } - - public getLocalBounds(rect?: Rectangle): Rectangle - { - // we can do a fast local bounds if the sprite has no children! - if(this.children.length === 0) - { - return this._$_localBounds.getRectangle(rect); - } - - return super.getLocalBounds.call(this, rect); - } - - destroy(options?: any) - { - super.destroy(options); - this.destroyVb(); - } -} diff --git a/src/room/floorplan/pixi-tilemap/RectTileShader.ts b/src/room/floorplan/pixi-tilemap/RectTileShader.ts deleted file mode 100644 index 9ee325a9..00000000 --- a/src/room/floorplan/pixi-tilemap/RectTileShader.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { Buffer, Geometry, Program, Shader } from '@pixi/core'; -import { Matrix } from '@pixi/math'; -import * as shaderGenerator from './shaderGenerator'; - -const rectShaderFrag = ` -varying vec2 vTextureCoord; -varying vec4 vFrame; -varying float vTextureId; -varying float vAlpha; -uniform vec4 shadowColor; -uniform sampler2D uSamplers[%count%]; -uniform vec2 uSamplerSize[%count%]; - -void main(void){ - - - vec2 textureCoord = clamp(vTextureCoord, vFrame.xy, vFrame.zw); - float textureId = floor(vTextureId + 0.5); - - vec4 color; - vec3 tint = vec3(1, 0.8, 0.5); // reddish - %forloop% - gl_FragColor = (color * vAlpha) + (gl_FragColor * (1.0 - vAlpha)); -} -`; - -const rectShaderVert = ` -attribute vec2 aVertexPosition; -attribute vec2 aTextureCoord; -attribute vec4 aFrame; -attribute vec2 aAnim; -attribute float aTextureId; -attribute float aAlpha; - -uniform mat3 projTransMatrix; -uniform vec2 animationFrame; - -varying vec2 vTextureCoord; -varying float vTextureId; -varying vec4 vFrame; -varying float vAlpha; - -void main(void){ - gl_Position = vec4((projTransMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); - vec2 animCount = floor((aAnim + 0.5) / 2048.0); - vec2 animFrameOffset = aAnim - animCount * 2048.0; - vec2 animOffset = animFrameOffset * floor(mod(animationFrame + 0.5, animCount)); - - vTextureCoord = aTextureCoord + animOffset; - vFrame = aFrame + vec4(animOffset, animOffset); - vTextureId = aTextureId; - vAlpha = aAlpha; -} -`; - -export abstract class TilemapShader extends Shader -{ - maxTextures = 0; - - constructor(maxTextures: number, shaderVert: string, shaderFrag: string) - { - super( - new Program( - shaderVert, - shaderFrag), - { - animationFrame: new Float32Array(2), - uSamplers: [], - uSamplerSize: [], - projTransMatrix: new Matrix() - } - ); - this.maxTextures = maxTextures; - shaderGenerator.fillSamplers(this, this.maxTextures); - } -} - -export class RectTileShader extends TilemapShader -{ - constructor(maxTextures: number) - { - super( - maxTextures, - rectShaderVert, - shaderGenerator.generateFragmentSrc(maxTextures, rectShaderFrag) - ); - shaderGenerator.fillSamplers(this, this.maxTextures); - } -} - -export class RectTileGeom extends Geometry -{ - vertSize = 12; - vertPerQuad = 4; - stride = this.vertSize * 4; - lastTimeAccess = 0; - buf: Buffer; - - constructor() - { - super(); - const buf = this.buf = new Buffer(new Float32Array(2), true, false); - this.addAttribute('aVertexPosition', buf, 0, false, 0, this.stride, 0) - .addAttribute('aTextureCoord', buf, 0, false, 0, this.stride, 2 * 4) - .addAttribute('aFrame', buf, 0, false, 0, this.stride, 4 * 4) - .addAttribute('aAnim', buf, 0, false, 0, this.stride, 8 * 4) - .addAttribute('aTextureId', buf, 0, false, 0, this.stride, 10 * 4) - .addAttribute('aTextureId', buf, 0, false, 0, this.stride, 10 * 4) - .addAttribute('aAlpha', buf, 0, false, 0, this.stride, 11 * 4); - } -} diff --git a/src/room/floorplan/pixi-tilemap/TileRenderer.ts b/src/room/floorplan/pixi-tilemap/TileRenderer.ts deleted file mode 100644 index d4e0e6f8..00000000 --- a/src/room/floorplan/pixi-tilemap/TileRenderer.ts +++ /dev/null @@ -1,166 +0,0 @@ -import { WRAP_MODES } from '@pixi/constants'; -import { Buffer, ObjectRenderer, Renderer, Resource, Texture } from '@pixi/core'; -import { createIndicesForQuads } from '@pixi/utils'; -import { Constant } from './Constant'; -import { MultiTextureResource } from './MultiTextureResource'; -import type { TilemapShader } from './RectTileShader'; -import { RectTileGeom, RectTileShader } from './RectTileShader'; - -/** - * Renderer for rectangle tiles. - */ -export class TileRenderer extends ObjectRenderer -{ - renderer: Renderer; - gl: WebGLRenderingContext; - sn: number = -1; - indexBuffer: Buffer = null; - ibLen: number = 0; - tileAnim = [0, 0]; - texLoc: Array = []; - - rectShader: RectTileShader; - texResources: Array = []; - - constructor(renderer: Renderer) - { - super(renderer); - this.rectShader = new RectTileShader(Constant.maxTextures); - this.indexBuffer = new Buffer(undefined, true, true); - this.checkIndexBuffer(2000); - this.initBounds(); - } - - initBounds() - { - if(Constant.boundCountPerBuffer <= 1) - { - return; - } - - const maxTextures = Constant.maxTextures; - for(let i = 0; i < maxTextures; i++) - { - const resource = new MultiTextureResource(Constant); - // @ts-ignore - const baseTex = new BaseTexture(resource); - baseTex.scaleMode = Constant.SCALE_MODE; - baseTex.wrapMode = WRAP_MODES.CLAMP; - this.texResources.push(resource); - } - } - - bindTexturesWithoutRT(renderer: Renderer, shader: TilemapShader, textures: Texture[]) - { - const samplerSize: Array = (shader as any).uniforms.uSamplerSize; - this.texLoc.length = 0; - for(let i = 0; i < textures.length; i++) - { - const texture = textures[i]; - if(!texture || !texture.valid) - { - return; - } - renderer.texture.bind(textures[i], i); - //TODO: add resolution here - samplerSize[i * 2] = 1.0 / textures[i].baseTexture.width; - samplerSize[i * 2 + 1] = 1.0 / textures[i].baseTexture.height; - } - (shader as any).uniforms.uSamplerSize = samplerSize; - } - - bindTextures(renderer: Renderer, shader: TilemapShader, textures: Array) - { - const len = textures.length; - const maxTextures = Constant.maxTextures; - if(len > Constant.boundCountPerBuffer * maxTextures) - { - return; - } - if(Constant.boundCountPerBuffer <= 1) - { - this.bindTexturesWithoutRT(renderer, shader, textures); - return; - } - - let i = 0; - for(; i < len; i++) - { - const texture = textures[i]; - if(!texture || !texture.valid) continue; - const multi = this.texResources[i >> 2]; - multi.setTexture(i & 3, texture); - } - - const gltsUsed = (i + 3) >> 2; - for(i = 0; i < gltsUsed; i++) - { - //remove "i, true" after resolving a bug - renderer.texture.bind(this.texResources[i].baseTex, i); - } - } - - start() - { - //sorry, nothing - } - - createVb() - { - const geom = new RectTileGeom(); - geom.addIndex(this.indexBuffer); - geom.lastTimeAccess = Date.now(); - return geom; - } - - checkIndexBuffer(size: number, vb: RectTileGeom = null) - { - const totalIndices = size * 6; - - if(totalIndices <= this.ibLen) - { - return; - } - - let len = totalIndices; - while(len < totalIndices) - { - len <<= 1; - } - - this.ibLen = totalIndices; - this.indexBuffer.update(createIndicesForQuads(size, Constant.use32bitIndex ? new Uint32Array(size * 6) : undefined)); - - // TODO: create new index buffer instead? - // if (vb) { - // const curIndex = vb.getIndex(); - // if (curIndex !== this.indexBuffer && (curIndex.data as any).length < totalIndices) { - // this.swapIndex(vb, this.indexBuffer); - // } - // } - } - - // swapIndex(geom: PIXI.Geometry, indexBuf: PIXI.Buffer) { - // let buffers = (geom as any).buffers; - // const oldIndex = geom.getIndex(); - // let ind = buffers.indexOf(oldIndex); - // if (ind >= 0) { - // buffers.splice(ind, 1); - // } - // geom.addIndex(indexBuf); - // } - - getShader(): TilemapShader - { - return this.rectShader; - } - - destroy() - { - super.destroy(); - // this.rectShader.destroy(); - this.rectShader = null; - } -} - -Renderer.registerPlugin('tilemap', TileRenderer as any); diff --git a/src/room/floorplan/pixi-tilemap/index.ts b/src/room/floorplan/pixi-tilemap/index.ts deleted file mode 100644 index 38e72430..00000000 --- a/src/room/floorplan/pixi-tilemap/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from './CanvasTileRenderer'; -export * from './CompositeRectTileLayer'; -export * from './Constant'; -export * from './MultiTextureResource'; -export * from './RectTileLayer'; -export * from './RectTileShader'; -export * from './shaderGenerator'; -export * from './TileRenderer'; diff --git a/src/room/floorplan/pixi-tilemap/shaderGenerator.ts b/src/room/floorplan/pixi-tilemap/shaderGenerator.ts deleted file mode 100644 index c7fe15ef..00000000 --- a/src/room/floorplan/pixi-tilemap/shaderGenerator.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Constant } from './Constant'; -import type { TilemapShader } from './RectTileShader'; - -export function fillSamplers(shader: TilemapShader, maxTextures: number) -{ - const sampleValues: Array = []; - for(let i = 0; i < maxTextures; i++) - { - sampleValues[i] = i; - } - shader.uniforms.uSamplers = sampleValues; - - const samplerSize: Array = []; - for(let i = 0; i < maxTextures; i++) - { - samplerSize.push(1.0 / Constant.bufferSize); - samplerSize.push(1.0 / Constant.bufferSize); - } - shader.uniforms.uSamplerSize = samplerSize; -} - -export function generateFragmentSrc(maxTextures: number, fragmentSrc: string) -{ - return fragmentSrc.replace(/%count%/gi, maxTextures + '') - .replace(/%forloop%/gi, generateSampleSrc(maxTextures)); -} - -export function generateSampleSrc(maxTextures: number) -{ - let src = ''; - - src += '\n'; - src += '\n'; - - src += 'if(vTextureId <= -1.0) {'; - src += '\n\tcolor = shadowColor;'; - src += '\n}'; - - for(let i = 0; i < maxTextures; i++) - { - src += '\nelse '; - - if(i < maxTextures-1) - { - src += 'if(textureId == ' + i + '.0)'; - } - - src += '\n{'; - src += '\n\tcolor = texture2D(uSamplers['+i+'], textureCoord * uSamplerSize['+i+']);'; - src += '\n}'; - } - - src += '\n'; - src += '\n'; - - return src; -} diff --git a/src/room/index.ts b/src/room/index.ts index 563d1355..b5b45eac 100644 --- a/src/room/index.ts +++ b/src/room/index.ts @@ -1,6 +1,5 @@ export * from './data'; export * from './events'; -export * from './floorplan'; export * from './IRoomInstance'; export * from './IRoomInstanceContainer'; export * from './IRoomManager'; From fcaa02ce9979a4156f9e569504afa3fe6d8651f5 Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 31 Oct 2021 16:47:46 -0400 Subject: [PATCH 073/108] Update pixi to 6.1.3 --- package-lock.json | 715 ++++++++++++++-------------------------------- package.json | 16 +- 2 files changed, 226 insertions(+), 505 deletions(-) diff --git a/package-lock.json b/package-lock.json index 089b8931..7e406f2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -86,70 +86,70 @@ "dev": true }, "@nodelib/fs.scandir": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", - "integrity": "sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "requires": { - "@nodelib/fs.stat": "2.0.4", + "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "@nodelib/fs.stat": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.4.tgz", - "integrity": "sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true }, "@nodelib/fs.walk": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.6.tgz", - "integrity": "sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "requires": { - "@nodelib/fs.scandir": "2.1.4", + "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "@pixi/accessibility": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/accessibility/-/accessibility-6.1.0.tgz", - "integrity": "sha512-SDbu08F0eXTc5jqkJdLoX5G6yrSD68V5X7nU9+AfVL5mYdR+wkAuDXjcOINbGq2vxHPN6fgoBNZIDNPfRHeATw==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/accessibility/-/accessibility-6.1.3.tgz", + "integrity": "sha512-JK6rtqfC2/rnJt1xLPznH2lNH0Jx9f2Py7uh50VM1sqoYrkyAAegenbOdyEzgB35Q4oQji3aBkTsWn2mrwXp/g==" }, "@pixi/app": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/app/-/app-6.1.0.tgz", - "integrity": "sha512-QIMNyMpswWAIXo1RhTbnem7DEdNnrYCV8RLK9E9nZ3NlzP3587IuMEmNfwZp7PsvMJXehH2opY/hlYxVOmYxew==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/app/-/app-6.1.3.tgz", + "integrity": "sha512-gryDVXuzErRIgY5G2CRQH6fZM7Pk3m1CFEInXEKa4rmVzfwRz+3OeU0YNSnD9atPAS5C2TaAzE4yOSHH2+wESQ==" }, "@pixi/canvas-renderer": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/canvas-renderer/-/canvas-renderer-6.1.0.tgz", - "integrity": "sha512-dukgaw9OQyFjTZZ/R2jvf+cyxVQA7P+wJVtGO4Ev/TlaLs85KKy1xtnRpgYbF/etPhORRgN232H6rys50B0YjQ==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/canvas-renderer/-/canvas-renderer-6.1.3.tgz", + "integrity": "sha512-Vkffpd1w69ketO2971iE2AwZtPPub7kVc2BaK/VIXEbr4WVEZx83H3aLZKU78pCjFogFqhxeCYe44Q5QjxQWiw==" }, "@pixi/compressed-textures": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/compressed-textures/-/compressed-textures-6.1.0.tgz", - "integrity": "sha512-3Go+GT43avgzyX4+fFYiTEfjR5pHrzafKpVlMvttC9xGRhMV1BZFDi1rKjHYuYk8SgNycuqRa2RulsoVq0bQUw==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/compressed-textures/-/compressed-textures-6.1.3.tgz", + "integrity": "sha512-FO2B7GhDMlZA0fnpH2PvNOh6ZlRxQoJnNlpjzNw+x1nvF9h3+V6dbFoG9oBC5zAisTfacdfoo1TdT789Oh+kTg==" }, "@pixi/constants": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-6.1.0.tgz", - "integrity": "sha512-4mIvvyiovu/tT1m32fQO/pYwGxO/ch9ZGOArAcsVKx0gWEk/Whi0fuJVxgCemu8gpSFkcIJreWnOiLUzZCVpdQ==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-6.1.3.tgz", + "integrity": "sha512-Qvz/SIxw+dQ6P9niOEdILWX2DQ5FnGA0XZNFLW/3amekzad/+WqHobL+Mg5S6A4/a9mXTnqjyB0BqhhtLfpFkA==" }, "@pixi/core": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-6.1.0.tgz", - "integrity": "sha512-u6pXk8K05ZLhFNQxg+mtlHA6IjV0+lr/IDrEbx55eDZo+ImJwI4ummkJ/uiXaNn04GG0tVAQt+y5+e3fJjVFEQ==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-6.1.3.tgz", + "integrity": "sha512-UQsR1Q7c+Zcvtu6HrYMidvoyF/j9n3b4WXPh3ojuNV6+ZIvps3rznoZYaIx6foEJNhj7HM9fMObsimGP+FB36A==" }, "@pixi/display": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/display/-/display-6.1.0.tgz", - "integrity": "sha512-Jb1V54kpJXiGjKFx1qe5NhZyl1u6Z1t3o6mWawIFbXKiOJs+nkouUqRyPX2877cu1zkufbAalEe5V8WXOkqixg==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-6.1.3.tgz", + "integrity": "sha512-8/GdapJVKfl6PUkxX/Et5zB1aXny+uy353cQX886KJ6dGle82fQAYjIn7I6Xm+JiZWOhWo0N6KE9cjotO0rroA==" }, "@pixi/extract": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/extract/-/extract-6.1.0.tgz", - "integrity": "sha512-QqOb9jZ473mt8NDuAnfD/oUuXefspGLOoVTfHD+NVRP0J3P4Mnzq98ljHHpOFII/XgM8Jam6YRuOlTGyT7H+vg==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/extract/-/extract-6.1.3.tgz", + "integrity": "sha512-yZOsXc9Lh+U59ayl+DoWDPmndrOJj5ft2nzENMAvz2rVEOHQjWxH73qCSP6Wa5VsoINyJLMmV4MTbI+U0SH7GA==" }, "@pixi/filter-adjustment": { "version": "4.1.3", @@ -157,151 +157,151 @@ "integrity": "sha512-W+NhPiZRYKoRToa5+tkU95eOw8gnS5dfIp3ZP+pLv2mdER9RI+4xHxp1uLHMqUYZViTaMdZIIoVOuCgHFPYCbQ==" }, "@pixi/filter-alpha": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/filter-alpha/-/filter-alpha-6.1.0.tgz", - "integrity": "sha512-giNst0xR8h3Ulkk3u6JEN8L1TmZsE5JEPZ+brvdZ336k6wiRMxkqIZ2wt1w9cQLq3PY3MAiUO+SZkYr4Zr1GJg==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/filter-alpha/-/filter-alpha-6.1.3.tgz", + "integrity": "sha512-eubgEO/qlxQbuPXgwxTZxTBTWjA0EQbrs7TyPqyBK2Wj0eEvimaVQ8u4eiqfMFJCZLnuWDCAPJpP9bMHxBXXpQ==" }, "@pixi/filter-blur": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/filter-blur/-/filter-blur-6.1.0.tgz", - "integrity": "sha512-EskO2DjKGyOwSMQIqVkONJgG8rdF7Ja9EtBBuWGL6V+lE7DUQ0I25+D13+12HD3OMUsEnXyZWmlYtGW9BD9P7g==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/filter-blur/-/filter-blur-6.1.3.tgz", + "integrity": "sha512-uo8FHpV+qm4SuXcDnWqZWrznHmLJ3b8ibgLAgi/e8VmwrFiC+EqGa4n4V8J+xtR5P/iA3lT5pRgWw09/xHN3dQ==" }, "@pixi/filter-color-matrix": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/filter-color-matrix/-/filter-color-matrix-6.1.0.tgz", - "integrity": "sha512-8OE8EDyV8KEUhcqwQxeNvW6r0YMBrQXS7IZLUlCvIVdM5rI24qBA1n9ec5w8ofe7A6jdMArmV4NwiNiSHCkYvw==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/filter-color-matrix/-/filter-color-matrix-6.1.3.tgz", + "integrity": "sha512-d1pyxmVrGDOrO5pINe+fTspj1NNxiIp2IZ+FGgT7e17xnxjXTvtk4n4KqXAZFS1NCoStImDAV5j+b8Lysdg5jQ==" }, "@pixi/filter-displacement": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/filter-displacement/-/filter-displacement-6.1.0.tgz", - "integrity": "sha512-ZmsLEYhLQLxVbhP688ofv0bmfRXObYk2Xa3ORwKgivyJeX3UqizP+OUHa1mJ+4n6Q50BwtCra/Cg+TJ0q2R0wQ==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/filter-displacement/-/filter-displacement-6.1.3.tgz", + "integrity": "sha512-tIXK8vXzb2unMxGmu4gjdlOwddnkHA0IJXFTOF25a5h36v/AHqWwWG4h5G775oPu37UuhuYjeD/j229t0Q9QNQ==" }, "@pixi/filter-fxaa": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/filter-fxaa/-/filter-fxaa-6.1.0.tgz", - "integrity": "sha512-htFHMvW7GId9UTw5c8Mdd4FU3RGTg9aSsQ04yQCJekm54pwQsTGzkbElGTVWHznurflOhjAJJRib6dtWW1CY8A==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/filter-fxaa/-/filter-fxaa-6.1.3.tgz", + "integrity": "sha512-yhKVxX5vFKQz3lxfqAGg4XoajFyIRR8XzWqEHgAsPMFRnIIQIbF25bMRygZj12P61z3vxwqAM/2bn7S46Ii1zQ==" }, "@pixi/filter-noise": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/filter-noise/-/filter-noise-6.1.0.tgz", - "integrity": "sha512-5qdW1UZOcN8pJsyp/L7qNzGvigGwKB0c+RvI9LKWn/DsWC4WfAhatMtKV7dTsYNSRE+MWaFbelBQZT6wYw05Jg==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/filter-noise/-/filter-noise-6.1.3.tgz", + "integrity": "sha512-oVRtcJwbN6VnAnvXZuLEZ0c12JUzporao5AziXgRAUjTMA3bFVE0/7Dx193Kx/l6UAasmzhWQctuv6NMxy5Efw==" }, "@pixi/graphics": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/graphics/-/graphics-6.1.0.tgz", - "integrity": "sha512-NfbVX/TIXYrzUDItrXCg6c9LKM6Td1O+xXFnM9uP6EQQ1cyH5uUHtkSR0xgnPpdcs8IEa/FgyOmABEJ+G17syA==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/graphics/-/graphics-6.1.3.tgz", + "integrity": "sha512-e5O47yECRp5WXWIvKhLDQKpiak7CfIqJzuTuQIyE7jXp8QiJNw+aoWNlJEd4ksKbsDkP3EE39CxlmiaBpxNL3w==" }, "@pixi/interaction": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/interaction/-/interaction-6.1.0.tgz", - "integrity": "sha512-0GijG3v7oWET96FaFC59ozNrXa5D/fROpZSh2ywwL0NRvftLcjHOSDMGxDXhrlfpsjPgLVqDQQUHAcpIKigleA==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/interaction/-/interaction-6.1.3.tgz", + "integrity": "sha512-ju3fE/KnO6KZChnZzZAdY6bfjlSh7/igZcVcd/MZRkAdNozx4QoN5sYmwrcvTvA5llMYaThSIRWgIHQiSlbOfQ==" }, "@pixi/loaders": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/loaders/-/loaders-6.1.0.tgz", - "integrity": "sha512-0RcJuWKJx+4r2lZoVWMfSdaMjC+gGTouDrnGFNX6NGRRXXE3vKQdyFlwwkaJzUefvsjbNe4cYxC7iws9lqL3oA==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/loaders/-/loaders-6.1.3.tgz", + "integrity": "sha512-qOvy72bsVGzCmWyoofm6dm1l//hd+bJneidngplwsovpqnnyMfuewCpQjeLRL6rLqcHR40V1+Qo4iJ+ElMdVZQ==" }, "@pixi/math": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/math/-/math-6.1.0.tgz", - "integrity": "sha512-4INGyMqO7z02kTzHEp/7sl1TOrIhPmKLx3jNUDyQ/J7RPJJE3ZbgEktZcfmG0tofJoW3KbLqL4fd6k/FIi5Hsw==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-6.1.3.tgz", + "integrity": "sha512-1bLZeHpG38Bz6TESwxayNbL7tztOd7gpZDXS5OiBB9n8SFZeKlWfRQ/aJrvjoBz2qsZf9gGeVKsHpC/FJz0qnA==" }, "@pixi/mesh": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/mesh/-/mesh-6.1.0.tgz", - "integrity": "sha512-l3zFMs9ENGB8y5PIRMCf2/7nHXu40yfeBZq4bPYIJJeHztkzaNKDbEFtDOx/Y1+QrG8VX4LiDWQ+sE7Tk+qIRA==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/mesh/-/mesh-6.1.3.tgz", + "integrity": "sha512-TF9eKNQdowozVOr4G05+Auku2EK8XwDXKYVvMYvt6Tsn2DLSrRhWl7xYyj4EuTjW/4eaP/c2QqY18cEMoMtJiQ==" }, "@pixi/mesh-extras": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/mesh-extras/-/mesh-extras-6.1.0.tgz", - "integrity": "sha512-/l/ohKrxDRkho85TcGPZrturJPQRUSGLoctIkWCqhNePMk9ATLVQ2ihg7GR1glaYqvxMOQXj5qqIfEC/T7eMlw==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/mesh-extras/-/mesh-extras-6.1.3.tgz", + "integrity": "sha512-HuTV8SkTQZDU1bmHmJWRo+4Hiz89oCuOonE3ckfqsoAoULfImgU72qqNIq7Vxmnu3kXoXAwV+fvOl49OzWl4+w==" }, "@pixi/mixin-cache-as-bitmap": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/mixin-cache-as-bitmap/-/mixin-cache-as-bitmap-6.1.0.tgz", - "integrity": "sha512-nwmXcfw7cFyhZwNDFHZLyE7dhJvLEZbm0BJ5cpiDb2HC1g4U5+BfGkjxQulUh2JfdOaqTp7EeU8K5okMVvcdnQ==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/mixin-cache-as-bitmap/-/mixin-cache-as-bitmap-6.1.3.tgz", + "integrity": "sha512-mEa0kn3Mou3KhbAUpaGnvmPz/ifI/41af1N6kVcTz1V8cu4BI/f74xLv5pKkQtp+xzWlquGo/2z9urkrRFD6qA==" }, "@pixi/mixin-get-child-by-name": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/mixin-get-child-by-name/-/mixin-get-child-by-name-6.1.0.tgz", - "integrity": "sha512-F78olhSbF9ukDigA27hqcPFYrqw0Yj6Z+2NLYVxyWD8vys8Cfev8wtztDk50WYVnCRk8BRYiTiEAtBGYIPSbYA==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/mixin-get-child-by-name/-/mixin-get-child-by-name-6.1.3.tgz", + "integrity": "sha512-HHrnA1MtsMSyW0lOnBlklHp7j3JGYHIyick4b8F8p8eKqOFiAVdLzf4tmX/fKF4zs6i7DuYKE8G9Z7vpAhyrFg==" }, "@pixi/mixin-get-global-position": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/mixin-get-global-position/-/mixin-get-global-position-6.1.0.tgz", - "integrity": "sha512-c/mrnEv7ZuKnjjaME+8jyOiP/Mtk2cq/UXDEM+lwOX98zVdxiaBFf13BhnMPnVq7Vq1+HeDDRZ2/VIlrLkU9Ag==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/mixin-get-global-position/-/mixin-get-global-position-6.1.3.tgz", + "integrity": "sha512-XqhEyViMlGOS+p2LKW2tFjQy4ghbARKriwgY10MGvNApHHZbUDL3VKM1EmR6F2Xj8PPmycWRw/0oBu148O2KhQ==" }, "@pixi/particle-container": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/particle-container/-/particle-container-6.1.0.tgz", - "integrity": "sha512-Nu/UqG6n66b51UPdfQjuVfuGnM+D3caUqQCq2rLGVJIJmfrd38J0AooOaTtqePuadQWII2g3pFZ+dXv0oN1Blg==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/particle-container/-/particle-container-6.1.3.tgz", + "integrity": "sha512-pZqRRL5Yx2Yy30cdjsNEXRpTfl1WEf640ZLVHX2+fcKcWftPJaIXQZR+0aLvijyWF3VA4O/r/8IxhYgiMkqAUQ==" }, "@pixi/polyfill": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/polyfill/-/polyfill-6.1.0.tgz", - "integrity": "sha512-gLz7eyfz5PAKxL7y9qI47O91WQyzuPFvuWm9sTxyncsgY7nchJxi6vUuxjLtFDd9vzl+/PXFDHyRGFyDe8tSkg==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/polyfill/-/polyfill-6.1.3.tgz", + "integrity": "sha512-e+g2sHK/ORKDOrhJ86zZgdMSkQNzKdkaMw/UUFZ5wEUJgltoqF7H0zwNVPPO/1m7hfrN02PBMinYtXM+qFdY/A==", "requires": { "object-assign": "^4.1.1", "promise-polyfill": "^8.2.0" } }, "@pixi/prepare": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/prepare/-/prepare-6.1.0.tgz", - "integrity": "sha512-IdQ0gefbDt4anT59MxZznaY3EZQwvGE9K2Jo3+6t+3ZOvRlsgOLHdMFbNy9N0/MzKp9TAvuvzEj5WW2NoHx5Yw==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/prepare/-/prepare-6.1.3.tgz", + "integrity": "sha512-zjv81fPJjdQyWGCbA9Ij04GfwJUYA3j6/vFyJFaDKVMqEWzNDJwu40G00P23BXh3F5dYL638EXvyLYDQavjseg==" }, "@pixi/runner": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-6.1.0.tgz", - "integrity": "sha512-Pf6WmyBZSQg9mf3wpB3UvnZNX9GeRDoC4gMcQEYxw0rZDe0Z0JwzrkV0EGGyGHCZSssdx4+K1+vUxUIyFWdymw==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-6.1.3.tgz", + "integrity": "sha512-hJw7O9enlei7Cp5/j2REKuUjvyyC4BGqmVycmt01jTYyphRYMNQgyF+OjwrL7nidZMXnCVzfNKWi8e5+c4wssg==" }, "@pixi/settings": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-6.1.0.tgz", - "integrity": "sha512-dVVOGqnCwZIHNtuAyzhw9QXZPtaxq8daDXYyRfmxfKS5SWX86HMl65KJW7rmA9TIua53i/igSSQVWgAhzRkUeg==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-6.1.3.tgz", + "integrity": "sha512-laKwS4/R+bTQokKIeMeMO4orvSNTMWUpNRXJbDq7N29bCrA5pT6BW+LNZ+4gJs4TFK/s9bmP/xU5BlPVKHRoyg==", "requires": { "ismobilejs": "^1.1.0" } }, "@pixi/sprite": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/sprite/-/sprite-6.1.0.tgz", - "integrity": "sha512-BnaRNiXgiqNNTN2a9WaeMPZtLP+v/D8W/fymNkjg2wWrs4FwnpT0lPGAL0YHFoBO328LI8qTCy6BCBZg74V4aQ==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/sprite/-/sprite-6.1.3.tgz", + "integrity": "sha512-TzvqeRV+bbxFbucR74c28wcDsCbXic+5dONM+fy31ejAIraKbigzKbgHxH6opgLEMMh5APzmJPlwntYdEUGSXQ==" }, "@pixi/sprite-animated": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/sprite-animated/-/sprite-animated-6.1.0.tgz", - "integrity": "sha512-yL6Fe+xyXb9m/NkofUcigE3+NYUA3VrKajacf/ONXND897A7JLCihqXS9cHJHJGTNL3X+wsba1iZc9Rax5H0Sg==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/sprite-animated/-/sprite-animated-6.1.3.tgz", + "integrity": "sha512-COrFkmcMPxyv3zGRJJrNB2nOdaeDEOYTkbxUcNxMSJ7eT3O3PUX5XEvfOW7bl2zHkt8XraIQ66uwWychqGHx7Q==" }, "@pixi/sprite-tiling": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/sprite-tiling/-/sprite-tiling-6.1.0.tgz", - "integrity": "sha512-7a0NubCDrLG5pK7rrLAQJoju0EydL71kljm1TgqhcnoYV7n70Dbpoz+N4OuPyObOyEz9VvcnPMy5srp9FNllfw==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/sprite-tiling/-/sprite-tiling-6.1.3.tgz", + "integrity": "sha512-om+RrModhNFljb8C1fhpGKtgt5k5AW9gCjFfeBPN+5pVdVjtc/luyO2Cbubpeow9YQldrUZri9it63GBo07Cfw==" }, "@pixi/spritesheet": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/spritesheet/-/spritesheet-6.1.0.tgz", - "integrity": "sha512-7kh7OuYujRGOAw1Pe6EtwH2Yzov80Qss2MtDlHNplJ+loImd/SCthFhsmpRrOb/lSBtxVn3h+pUzV0bc7bxQXg==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/spritesheet/-/spritesheet-6.1.3.tgz", + "integrity": "sha512-QUqAYUzn/+0JlzrLo7ASIFzJSteGZuNMxKwyFL29JtttUIjdJlXe3+jrfUMAu6gewYd9HVYkXJ0ODhH8PH6KpA==" }, "@pixi/text": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/text/-/text-6.1.0.tgz", - "integrity": "sha512-Yul5LqVYr/XW21uNAoMrkjn7p63RfD19c0S6EWCV18QOJaOjz6ZwzPMg6wpm6b+2i/Ob6F8ZFZdSwAM0hznRYg==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/text/-/text-6.1.3.tgz", + "integrity": "sha512-R0D3cbwwLbQOfobja4NGhq0bF7biCfNE3PXsOmTEsWOroVJqUexIob5XZXoT9Avy3B8nlrB2Hyl5imIQx60jFw==" }, "@pixi/text-bitmap": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/text-bitmap/-/text-bitmap-6.1.0.tgz", - "integrity": "sha512-xcpRzXueq/XPqVJyd0FeJhdnmXcap8clZMrzLjND8blIWS9sJDJKXrpTmNco/JdOrU+vuOkWRau2OSJJKd882A==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/text-bitmap/-/text-bitmap-6.1.3.tgz", + "integrity": "sha512-x46qOVoosl67dBrG3mgd2eQx3A9NTxWUnzgRpk5vsNfLLNRu6XlM+YoscRMuHT5sLEEBLewjcVxzAAkrSW45eQ==" }, "@pixi/ticker": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-6.1.0.tgz", - "integrity": "sha512-tCh1dhmriLKLMcxTJ9usm1UZEK2+M5nEwvyec9kouF4EMi/PiGup65+pwTHK4SvjXD+9vbtTDam39fWYXCpRxg==" + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-6.1.3.tgz", + "integrity": "sha512-ZSuhe5HrmkDoqSIZjETUGYCQr/EbtDQGngq0LQLAgblyhAJbi4p/B3uf2XGfRNZ7Tdxdl0j81BmUqBEu2+DeoA==" }, "@pixi/utils": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-6.1.0.tgz", - "integrity": "sha512-N7LaVjo2NiP0/4DMX6Hj6SsSoFFEA1Pc3U/I/kQJHj9OyLrNSpcl9PZEiPusnuhpMr+zlQKa+MMU+RyTj+06Hw==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-6.1.3.tgz", + "integrity": "sha512-05mm9TBbpYorYO3ALC4CVgR5K6sA/0uhnwE/Zl4ZhNJZN699LrIr0OWFQhxhySeGUPMDaizeEZpn2rhx+CYYpg==", "requires": { "@types/earcut": "^2.1.0", "earcut": "^2.2.2", @@ -315,15 +315,9 @@ "integrity": "sha512-w8oigUCDjElRHRRrMvn/spybSMyX8MTkKA5Dv+tS1IE/TgmNZPqUYtvYBXGY8cieSE66gm+szeK+bnbxC2xHTQ==" }, "@types/json-schema": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", - "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", - "dev": true - }, - "@types/node": { - "version": "14.17.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.7.tgz", - "integrity": "sha512-SYTdMaW47se8499q8m0fYKZZRlmq0RaRv6oYmlVm6DUm31l0fhOl1D03X8hGxohCKTI2Bg6w7W0TiYB51aJzag==", + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, "@types/pako": { @@ -333,70 +327,71 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.29.0.tgz", - "integrity": "sha512-eiREtqWRZ8aVJcNru7cT/AMVnYd9a2UHsfZT8MR1dW3UUEg6jDv9EQ9Cq4CUPZesyQ58YUpoAADGv71jY8RwgA==", + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.33.0.tgz", + "integrity": "sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.29.0", - "@typescript-eslint/scope-manager": "4.29.0", + "@typescript-eslint/experimental-utils": "4.33.0", + "@typescript-eslint/scope-manager": "4.33.0", "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", + "ignore": "^5.1.8", "regexpp": "^3.1.0", "semver": "^7.3.5", "tsutils": "^3.21.0" } }, "@typescript-eslint/experimental-utils": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.29.0.tgz", - "integrity": "sha512-FpNVKykfeaIxlArLUP/yQfv/5/3rhl1ov6RWgud4OgbqWLkEq7lqgQU9iiavZRzpzCRQV4XddyFz3wFXdkiX9w==", + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.33.0.tgz", + "integrity": "sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==", "dev": true, "requires": { "@types/json-schema": "^7.0.7", - "@typescript-eslint/scope-manager": "4.29.0", - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/typescript-estree": "4.29.0", + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/parser": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.0.tgz", - "integrity": "sha512-+92YRNHFdXgq+GhWQPT2bmjX09X7EH36JfgN2/4wmhtwV/HPxozpCNst8jrWcngLtEVd/4zAwA6BKojAlf+YqA==", + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.33.0.tgz", + "integrity": "sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.29.0", - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/typescript-estree": "4.29.0", + "@typescript-eslint/scope-manager": "4.33.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/typescript-estree": "4.33.0", "debug": "^4.3.1" } }, "@typescript-eslint/scope-manager": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.0.tgz", - "integrity": "sha512-HPq7XAaDMM3DpmuijxLV9Io8/6pQnliiXMQUcAdjpJJSR+fdmbD/zHCd7hMkjJn04UQtCQBtshgxClzg6NIS2w==", + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.33.0.tgz", + "integrity": "sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==", "dev": true, "requires": { - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/visitor-keys": "4.29.0" + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/visitor-keys": "4.33.0" } }, "@typescript-eslint/types": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.0.tgz", - "integrity": "sha512-2YJM6XfWfi8pgU2HRhTp7WgRw78TCRO3dOmSpAvIQ8MOv4B46JD2chnhpNT7Jq8j0APlIbzO1Bach734xxUl4A==", + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.33.0.tgz", + "integrity": "sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.0.tgz", - "integrity": "sha512-8ZpNHDIOyqzzgZrQW9+xQ4k5hM62Xy2R4RPO3DQxMc5Rq5QkCdSpk/drka+DL9w6sXNzV5nrdlBmf8+x495QXQ==", + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz", + "integrity": "sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.29.0", - "@typescript-eslint/visitor-keys": "4.29.0", + "@typescript-eslint/types": "4.33.0", + "@typescript-eslint/visitor-keys": "4.33.0", "debug": "^4.3.1", "globby": "^11.0.3", "is-glob": "^4.0.1", @@ -405,12 +400,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.29.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.0.tgz", - "integrity": "sha512-LoaofO1C/jAJYs0uEpYMXfHboGXzOJeV118X4OsZu9f7rG7Pr9B3+4HTU8+err81rADa4xfQmAxnRnPAI2jp+Q==", + "version": "4.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz", + "integrity": "sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.29.0", + "@typescript-eslint/types": "4.33.0", "eslint-visitor-keys": "^2.0.0" } }, @@ -511,12 +506,6 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -568,17 +557,6 @@ } } }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -594,58 +572,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "create-ts-index": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/create-ts-index/-/create-ts-index-1.13.6.tgz", - "integrity": "sha512-vBcuficF62laj/wZv01D4YBz1TXTtEM8hsUq7J1k1uyPUHYq3YTWTVQlmlp+Y311KdM6HhPQeC2aHktvQR8u3w==", - "dev": true, - "requires": { - "chalk": "^2.4.1", - "commander": "^2.19.0", - "dayjs": "^1.8.14", - "debug": "^4.1.1", - "deepmerge": "^4.2.2", - "fast-glob": "^3.2.2", - "glob": "^7.1.3", - "json5": "^2.1.3", - "merge": "^1.2.1", - "minimatch": "^3.0.4", - "my-easy-fp": "^0.5.1", - "tslib": "^1.10.0", - "yargs": "^15.3.1" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } - } - }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -657,12 +589,6 @@ "which": "^2.0.1" } }, - "dayjs": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.10.4.tgz", - "integrity": "sha512-RI/Hh4kqRc1UKLOAf/T5zdMMX5DQIlDxwUe3wSyMMnEbGunnpENCdbUgM+dW7kXidZqCttBrmw7BhN4TMddkCw==", - "dev": true - }, "debug": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", @@ -672,24 +598,12 @@ "ms": "2.1.2" } }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", - "dev": true - }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -921,17 +835,16 @@ "dev": true }, "fast-glob": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz", - "integrity": "sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", + "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.0", + "glob-parent": "^5.1.2", "merge2": "^1.3.0", - "micromatch": "^4.0.2", - "picomatch": "^2.2.1" + "micromatch": "^4.0.4" } }, "fast-json-stable-stringify": { @@ -947,9 +860,9 @@ "dev": true }, "fastq": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.0.tgz", - "integrity": "sha512-7Eczs8gIPDrVzT+EksYBcupqMyxSHXXrHOLRRxU2/DicV8789MRBRR8+Hc2uWzUupOs4YS4JzBmBxjjCVBxD/g==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "dev": true, "requires": { "reusify": "^1.0.4" @@ -973,16 +886,6 @@ "to-regex-range": "^5.0.1" } }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, "flat-cache": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", @@ -1011,12 +914,6 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true - }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -1173,15 +1070,6 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, - "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -1192,15 +1080,6 @@ "type-check": "~0.4.0" } }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -1228,12 +1107,6 @@ "yallist": "^4.0.0" } }, - "merge": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz", - "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==", - "dev": true - }, "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -1241,13 +1114,13 @@ "dev": true }, "micromatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", - "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", "dev": true, "requires": { "braces": "^3.0.1", - "picomatch": "^2.0.5" + "picomatch": "^2.2.3" } }, "minimatch": { @@ -1259,36 +1132,12 @@ "brace-expansion": "^1.1.7" } }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "my-easy-fp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/my-easy-fp/-/my-easy-fp-0.5.1.tgz", - "integrity": "sha512-musRCJYBnEDDzod5ugUykOqHoZYudhtC90J536tFrMqXfjpBzb0PRzLkadM2chgNFsCebzm9GtC+qjQ7xKgpGg==", - "dev": true, - "requires": { - "debug": "^4.1.1", - "tslib": "1.11.1" - }, - "dependencies": { - "tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", - "dev": true - } - } - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -1323,30 +1172,6 @@ "word-wrap": "^1.2.3" } }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, "pako": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pako/-/pako-2.0.4.tgz", @@ -1361,12 +1186,6 @@ "callsites": "^3.0.0" } }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1386,51 +1205,51 @@ "dev": true }, "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "pixi.js": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/pixi.js/-/pixi.js-6.1.0.tgz", - "integrity": "sha512-uBcM3wivcLq7CPwLGkcyGscsvRST4TcXSlgXaH46P6mxNnJoDgVJtEYwYP+5H9g7b96ZBo5We6lddO+mmz7cXw==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/pixi.js/-/pixi.js-6.1.3.tgz", + "integrity": "sha512-h8Y/YVgP4CSPoUQvXaQvQf5GyQxi0b1NtVD38bZQsrX4CQ3r85jBU+zPyHN0fAcvhCB+nNvdD2sEwhhqkNsuSw==", "requires": { - "@pixi/accessibility": "6.1.0", - "@pixi/app": "6.1.0", - "@pixi/compressed-textures": "6.1.0", - "@pixi/constants": "6.1.0", - "@pixi/core": "6.1.0", - "@pixi/display": "6.1.0", - "@pixi/extract": "6.1.0", - "@pixi/filter-alpha": "6.1.0", - "@pixi/filter-blur": "6.1.0", - "@pixi/filter-color-matrix": "6.1.0", - "@pixi/filter-displacement": "6.1.0", - "@pixi/filter-fxaa": "6.1.0", - "@pixi/filter-noise": "6.1.0", - "@pixi/graphics": "6.1.0", - "@pixi/interaction": "6.1.0", - "@pixi/loaders": "6.1.0", - "@pixi/math": "6.1.0", - "@pixi/mesh": "6.1.0", - "@pixi/mesh-extras": "6.1.0", - "@pixi/mixin-cache-as-bitmap": "6.1.0", - "@pixi/mixin-get-child-by-name": "6.1.0", - "@pixi/mixin-get-global-position": "6.1.0", - "@pixi/particle-container": "6.1.0", - "@pixi/polyfill": "6.1.0", - "@pixi/prepare": "6.1.0", - "@pixi/runner": "6.1.0", - "@pixi/settings": "6.1.0", - "@pixi/sprite": "6.1.0", - "@pixi/sprite-animated": "6.1.0", - "@pixi/sprite-tiling": "6.1.0", - "@pixi/spritesheet": "6.1.0", - "@pixi/text": "6.1.0", - "@pixi/text-bitmap": "6.1.0", - "@pixi/ticker": "6.1.0", - "@pixi/utils": "6.1.0" + "@pixi/accessibility": "6.1.3", + "@pixi/app": "6.1.3", + "@pixi/compressed-textures": "6.1.3", + "@pixi/constants": "6.1.3", + "@pixi/core": "6.1.3", + "@pixi/display": "6.1.3", + "@pixi/extract": "6.1.3", + "@pixi/filter-alpha": "6.1.3", + "@pixi/filter-blur": "6.1.3", + "@pixi/filter-color-matrix": "6.1.3", + "@pixi/filter-displacement": "6.1.3", + "@pixi/filter-fxaa": "6.1.3", + "@pixi/filter-noise": "6.1.3", + "@pixi/graphics": "6.1.3", + "@pixi/interaction": "6.1.3", + "@pixi/loaders": "6.1.3", + "@pixi/math": "6.1.3", + "@pixi/mesh": "6.1.3", + "@pixi/mesh-extras": "6.1.3", + "@pixi/mixin-cache-as-bitmap": "6.1.3", + "@pixi/mixin-get-child-by-name": "6.1.3", + "@pixi/mixin-get-global-position": "6.1.3", + "@pixi/particle-container": "6.1.3", + "@pixi/polyfill": "6.1.3", + "@pixi/prepare": "6.1.3", + "@pixi/runner": "6.1.3", + "@pixi/settings": "6.1.3", + "@pixi/sprite": "6.1.3", + "@pixi/sprite-animated": "6.1.3", + "@pixi/sprite-tiling": "6.1.3", + "@pixi/spritesheet": "6.1.3", + "@pixi/text": "6.1.3", + "@pixi/text-bitmap": "6.1.3", + "@pixi/ticker": "6.1.3", + "@pixi/utils": "6.1.3" } }, "prelude-ls": { @@ -1462,9 +1281,9 @@ "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" }, "queue-microtask": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.2.tgz", - "integrity": "sha512-dB15eXv3p2jDlbOiNLyMabYg1/sXvppd8DP2J3EOCQ0AkuSXCW2tP7mnVouVLJKgUMY6yP0kcQDVpLCN13h4Xg==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, "regexpp": { @@ -1473,24 +1292,12 @@ "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, "require-from-string": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -1530,12 +1337,6 @@ "lru-cache": "^6.0.0" } }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true - }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -1685,9 +1486,9 @@ } }, "tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "tsutils": { "version": "3.21.0", @@ -1722,9 +1523,9 @@ "dev": true }, "typescript": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", - "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", + "version": "4.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", + "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", "dev": true }, "uri-js": { @@ -1767,101 +1568,23 @@ "isexe": "^2.0.0" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } } } } diff --git a/package.json b/package.json index ace00f84..580ff696 100644 --- a/package.json +++ b/package.json @@ -12,20 +12,18 @@ }, "private": true, "dependencies": { - "@pixi/canvas-renderer": "^6.1.0", - "@pixi/extract": "^6.1.0", + "@pixi/canvas-renderer": "^6.1.3", + "@pixi/extract": "^6.1.3", "@pixi/filter-adjustment": "^4.1.3", "pako": "^2.0.4", - "pixi.js": "^6.1.0", - "tslib": "^2.3.0" + "pixi.js": "^6.1.3", + "tslib": "^2.3.1" }, "devDependencies": { - "@types/node": "^14.17.7", "@types/pako": "^1.0.2", - "@typescript-eslint/eslint-plugin": "^4.29.0", - "@typescript-eslint/parser": "^4.29.0", - "create-ts-index": "^1.13.6", + "@typescript-eslint/eslint-plugin": "^4.33.0", + "@typescript-eslint/parser": "^4.33.0", "eslint": "^7.32.0", - "typescript": "^4.3.5" + "typescript": "^4.4.4" } } From 27cbd6d5f92ee73d295fe6276e40074c6c14cb38 Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 7 Nov 2021 02:02:41 -0500 Subject: [PATCH 074/108] Fix RoomObjectModel --- src/room/object/RoomObjectModel.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/room/object/RoomObjectModel.ts b/src/room/object/RoomObjectModel.ts index dadba40e..d2fc0b27 100644 --- a/src/room/object/RoomObjectModel.ts +++ b/src/room/object/RoomObjectModel.ts @@ -27,6 +27,11 @@ export class RoomObjectModel implements IRoomObjectModel public setValue(key: string, value: T): void { + if(this._map.has(key)) + { + if(this._map.get(key) === value) return; + } + this._map.set(key, (value as T)); this._updateCounter++; @@ -45,4 +50,4 @@ export class RoomObjectModel implements IRoomObjectModel { return this._updateCounter; } -} \ No newline at end of file +} From 62ac80cab298a727e6d7a927315ed8e9f97afeb7 Mon Sep 17 00:00:00 2001 From: dank074 Date: Thu, 11 Nov 2021 21:23:41 -0600 Subject: [PATCH 075/108] added outgoing help packets --- src/nitro/communication/NitroMessages.ts | 31 ++++++++++++++++++- .../messages/outgoing/OutgoingHeader.ts | 29 +++++++++++++++++ ...lForHelpFromForumMessageMessageComposer.ts | 21 +++++++++++++ ...llForHelpFromForumThreadMessageComposer.ts | 21 +++++++++++++ .../help/CallForHelpFromIMMessageComposer.ts | 21 +++++++++++++ .../CallForHelpFromPhotoMessageComposer.ts | 21 +++++++++++++ .../CallForHelpFromSelfieMessageComposer.ts | 21 +++++++++++++ ...eviewGuideDecidesOnOfferMessageComposer.ts | 21 +++++++++++++ .../ChatReviewGuideDetachedMessageComposer.ts | 21 +++++++++++++ .../ChatReviewGuideVoteMessageComposer.ts | 21 +++++++++++++ .../ChatReviewSessionCreateMessageComposer.ts | 21 +++++++++++++ ...eletePendingCallsForHelpMessageComposer.ts | 21 +++++++++++++ .../help/GetCfhStatusMessageComposer.ts | 21 +++++++++++++ .../help/GetFaqCategoryMessageComposer.ts | 21 +++++++++++++ .../help/GetFaqTextMessageComposer.ts | 21 +++++++++++++ .../GetGuideReportingStatusMessageComposer.ts | 21 +++++++++++++ .../GetPendingCallsForHelpMessageComposer.ts | 21 +++++++++++++ .../outgoing/help/GetQuizQuestionsComposer.ts | 21 +++++++++++++ .../help/GuideSessionCreateMessageComposer.ts | 21 +++++++++++++ .../GuideSessionFeedbackMessageComposer.ts | 21 +++++++++++++ ...eSessionGetRequesterRoomMessageComposer.ts | 21 +++++++++++++ ...GuideSessionGuideDecidesMessageComposer.ts | 21 +++++++++++++ ...deSessionInviteRequesterMessageComposer.ts | 21 +++++++++++++ .../GuideSessionIsTypingMessageComposer.ts | 21 +++++++++++++ .../GuideSessionMessageMessageComposer.ts | 21 +++++++++++++ ...GuideSessionOnDutyUpdateMessageComposer.ts | 21 +++++++++++++ .../help/GuideSessionReportMessageComposer.ts | 21 +++++++++++++ ...eSessionRequesterCancelsMessageComposer.ts | 21 +++++++++++++ .../GuideSessionResolvedMessageComposer.ts | 21 +++++++++++++ .../outgoing/help/PostQuizAnswersComposer.ts | 21 +++++++++++++ .../help/SearchFaqsMessageComposer.ts | 21 +++++++++++++ .../messages/outgoing/help/index.ts | 29 +++++++++++++++++ 32 files changed, 697 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/outgoing/help/CallForHelpFromForumMessageMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/CallForHelpFromForumThreadMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/CallForHelpFromIMMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/CallForHelpFromPhotoMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/CallForHelpFromSelfieMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/ChatReviewGuideDecidesOnOfferMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/ChatReviewGuideDetachedMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/ChatReviewGuideVoteMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/ChatReviewSessionCreateMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/DeletePendingCallsForHelpMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GetCfhStatusMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GetFaqCategoryMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GetFaqTextMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GetGuideReportingStatusMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GetPendingCallsForHelpMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GetQuizQuestionsComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GuideSessionCreateMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GuideSessionFeedbackMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GuideSessionGetRequesterRoomMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GuideSessionGuideDecidesMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GuideSessionInviteRequesterMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GuideSessionIsTypingMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GuideSessionMessageMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GuideSessionOnDutyUpdateMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GuideSessionReportMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GuideSessionRequesterCancelsMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/GuideSessionResolvedMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/PostQuizAnswersComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/help/SearchFaqsMessageComposer.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index e9dd2af4..a93ec143 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -963,7 +963,36 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.FORUM_UPDATE_THREAD, UpdateThreadMessageComposer); // HELP + this._composers.set(OutgoingHeader.CALL_FOR_HELP_FROM_FORUM_MESSAGE, CallForHelpFromForumMessageMessageComposer); + this._composers.set(OutgoingHeader.CALL_FOR_HELP_FROM_FORUM_THREAD, CallForHelpFromForumThreadMessageComposer); + this._composers.set(OutgoingHeader.CALL_FOR_HELP_FROM_IM, CallForHelpFromIMMessageComposer); + this._composers.set(OutgoingHeader.CALL_FOR_HELP_FROM_PHOTO, CallForHelpFromPhotoMessageComposer); + this._composers.set(OutgoingHeader.CALL_FOR_HELP_FROM_SELFIE, CallForHelpFromSelfieMessageComposer); this._composers.set(OutgoingHeader.CALL_FOR_HELP, CallForHelpMessageComposer); + this._composers.set(OutgoingHeader.CHAT_REVIEW_GUIDE_DECIDES, ChatReviewGuideDecidesOnOfferMessageComposer); + this._composers.set(OutgoingHeader.CHAT_REVIEW_GUIDE_DETACHED, ChatReviewGuideDetachedMessageComposer); + this._composers.set(OutgoingHeader.CHAT_REVIEW_GUIDE_VOTE, ChatReviewGuideVoteMessageComposer); + this._composers.set(OutgoingHeader.CHAT_REVIEW_SESSION_CREATE, ChatReviewSessionCreateMessageComposer); + this._composers.set(OutgoingHeader.DELETE_PENDING_CALLS_FOR_HELP, DeletePendingCallsForHelpMessageComposer); + this._composers.set(OutgoingHeader.GET_CFH_STATUS, GetCfhStatusMessageComposer); + this._composers.set(OutgoingHeader.GET_FAQ_CATEGORY, GetFaqCategoryMessageComposer); + this._composers.set(OutgoingHeader.GET_FAQ_TEXT, GetFaqTextMessageComposer); + this._composers.set(OutgoingHeader.GET_GUIDE_REPORTING_STATUS, GetGuideReportingStatusMessageComposer); + this._composers.set(OutgoingHeader.GET_PENDING_CALLS_FOR_HELP, GetPendingCallsForHelpMessageComposer); + this._composers.set(OutgoingHeader.GET_QUIZ_QUESTIONS, GetQuizQuestionsComposer); + this._composers.set(OutgoingHeader.GUIDE_SESSION_CREATE, GuideSessionCreateMessageComposer); + this._composers.set(OutgoingHeader.GUIDE_SESSION_FEEDBACK, GuideSessionFeedbackMessageComposer); + this._composers.set(OutgoingHeader.GUIDE_SESSION_GET_REQUESTER_ROOM, GuideSessionGetRequesterRoomMessageComposer); + this._composers.set(OutgoingHeader.GUIDE_SESSION_GUIDE_DECIDES, GuideSessionGuideDecidesMessageComposer); + this._composers.set(OutgoingHeader.GUIDE_SESSION_INVITE_REQUESTER, GuideSessionInviteRequesterMessageComposer); + this._composers.set(OutgoingHeader.GUIDE_SESSION_IS_TYPING, GuideSessionIsTypingMessageComposer); + this._composers.set(OutgoingHeader.GUIDE_SESSION_MESSAGE, GuideSessionMessageMessageComposer); + this._composers.set(OutgoingHeader.GUIDE_SESSION_ON_DUTY_UPDATE, GuideSessionOnDutyUpdateMessageComposer); + this._composers.set(OutgoingHeader.GUIDE_SESSION_REPORT, GuideSessionReportMessageComposer); + this._composers.set(OutgoingHeader.GUIDE_SESSION_REQUESTER_CANCELS, GuideSessionRequesterCancelsMessageComposer); + this._composers.set(OutgoingHeader.GUIDE_SESSION_RESOLVED, GuideSessionResolvedMessageComposer); + this._composers.set(OutgoingHeader.POST_QUIZ_ANSWERS, PostQuizAnswersComposer); + this._composers.set(OutgoingHeader.SEARCH_FAQS, SearchFaqsMessageComposer); // CLIENT this._composers.set(OutgoingHeader.CLIENT_PONG, ClientPongComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index d0459988..84555065 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -343,4 +343,33 @@ export class OutgoingHeader public static GET_YOUTUBE_DISPLAY_STATUS = 336; public static SET_YOUTUBE_DISPLAY_PLAYLIST = 2069; public static GO_TO_FLAT = 685; + public static CALL_FOR_HELP_FROM_FORUM_MESSAGE = 1412; + public static CALL_FOR_HELP_FROM_FORUM_THREAD = 534; + public static CALL_FOR_HELP_FROM_IM = 2950; + public static CALL_FOR_HELP_FROM_PHOTO = 2492; + public static CALL_FOR_HELP_FROM_SELFIE = 2755; + public static CHAT_REVIEW_GUIDE_DECIDES = 3365; + public static CHAT_REVIEW_GUIDE_DETACHED = 2501; + public static CHAT_REVIEW_GUIDE_VOTE = 3961; + public static CHAT_REVIEW_SESSION_CREATE = 3060; + public static DELETE_PENDING_CALLS_FOR_HELP = 3605; + public static GET_CFH_STATUS = 2746; + public static GET_FAQ_CATEGORY = 3445; + public static GET_FAQ_TEXT = 1849; + public static GET_GUIDE_REPORTING_STATUS = 3786; + public static GET_PENDING_CALLS_FOR_HELP = 3267; + public static GET_QUIZ_QUESTIONS = 1296; + public static GUIDE_SESSION_CREATE = 3338; + public static GUIDE_SESSION_FEEDBACK = 477; + public static GUIDE_SESSION_GET_REQUESTER_ROOM = 1052; + public static GUIDE_SESSION_GUIDE_DECIDES = 1424; + public static GUIDE_SESSION_INVITE_REQUESTER = 234; + public static GUIDE_SESSION_IS_TYPING = 519; + public static GUIDE_SESSION_MESSAGE = 3899 + public static GUIDE_SESSION_ON_DUTY_UPDATE = 1922; + public static GUIDE_SESSION_REPORT = 3969; + public static GUIDE_SESSION_REQUESTER_CANCELS = 291; + public static GUIDE_SESSION_RESOLVED = 887; + public static POST_QUIZ_ANSWERS = 3720; + public static SEARCH_FAQS = 2031; } diff --git a/src/nitro/communication/messages/outgoing/help/CallForHelpFromForumMessageMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/CallForHelpFromForumMessageMessageComposer.ts new file mode 100644 index 00000000..9d49e92b --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/CallForHelpFromForumMessageMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class CallForHelpFromForumMessageMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:number, _arg_3:number, _arg_4:number, _arg_5:string) + { + this._data = [k, _arg_2, _arg_3, _arg_4, _arg_5]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/CallForHelpFromForumThreadMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/CallForHelpFromForumThreadMessageComposer.ts new file mode 100644 index 00000000..5b19eee4 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/CallForHelpFromForumThreadMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class CallForHelpFromForumThreadMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:number, _arg_3:number, _arg_4:string) + { + this._data = [k, _arg_2, _arg_3, _arg_4]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/CallForHelpFromIMMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/CallForHelpFromIMMessageComposer.ts new file mode 100644 index 00000000..6016ff90 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/CallForHelpFromIMMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class CallForHelpFromIMMessageComposer implements IMessageComposer +{ + private _data: any; + + constructor(message:string, topicId:number, reportedUserId:number, chatEntries:(string|number)[]) + { + this._data = [message, topicId, reportedUserId, chatEntries.length / 2, ...chatEntries]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/CallForHelpFromPhotoMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/CallForHelpFromPhotoMessageComposer.ts new file mode 100644 index 00000000..f907f692 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/CallForHelpFromPhotoMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class CallForHelpFromPhotoMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:string, _arg_2:number, _arg_3:number, _arg_4:number, _arg_5:number) + { + this._data = [k, _arg_2, _arg_3, _arg_4, _arg_5]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/CallForHelpFromSelfieMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/CallForHelpFromSelfieMessageComposer.ts new file mode 100644 index 00000000..a7e49327 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/CallForHelpFromSelfieMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class CallForHelpFromSelfieMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:string, _arg_2:number, _arg_3:number, _arg_4:string, _arg_5:number) + { + this._data = [k, _arg_2, _arg_3, _arg_4, _arg_5]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/ChatReviewGuideDecidesOnOfferMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/ChatReviewGuideDecidesOnOfferMessageComposer.ts new file mode 100644 index 00000000..89fb523e --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/ChatReviewGuideDecidesOnOfferMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class ChatReviewGuideDecidesOnOfferMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:boolean) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/ChatReviewGuideDetachedMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/ChatReviewGuideDetachedMessageComposer.ts new file mode 100644 index 00000000..9717dfe9 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/ChatReviewGuideDetachedMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class ChatReviewGuideDetachedMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/ChatReviewGuideVoteMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/ChatReviewGuideVoteMessageComposer.ts new file mode 100644 index 00000000..1ba5ae7b --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/ChatReviewGuideVoteMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class ChatReviewGuideVoteMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/ChatReviewSessionCreateMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/ChatReviewSessionCreateMessageComposer.ts new file mode 100644 index 00000000..a00b8a95 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/ChatReviewSessionCreateMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class ChatReviewSessionCreateMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:number) + { + this._data = [k, _arg_2]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/DeletePendingCallsForHelpMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/DeletePendingCallsForHelpMessageComposer.ts new file mode 100644 index 00000000..ad520572 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/DeletePendingCallsForHelpMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class DeletePendingCallsForHelpMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GetCfhStatusMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GetCfhStatusMessageComposer.ts new file mode 100644 index 00000000..29928871 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GetCfhStatusMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetCfhStatusMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:boolean) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GetFaqCategoryMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GetFaqCategoryMessageComposer.ts new file mode 100644 index 00000000..1679d5ec --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GetFaqCategoryMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetFaqCategoryMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(categoryId:number) + { + this._data = [categoryId]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GetFaqTextMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GetFaqTextMessageComposer.ts new file mode 100644 index 00000000..3a0b850c --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GetFaqTextMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetFaqTextMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(questionId:number) + { + this._data = [questionId]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GetGuideReportingStatusMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GetGuideReportingStatusMessageComposer.ts new file mode 100644 index 00000000..a2183636 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GetGuideReportingStatusMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetGuideReportingStatusMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GetPendingCallsForHelpMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GetPendingCallsForHelpMessageComposer.ts new file mode 100644 index 00000000..c08a4a2b --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GetPendingCallsForHelpMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetPendingCallsForHelpMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GetQuizQuestionsComposer.ts b/src/nitro/communication/messages/outgoing/help/GetQuizQuestionsComposer.ts new file mode 100644 index 00000000..4bb85a3f --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GetQuizQuestionsComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetQuizQuestionsComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:string) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GuideSessionCreateMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GuideSessionCreateMessageComposer.ts new file mode 100644 index 00000000..21f5233b --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GuideSessionCreateMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GuideSessionCreateMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:number, _arg_2:string) + { + this._data = [k, _arg_2]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GuideSessionFeedbackMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GuideSessionFeedbackMessageComposer.ts new file mode 100644 index 00000000..37f06331 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GuideSessionFeedbackMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GuideSessionFeedbackMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:boolean) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GuideSessionGetRequesterRoomMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GuideSessionGetRequesterRoomMessageComposer.ts new file mode 100644 index 00000000..2246034a --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GuideSessionGetRequesterRoomMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GuideSessionGetRequesterRoomMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GuideSessionGuideDecidesMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GuideSessionGuideDecidesMessageComposer.ts new file mode 100644 index 00000000..f78403dc --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GuideSessionGuideDecidesMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GuideSessionGuideDecidesMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:boolean) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GuideSessionInviteRequesterMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GuideSessionInviteRequesterMessageComposer.ts new file mode 100644 index 00000000..143a3aba --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GuideSessionInviteRequesterMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GuideSessionInviteRequesterMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GuideSessionIsTypingMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GuideSessionIsTypingMessageComposer.ts new file mode 100644 index 00000000..3bfcc871 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GuideSessionIsTypingMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GuideSessionIsTypingMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:boolean) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GuideSessionMessageMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GuideSessionMessageMessageComposer.ts new file mode 100644 index 00000000..fbb761b0 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GuideSessionMessageMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GuideSessionMessageMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:string) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GuideSessionOnDutyUpdateMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GuideSessionOnDutyUpdateMessageComposer.ts new file mode 100644 index 00000000..d171b14f --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GuideSessionOnDutyUpdateMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GuideSessionOnDutyUpdateMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:boolean, _arg_2:boolean, _arg_3:boolean, _arg_4:boolean) + { + this._data = [k, _arg_2, _arg_3, _arg_4]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GuideSessionReportMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GuideSessionReportMessageComposer.ts new file mode 100644 index 00000000..86e47cd3 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GuideSessionReportMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GuideSessionReportMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:string) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GuideSessionRequesterCancelsMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GuideSessionRequesterCancelsMessageComposer.ts new file mode 100644 index 00000000..c0ce2530 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GuideSessionRequesterCancelsMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GuideSessionRequesterCancelsMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/GuideSessionResolvedMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/GuideSessionResolvedMessageComposer.ts new file mode 100644 index 00000000..a868f874 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/GuideSessionResolvedMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GuideSessionResolvedMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/PostQuizAnswersComposer.ts b/src/nitro/communication/messages/outgoing/help/PostQuizAnswersComposer.ts new file mode 100644 index 00000000..62b308dc --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/PostQuizAnswersComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class PostQuizAnswersComposer implements IMessageComposer +{ + private _data: any; + + constructor(quizCode:string, answerIds:number[]) + { + this._data = [quizCode, answerIds.length, ...answerIds]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/SearchFaqsMessageComposer.ts b/src/nitro/communication/messages/outgoing/help/SearchFaqsMessageComposer.ts new file mode 100644 index 00000000..cdfe8a73 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/help/SearchFaqsMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class SearchFaqsMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k:string) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/help/index.ts b/src/nitro/communication/messages/outgoing/help/index.ts index 7f5349c9..9824e8cf 100644 --- a/src/nitro/communication/messages/outgoing/help/index.ts +++ b/src/nitro/communication/messages/outgoing/help/index.ts @@ -1 +1,30 @@ +export * from './CallForHelpFromForumMessageMessageComposer'; +export * from './CallForHelpFromForumThreadMessageComposer'; +export * from './CallForHelpFromIMMessageComposer'; +export * from './CallForHelpFromPhotoMessageComposer'; +export * from './CallForHelpFromSelfieMessageComposer'; export * from './CallForHelpMessageComposer'; +export * from './ChatReviewGuideDecidesOnOfferMessageComposer'; +export * from './ChatReviewGuideDetachedMessageComposer'; +export * from './ChatReviewGuideVoteMessageComposer'; +export * from './ChatReviewSessionCreateMessageComposer'; +export * from './DeletePendingCallsForHelpMessageComposer'; +export * from './GetCfhStatusMessageComposer'; +export * from './GetFaqCategoryMessageComposer'; +export * from './GetFaqTextMessageComposer'; +export * from './GetGuideReportingStatusMessageComposer'; +export * from './GetPendingCallsForHelpMessageComposer'; +export * from './GetQuizQuestionsComposer'; +export * from './GuideSessionCreateMessageComposer'; +export * from './GuideSessionFeedbackMessageComposer'; +export * from './GuideSessionGetRequesterRoomMessageComposer'; +export * from './GuideSessionGuideDecidesMessageComposer'; +export * from './GuideSessionInviteRequesterMessageComposer'; +export * from './GuideSessionIsTypingMessageComposer'; +export * from './GuideSessionMessageMessageComposer'; +export * from './GuideSessionOnDutyUpdateMessageComposer'; +export * from './GuideSessionReportMessageComposer'; +export * from './GuideSessionRequesterCancelsMessageComposer'; +export * from './GuideSessionResolvedMessageComposer'; +export * from './PostQuizAnswersComposer'; +export * from './SearchFaqsMessageComposer'; From a5c5aa742d5be3dd16c53d0f979b1bb2b010e36b Mon Sep 17 00:00:00 2001 From: dank074 Date: Thu, 11 Nov 2021 22:47:52 -0600 Subject: [PATCH 076/108] move talent track packets to correct dir --- src/nitro/communication/NitroMessages.ts | 7 +-- .../messages/incoming/help/index.ts | 1 - .../communication/messages/incoming/index.ts | 1 + .../TalentTrackMessageEvent.ts} | 4 +- .../messages/incoming/talent/index.ts | 1 + .../parser/help/common/TalentTrackLevel.ts | 45 ----------------- .../common/TalentTrackLevelAchievement.ts | 49 ------------------- .../help/common/TalentTrackLevelItem.ts | 21 -------- .../messages/parser/help/common/index.ts | 3 -- .../messages/parser/help/index.ts | 2 - .../communication/messages/parser/index.ts | 1 + .../parser/talent/TalentTrackLevel.ts | 45 +++++++++++++++++ .../{help => talent}/TalentTrackParser.ts | 14 +++--- .../parser/talent/TalentTrackRewardProduct.ts | 21 ++++++++ .../messages/parser/talent/TalentTrackTask.ts | 49 +++++++++++++++++++ .../messages/parser/talent/index.ts | 4 ++ 16 files changed, 135 insertions(+), 133 deletions(-) rename src/nitro/communication/messages/incoming/{help/TalentTrackEvent.ts => talent/TalentTrackMessageEvent.ts} (70%) create mode 100644 src/nitro/communication/messages/incoming/talent/index.ts delete mode 100644 src/nitro/communication/messages/parser/help/common/TalentTrackLevel.ts delete mode 100644 src/nitro/communication/messages/parser/help/common/TalentTrackLevelAchievement.ts delete mode 100644 src/nitro/communication/messages/parser/help/common/TalentTrackLevelItem.ts delete mode 100644 src/nitro/communication/messages/parser/help/common/index.ts create mode 100644 src/nitro/communication/messages/parser/talent/TalentTrackLevel.ts rename src/nitro/communication/messages/parser/{help => talent}/TalentTrackParser.ts (77%) create mode 100644 src/nitro/communication/messages/parser/talent/TalentTrackRewardProduct.ts create mode 100644 src/nitro/communication/messages/parser/talent/TalentTrackTask.ts create mode 100644 src/nitro/communication/messages/parser/talent/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index a93ec143..e15facaf 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -601,8 +601,6 @@ export class NitroMessages implements IMessageConfiguration // HELP this._events.set(IncomingHeader.CFH_DISABLED_NOTIFY, CallForHelpDisabledNotifyMessageEvent); this._events.set(IncomingHeader.CFH_RESULT_MESSAGE, CallForHelpResultMessageEvent); - this._events.set(IncomingHeader.HELPER_TALENT_TRACK, TalentTrackEvent); - // INVENTORY this._events.set(IncomingHeader.ACHIEVEMENT_PROGRESSED, AchievementEvent); @@ -813,6 +811,9 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.TRAX_SONG_INFO, TraxSongInfoMessageEvent); this._events.set(IncomingHeader.USER_SONG_DISKS_INVENTORY, UserSongDisksInventoryMessageEvent); + // TALENT + this._events.set(IncomingHeader.HELPER_TALENT_TRACK, TalentTrackMessageEvent); + // USER this._events.set(IncomingHeader.IN_CLIENT_LINK, InClientLinkEvent); this._events.set(IncomingHeader.USER_IGNORED, IgnoredUsersEvent); diff --git a/src/nitro/communication/messages/incoming/help/index.ts b/src/nitro/communication/messages/incoming/help/index.ts index f3c3017a..ed4c56df 100644 --- a/src/nitro/communication/messages/incoming/help/index.ts +++ b/src/nitro/communication/messages/incoming/help/index.ts @@ -1,3 +1,2 @@ export * from './CallForHelpDisabledNotifyMessageEvent'; export * from './CallForHelpResultMessageEvent'; -export * from './TalentTrackEvent'; diff --git a/src/nitro/communication/messages/incoming/index.ts b/src/nitro/communication/messages/incoming/index.ts index 68200572..b9e74ff9 100644 --- a/src/nitro/communication/messages/incoming/index.ts +++ b/src/nitro/communication/messages/incoming/index.ts @@ -47,6 +47,7 @@ export * from './room/unit/chat'; export * from './roomevents'; export * from './security'; export * from './sound'; +export * from './talent'; export * from './user'; export * from './user/access'; export * from './user/data'; diff --git a/src/nitro/communication/messages/incoming/help/TalentTrackEvent.ts b/src/nitro/communication/messages/incoming/talent/TalentTrackMessageEvent.ts similarity index 70% rename from src/nitro/communication/messages/incoming/help/TalentTrackEvent.ts rename to src/nitro/communication/messages/incoming/talent/TalentTrackMessageEvent.ts index 488e9f42..7fd14982 100644 --- a/src/nitro/communication/messages/incoming/help/TalentTrackEvent.ts +++ b/src/nitro/communication/messages/incoming/talent/TalentTrackMessageEvent.ts @@ -1,8 +1,8 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { TalentTrackParser } from '../../parser/help/TalentTrackParser'; +import { TalentTrackParser } from '../../parser/talent/TalentTrackParser'; -export class TalentTrackEvent extends MessageEvent implements IMessageEvent +export class TalentTrackMessageEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { diff --git a/src/nitro/communication/messages/incoming/talent/index.ts b/src/nitro/communication/messages/incoming/talent/index.ts new file mode 100644 index 00000000..ebe3f002 --- /dev/null +++ b/src/nitro/communication/messages/incoming/talent/index.ts @@ -0,0 +1 @@ +export * from './TalentTrackMessageEvent'; diff --git a/src/nitro/communication/messages/parser/help/common/TalentTrackLevel.ts b/src/nitro/communication/messages/parser/help/common/TalentTrackLevel.ts deleted file mode 100644 index ffc487bd..00000000 --- a/src/nitro/communication/messages/parser/help/common/TalentTrackLevel.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { TalentTrackLevelAchievement } from './TalentTrackLevelAchievement'; -import { TalentTrackLevelItem } from './TalentTrackLevelItem'; - -export class TalentTrackLevel -{ - private _level: number; - private _state: number; - private _achievements: TalentTrackLevelAchievement[] - private _perks: string[]; - private _items: TalentTrackLevelItem[]; - - constructor(level: number, state: number, achievements: TalentTrackLevelAchievement[], perks: string[], items: TalentTrackLevelItem[]) - { - this._level = level; - this._state = state; - this._achievements = achievements; - this._perks = perks; - this._items = items; - } - - public get level(): number - { - return this._level; - } - - public get state(): number - { - return this._state; - } - - public get achievements(): TalentTrackLevelAchievement[] - { - return this._achievements; - } - - public get perks(): string[] - { - return this._perks; - } - - public get items(): TalentTrackLevelItem[] - { - return this._items; - } -} diff --git a/src/nitro/communication/messages/parser/help/common/TalentTrackLevelAchievement.ts b/src/nitro/communication/messages/parser/help/common/TalentTrackLevelAchievement.ts deleted file mode 100644 index cd77c5d7..00000000 --- a/src/nitro/communication/messages/parser/help/common/TalentTrackLevelAchievement.ts +++ /dev/null @@ -1,49 +0,0 @@ -export class TalentTrackLevelAchievement -{ - private _id: number; - private _index: number; - private _achievementCode: string; - private _state: number; - private _progress: number; - private _achievementProgress: number; - - constructor(id: number, index: number, achievementCode: string, state: number, progress: number, achievementProgress: number) - { - this._id = id; - this._index = index; - this._achievementCode = achievementCode; - this._state = state; - this._progress = progress; - this._achievementProgress = achievementProgress; - } - - public get id(): number - { - return this._id; - } - - public get index(): number - { - return this._index; - } - - public get achievementCode(): string - { - return this._achievementCode; - } - - public get state(): number - { - return this._state; - } - - public get progress(): number - { - return this._progress; - } - - public get achievementProgress(): number - { - return this._achievementProgress; - } -} diff --git a/src/nitro/communication/messages/parser/help/common/TalentTrackLevelItem.ts b/src/nitro/communication/messages/parser/help/common/TalentTrackLevelItem.ts deleted file mode 100644 index bf59dc07..00000000 --- a/src/nitro/communication/messages/parser/help/common/TalentTrackLevelItem.ts +++ /dev/null @@ -1,21 +0,0 @@ -export class TalentTrackLevelItem -{ - private _name: string; - private _unknownInt: number; - - constructor(name: string, unknownInt: number) - { - this._name = name; - this._unknownInt = unknownInt; - } - - public get name(): string - { - return this._name; - } - - public get unknownInt(): number - { - return this._unknownInt; - } -} diff --git a/src/nitro/communication/messages/parser/help/common/index.ts b/src/nitro/communication/messages/parser/help/common/index.ts deleted file mode 100644 index 22aefb71..00000000 --- a/src/nitro/communication/messages/parser/help/common/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './TalentTrackLevel'; -export * from './TalentTrackLevelAchievement'; -export * from './TalentTrackLevelItem'; diff --git a/src/nitro/communication/messages/parser/help/index.ts b/src/nitro/communication/messages/parser/help/index.ts index c6f0c7d9..5cd9ff49 100644 --- a/src/nitro/communication/messages/parser/help/index.ts +++ b/src/nitro/communication/messages/parser/help/index.ts @@ -1,4 +1,2 @@ export * from './CallForHelpDisabledNotifyMessageParser'; export * from './CallForHelpResultMessageParser'; -export * from './common'; -export * from './TalentTrackParser'; diff --git a/src/nitro/communication/messages/parser/index.ts b/src/nitro/communication/messages/parser/index.ts index 8cac1987..a2660f7f 100644 --- a/src/nitro/communication/messages/parser/index.ts +++ b/src/nitro/communication/messages/parser/index.ts @@ -24,4 +24,5 @@ export * from './room'; export * from './roomevents'; export * from './security'; export * from './sound'; +export * from './talent'; export * from './user'; diff --git a/src/nitro/communication/messages/parser/talent/TalentTrackLevel.ts b/src/nitro/communication/messages/parser/talent/TalentTrackLevel.ts new file mode 100644 index 00000000..03d8c4db --- /dev/null +++ b/src/nitro/communication/messages/parser/talent/TalentTrackLevel.ts @@ -0,0 +1,45 @@ +import { TalentTrackRewardProduct } from './TalentTrackRewardProduct'; +import { TalentTrackTask } from './TalentTrackTask'; + +export class TalentTrackLevel +{ + private _level: number; + private _state: number; + private _tasks: TalentTrackTask[] + private _rewardPerks: string[]; + private _rewardProducts: TalentTrackRewardProduct[]; + + constructor(level: number, state: number, achievements: TalentTrackTask[], perks: string[], items: TalentTrackRewardProduct[]) + { + this._level = level; + this._state = state; + this._tasks = achievements; + this._rewardPerks = perks; + this._rewardProducts = items; + } + + public get level(): number + { + return this._level; + } + + public get state(): number + { + return this._state; + } + + public get tasks(): TalentTrackTask[] + { + return this._tasks; + } + + public get perks(): string[] + { + return this._rewardPerks; + } + + public get items(): TalentTrackRewardProduct[] + { + return this._rewardProducts; + } +} diff --git a/src/nitro/communication/messages/parser/help/TalentTrackParser.ts b/src/nitro/communication/messages/parser/talent/TalentTrackParser.ts similarity index 77% rename from src/nitro/communication/messages/parser/help/TalentTrackParser.ts rename to src/nitro/communication/messages/parser/talent/TalentTrackParser.ts index 71e97ccd..4cf2984d 100644 --- a/src/nitro/communication/messages/parser/help/TalentTrackParser.ts +++ b/src/nitro/communication/messages/parser/talent/TalentTrackParser.ts @@ -1,7 +1,7 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; -import { TalentTrackLevel } from './common/TalentTrackLevel'; -import { TalentTrackLevelAchievement } from './common/TalentTrackLevelAchievement'; -import { TalentTrackLevelItem } from './common/TalentTrackLevelItem'; +import { TalentTrackLevel } from './TalentTrackLevel'; +import { TalentTrackRewardProduct } from './TalentTrackRewardProduct'; +import { TalentTrackTask } from './TalentTrackTask'; export class TalentTrackParser implements IMessageParser { @@ -30,7 +30,7 @@ export class TalentTrackParser implements IMessageParser const levelId = wrapper.readInt(); const levelState = wrapper.readInt(); - const levelAchievements: TalentTrackLevelAchievement[] = []; + const levelAchievements: TalentTrackTask[] = []; const achievementsCount = wrapper.readInt(); for(let j = 0; j < achievementsCount; j++) @@ -42,7 +42,7 @@ export class TalentTrackParser implements IMessageParser const progress = wrapper.readInt(); const achievementProgress = wrapper.readInt(); - levelAchievements.push(new TalentTrackLevelAchievement(id, index, code, state, progress, achievementProgress)); + levelAchievements.push(new TalentTrackTask(id, index, code, state, progress, achievementProgress)); } const levelPerks: string[] = []; @@ -50,7 +50,7 @@ export class TalentTrackParser implements IMessageParser for(let j = 0; j < perksCount; j++) levelPerks.push(wrapper.readString()); - const levelItems: TalentTrackLevelItem[] = []; + const levelItems: TalentTrackRewardProduct[] = []; const itemsCount = wrapper.readInt(); for(let j = 0; j < itemsCount; j++) @@ -58,7 +58,7 @@ export class TalentTrackParser implements IMessageParser const name = wrapper.readString(); const unknownInt = wrapper.readInt(); - levelItems.push(new TalentTrackLevelItem(name, unknownInt)); + levelItems.push(new TalentTrackRewardProduct(name, unknownInt)); } this._levels.push(new TalentTrackLevel(levelId, levelState, levelAchievements, levelPerks, levelItems)); diff --git a/src/nitro/communication/messages/parser/talent/TalentTrackRewardProduct.ts b/src/nitro/communication/messages/parser/talent/TalentTrackRewardProduct.ts new file mode 100644 index 00000000..24aaaa99 --- /dev/null +++ b/src/nitro/communication/messages/parser/talent/TalentTrackRewardProduct.ts @@ -0,0 +1,21 @@ +export class TalentTrackRewardProduct +{ + private _productCode: string; + private _vipDays: number; + + constructor(name: string, unknownInt: number) + { + this._productCode = name; + this._vipDays = unknownInt; + } + + public get productCode(): string + { + return this._productCode; + } + + public get vipDays(): number + { + return this._vipDays; + } +} diff --git a/src/nitro/communication/messages/parser/talent/TalentTrackTask.ts b/src/nitro/communication/messages/parser/talent/TalentTrackTask.ts new file mode 100644 index 00000000..a249b11a --- /dev/null +++ b/src/nitro/communication/messages/parser/talent/TalentTrackTask.ts @@ -0,0 +1,49 @@ +export class TalentTrackTask +{ + private _id: number; + private _requiredLevel: number; + private _badgeCode: string; + private _state: number; + private _currentScore: number; + private _totalScore: number; + + constructor(id: number, requiredLevel: number, badgeCode: string, state: number, currentScore: number, totalScore: number) + { + this._id = id; + this._requiredLevel = requiredLevel; + this._badgeCode = badgeCode; + this._state = state; + this._currentScore = currentScore; + this._totalScore = totalScore; + } + + public get id(): number + { + return this._id; + } + + public get requiredLevel(): number + { + return this._requiredLevel; + } + + public get badgeCode(): string + { + return this._badgeCode; + } + + public get state(): number + { + return this._state; + } + + public get currentScore(): number + { + return this._currentScore; + } + + public get totalScore(): number + { + return this._totalScore; + } +} diff --git a/src/nitro/communication/messages/parser/talent/index.ts b/src/nitro/communication/messages/parser/talent/index.ts new file mode 100644 index 00000000..7df63262 --- /dev/null +++ b/src/nitro/communication/messages/parser/talent/index.ts @@ -0,0 +1,4 @@ +export * from './TalentTrackLevel'; +export * from './TalentTrackParser'; +export * from './TalentTrackRewardProduct'; +export * from './TalentTrackTask'; From ba105d78a6cd029a9ce6a7d887f4efd14acb207d Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 12 Nov 2021 00:20:33 -0500 Subject: [PATCH 077/108] Rename packets --- src/nitro/communication/NitroMessages.ts | 20 ++++++------- ...nfoEvent.ts => GetGuestRoomResultEvent.ts} | 2 +- .../room/data/RoomEntryInfoMessageEvent.ts | 16 ++++++++++ .../incoming/room/data/RoomInfoOwnerEvent.ts | 16 ---------- .../messages/incoming/room/data/index.ts | 4 +-- .../room/furniture/DiceValueMessageEvent.ts | 8 ++--- .../room/furniture/FurnitureItemDataEvent.ts | 16 ---------- .../room/furniture/FurnitureStateEvent.ts | 16 ---------- .../furniture/ItemDataUpdateMessageEvent.ts | 16 ++++++++++ .../furniture/OneWayDoorStatusMessageEvent.ts | 16 ++++++++++ .../messages/incoming/room/furniture/index.ts | 4 +-- .../room/mapping/RoomModelNameEvent.ts | 16 ---------- .../room/mapping/RoomReadyMessageEvent.ts | 16 ++++++++++ .../messages/incoming/room/mapping/index.ts | 2 +- ...arser.ts => RoomEntryInfoMessageParser.ts} | 2 +- .../messages/parser/room/data/index.ts | 2 +- ...te2Parser.ts => DiceValueMessageParser.ts} | 2 +- ...rser.ts => ItemDataUpdateMessageParser.ts} | 2 +- ...er.ts => OneWayDoorStatusMessageParser.ts} | 2 +- .../messages/parser/room/furniture/index.ts | 6 ++-- ...ameParser.ts => RoomReadyMessageParser.ts} | 2 +- .../messages/parser/room/mapping/index.ts | 2 +- src/nitro/room/RoomMessageHandler.ts | 30 +++++++++---------- src/nitro/session/SessionDataManager.ts | 6 ++-- src/nitro/session/handler/RoomDataHandler.ts | 10 +++---- .../session/handler/RoomSessionHandler.ts | 8 ++--- 26 files changed, 121 insertions(+), 121 deletions(-) rename src/nitro/communication/messages/incoming/room/data/{RoomInfoEvent.ts => GetGuestRoomResultEvent.ts} (84%) create mode 100644 src/nitro/communication/messages/incoming/room/data/RoomEntryInfoMessageEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/room/data/RoomInfoOwnerEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/room/furniture/FurnitureItemDataEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/room/furniture/FurnitureStateEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/furniture/ItemDataUpdateMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/furniture/OneWayDoorStatusMessageEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/room/mapping/RoomModelNameEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/mapping/RoomReadyMessageEvent.ts rename src/nitro/communication/messages/parser/room/data/{RoomInfoOwnerParser.ts => RoomEntryInfoMessageParser.ts} (90%) rename src/nitro/communication/messages/parser/room/furniture/{FurnitureState2Parser.ts => DiceValueMessageParser.ts} (90%) rename src/nitro/communication/messages/parser/room/furniture/{FurnitureItemDataParser.ts => ItemDataUpdateMessageParser.ts} (90%) rename src/nitro/communication/messages/parser/room/furniture/{FurnitureStateParser.ts => OneWayDoorStatusMessageParser.ts} (90%) rename src/nitro/communication/messages/parser/room/mapping/{RoomModelNameParser.ts => RoomReadyMessageParser.ts} (91%) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index e9dd2af4..dea9f7e3 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -131,10 +131,10 @@ import { RoomEnterErrorEvent } from './messages/incoming/room/access/RoomEnterEr import { RoomEnterEvent } from './messages/incoming/room/access/RoomEnterEvent'; import { RoomForwardEvent } from './messages/incoming/room/access/RoomForwardEvent'; import { BotCommandConfigurationEvent } from './messages/incoming/room/bots/BotCommandConfigurationEvent'; +import { GetGuestRoomResultEvent } from './messages/incoming/room/data/GetGuestRoomResultEvent'; import { RoomBannedUsersEvent } from './messages/incoming/room/data/RoomBannedUsersEvent'; import { RoomChatSettingsEvent } from './messages/incoming/room/data/RoomChatSettingsEvent'; -import { RoomInfoEvent } from './messages/incoming/room/data/RoomInfoEvent'; -import { RoomInfoOwnerEvent } from './messages/incoming/room/data/RoomInfoOwnerEvent'; +import { RoomEntryInfoMessageEvent } from './messages/incoming/room/data/RoomEntryInfoMessageEvent'; import { RoomScoreEvent } from './messages/incoming/room/data/RoomScoreEvent'; import { RoomSettingsErrorEvent } from './messages/incoming/room/data/RoomSettingsErrorEvent'; import { RoomSettingsEvent } from './messages/incoming/room/data/RoomSettingsEvent'; @@ -151,14 +151,14 @@ import { FurnitureFloorRemoveEvent } from './messages/incoming/room/furniture/fl import { FurnitureFloorUpdateEvent } from './messages/incoming/room/furniture/floor/FurnitureFloorUpdateEvent'; import { FurnitureAliasesEvent } from './messages/incoming/room/furniture/FurnitureAliasesEvent'; import { FurnitureDataEvent } from './messages/incoming/room/furniture/FurnitureDataEvent'; -import { FurnitureItemDataEvent } from './messages/incoming/room/furniture/FurnitureItemDataEvent'; import { FurniturePostItStickyPoleOpenEvent } from './messages/incoming/room/furniture/FurniturePostItStickyPoleOpenEvent'; import { FurnitureStackHeightEvent } from './messages/incoming/room/furniture/FurnitureStackHeightEvent'; -import { FurnitureStateEvent } from './messages/incoming/room/furniture/FurnitureStateEvent'; import { GroupFurniContextMenuInfoMessageEvent } from './messages/incoming/room/furniture/GroupFurniContextMenuInfoMessageEvent'; +import { ItemDataUpdateMessageEvent } from './messages/incoming/room/furniture/ItemDataUpdateMessageEvent'; import { LoveLockFurniFinishedEvent } from './messages/incoming/room/furniture/LoveLockFurniFinishedEvent'; import { LoveLockFurniFriendConfirmedEvent } from './messages/incoming/room/furniture/LoveLockFurniFriendConfirmedEvent'; import { LoveLockFurniStartEvent } from './messages/incoming/room/furniture/LoveLockFurniStartEvent'; +import { OneWayDoorStatusMessageEvent } from './messages/incoming/room/furniture/OneWayDoorStatusMessageEvent'; import { RoomDimmerPresetsEvent } from './messages/incoming/room/furniture/RoomDimmerPresetsMessageEvent'; import { FurnitureWallAddEvent } from './messages/incoming/room/furniture/wall/FurnitureWallAddEvent'; import { FurnitureWallEvent } from './messages/incoming/room/furniture/wall/FurnitureWallEvent'; @@ -171,9 +171,9 @@ import { FloorHeightMapEvent } from './messages/incoming/room/mapping/FloorHeigh import { RoomEntryTileMessageEvent } from './messages/incoming/room/mapping/RoomEntryTileMessageEvent'; import { RoomHeightMapEvent } from './messages/incoming/room/mapping/RoomHeightMapEvent'; import { RoomHeightMapUpdateEvent } from './messages/incoming/room/mapping/RoomHeightMapUpdateEvent'; -import { RoomModelNameEvent } from './messages/incoming/room/mapping/RoomModelNameEvent'; import { RoomOccupiedTilesMessageEvent } from './messages/incoming/room/mapping/RoomOccupiedTilesMessageEvent'; import { RoomPaintEvent } from './messages/incoming/room/mapping/RoomPaintEvent'; +import { RoomReadyMessageEvent } from './messages/incoming/room/mapping/RoomReadyMessageEvent'; import { RoomVisualizationSettingsEvent } from './messages/incoming/room/mapping/RoomVisualizationSettingsEvent'; import { PetFigureUpdateEvent } from './messages/incoming/room/pet/PetFigureUpdateEvent'; import { PetInfoEvent } from './messages/incoming/room/pet/PetInfoEvent'; @@ -726,8 +726,8 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.ROOM_RIGHTS, RoomRightsEvent); this._events.set(IncomingHeader.BOT_COMMAND_CONFIGURATION, BotCommandConfigurationEvent); this._events.set(IncomingHeader.ROOM_SETTINGS_CHAT, RoomChatSettingsEvent); - this._events.set(IncomingHeader.ROOM_INFO, RoomInfoEvent); - this._events.set(IncomingHeader.ROOM_INFO_OWNER, RoomInfoOwnerEvent); + this._events.set(IncomingHeader.ROOM_INFO, GetGuestRoomResultEvent); + this._events.set(IncomingHeader.ROOM_INFO_OWNER, RoomEntryInfoMessageEvent); this._events.set(IncomingHeader.ROOM_SCORE, RoomScoreEvent); this._events.set(IncomingHeader.ROOM_SETTINGS_SAVE_ERROR, RoomSettingsErrorEvent); this._events.set(IncomingHeader.ROOM_SETTINGS, RoomSettingsEvent); @@ -747,9 +747,9 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.ITEM_WALL_UPDATE, FurnitureWallUpdateEvent); this._events.set(IncomingHeader.FURNITURE_ALIASES, FurnitureAliasesEvent); this._events.set(IncomingHeader.FURNITURE_DATA, FurnitureDataEvent); - this._events.set(IncomingHeader.FURNITURE_ITEMDATA, FurnitureItemDataEvent); + this._events.set(IncomingHeader.FURNITURE_ITEMDATA, ItemDataUpdateMessageEvent); this._events.set(IncomingHeader.ITEM_STACK_HELPER, FurnitureStackHeightEvent); - this._events.set(IncomingHeader.FURNITURE_STATE, FurnitureStateEvent); + this._events.set(IncomingHeader.FURNITURE_STATE, OneWayDoorStatusMessageEvent); this._events.set(IncomingHeader.ITEM_DIMMER_SETTINGS, RoomDimmerPresetsEvent); this._events.set(IncomingHeader.FURNITURE_STATE_2, DiceValueMessageEvent); this._events.set(IncomingHeader.LOVELOCK_FURNI_FINISHED, LoveLockFurniFinishedEvent); @@ -764,7 +764,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.ROOM_HEIGHT_MAP, RoomHeightMapEvent); this._events.set(IncomingHeader.ROOM_HEIGHT_MAP_UPDATE, RoomHeightMapUpdateEvent); this._events.set(IncomingHeader.ROOM_MODEL, FloorHeightMapEvent); - this._events.set(IncomingHeader.ROOM_MODEL_NAME, RoomModelNameEvent); + this._events.set(IncomingHeader.ROOM_MODEL_NAME, RoomReadyMessageEvent); this._events.set(IncomingHeader.ROOM_PAINT, RoomPaintEvent); this._events.set(IncomingHeader.ROOM_THICKNESS, RoomVisualizationSettingsEvent); this._events.set(IncomingHeader.ROOM_MODEL_BLOCKED_TILES, RoomOccupiedTilesMessageEvent); diff --git a/src/nitro/communication/messages/incoming/room/data/RoomInfoEvent.ts b/src/nitro/communication/messages/incoming/room/data/GetGuestRoomResultEvent.ts similarity index 84% rename from src/nitro/communication/messages/incoming/room/data/RoomInfoEvent.ts rename to src/nitro/communication/messages/incoming/room/data/GetGuestRoomResultEvent.ts index ca7c05a3..98eb78fb 100644 --- a/src/nitro/communication/messages/incoming/room/data/RoomInfoEvent.ts +++ b/src/nitro/communication/messages/incoming/room/data/GetGuestRoomResultEvent.ts @@ -2,7 +2,7 @@ import { IMessageEvent } from '../../../../../../core/communication/messages/IMe import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; import { RoomInfoParser } from '../../../parser/room/data/RoomInfoParser'; -export class RoomInfoEvent extends MessageEvent implements IMessageEvent +export class GetGuestRoomResultEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { diff --git a/src/nitro/communication/messages/incoming/room/data/RoomEntryInfoMessageEvent.ts b/src/nitro/communication/messages/incoming/room/data/RoomEntryInfoMessageEvent.ts new file mode 100644 index 00000000..bcf5f89a --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/data/RoomEntryInfoMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { RoomEntryInfoMessageParser } from '../../../parser/room/data/RoomEntryInfoMessageParser'; + +export class RoomEntryInfoMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, RoomEntryInfoMessageParser); + } + + public getParser(): RoomEntryInfoMessageParser + { + return this.parser as RoomEntryInfoMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/data/RoomInfoOwnerEvent.ts b/src/nitro/communication/messages/incoming/room/data/RoomInfoOwnerEvent.ts deleted file mode 100644 index cbe37b2a..00000000 --- a/src/nitro/communication/messages/incoming/room/data/RoomInfoOwnerEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { RoomInfoOwnerParser } from '../../../parser/room/data/RoomInfoOwnerParser'; - -export class RoomInfoOwnerEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, RoomInfoOwnerParser); - } - - public getParser(): RoomInfoOwnerParser - { - return this.parser as RoomInfoOwnerParser; - } -} diff --git a/src/nitro/communication/messages/incoming/room/data/index.ts b/src/nitro/communication/messages/incoming/room/data/index.ts index e68d0d70..5f0345e5 100644 --- a/src/nitro/communication/messages/incoming/room/data/index.ts +++ b/src/nitro/communication/messages/incoming/room/data/index.ts @@ -1,7 +1,7 @@ +export * from './GetGuestRoomResultEvent'; export * from './RoomBannedUsersEvent'; export * from './RoomChatSettingsEvent'; -export * from './RoomInfoEvent'; -export * from './RoomInfoOwnerEvent'; +export * from './RoomEntryInfoMessageEvent'; export * from './RoomScoreEvent'; export * from './RoomSettingsErrorEvent'; export * from './RoomSettingsEvent'; diff --git a/src/nitro/communication/messages/incoming/room/furniture/DiceValueMessageEvent.ts b/src/nitro/communication/messages/incoming/room/furniture/DiceValueMessageEvent.ts index 4b331398..1bf71fce 100644 --- a/src/nitro/communication/messages/incoming/room/furniture/DiceValueMessageEvent.ts +++ b/src/nitro/communication/messages/incoming/room/furniture/DiceValueMessageEvent.ts @@ -1,16 +1,16 @@ import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { FurnitureState2Parser } from '../../../parser/room/furniture/FurnitureState2Parser'; +import { DiceValueMessageParser } from '../../../parser/room/furniture/DiceValueMessageParser'; export class DiceValueMessageEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { - super(callBack, FurnitureState2Parser); + super(callBack, DiceValueMessageParser); } - public getParser(): FurnitureState2Parser + public getParser(): DiceValueMessageParser { - return this.parser as FurnitureState2Parser; + return this.parser as DiceValueMessageParser; } } diff --git a/src/nitro/communication/messages/incoming/room/furniture/FurnitureItemDataEvent.ts b/src/nitro/communication/messages/incoming/room/furniture/FurnitureItemDataEvent.ts deleted file mode 100644 index 171cdd8d..00000000 --- a/src/nitro/communication/messages/incoming/room/furniture/FurnitureItemDataEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { FurnitureItemDataParser } from '../../../parser/room/furniture/FurnitureItemDataParser'; - -export class FurnitureItemDataEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, FurnitureItemDataParser); - } - - public getParser(): FurnitureItemDataParser - { - return this.parser as FurnitureItemDataParser; - } -} diff --git a/src/nitro/communication/messages/incoming/room/furniture/FurnitureStateEvent.ts b/src/nitro/communication/messages/incoming/room/furniture/FurnitureStateEvent.ts deleted file mode 100644 index 26b42ba7..00000000 --- a/src/nitro/communication/messages/incoming/room/furniture/FurnitureStateEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { FurnitureStateParser } from '../../../parser/room/furniture/FurnitureStateParser'; - -export class FurnitureStateEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, FurnitureStateParser); - } - - public getParser(): FurnitureStateParser - { - return this.parser as FurnitureStateParser; - } -} diff --git a/src/nitro/communication/messages/incoming/room/furniture/ItemDataUpdateMessageEvent.ts b/src/nitro/communication/messages/incoming/room/furniture/ItemDataUpdateMessageEvent.ts new file mode 100644 index 00000000..e50e0554 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/furniture/ItemDataUpdateMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { ItemDataUpdateMessageParser } from '../../../parser/room/furniture/ItemDataUpdateMessageParser'; + +export class ItemDataUpdateMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ItemDataUpdateMessageParser); + } + + public getParser(): ItemDataUpdateMessageParser + { + return this.parser as ItemDataUpdateMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/furniture/OneWayDoorStatusMessageEvent.ts b/src/nitro/communication/messages/incoming/room/furniture/OneWayDoorStatusMessageEvent.ts new file mode 100644 index 00000000..03033c3b --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/furniture/OneWayDoorStatusMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { OneWayDoorStatusMessageParser } from '../../../parser/room/furniture/OneWayDoorStatusMessageParser'; + +export class OneWayDoorStatusMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, OneWayDoorStatusMessageParser); + } + + public getParser(): OneWayDoorStatusMessageParser + { + return this.parser as OneWayDoorStatusMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/furniture/index.ts b/src/nitro/communication/messages/incoming/room/furniture/index.ts index be7d5cb1..a866b849 100644 --- a/src/nitro/communication/messages/incoming/room/furniture/index.ts +++ b/src/nitro/communication/messages/incoming/room/furniture/index.ts @@ -2,14 +2,14 @@ export * from './DiceValueMessageEvent'; export * from './floor'; export * from './FurnitureAliasesEvent'; export * from './FurnitureDataEvent'; -export * from './FurnitureItemDataEvent'; export * from './FurniturePostItStickyPoleOpenEvent'; export * from './FurnitureStackHeightEvent'; -export * from './FurnitureStateEvent'; export * from './GroupFurniContextMenuInfoMessageEvent'; +export * from './ItemDataUpdateMessageEvent'; export * from './LoveLockFurniFinishedEvent'; export * from './LoveLockFurniFriendConfirmedEvent'; export * from './LoveLockFurniStartEvent'; +export * from './OneWayDoorStatusMessageEvent'; export * from './RoomDimmerPresetsMessageData'; export * from './RoomDimmerPresetsMessageEvent'; export * from './wall'; diff --git a/src/nitro/communication/messages/incoming/room/mapping/RoomModelNameEvent.ts b/src/nitro/communication/messages/incoming/room/mapping/RoomModelNameEvent.ts deleted file mode 100644 index 85908552..00000000 --- a/src/nitro/communication/messages/incoming/room/mapping/RoomModelNameEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { RoomModelNameParser } from '../../../parser/room/mapping/RoomModelNameParser'; - -export class RoomModelNameEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, RoomModelNameParser); - } - - public getParser(): RoomModelNameParser - { - return this.parser as RoomModelNameParser; - } -} diff --git a/src/nitro/communication/messages/incoming/room/mapping/RoomReadyMessageEvent.ts b/src/nitro/communication/messages/incoming/room/mapping/RoomReadyMessageEvent.ts new file mode 100644 index 00000000..cad05381 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/mapping/RoomReadyMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { RoomReadyMessageParser } from '../../../parser/room/mapping/RoomReadyMessageParser'; + +export class RoomReadyMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, RoomReadyMessageParser); + } + + public getParser(): RoomReadyMessageParser + { + return this.parser as RoomReadyMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/mapping/index.ts b/src/nitro/communication/messages/incoming/room/mapping/index.ts index 038f1df4..1ada5b8c 100644 --- a/src/nitro/communication/messages/incoming/room/mapping/index.ts +++ b/src/nitro/communication/messages/incoming/room/mapping/index.ts @@ -2,7 +2,7 @@ export * from './FloorHeightMapEvent'; export * from './RoomEntryTileMessageEvent'; export * from './RoomHeightMapEvent'; export * from './RoomHeightMapUpdateEvent'; -export * from './RoomModelNameEvent'; export * from './RoomOccupiedTilesMessageEvent'; export * from './RoomPaintEvent'; +export * from './RoomReadyMessageEvent'; export * from './RoomVisualizationSettingsEvent'; diff --git a/src/nitro/communication/messages/parser/room/data/RoomInfoOwnerParser.ts b/src/nitro/communication/messages/parser/room/data/RoomEntryInfoMessageParser.ts similarity index 90% rename from src/nitro/communication/messages/parser/room/data/RoomInfoOwnerParser.ts rename to src/nitro/communication/messages/parser/room/data/RoomEntryInfoMessageParser.ts index fd28163a..c52da864 100644 --- a/src/nitro/communication/messages/parser/room/data/RoomInfoOwnerParser.ts +++ b/src/nitro/communication/messages/parser/room/data/RoomEntryInfoMessageParser.ts @@ -1,6 +1,6 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -export class RoomInfoOwnerParser implements IMessageParser +export class RoomEntryInfoMessageParser implements IMessageParser { private _roomId: number; private _isOwner: boolean; diff --git a/src/nitro/communication/messages/parser/room/data/index.ts b/src/nitro/communication/messages/parser/room/data/index.ts index f509c354..648d08bd 100644 --- a/src/nitro/communication/messages/parser/room/data/index.ts +++ b/src/nitro/communication/messages/parser/room/data/index.ts @@ -1,7 +1,7 @@ export * from './RoomChatSettings'; export * from './RoomChatSettingsParser'; export * from './RoomDataParser'; -export * from './RoomInfoOwnerParser'; +export * from './RoomEntryInfoMessageParser'; export * from './RoomInfoParser'; export * from './RoomModerationSettings'; export * from './RoomScoreParser'; diff --git a/src/nitro/communication/messages/parser/room/furniture/FurnitureState2Parser.ts b/src/nitro/communication/messages/parser/room/furniture/DiceValueMessageParser.ts similarity index 90% rename from src/nitro/communication/messages/parser/room/furniture/FurnitureState2Parser.ts rename to src/nitro/communication/messages/parser/room/furniture/DiceValueMessageParser.ts index 08a650c1..8b94c4fe 100644 --- a/src/nitro/communication/messages/parser/room/furniture/FurnitureState2Parser.ts +++ b/src/nitro/communication/messages/parser/room/furniture/DiceValueMessageParser.ts @@ -1,6 +1,6 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -export class FurnitureState2Parser implements IMessageParser +export class DiceValueMessageParser implements IMessageParser { private _itemId: number; private _value: number; diff --git a/src/nitro/communication/messages/parser/room/furniture/FurnitureItemDataParser.ts b/src/nitro/communication/messages/parser/room/furniture/ItemDataUpdateMessageParser.ts similarity index 90% rename from src/nitro/communication/messages/parser/room/furniture/FurnitureItemDataParser.ts rename to src/nitro/communication/messages/parser/room/furniture/ItemDataUpdateMessageParser.ts index 8c2e700e..bf5974b5 100644 --- a/src/nitro/communication/messages/parser/room/furniture/FurnitureItemDataParser.ts +++ b/src/nitro/communication/messages/parser/room/furniture/ItemDataUpdateMessageParser.ts @@ -1,6 +1,6 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -export class FurnitureItemDataParser implements IMessageParser +export class ItemDataUpdateMessageParser implements IMessageParser { private _itemId: number; private _data: string; diff --git a/src/nitro/communication/messages/parser/room/furniture/FurnitureStateParser.ts b/src/nitro/communication/messages/parser/room/furniture/OneWayDoorStatusMessageParser.ts similarity index 90% rename from src/nitro/communication/messages/parser/room/furniture/FurnitureStateParser.ts rename to src/nitro/communication/messages/parser/room/furniture/OneWayDoorStatusMessageParser.ts index 946650ee..db5e62d8 100644 --- a/src/nitro/communication/messages/parser/room/furniture/FurnitureStateParser.ts +++ b/src/nitro/communication/messages/parser/room/furniture/OneWayDoorStatusMessageParser.ts @@ -1,6 +1,6 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -export class FurnitureStateParser implements IMessageParser +export class OneWayDoorStatusMessageParser implements IMessageParser { private _itemId: number; private _state: number; diff --git a/src/nitro/communication/messages/parser/room/furniture/index.ts b/src/nitro/communication/messages/parser/room/furniture/index.ts index 458b1bf0..92946c41 100644 --- a/src/nitro/communication/messages/parser/room/furniture/index.ts +++ b/src/nitro/communication/messages/parser/room/furniture/index.ts @@ -1,14 +1,14 @@ +export * from './DiceValueMessageParser'; export * from './floor'; export * from './FurnitureAliasesParser'; export * from './FurnitureDataParser'; -export * from './FurnitureItemDataParser'; export * from './FurnitureStackHeightParser'; -export * from './FurnitureState2Parser'; -export * from './FurnitureStateParser'; export * from './GroupFurniContextMenuInfoMessageParser'; +export * from './ItemDataUpdateMessageParser'; export * from './LoveLockFurniFinishedParser'; export * from './LoveLockFurniFriendConfirmedParser'; export * from './LoveLockFurniStartParser'; +export * from './OneWayDoorStatusMessageParser'; export * from './RoomDimmerPresetsMessageParser'; export * from './wall'; export * from './youtube'; diff --git a/src/nitro/communication/messages/parser/room/mapping/RoomModelNameParser.ts b/src/nitro/communication/messages/parser/room/mapping/RoomReadyMessageParser.ts similarity index 91% rename from src/nitro/communication/messages/parser/room/mapping/RoomModelNameParser.ts rename to src/nitro/communication/messages/parser/room/mapping/RoomReadyMessageParser.ts index d9c42590..8c938352 100644 --- a/src/nitro/communication/messages/parser/room/mapping/RoomModelNameParser.ts +++ b/src/nitro/communication/messages/parser/room/mapping/RoomReadyMessageParser.ts @@ -1,6 +1,6 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -export class RoomModelNameParser implements IMessageParser +export class RoomReadyMessageParser implements IMessageParser { private _name: string; private _roomId: number; diff --git a/src/nitro/communication/messages/parser/room/mapping/index.ts b/src/nitro/communication/messages/parser/room/mapping/index.ts index 155d6846..11846fd2 100644 --- a/src/nitro/communication/messages/parser/room/mapping/index.ts +++ b/src/nitro/communication/messages/parser/room/mapping/index.ts @@ -2,7 +2,7 @@ export * from './FloorHeightMapMessageParser'; export * from './RoomEntryTileMessageParser'; export * from './RoomHeightMapParser'; export * from './RoomHeightMapUpdateParser'; -export * from './RoomModelNameParser'; export * from './RoomOccupiedTilesMessageParser'; export * from './RoomPaintParser'; +export * from './RoomReadyMessageParser'; export * from './RoomVisualizationSettingsParser'; diff --git a/src/nitro/room/RoomMessageHandler.ts b/src/nitro/room/RoomMessageHandler.ts index b9e06c38..b15dbc45 100644 --- a/src/nitro/room/RoomMessageHandler.ts +++ b/src/nitro/room/RoomMessageHandler.ts @@ -12,8 +12,8 @@ import { FurnitureFloorRemoveEvent } from '../communication/messages/incoming/ro import { FurnitureFloorUpdateEvent } from '../communication/messages/incoming/room/furniture/floor/FurnitureFloorUpdateEvent'; import { FurnitureAliasesEvent } from '../communication/messages/incoming/room/furniture/FurnitureAliasesEvent'; import { FurnitureDataEvent } from '../communication/messages/incoming/room/furniture/FurnitureDataEvent'; -import { FurnitureItemDataEvent } from '../communication/messages/incoming/room/furniture/FurnitureItemDataEvent'; -import { FurnitureStateEvent } from '../communication/messages/incoming/room/furniture/FurnitureStateEvent'; +import { ItemDataUpdateMessageEvent } from '../communication/messages/incoming/room/furniture/ItemDataUpdateMessageEvent'; +import { OneWayDoorStatusMessageEvent } from '../communication/messages/incoming/room/furniture/OneWayDoorStatusMessageEvent'; import { FurnitureWallAddEvent } from '../communication/messages/incoming/room/furniture/wall/FurnitureWallAddEvent'; import { FurnitureWallEvent } from '../communication/messages/incoming/room/furniture/wall/FurnitureWallEvent'; import { FurnitureWallRemoveEvent } from '../communication/messages/incoming/room/furniture/wall/FurnitureWallRemoveEvent'; @@ -22,8 +22,8 @@ import { FloorHeightMapEvent } from '../communication/messages/incoming/room/map import { RoomEntryTileMessageEvent } from '../communication/messages/incoming/room/mapping/RoomEntryTileMessageEvent'; import { RoomHeightMapEvent } from '../communication/messages/incoming/room/mapping/RoomHeightMapEvent'; import { RoomHeightMapUpdateEvent } from '../communication/messages/incoming/room/mapping/RoomHeightMapUpdateEvent'; -import { RoomModelNameEvent } from '../communication/messages/incoming/room/mapping/RoomModelNameEvent'; import { RoomPaintEvent } from '../communication/messages/incoming/room/mapping/RoomPaintEvent'; +import { RoomReadyMessageEvent } from '../communication/messages/incoming/room/mapping/RoomReadyMessageEvent'; import { RoomVisualizationSettingsEvent } from '../communication/messages/incoming/room/mapping/RoomVisualizationSettingsEvent'; import { PetFigureUpdateEvent } from '../communication/messages/incoming/room/pet/PetFigureUpdateEvent'; import { YouArePlayingGameEvent } from '../communication/messages/incoming/room/session/YouArePlayingGameEvent'; @@ -106,7 +106,7 @@ export class RoomMessageHandler extends Disposable this._connection = connection; this._connection.addMessageEvent(new UserInfoEvent(this.onUserInfoEvent.bind(this))); - this._connection.addMessageEvent(new RoomModelNameEvent(this.onRoomModelNameEvent.bind(this))); + this._connection.addMessageEvent(new RoomReadyMessageEvent(this.onRoomReadyMessageEvent.bind(this))); this._connection.addMessageEvent(new RoomPaintEvent(this.onRoomPaintEvent.bind(this))); this._connection.addMessageEvent(new FloorHeightMapEvent(this.onRoomModelEvent.bind(this))); this._connection.addMessageEvent(new RoomHeightMapEvent(this.onRoomHeightMapEvent.bind(this))); @@ -125,8 +125,8 @@ export class RoomMessageHandler extends Disposable this._connection.addMessageEvent(new FurnitureWallRemoveEvent(this.onFurnitureWallRemoveEvent.bind(this))); this._connection.addMessageEvent(new FurnitureWallUpdateEvent(this.onFurnitureWallUpdateEvent.bind(this))); this._connection.addMessageEvent(new FurnitureDataEvent(this.onFurnitureDataEvent.bind(this))); - this._connection.addMessageEvent(new FurnitureItemDataEvent(this.onFurnitureItemDataEvent.bind(this))); - this._connection.addMessageEvent(new FurnitureStateEvent(this.onFurnitureStateEvent.bind(this))); + this._connection.addMessageEvent(new ItemDataUpdateMessageEvent(this.onItemDataUpdateMessageEvent.bind(this))); + this._connection.addMessageEvent(new OneWayDoorStatusMessageEvent(this.onOneWayDoorStatusMessageEvent.bind(this))); this._connection.addMessageEvent(new RoomUnitDanceEvent(this.onRoomUnitDanceEvent.bind(this))); this._connection.addMessageEvent(new RoomUnitEffectEvent(this.onRoomUnitEffectEvent.bind(this))); this._connection.addMessageEvent(new RoomUnitEvent(this.onRoomUnitEvent.bind(this))); @@ -176,18 +176,18 @@ export class RoomMessageHandler extends Disposable this._ownUserId = parser.userInfo.userId; } - private onRoomModelNameEvent(event: RoomModelNameEvent): void + private onRoomReadyMessageEvent(event: RoomReadyMessageEvent): void { - if(!(event instanceof RoomModelNameEvent) || !event.connection) return; + const parser = event.getParser(); - if(this._currentRoomId !== event.getParser().roomId) + if(this._currentRoomId !== parser.roomId) { - this.setRoomId(event.getParser().roomId); + this.setRoomId(parser.roomId); } if(this._roomCreator) { - this._roomCreator.setRoomInstanceModelName(event.getParser().roomId, event.getParser().name); + this._roomCreator.setRoomInstanceModelName(parser.roomId, parser.name); } if(this._initialConnection) @@ -627,18 +627,18 @@ export class RoomMessageHandler extends Disposable this._roomCreator.updateRoomObjectFloor(this._currentRoomId, parser.furnitureId, null, null, parser.objectData.state, parser.objectData); } - private onFurnitureItemDataEvent(event: FurnitureItemDataEvent): void + private onItemDataUpdateMessageEvent(event: ItemDataUpdateMessageEvent): void { - if(!(event instanceof FurnitureItemDataEvent) || !event.connection || !this._roomCreator) return; + if(!(event instanceof ItemDataUpdateMessageEvent) || !event.connection || !this._roomCreator) return; const parser = event.getParser(); this._roomCreator.updateRoomObjectWallItemData(this._currentRoomId, parser.furnitureId, parser.data); } - private onFurnitureStateEvent(event: FurnitureStateEvent): void + private onOneWayDoorStatusMessageEvent(event: OneWayDoorStatusMessageEvent): void { - if(!(event instanceof FurnitureStateEvent) || !event.connection || !this._roomCreator) return; + if(!(event instanceof OneWayDoorStatusMessageEvent) || !event.connection || !this._roomCreator) return; const parser = event.getParser(); diff --git a/src/nitro/session/SessionDataManager.ts b/src/nitro/session/SessionDataManager.ts index 50e13c7d..912cb8fb 100644 --- a/src/nitro/session/SessionDataManager.ts +++ b/src/nitro/session/SessionDataManager.ts @@ -6,7 +6,7 @@ import { FigureUpdateEvent, MysteryBoxKeysEvent } from '../communication'; import { INitroCommunicationManager } from '../communication/INitroCommunicationManager'; import { AvailabilityStatusMessageEvent } from '../communication/messages/incoming/availability/AvailabilityStatusMessageEvent'; import { ChangeUserNameResultMessageEvent } from '../communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent'; -import { RoomModelNameEvent } from '../communication/messages/incoming/room/mapping/RoomModelNameEvent'; +import { RoomReadyMessageEvent } from '../communication/messages/incoming/room/mapping/RoomReadyMessageEvent'; import { UserPermissionsEvent } from '../communication/messages/incoming/user/access/UserPermissionsEvent'; import { UserInfoEvent } from '../communication/messages/incoming/user/data/UserInfoEvent'; import { UserNameChangeMessageEvent } from '../communication/messages/incoming/user/data/UserNameChangeMessageEvent'; @@ -131,7 +131,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana this._communication.registerMessageEvent(new AvailabilityStatusMessageEvent(this.onAvailabilityStatusMessageEvent.bind(this))); this._communication.registerMessageEvent(new ChangeUserNameResultMessageEvent(this.onChangeNameUpdateEvent.bind(this))); this._communication.registerMessageEvent(new UserNameChangeMessageEvent(this.onUserNameChangeMessageEvent.bind(this))); - this._communication.registerMessageEvent(new RoomModelNameEvent(this.onRoomModelNameEvent.bind(this))); + this._communication.registerMessageEvent(new RoomReadyMessageEvent(this.onRoomModelNameEvent.bind(this))); this._communication.registerMessageEvent(new InClientLinkEvent(this.onInClientLinkEvent.bind(this))); this._communication.registerMessageEvent(new MysteryBoxKeysEvent(this.onMysteryBoxKeysEvent.bind(this))); @@ -335,7 +335,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana this.events.dispatchEvent(new UserNameUpdateEvent(this._name)); } - private onRoomModelNameEvent(event: RoomModelNameEvent): void + private onRoomModelNameEvent(event: RoomReadyMessageEvent): void { if(!event) return; diff --git a/src/nitro/session/handler/RoomDataHandler.ts b/src/nitro/session/handler/RoomDataHandler.ts index d96e6be8..66773f0d 100644 --- a/src/nitro/session/handler/RoomDataHandler.ts +++ b/src/nitro/session/handler/RoomDataHandler.ts @@ -1,5 +1,5 @@ import { IConnection } from '../../../core/communication/connections/IConnection'; -import { RoomInfoEvent } from '../../communication/messages/incoming/room/data/RoomInfoEvent'; +import { GetGuestRoomResultEvent } from '../../communication/messages/incoming/room/data/GetGuestRoomResultEvent'; import { RoomSessionEvent } from '../events/RoomSessionEvent'; import { RoomSessionPropertyUpdateEvent } from '../events/RoomSessionPropertyUpdateEvent'; import { IRoomHandlerListener } from '../IRoomHandlerListener'; @@ -11,12 +11,12 @@ export class RoomDataHandler extends BaseHandler { super(connection, listener); - connection.addMessageEvent(new RoomInfoEvent(this.onRoomInfoEvent.bind(this))); + connection.addMessageEvent(new GetGuestRoomResultEvent(this.onGetGuestRoomResultEvent.bind(this))); } - private onRoomInfoEvent(event: RoomInfoEvent): void + private onGetGuestRoomResultEvent(event: GetGuestRoomResultEvent): void { - if(!(event instanceof RoomInfoEvent)) return; + if(!(event instanceof GetGuestRoomResultEvent)) return; const parser = event.getParser(); @@ -39,4 +39,4 @@ export class RoomDataHandler extends BaseHandler this.listener.events.dispatchEvent(new RoomSessionPropertyUpdateEvent(RoomSessionPropertyUpdateEvent.RSDUE_ALLOW_PETS, roomSession)); this.listener.events.dispatchEvent(new RoomSessionEvent(RoomSessionEvent.ROOM_DATA, roomSession)); } -} \ No newline at end of file +} diff --git a/src/nitro/session/handler/RoomSessionHandler.ts b/src/nitro/session/handler/RoomSessionHandler.ts index dde134d4..e5198523 100644 --- a/src/nitro/session/handler/RoomSessionHandler.ts +++ b/src/nitro/session/handler/RoomSessionHandler.ts @@ -3,7 +3,7 @@ import { DesktopViewEvent } from '../../communication/messages/incoming/desktop/ import { RoomDoorbellAcceptedEvent } from '../../communication/messages/incoming/room/access/doorbell/RoomDoorbellAcceptedEvent'; import { RoomDoorbellRejectedEvent } from '../../communication/messages/incoming/room/access/doorbell/RoomDoorbellRejectedEvent'; import { RoomEnterEvent } from '../../communication/messages/incoming/room/access/RoomEnterEvent'; -import { RoomModelNameEvent } from '../../communication/messages/incoming/room/mapping/RoomModelNameEvent'; +import { RoomReadyMessageEvent } from '../../communication/messages/incoming/room/mapping/RoomReadyMessageEvent'; import { GoToFlatMessageComposer } from '../../communication/messages/outgoing/room/session/GoToFlatMessageComposer'; import { RoomSessionDoorbellEvent } from '../events/RoomSessionDoorbellEvent'; import { IRoomHandlerListener } from '../IRoomHandlerListener'; @@ -20,7 +20,7 @@ export class RoomSessionHandler extends BaseHandler super(connection, listener); connection.addMessageEvent(new RoomEnterEvent(this.onRoomEnterEvent.bind(this))); - connection.addMessageEvent(new RoomModelNameEvent(this.onRoomModelNameEvent.bind(this))); + connection.addMessageEvent(new RoomReadyMessageEvent(this.onRoomReadyMessageEvent.bind(this))); connection.addMessageEvent(new DesktopViewEvent(this.onDesktopViewEvent.bind(this))); connection.addMessageEvent(new RoomDoorbellAcceptedEvent(this.onRoomDoorbellAcceptedEvent.bind(this))); connection.addMessageEvent(new RoomDoorbellRejectedEvent(this.onRoomDoorbellRejectedEvent.bind(this))); @@ -33,9 +33,9 @@ export class RoomSessionHandler extends BaseHandler if(this.listener) this.listener.sessionUpdate(this.roomId, RoomSessionHandler.RS_CONNECTED); } - private onRoomModelNameEvent(event: RoomModelNameEvent): void + private onRoomReadyMessageEvent(event: RoomReadyMessageEvent): void { - if(!(event instanceof RoomModelNameEvent)) return; + if(!(event instanceof RoomReadyMessageEvent)) return; const fromRoomId = this.roomId; const toRoomId = event.getParser().roomId; From 0880ccfc4a2917dd8d0751456b86df264824a5dc Mon Sep 17 00:00:00 2001 From: dank074 Date: Sat, 13 Nov 2021 16:39:31 -0600 Subject: [PATCH 078/108] fix sanction parser vars --- .../SanctionStatusMessageParser.ts | 110 +++++++++--------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/src/nitro/communication/messages/parser/callforhelp/SanctionStatusMessageParser.ts b/src/nitro/communication/messages/parser/callforhelp/SanctionStatusMessageParser.ts index b64eb812..65eb6cd4 100644 --- a/src/nitro/communication/messages/parser/callforhelp/SanctionStatusMessageParser.ts +++ b/src/nitro/communication/messages/parser/callforhelp/SanctionStatusMessageParser.ts @@ -3,31 +3,31 @@ import { IMessageParser } from './../../../../../core'; export class SanctionStatusMessageParser implements IMessageParser { - private _Str_21269: boolean; - private _Str_20966: boolean; - private _Str_19378: string; - private _Str_19998: number; - private _Str_21197: string; - private _Str_20631: string; - private _Str_19322: number; - private _Str_22000: string; - private _Str_19157: number; - private _Str_21458: boolean; - private _Str_22154: string; + private _isSanctionNew: boolean; + private _isSanctionActive: boolean; + private _sanctionName: string; + private _sanctionLengthHours: number; + private _sanctionReason: string; + private _sanctionCreationTime: string; + private _probationHoursLeft: number; + private _nextSanctionName: string; + private _nextSanctionLengthHours: number; + private _hasCustomMute: boolean; + private _tradeLockExpiryTime: string; public flush(): boolean { - this._Str_21269 = false; - this._Str_20966 = false; - this._Str_19378 = null; - this._Str_19998 = 0; - this._Str_21197 = null; - this._Str_20631 = null; - this._Str_19322 = 0; - this._Str_22000 = null; - this._Str_19157 = 0; - this._Str_21458 = false; - this._Str_22154 = null; + this._isSanctionNew = false; + this._isSanctionActive = false; + this._sanctionName = null; + this._sanctionLengthHours = 0; + this._sanctionReason = null; + this._sanctionCreationTime = null; + this._probationHoursLeft = 0; + this._nextSanctionName = null; + this._nextSanctionLengthHours = 0; + this._hasCustomMute = false; + this._tradeLockExpiryTime = null; return true; } @@ -36,80 +36,80 @@ export class SanctionStatusMessageParser implements IMessageParser { if(!wrapper) return false; - this._Str_21269 = wrapper.readBoolean(); - this._Str_20966 = wrapper.readBoolean(); - this._Str_19378 = wrapper.readString(); - this._Str_19998 = wrapper.readInt(); + this._isSanctionNew = wrapper.readBoolean(); + this._isSanctionActive = wrapper.readBoolean(); + this._sanctionName = wrapper.readString(); + this._sanctionLengthHours = wrapper.readInt(); wrapper.readInt(); - this._Str_21197 = wrapper.readString(); - this._Str_20631 = wrapper.readString(); - this._Str_19322 = wrapper.readInt(); - this._Str_22000 = wrapper.readString(); - this._Str_19157 = wrapper.readInt(); + this._sanctionReason = wrapper.readString(); + this._sanctionCreationTime = wrapper.readString(); + this._probationHoursLeft = wrapper.readInt(); + this._nextSanctionName = wrapper.readString(); + this._nextSanctionLengthHours = wrapper.readInt(); wrapper.readInt(); - this._Str_21458 = wrapper.readBoolean(); + this._hasCustomMute = wrapper.readBoolean(); - if(wrapper.bytesAvailable) this._Str_22154 = wrapper.readString(); + if(wrapper.bytesAvailable) this._tradeLockExpiryTime = wrapper.readString(); return true; } - public get _Str_22957(): boolean + public get isSanctionNew(): boolean { - return this._Str_21269; + return this._isSanctionNew; } - public get _Str_16442(): boolean + public get isSanctionActive(): boolean { - return this._Str_20966; + return this._isSanctionActive; } - public get _Str_22691(): string + public get sanctionName(): string { - return this._Str_19378; + return this._sanctionName; } - public get _Str_22497(): number + public get sanctionLengthHours(): number { - return this._Str_19998; + return this._sanctionLengthHours; } - public get _Str_22005(): string + public get sanctionReason(): string { - return this._Str_21197; + return this._sanctionReason; } - public get _Str_25720(): string + public get sanctionCreationTime(): string { - return this._Str_20631; + return this._sanctionCreationTime; } - public get _Str_20904(): number + public get probationHoursLeft(): number { - return this._Str_19322; + return this._probationHoursLeft; } - public get _Str_23024(): string + public get nextSanctionName(): string { - return this._Str_22000; + return this._nextSanctionName; } - public get _Str_23610(): number + public get nextSanctionLengthHours(): number { - return this._Str_19157; + return this._nextSanctionLengthHours; } - public get _Str_23177(): boolean + public get hasCustomMute(): boolean { - return this._Str_21458; + return this._hasCustomMute; } - public get _Str_21248(): string + public get tradeLockExpiryTime(): string { - return this._Str_22154; + return this._tradeLockExpiryTime; } } From 0d1922e958f44e6c0f3f5f8db2c8a357f0c9b0f4 Mon Sep 17 00:00:00 2001 From: dank074 Date: Sat, 13 Nov 2021 17:20:30 -0600 Subject: [PATCH 079/108] yes --- src/nitro/communication/messages/parser/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nitro/communication/messages/parser/index.ts b/src/nitro/communication/messages/parser/index.ts index a2660f7f..19864764 100644 --- a/src/nitro/communication/messages/parser/index.ts +++ b/src/nitro/communication/messages/parser/index.ts @@ -2,6 +2,7 @@ export * from './advertisement'; export * from './availability'; export * from './avatar'; export * from './bots'; +export * from './callforhelp'; export * from './camera'; export * from './catalog'; export * from './client'; From 7ad0b94ed77f526cf697856ad6d8ad5d6311813a Mon Sep 17 00:00:00 2001 From: dank074 Date: Sun, 14 Nov 2021 03:33:40 -0600 Subject: [PATCH 080/108] added incoming poll packets --- src/nitro/communication/NitroMessages.ts | 10 +- .../messages/incoming/IncomingHeader.ts | 6 + .../communication/messages/incoming/index.ts | 1 + .../incoming/poll/PollContentsEvent.ts | 16 +++ .../messages/incoming/poll/PollErrorEvent.ts | 16 +++ .../messages/incoming/poll/PollOfferEvent.ts | 16 +++ .../incoming/poll/QuestionAnsweredEvent.ts | 16 +++ .../messages/incoming/poll/QuestionEvent.ts | 16 +++ .../incoming/poll/QuestionFinishedEvent.ts | 16 +++ .../messages/incoming/poll/index.ts | 6 + .../communication/messages/parser/index.ts | 1 + .../messages/parser/poll/PollChoice.ts | 43 +++++++ .../parser/poll/PollContentsParser.ts | 99 ++++++++++++++++ .../messages/parser/poll/PollErrorParser.ts | 15 +++ .../messages/parser/poll/PollOfferParser.ts | 47 ++++++++ .../messages/parser/poll/PollQuestion.ts | 110 ++++++++++++++++++ .../parser/poll/QuestionAnsweredParser.ts | 50 ++++++++ .../parser/poll/QuestionFinishedParser.ts | 40 +++++++ .../messages/parser/poll/QuestionParser.ts | 91 +++++++++++++++ .../messages/parser/poll/index.ts | 8 ++ 20 files changed, 622 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/incoming/poll/PollContentsEvent.ts create mode 100644 src/nitro/communication/messages/incoming/poll/PollErrorEvent.ts create mode 100644 src/nitro/communication/messages/incoming/poll/PollOfferEvent.ts create mode 100644 src/nitro/communication/messages/incoming/poll/QuestionAnsweredEvent.ts create mode 100644 src/nitro/communication/messages/incoming/poll/QuestionEvent.ts create mode 100644 src/nitro/communication/messages/incoming/poll/QuestionFinishedEvent.ts create mode 100644 src/nitro/communication/messages/incoming/poll/index.ts create mode 100644 src/nitro/communication/messages/parser/poll/PollChoice.ts create mode 100644 src/nitro/communication/messages/parser/poll/PollContentsParser.ts create mode 100644 src/nitro/communication/messages/parser/poll/PollErrorParser.ts create mode 100644 src/nitro/communication/messages/parser/poll/PollOfferParser.ts create mode 100644 src/nitro/communication/messages/parser/poll/PollQuestion.ts create mode 100644 src/nitro/communication/messages/parser/poll/QuestionAnsweredParser.ts create mode 100644 src/nitro/communication/messages/parser/poll/QuestionFinishedParser.ts create mode 100644 src/nitro/communication/messages/parser/poll/QuestionParser.ts create mode 100644 src/nitro/communication/messages/parser/poll/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 76cf1357..f79dac9b 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollContentsEvent, PollErrorEvent, PollOfferEvent, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -699,6 +699,14 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.BOT_ERROR, BotErrorEvent); this._events.set(IncomingHeader.PET_LEVEL_NOTIFICATION, PetLevelNotificationEvent); + // POLL + this._events.set(IncomingHeader.QUESTION, QuestionEvent); + this._events.set(IncomingHeader.POLL_CONTENTS, PollContentsEvent); + this._events.set(IncomingHeader.POLL_ERROR, PollErrorEvent); + this._events.set(IncomingHeader.POLL_OFFER, PollOfferEvent); + this._events.set(IncomingHeader.QUESTION_ANSWERED, QuestionAnsweredEvent); + this._events.set(IncomingHeader.QUESTION_FINISHED, QuestionFinishedEvent); + // QUEST this._events.set(IncomingHeader.COMMUNITY_GOAL_EARNED_PRIZES, CommunityGoalEarnedPrizesMessageEvent); this._events.set(IncomingHeader.COMMUNITY_GOAL_PROGRESS, CommunityGoalProgressMessageEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 762d9e8b..4393bb58 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -331,4 +331,10 @@ export class IncomingHeader public static YOUTUBE_DISPLAY_PLAYLISTS = 1112; public static YOUTUBE_DISPLAY_VIDEO = 1411; public static CFH_DISABLED_NOTIFY = 1651; + public static QUESTION = 2665; + public static POLL_CONTENTS = 2997; + public static POLL_ERROR = 662; + public static POLL_OFFER = 3785; + public static QUESTION_ANSWERED = 2589; + public static QUESTION_FINISHED = 1066; } diff --git a/src/nitro/communication/messages/incoming/index.ts b/src/nitro/communication/messages/incoming/index.ts index b9e74ff9..4cbde107 100644 --- a/src/nitro/communication/messages/incoming/index.ts +++ b/src/nitro/communication/messages/incoming/index.ts @@ -28,6 +28,7 @@ export * from './moderation'; export * from './mysterybox'; export * from './navigator'; export * from './notifications'; +export * from './poll'; export * from './quest'; export * from './room'; export * from './room/access'; diff --git a/src/nitro/communication/messages/incoming/poll/PollContentsEvent.ts b/src/nitro/communication/messages/incoming/poll/PollContentsEvent.ts new file mode 100644 index 00000000..b8e70ad9 --- /dev/null +++ b/src/nitro/communication/messages/incoming/poll/PollContentsEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { PollContentsParser } from '../../parser/poll/PollContentsParser'; + +export class PollContentsEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, PollContentsParser); + } + + public getParser(): PollContentsParser + { + return this.parser as PollContentsParser; + } +} diff --git a/src/nitro/communication/messages/incoming/poll/PollErrorEvent.ts b/src/nitro/communication/messages/incoming/poll/PollErrorEvent.ts new file mode 100644 index 00000000..b70d82bd --- /dev/null +++ b/src/nitro/communication/messages/incoming/poll/PollErrorEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { PollErrorParser } from '../../parser/poll/PollErrorParser'; + +export class PollErrorEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, PollErrorParser); + } + + public getParser(): PollErrorParser + { + return this.parser as PollErrorParser; + } +} diff --git a/src/nitro/communication/messages/incoming/poll/PollOfferEvent.ts b/src/nitro/communication/messages/incoming/poll/PollOfferEvent.ts new file mode 100644 index 00000000..e7bdf1b1 --- /dev/null +++ b/src/nitro/communication/messages/incoming/poll/PollOfferEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { PollOfferParser } from '../../parser/poll/PollOfferParser'; + +export class PollOfferEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, PollOfferParser); + } + + public getParser(): PollOfferParser + { + return this.parser as PollOfferParser; + } +} diff --git a/src/nitro/communication/messages/incoming/poll/QuestionAnsweredEvent.ts b/src/nitro/communication/messages/incoming/poll/QuestionAnsweredEvent.ts new file mode 100644 index 00000000..1a298384 --- /dev/null +++ b/src/nitro/communication/messages/incoming/poll/QuestionAnsweredEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuestionAnsweredParser } from '../../parser/poll/QuestionAnsweredParser'; + +export class QuestionAnsweredEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuestionAnsweredParser); + } + + public getParser(): QuestionAnsweredParser + { + return this.parser as QuestionAnsweredParser; + } +} diff --git a/src/nitro/communication/messages/incoming/poll/QuestionEvent.ts b/src/nitro/communication/messages/incoming/poll/QuestionEvent.ts new file mode 100644 index 00000000..19cedd68 --- /dev/null +++ b/src/nitro/communication/messages/incoming/poll/QuestionEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuestionParser } from '../../parser/poll/QuestionParser'; + +export class QuestionEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuestionParser); + } + + public getParser(): QuestionParser + { + return this.parser as QuestionParser; + } +} diff --git a/src/nitro/communication/messages/incoming/poll/QuestionFinishedEvent.ts b/src/nitro/communication/messages/incoming/poll/QuestionFinishedEvent.ts new file mode 100644 index 00000000..4ccf9c6a --- /dev/null +++ b/src/nitro/communication/messages/incoming/poll/QuestionFinishedEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuestionFinishedParser } from '../../parser/poll/QuestionFinishedParser'; + +export class QuestionFinishedEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuestionFinishedParser); + } + + public getParser(): QuestionFinishedParser + { + return this.parser as QuestionFinishedParser; + } +} diff --git a/src/nitro/communication/messages/incoming/poll/index.ts b/src/nitro/communication/messages/incoming/poll/index.ts new file mode 100644 index 00000000..ef4863f6 --- /dev/null +++ b/src/nitro/communication/messages/incoming/poll/index.ts @@ -0,0 +1,6 @@ +export * from './PollContentsEvent'; +export * from './PollErrorEvent'; +export * from './PollOfferEvent'; +export * from './QuestionAnsweredEvent'; +export * from './QuestionEvent'; +export * from './QuestionFinishedEvent'; diff --git a/src/nitro/communication/messages/parser/index.ts b/src/nitro/communication/messages/parser/index.ts index 19864764..19f2d081 100644 --- a/src/nitro/communication/messages/parser/index.ts +++ b/src/nitro/communication/messages/parser/index.ts @@ -20,6 +20,7 @@ export * from './moderation'; export * from './mysterybox'; export * from './navigator'; export * from './notifications'; +export * from './poll'; export * from './quest'; export * from './room'; export * from './roomevents'; diff --git a/src/nitro/communication/messages/parser/poll/PollChoice.ts b/src/nitro/communication/messages/parser/poll/PollChoice.ts new file mode 100644 index 00000000..5895b3ef --- /dev/null +++ b/src/nitro/communication/messages/parser/poll/PollChoice.ts @@ -0,0 +1,43 @@ +export class PollChoice +{ + private _value:string; + private _choiceText:string; + private _choiceType:number; + + constructor(k:string, _arg_2:string, _arg_3:number) + { + this._value = k; + this._choiceText = _arg_2; + this._choiceType = _arg_3; + } + + public get value():string + { + return this._value; + } + + public set value(value:string) + { + this._value = value; + } + + public get choiceText():string + { + return this._choiceText; + } + + public set choiceText(choiceText:string) + { + this._choiceText = choiceText; + } + + public get choiceType():number + { + return this._choiceType; + } + + public set choiceType(k:number) + { + this._choiceType = k; + } +} diff --git a/src/nitro/communication/messages/parser/poll/PollContentsParser.ts b/src/nitro/communication/messages/parser/poll/PollContentsParser.ts new file mode 100644 index 00000000..383494d6 --- /dev/null +++ b/src/nitro/communication/messages/parser/poll/PollContentsParser.ts @@ -0,0 +1,99 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; +import { PollChoice } from './PollChoice'; +import { PollQuestion } from './PollQuestion'; + +export class PollContentsParser implements IMessageParser +{ + private _id = -1; + private _startMessage = ''; + private _endMessage = ''; + private _numQuestions = 0; + private _questionArray:PollQuestion[] = []; + private _npsPoll = false + + flush(): boolean + { + this._id = -1; + this._startMessage = ''; + this._endMessage = ''; + this._numQuestions = 0; + this._questionArray = []; + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._id = wrapper.readInt(); + this._startMessage = wrapper.readString(); + this._endMessage = wrapper.readString(); + this._numQuestions = wrapper.readInt(); + + for(let i = 0; i < this._numQuestions; i++) + { + const question = this.parsePollQuestion(wrapper); + const childrenCount = wrapper.readInt(); + + for(let j = 0; j < childrenCount; j++) + { + question.children.push(this.parsePollQuestion(wrapper)); + } + + this._questionArray.push(question); + } + + this._npsPoll = wrapper.readBoolean(); + return true; + } + + private parsePollQuestion(k:IMessageDataWrapper):PollQuestion + { + const pollQuestion = new PollQuestion(); + pollQuestion.questionId = k.readInt(); + pollQuestion.sortOrder = k.readInt(); + pollQuestion.questionType = k.readInt(); + pollQuestion.questionText = k.readString(); + pollQuestion.questionCategory = k.readInt(); + pollQuestion.questionAnswerType = k.readInt(); + pollQuestion.questionAnswerCount = k.readInt(); + if(((pollQuestion.questionType == 1) || (pollQuestion.questionType == 2))) + { + for(let i = 0; i < pollQuestion.questionAnswerCount; i++) + { + pollQuestion.questionChoices.push(new PollChoice(k.readString(), k.readString(), k.readInt())); + } + } + return pollQuestion; + } + + public get id():number + { + return this._id; + } + + public get startMessage():string + { + return this._startMessage; + } + + public get endMessage():string + { + return this._endMessage; + } + + public get numQuestions():number + { + return this._numQuestions; + } + + public get questionArray():PollQuestion[] + { + return this._questionArray; + } + + public get npsPoll():boolean + { + return this._npsPoll; + } + +} diff --git a/src/nitro/communication/messages/parser/poll/PollErrorParser.ts b/src/nitro/communication/messages/parser/poll/PollErrorParser.ts new file mode 100644 index 00000000..132187a4 --- /dev/null +++ b/src/nitro/communication/messages/parser/poll/PollErrorParser.ts @@ -0,0 +1,15 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class PollErrorParser implements IMessageParser +{ + flush(): boolean + { + throw true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + return true; + } +} diff --git a/src/nitro/communication/messages/parser/poll/PollOfferParser.ts b/src/nitro/communication/messages/parser/poll/PollOfferParser.ts new file mode 100644 index 00000000..6f27805d --- /dev/null +++ b/src/nitro/communication/messages/parser/poll/PollOfferParser.ts @@ -0,0 +1,47 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class PollOfferParser implements IMessageParser +{ + private _id = -1; + private _type = ''; + private _headline = ''; + private _summary = ''; + + flush(): boolean + { + this._id = -1; + this._type = ''; + this._summary = ''; + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._id = wrapper.readInt(); + this._type = wrapper.readString(); + this._headline = wrapper.readString(); + this._summary = wrapper.readString(); + return true; + } + + public get id():number + { + return this._id; + } + + public get type():string + { + return this._type; + } + + public get headline():string + { + return this._headline; + } + + public get summary():string + { + return this._summary; + } +} diff --git a/src/nitro/communication/messages/parser/poll/PollQuestion.ts b/src/nitro/communication/messages/parser/poll/PollQuestion.ts new file mode 100644 index 00000000..35fdb802 --- /dev/null +++ b/src/nitro/communication/messages/parser/poll/PollQuestion.ts @@ -0,0 +1,110 @@ +import { PollChoice } from './PollChoice'; + +export class PollQuestion +{ + private _questionId:number; + private _questionType:number; + private _sortOrder:number; + private _questionCategory:number; + private _questionText:string; + private _questionAnswerType:number; + private _questionAnswerCount:number; + private _children:PollQuestion[]; + private _questionChoices:PollChoice[]; + + constructor() + { + this._children = []; + this._questionChoices = []; + } + + public get questionId():number + { + return this._questionId; + } + + public set questionId(k:number) + { + this._questionId = k; + } + + public get questionType():number + { + return this._questionType; + } + + public set questionType(k:number) + { + this._questionType = k; + } + + public get sortOrder():number + { + return this._sortOrder; + } + + public set sortOrder(sortOrder:number) + { + this._sortOrder = sortOrder; + } + + public get questionText():string + { + return this._questionText; + } + + public set questionText(k:string) + { + this._questionText = k; + } + + public get questionCategory():number + { + return this._questionCategory; + } + + public set questionCategory(k:number) + { + this._questionCategory = k; + } + + public get questionAnswerType():number + { + return this._questionAnswerType; + } + + public set questionAnswerType(k:number) + { + this._questionAnswerType = k; + } + + public get questionAnswerCount():number + { + return this._questionAnswerCount; + } + + public set questionAnswerCount(k:number) + { + this._questionAnswerCount = k; + } + + public get children():PollQuestion[] + { + return this._children; + } + + public set children(children:PollQuestion[]) + { + this._children = children; + } + + public get questionChoices():PollChoice[] + { + return this._questionChoices; + } + + public set questionChoices(k:PollChoice[]) + { + this._questionChoices = k; + } +} diff --git a/src/nitro/communication/messages/parser/poll/QuestionAnsweredParser.ts b/src/nitro/communication/messages/parser/poll/QuestionAnsweredParser.ts new file mode 100644 index 00000000..8902a42a --- /dev/null +++ b/src/nitro/communication/messages/parser/poll/QuestionAnsweredParser.ts @@ -0,0 +1,50 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class QuestionAnsweredParser implements IMessageParser +{ + private _userId:number; + private _value:string; + private _answerCounts:Map; + + flush(): boolean + { + this._userId = -1; + this._value = ''; + this._answerCounts = null; + return false; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._userId = wrapper.readInt(); + this._value = wrapper.readString(); + this._answerCounts = new Map(); + + const count = wrapper.readInt(); + + for(let i = 0; i < count; i++) + { + const key = wrapper.readString(); + const value = wrapper.readInt(); + this._answerCounts.set(key, value); + } + return true; + } + + public get userId():number + { + return this._userId; + } + + public get value():string + { + return this._value; + } + + public get answerCounts():Map + { + return this._answerCounts; + } + +} diff --git a/src/nitro/communication/messages/parser/poll/QuestionFinishedParser.ts b/src/nitro/communication/messages/parser/poll/QuestionFinishedParser.ts new file mode 100644 index 00000000..c3d7aea4 --- /dev/null +++ b/src/nitro/communication/messages/parser/poll/QuestionFinishedParser.ts @@ -0,0 +1,40 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class QuestionFinishedParser implements IMessageParser +{ + private _questionId:number; + private _answerCounts:Map; + + flush(): boolean + { + this._questionId = -1; + this._answerCounts = null; + return false; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._questionId = wrapper.readInt(); + this._answerCounts = new Map(); + const count = wrapper.readInt(); + + for(let i = 0; i < count; i++) + { + const key = wrapper.readString(); + const value = wrapper.readInt(); + this._answerCounts.set(key, value); + } + return true; + } + + public get questionId():number + { + return this._questionId; + } + + public get answerCounts():Map + { + return this._answerCounts; + } +} diff --git a/src/nitro/communication/messages/parser/poll/QuestionParser.ts b/src/nitro/communication/messages/parser/poll/QuestionParser.ts new file mode 100644 index 00000000..735768dd --- /dev/null +++ b/src/nitro/communication/messages/parser/poll/QuestionParser.ts @@ -0,0 +1,91 @@ +import { IMessageDataWrapper } from '../../../../../core'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class QuestionParser implements IMessageParser +{ + private _pollType:string = null; + private _pollId= -1; + private _questionId = -1; + private _duration = -1; + private _question:IQuestion = null; + + flush(): boolean + { + this._pollType = null; + this._pollId = -1; + this._questionId = -1; + this._duration = -1; + this._question = null; + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._pollType = wrapper.readString(); + this._pollId = wrapper.readInt(); + this._questionId = wrapper.readInt(); + this._duration = wrapper.readInt(); + + const questionId = wrapper.readInt(); + const questionNumber = wrapper.readInt(); + const questionType = wrapper.readInt(); + const questionContent = wrapper.readString(); + + this._question = { id: questionId, number: questionNumber, type: questionType, content: questionContent }; + + if(((this._question.type == 1) || (this._question.type == 2))) + { + this._question.selection_min = wrapper.readInt(); + const count = wrapper.readInt(); + this._question.selections = []; + this._question.selection_values = []; + this._question.selection_count = count; + this._question.selection_max = count; + + for(let i = 0; i < count; i++) + { + this._question.selection_values.push(wrapper.readString()); + this._question.selections.push(wrapper.readString()); + } + } + return true; + } + + public get pollType():string + { + return this._pollType; + } + + public get pollId():number + { + return this._pollId; + } + + public get questionId():number + { + return this._questionId; + } + + public get duration():number + { + return this._duration; + } + + public get question():IQuestion + { + return this._question; + } +} + +interface IQuestion +{ + id: number; + number: number; + type: number; + content: string; + selection_min?: number; + selections?: string[]; + selection_values?: string[]; + selection_count?: number; + selection_max?: number; +} diff --git a/src/nitro/communication/messages/parser/poll/index.ts b/src/nitro/communication/messages/parser/poll/index.ts new file mode 100644 index 00000000..b82d2b0a --- /dev/null +++ b/src/nitro/communication/messages/parser/poll/index.ts @@ -0,0 +1,8 @@ +export * from './PollChoice'; +export * from './PollContentsParser'; +export * from './PollErrorParser'; +export * from './PollOfferParser'; +export * from './PollQuestion'; +export * from './QuestionAnsweredParser'; +export * from './QuestionFinishedParser'; +export * from './QuestionParser'; From d208aaa283017d7c4b40f98953a656665e89e652 Mon Sep 17 00:00:00 2001 From: dank074 Date: Sun, 14 Nov 2021 03:50:44 -0600 Subject: [PATCH 081/108] add poll outgoing packets --- src/nitro/communication/NitroMessages.ts | 7 ++++++- .../messages/outgoing/OutgoingHeader.ts | 3 +++ .../communication/messages/outgoing/index.ts | 1 + .../outgoing/poll/PollAnswerComposer.ts | 21 +++++++++++++++++++ .../outgoing/poll/PollStartComposer.ts | 21 +++++++++++++++++++ .../messages/outgoing/poll/index.ts | 3 +++ 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/outgoing/poll/PollAnswerComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/poll/PollStartComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/poll/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index f79dac9b..34e5cf52 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollContentsEvent, PollErrorEvent, PollOfferEvent, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -1049,6 +1049,11 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.CONVERT_GLOBAL_ROOM_ID, ConvertGlobalRoomIdMessageComposer); this._composers.set(OutgoingHeader.ROOM_RIGHTS_REMOVE_OWN, RemoveOwnRoomRightsRoomMessageComposer); + // POLL + this._composers.set(OutgoingHeader.POLL_ANSWER, PollAnswerComposer); + this._composers.set(OutgoingHeader.POLL_REJECT, PollRejectComposer); + this._composers.set(OutgoingHeader.POLL_START, PollStartComposer); + // INVENTORY //// BADGES diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 84555065..8f89b6c0 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -372,4 +372,7 @@ export class OutgoingHeader public static GUIDE_SESSION_RESOLVED = 887; public static POST_QUIZ_ANSWERS = 3720; public static SEARCH_FAQS = 2031; + public static POLL_ANSWER = 3505; + public static POLL_REJECT = 1773; + public static POLL_START = 109; } diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index 7cc0a193..f44efee4 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -20,6 +20,7 @@ export * from './moderation'; export * from './navigator'; export * from './OutgoingHeader'; export * from './pet'; +export * from './poll'; export * from './quest'; export * from './room'; export * from './roomevents'; diff --git a/src/nitro/communication/messages/outgoing/poll/PollAnswerComposer.ts b/src/nitro/communication/messages/outgoing/poll/PollAnswerComposer.ts new file mode 100644 index 00000000..323f44b3 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/poll/PollAnswerComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class PollAnswerComposer implements IMessageComposer +{ + private _data: any; + + constructor(pollId:number, questionId:number, answers:string[]) + { + this._data = [ pollId, questionId, answers.length, ...answers ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/poll/PollStartComposer.ts b/src/nitro/communication/messages/outgoing/poll/PollStartComposer.ts new file mode 100644 index 00000000..f469c68a --- /dev/null +++ b/src/nitro/communication/messages/outgoing/poll/PollStartComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class PollStartComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number) + { + this._data = [ k ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/poll/index.ts b/src/nitro/communication/messages/outgoing/poll/index.ts new file mode 100644 index 00000000..d41d4182 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/poll/index.ts @@ -0,0 +1,3 @@ +export * from './PollAnswerComposer'; +export * from './PollRejectComposer'; +export * from './PollStartComposer'; From 2cc9598141c1bf87d97c65aa155f6d3c519dc525 Mon Sep 17 00:00:00 2001 From: dank074 Date: Sun, 14 Nov 2021 03:50:55 -0600 Subject: [PATCH 082/108] missed one --- .../outgoing/poll/PollRejectComposer.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/nitro/communication/messages/outgoing/poll/PollRejectComposer.ts diff --git a/src/nitro/communication/messages/outgoing/poll/PollRejectComposer.ts b/src/nitro/communication/messages/outgoing/poll/PollRejectComposer.ts new file mode 100644 index 00000000..1e26b5db --- /dev/null +++ b/src/nitro/communication/messages/outgoing/poll/PollRejectComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class PollRejectComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number) + { + this._data = [ k ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} From e6d4d2a8f22113060faec8a60c6610da5a8dd49e Mon Sep 17 00:00:00 2001 From: dank074 Date: Mon, 15 Nov 2021 20:28:08 -0600 Subject: [PATCH 083/108] added wordquiz handler --- .../messages/parser/poll/QuestionParser.ts | 2 +- src/nitro/session/RoomSessionManager.ts | 2 + .../events/RoomSessionWordQuizEvent.ts | 9 +- src/nitro/session/handler/WordQuizHandler.ts | 82 +++++++++++++++++++ 4 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 src/nitro/session/handler/WordQuizHandler.ts diff --git a/src/nitro/communication/messages/parser/poll/QuestionParser.ts b/src/nitro/communication/messages/parser/poll/QuestionParser.ts index 735768dd..24b76899 100644 --- a/src/nitro/communication/messages/parser/poll/QuestionParser.ts +++ b/src/nitro/communication/messages/parser/poll/QuestionParser.ts @@ -77,7 +77,7 @@ export class QuestionParser implements IMessageParser } } -interface IQuestion +export interface IQuestion { id: number; number: number; diff --git a/src/nitro/session/RoomSessionManager.ts b/src/nitro/session/RoomSessionManager.ts index d1e54169..6a9a8702 100644 --- a/src/nitro/session/RoomSessionManager.ts +++ b/src/nitro/session/RoomSessionManager.ts @@ -12,6 +12,7 @@ import { RoomPermissionsHandler } from './handler/RoomPermissionsHandler'; import { RoomPresentHandler } from './handler/RoomPresentHandler'; import { RoomSessionHandler } from './handler/RoomSessionHandler'; import { RoomUsersHandler } from './handler/RoomUsersHandler'; +import { WordQuizHandler } from './handler/WordQuizHandler'; import { IRoomHandlerListener } from './IRoomHandlerListener'; import { IRoomSession } from './IRoomSession'; import { IRoomSessionManager } from './IRoomSessionManager'; @@ -77,6 +78,7 @@ export class RoomSessionManager extends NitroManager implements IRoomSessionMana new RoomUsersHandler(connection, this), new RoomPresentHandler(connection, this), new GenericErrorHandler(connection, this), + new WordQuizHandler(connection, this), ); } diff --git a/src/nitro/session/events/RoomSessionWordQuizEvent.ts b/src/nitro/session/events/RoomSessionWordQuizEvent.ts index b287188e..9498cb1b 100644 --- a/src/nitro/session/events/RoomSessionWordQuizEvent.ts +++ b/src/nitro/session/events/RoomSessionWordQuizEvent.ts @@ -1,4 +1,5 @@ -import { IRoomSession } from '../IRoomSession'; +import { IQuestion } from '../../communication/messages/parser/poll/QuestionParser'; +import { IRoomSession } from '../IRoomSession'; import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionWordQuizEvent extends RoomSessionEvent @@ -12,7 +13,7 @@ export class RoomSessionWordQuizEvent extends RoomSessionEvent private _pollId: number = -1; private _questionId: number = -1; private _duration: number = -1; - private _question: string[] = null; + private _question: IQuestion = null; private _userId: number = -1; private _value: string; private _answerCounts: Map; @@ -69,12 +70,12 @@ export class RoomSessionWordQuizEvent extends RoomSessionEvent this._duration = k; } - public get question(): string[] + public get question(): IQuestion { return this._question; } - public set question(k: string[]) + public set question(k: IQuestion) { this._question = k; } diff --git a/src/nitro/session/handler/WordQuizHandler.ts b/src/nitro/session/handler/WordQuizHandler.ts new file mode 100644 index 00000000..57a1544e --- /dev/null +++ b/src/nitro/session/handler/WordQuizHandler.ts @@ -0,0 +1,82 @@ +import { IConnection } from '../../../core/communication/connections/IConnection'; +import { QuestionAnsweredEvent } from '../../communication/messages/incoming/poll/QuestionAnsweredEvent'; +import { QuestionEvent } from '../../communication/messages/incoming/poll/QuestionEvent'; +import { QuestionFinishedEvent } from '../../communication/messages/incoming/poll/QuestionFinishedEvent'; +import { RoomSessionWordQuizEvent } from '../events/RoomSessionWordQuizEvent'; +import { IRoomHandlerListener } from '../IRoomHandlerListener'; +import { BaseHandler } from './BaseHandler'; + +export class WordQuizHandler extends BaseHandler +{ + constructor(connection: IConnection, listener: IRoomHandlerListener) + { + super(connection, listener); + + connection.addMessageEvent(new QuestionEvent(this.onQuestionEvent.bind(this))); + connection.addMessageEvent(new QuestionAnsweredEvent(this.onQuestionAnsweredEvent.bind(this))); + connection.addMessageEvent(new QuestionFinishedEvent(this.onQuestionFinishedEvent.bind(this))); + } + + private onQuestionEvent(event: QuestionEvent): void + { + if(!this.listener) return; + + const session = this.listener.getSession(this.roomId); + + if(!session) return; + + const parser = event.getParser(); + + if(!parser) return; + + const quizEvent = new RoomSessionWordQuizEvent(RoomSessionWordQuizEvent.QUESTION, session, parser.pollId); + + quizEvent.question = parser.question; + quizEvent.duration = parser.duration; + quizEvent.pollType = parser.pollType; + quizEvent.questionId = parser.questionId; + quizEvent.pollId = parser.pollId; + + this.listener.events.dispatchEvent(quizEvent); + } + + private onQuestionAnsweredEvent(event: QuestionAnsweredEvent): void + { + if(!this.listener) return; + + const session = this.listener.getSession(this.roomId); + + if(!session) return; + + const parser = event.getParser(); + + if(!parser) return; + + const quizEvent = new RoomSessionWordQuizEvent(RoomSessionWordQuizEvent.ANSWERED, session, parser.userId); + + quizEvent.value = parser.value; + quizEvent.userId = parser.userId; + quizEvent.answerCounts = parser.answerCounts; + + this.listener.events.dispatchEvent(quizEvent); + } + + private onQuestionFinishedEvent(event: QuestionFinishedEvent): void + { + if(!this.listener) return; + + const session = this.listener.getSession(this.roomId); + + if(!session) return; + + const parser = event.getParser(); + + if(!parser) return; + + const quizEvent = new RoomSessionWordQuizEvent(RoomSessionWordQuizEvent.FINISHED, session); + quizEvent.questionId = parser.questionId; + quizEvent.answerCounts = parser.answerCounts; + + this.listener.events.dispatchEvent(quizEvent); + } +} From 1cedce0a76fbdcd9794a5ced5a6b0ccce43aaa9d Mon Sep 17 00:00:00 2001 From: dank074 Date: Mon, 15 Nov 2021 23:51:24 -0600 Subject: [PATCH 084/108] add session poll handler --- src/nitro/session/RoomSessionManager.ts | 2 + .../session/events/RoomSessionPollEvent.ts | 9 ++- src/nitro/session/handler/PollHandler.ts | 81 +++++++++++++++++++ 3 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 src/nitro/session/handler/PollHandler.ts diff --git a/src/nitro/session/RoomSessionManager.ts b/src/nitro/session/RoomSessionManager.ts index 6a9a8702..6b2817c7 100644 --- a/src/nitro/session/RoomSessionManager.ts +++ b/src/nitro/session/RoomSessionManager.ts @@ -5,6 +5,7 @@ import { IRoomEngine } from '../room/IRoomEngine'; import { RoomSessionEvent } from './events/RoomSessionEvent'; import { BaseHandler } from './handler/BaseHandler'; import { GenericErrorHandler } from './handler/GenericErrorHandler'; +import { PollHandler } from './handler/PollHandler'; import { RoomChatHandler } from './handler/RoomChatHandler'; import { RoomDataHandler } from './handler/RoomDataHandler'; import { RoomDimmerPresetsHandler } from './handler/RoomDimmerPresetsHandler'; @@ -79,6 +80,7 @@ export class RoomSessionManager extends NitroManager implements IRoomSessionMana new RoomPresentHandler(connection, this), new GenericErrorHandler(connection, this), new WordQuizHandler(connection, this), + new PollHandler(connection, this), ); } diff --git a/src/nitro/session/events/RoomSessionPollEvent.ts b/src/nitro/session/events/RoomSessionPollEvent.ts index 5f9dff0d..2dd84d36 100644 --- a/src/nitro/session/events/RoomSessionPollEvent.ts +++ b/src/nitro/session/events/RoomSessionPollEvent.ts @@ -1,4 +1,5 @@ -import { IRoomSession } from '../IRoomSession'; +import { PollQuestion } from '../../communication/messages/parser/poll/PollQuestion'; +import { IRoomSession } from '../IRoomSession'; import { RoomSessionEvent } from './RoomSessionEvent'; @@ -14,7 +15,7 @@ export class RoomSessionPollEvent extends RoomSessionEvent private _numQuestions: number = 0; private _startMessage: string = ''; private _endMessage: string = ''; - private _questionArray: string[] = null; + private _questionArray: PollQuestion[] = null; private _npsPoll: boolean = false; constructor(k: string, _arg_2: IRoomSession, _arg_3: number) @@ -79,12 +80,12 @@ export class RoomSessionPollEvent extends RoomSessionEvent this._endMessage = k; } - public get questionArray(): string[] + public get questionArray(): PollQuestion[] { return this._questionArray; } - public set questionArray(k: string[]) + public set questionArray(k: PollQuestion[]) { this._questionArray = k; } diff --git a/src/nitro/session/handler/PollHandler.ts b/src/nitro/session/handler/PollHandler.ts new file mode 100644 index 00000000..bc83b052 --- /dev/null +++ b/src/nitro/session/handler/PollHandler.ts @@ -0,0 +1,81 @@ +import { IConnection } from '../../../core/communication/connections/IConnection'; +import { PollContentsEvent } from '../../communication/messages/incoming/poll/PollContentsEvent'; +import { PollErrorEvent } from '../../communication/messages/incoming/poll/PollErrorEvent'; +import { PollOfferEvent } from '../../communication/messages/incoming/poll/PollOfferEvent'; +import { RoomSessionPollEvent } from '../events/RoomSessionPollEvent'; +import { IRoomHandlerListener } from '../IRoomHandlerListener'; +import { BaseHandler } from './BaseHandler'; + +export class PollHandler extends BaseHandler +{ + constructor(connection: IConnection, listener: IRoomHandlerListener) + { + super(connection, listener); + + connection.addMessageEvent(new PollContentsEvent(this.onPollContentsEvent.bind(this))); + connection.addMessageEvent(new PollOfferEvent(this.onPollOfferEvent.bind(this))); + connection.addMessageEvent(new PollErrorEvent(this.onPollErrorEvent.bind(this))); + } + + private onPollContentsEvent(event: PollContentsEvent): void + { + if(!this.listener) return; + + const session = this.listener.getSession(this.roomId); + + if(!session) return; + + const parser = event.getParser(); + + if(!parser) return; + + const pollEvent = new RoomSessionPollEvent(RoomSessionPollEvent.CONTENT, session, parser.id); + + pollEvent.startMessage = parser.startMessage; + pollEvent.endMessage = parser.endMessage; + pollEvent.numQuestions = parser.numQuestions; + pollEvent.questionArray = parser.questionArray; + pollEvent.npsPoll = parser.npsPoll; + + this.listener.events.dispatchEvent(pollEvent); + } + + private onPollOfferEvent(event: PollOfferEvent): void + { + if(!this.listener) return; + + const session = this.listener.getSession(this.roomId); + + if(!session) return; + + const parser = event.getParser(); + + if(!parser) return; + + const pollEvent = new RoomSessionPollEvent(RoomSessionPollEvent.OFFER, session, parser.id); + + pollEvent.summary = parser.headline; + pollEvent.summary = parser.summary; + + this.listener.events.dispatchEvent(pollEvent); + } + + private onPollErrorEvent(event: PollErrorEvent): void + { + if(!this.listener) return; + + const session = this.listener.getSession(this.roomId); + + if(!session) return; + + const parser = event.getParser(); + + if(!parser) return; + + const pollEvent = new RoomSessionPollEvent(RoomSessionPollEvent.ERROR, session, -1); + pollEvent.headline = '???'; + pollEvent.summary = '???'; + + this.listener.events.dispatchEvent(pollEvent); + } +} From 52954806f809e4d3aaa5e785fc8067a765b0a0b0 Mon Sep 17 00:00:00 2001 From: dank074 Date: Tue, 16 Nov 2021 01:01:05 -0600 Subject: [PATCH 085/108] add poll methods to RoomSession --- src/nitro/session/IRoomSession.ts | 3 +++ src/nitro/session/RoomSession.ts | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/nitro/session/IRoomSession.ts b/src/nitro/session/IRoomSession.ts index d4847481..8b3ee921 100644 --- a/src/nitro/session/IRoomSession.ts +++ b/src/nitro/session/IRoomSession.ts @@ -28,6 +28,9 @@ export interface IRoomSession extends IDisposable sendBanMessage(userId: number, type: string): void; sendGiveRightsMessage(userId: number): void; sendTakeRightsMessage(userId: number): void; + sendPollStartMessage(pollId:number):void; + sendPollRejectMessage(pollId:number):void; + sendPollAnswerMessage(pollId:number, questionId:number, answers:string[]):void; updateMoodlightData(id: number, effectId: number, color: number, brightness: number, apply: boolean): void; toggleMoodlightState(): void; pickupPet(id: number): void; diff --git a/src/nitro/session/RoomSession.ts b/src/nitro/session/RoomSession.ts index 34df6dff..751eaeaf 100644 --- a/src/nitro/session/RoomSession.ts +++ b/src/nitro/session/RoomSession.ts @@ -1,6 +1,6 @@ import { Disposable } from '../../core/common/disposable/Disposable'; import { IConnection } from '../../core/communication/connections/IConnection'; -import { FurnitureMultiStateComposer, PetMountComposer, RemovePetSaddleComposer, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from '../communication'; +import { FurnitureMultiStateComposer, PetMountComposer, PollAnswerComposer, PollRejectComposer, PollStartComposer, RemovePetSaddleComposer, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from '../communication'; import { RoomDoorbellAccessComposer } from '../communication/messages/outgoing/room/access/RoomDoorbellAccessComposer'; import { RoomEnterComposer } from '../communication/messages/outgoing/room/access/RoomEnterComposer'; import { RoomAmbassadorAlertComposer } from '../communication/messages/outgoing/room/action/RoomAmbassadorAlertComposer'; @@ -225,6 +225,21 @@ export class RoomSession extends Disposable implements IRoomSession this._connection.send(new RoomTakeRightsComposer(userId)); } + public sendPollStartMessage(pollId:number):void + { + this._connection.send(new PollStartComposer(pollId)); + } + + public sendPollRejectMessage(pollId:number):void + { + this._connection.send(new PollRejectComposer(pollId)); + } + + public sendPollAnswerMessage(pollId:number, questionId:number, answers:string[]):void + { + this._connection.send(new PollAnswerComposer(pollId, questionId, answers)); + } + public updateMoodlightData(id: number, effectId: number, color: number, brightness: number, apply: boolean): void { let colorString = '000000' + color.toString(16).toUpperCase(); From e0e8357dcbd25608a3d5b83b7c0bdf8ee09f6aba Mon Sep 17 00:00:00 2001 From: dank074 Date: Tue, 16 Nov 2021 15:28:41 -0600 Subject: [PATCH 086/108] FMLLLLLLLLLLLLLLLLLLL --- .../messages/parser/poll/QuestionAnsweredParser.ts | 2 +- .../messages/parser/poll/QuestionFinishedParser.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nitro/communication/messages/parser/poll/QuestionAnsweredParser.ts b/src/nitro/communication/messages/parser/poll/QuestionAnsweredParser.ts index 8902a42a..e5b26406 100644 --- a/src/nitro/communication/messages/parser/poll/QuestionAnsweredParser.ts +++ b/src/nitro/communication/messages/parser/poll/QuestionAnsweredParser.ts @@ -12,7 +12,7 @@ export class QuestionAnsweredParser implements IMessageParser this._userId = -1; this._value = ''; this._answerCounts = null; - return false; + return true; } parse(wrapper: IMessageDataWrapper): boolean diff --git a/src/nitro/communication/messages/parser/poll/QuestionFinishedParser.ts b/src/nitro/communication/messages/parser/poll/QuestionFinishedParser.ts index c3d7aea4..da361013 100644 --- a/src/nitro/communication/messages/parser/poll/QuestionFinishedParser.ts +++ b/src/nitro/communication/messages/parser/poll/QuestionFinishedParser.ts @@ -10,7 +10,7 @@ export class QuestionFinishedParser implements IMessageParser { this._questionId = -1; this._answerCounts = null; - return false; + return true; } parse(wrapper: IMessageDataWrapper): boolean From dcfded6a15abdccc9e8eb5fb095b50a5cab69de9 Mon Sep 17 00:00:00 2001 From: dank074 Date: Mon, 22 Nov 2021 00:35:12 -0600 Subject: [PATCH 087/108] update marketplace outgoing packet names --- src/nitro/communication/NitroMessages.ts | 27 +++++++++---------- .../messages/outgoing/OutgoingHeader.ts | 1 + .../messages/outgoing/inventory/index.ts | 1 - .../MarketplaceSellItemComposer.ts | 21 --------------- .../marketplace/RequestSellItemComposer.ts | 21 --------------- .../outgoing/inventory/marketplace/index.ts | 2 -- ... => BuyMarketplaceOfferMessageComposer.ts} | 4 +-- .../BuyMarketplaceTokensMessageComposer.ts | 21 +++++++++++++++ ... CancelMarketplaceOfferMessageComposer.ts} | 4 +-- .../GetMarketplaceCanMakeOfferComposer.ts | 21 +++++++++++++++ ...arketplaceConfigurationMessageComposer.ts} | 4 +-- ....ts => GetMarketplaceItemStatsComposer.ts} | 4 +-- ...=> GetMarketplaceOffersMessageComposer.ts} | 4 +-- ...GetMarketplaceOwnOffersMessageComposer.ts} | 4 +-- .../marketplace/MakeOfferMessageComposer.ts | 21 +++++++++++++++ ...MarketplaceOfferCreditsMessageComposer.ts} | 4 +-- .../messages/outgoing/marketplace/index.ts | 17 +++++++----- 17 files changed, 101 insertions(+), 80 deletions(-) delete mode 100644 src/nitro/communication/messages/outgoing/inventory/marketplace/MarketplaceSellItemComposer.ts delete mode 100644 src/nitro/communication/messages/outgoing/inventory/marketplace/RequestSellItemComposer.ts delete mode 100644 src/nitro/communication/messages/outgoing/inventory/marketplace/index.ts rename src/nitro/communication/messages/outgoing/marketplace/{MarketplaceTakeItemBackComposer.ts => BuyMarketplaceOfferMessageComposer.ts} (58%) create mode 100644 src/nitro/communication/messages/outgoing/marketplace/BuyMarketplaceTokensMessageComposer.ts rename src/nitro/communication/messages/outgoing/marketplace/{MarketplaceBuyOfferComposer.ts => CancelMarketplaceOfferMessageComposer.ts} (57%) create mode 100644 src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceCanMakeOfferComposer.ts rename src/nitro/communication/messages/outgoing/marketplace/{MarketplaceRequestComposer.ts => GetMarketplaceConfigurationMessageComposer.ts} (53%) rename src/nitro/communication/messages/outgoing/marketplace/{MarketplaceRequesstItemStatsComposer.ts => GetMarketplaceItemStatsComposer.ts} (59%) rename src/nitro/communication/messages/outgoing/marketplace/{MarketplaceRequestOffersComposer.ts => GetMarketplaceOffersMessageComposer.ts} (61%) rename src/nitro/communication/messages/outgoing/marketplace/{MarketplaceRequestOwnItemsComposer.ts => GetMarketplaceOwnOffersMessageComposer.ts} (55%) create mode 100644 src/nitro/communication/messages/outgoing/marketplace/MakeOfferMessageComposer.ts rename src/nitro/communication/messages/outgoing/marketplace/{MarketplaceRedeemCreditsComposer.ts => RedeemMarketplaceOfferCreditsMessageComposer.ts} (53%) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 34e5cf52..fd037c1f 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, MarketplaceBuyOfferComposer, MarketplaceRedeemCreditsComposer, MarketplaceRequesstItemStatsComposer, MarketplaceRequestComposer, MarketplaceRequestOffersComposer, MarketplaceRequestOwnItemsComposer, MarketplaceTakeItemBackComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CancelMarketplaceOfferMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, RedeemMarketplaceOfferCreditsMessageComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -300,8 +300,6 @@ import { SetActivatedBadgesComposer } from './messages/outgoing/inventory/badges import { GetBotInventoryComposer } from './messages/outgoing/inventory/bots/GetBotInventoryComposer'; import { FurnitureList2Composer } from './messages/outgoing/inventory/furni/FurnitureList2Composer'; import { FurnitureListComposer } from './messages/outgoing/inventory/furni/FurnitureListComposer'; -import { MarketplaceSellItemComposer } from './messages/outgoing/inventory/marketplace/MarketplaceSellItemComposer'; -import { RequestSellItemComposer } from './messages/outgoing/inventory/marketplace/RequestSellItemComposer'; import { RequestPetsComposer } from './messages/outgoing/inventory/pets/RequestPetsComposer'; import { TradingAcceptComposer } from './messages/outgoing/inventory/trading/TradingAcceptComposer'; import { TradingCancelComposer } from './messages/outgoing/inventory/trading/TradingCancelComposer'; @@ -314,6 +312,8 @@ import { TradingOpenComposer } from './messages/outgoing/inventory/trading/Tradi import { TradingUnacceptComposer } from './messages/outgoing/inventory/trading/TradingUnacceptComposer'; import { GetPromoArticlesComposer } from './messages/outgoing/landingview/GetPromoArticlesComposer'; import { CommunityGoalVoteMessageComposer } from './messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer'; +import { GetMarketplaceCanMakeOfferComposer } from './messages/outgoing/marketplace/GetMarketplaceCanMakeOfferComposer'; +import { MakeOfferMessageComposer } from './messages/outgoing/marketplace/MakeOfferMessageComposer'; import { DefaultSanctionMessageComposer } from './messages/outgoing/moderation/DefaultSanctionMessageComposer'; import { GetModeratorRoomInfoMessageComposer } from './messages/outgoing/moderation/GetModeratorRoomInfoMessageComposer'; import { GetModeratorUserInfoMessageComposer } from './messages/outgoing/moderation/GetModeratorUserInfoMessageComposer'; @@ -1067,10 +1067,6 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.USER_FURNITURE, FurnitureListComposer); this._composers.set(OutgoingHeader.USER_FURNITURE2, FurnitureList2Composer); - //// MARKETPLACE - this._composers.set(OutgoingHeader.REQUEST_SELL_ITEM, RequestSellItemComposer); - this._composers.set(OutgoingHeader.REQUEST_MARKETPLACE_ITEM_STATS, MarketplaceRequesstItemStatsComposer); - //// PETS this._composers.set(OutgoingHeader.USER_PETS, RequestPetsComposer); @@ -1243,13 +1239,16 @@ export class NitroMessages implements IMessageConfiguration // INVENTORY // MARKETPLACE - this._composers.set(OutgoingHeader.MARKETPLACE_CONFIG, MarketplaceRequestComposer); - this._composers.set(OutgoingHeader.MARKETPLACE_SELL_ITEM, MarketplaceSellItemComposer); - this._composers.set(OutgoingHeader.MARKETPLACE_REQUEST_OWN_ITEMS, MarketplaceRequestOwnItemsComposer); - this._composers.set(OutgoingHeader.MARKETPLACE_TAKE_BACK_ITEM, MarketplaceTakeItemBackComposer); - this._composers.set(OutgoingHeader.MARKETPLACE_REQUEST_OFFERS, MarketplaceRequestOffersComposer); - this._composers.set(OutgoingHeader.MARKETPLACE_BUY_OFFER, MarketplaceBuyOfferComposer); - this._composers.set(OutgoingHeader.MARKETPLACE_REDEEM_CREDITS, MarketplaceRedeemCreditsComposer); + this._composers.set(OutgoingHeader.MARKETPLACE_CONFIG, GetMarketplaceConfigurationMessageComposer); + this._composers.set(OutgoingHeader.MARKETPLACE_SELL_ITEM, MakeOfferMessageComposer); + this._composers.set(OutgoingHeader.MARKETPLACE_REQUEST_OWN_ITEMS, GetMarketplaceOwnOffersMessageComposer); + this._composers.set(OutgoingHeader.MARKETPLACE_TAKE_BACK_ITEM, CancelMarketplaceOfferMessageComposer); + this._composers.set(OutgoingHeader.MARKETPLACE_REQUEST_OFFERS, GetMarketplaceOffersMessageComposer); + this._composers.set(OutgoingHeader.MARKETPLACE_BUY_OFFER, BuyMarketplaceOfferMessageComposer); + this._composers.set(OutgoingHeader.MARKETPLACE_REDEEM_CREDITS, RedeemMarketplaceOfferCreditsMessageComposer); + this._composers.set(OutgoingHeader.MARKETPLACE_BUY_TOKENS, BuyMarketplaceTokensMessageComposer); + this._composers.set(OutgoingHeader.REQUEST_SELL_ITEM, GetMarketplaceCanMakeOfferComposer); + this._composers.set(OutgoingHeader.REQUEST_MARKETPLACE_ITEM_STATS, GetMarketplaceItemStatsComposer); // BOTS this._composers.set(OutgoingHeader.USER_BOTS, GetBotInventoryComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 8f89b6c0..88781222 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -246,6 +246,7 @@ export class OutgoingHeader public static MARKETPLACE_REDEEM_CREDITS = 2650; public static MARKETPLACE_REQUEST_OFFERS = 2407; public static MARKETPLACE_BUY_OFFER = 1603; + public static MARKETPLACE_BUY_TOKENS = 1866; public static CATALOG_REQUESET_PET_BREEDS = 1756; public static APPROVE_NAME = 2109; public static UNIT_GIVE_HANDITEM_PET = 2768; diff --git a/src/nitro/communication/messages/outgoing/inventory/index.ts b/src/nitro/communication/messages/outgoing/inventory/index.ts index 3832a002..51ef5120 100644 --- a/src/nitro/communication/messages/outgoing/inventory/index.ts +++ b/src/nitro/communication/messages/outgoing/inventory/index.ts @@ -1,7 +1,6 @@ export * from './badges'; export * from './bots'; export * from './furni'; -export * from './marketplace'; export * from './pets'; export * from './trading'; export * from './unseen'; diff --git a/src/nitro/communication/messages/outgoing/inventory/marketplace/MarketplaceSellItemComposer.ts b/src/nitro/communication/messages/outgoing/inventory/marketplace/MarketplaceSellItemComposer.ts deleted file mode 100644 index 825d3f4b..00000000 --- a/src/nitro/communication/messages/outgoing/inventory/marketplace/MarketplaceSellItemComposer.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; - -export class MarketplaceSellItemComposer implements IMessageComposer> -{ - private _data: ConstructorParameters; - - constructor(credits: number, arg2: number, itemId: number) - { - this._data = [credits, arg2, itemId]; - } - - public getMessageArray() - { - return this._data; - } - - public dispose(): void - { - return; - } -} diff --git a/src/nitro/communication/messages/outgoing/inventory/marketplace/RequestSellItemComposer.ts b/src/nitro/communication/messages/outgoing/inventory/marketplace/RequestSellItemComposer.ts deleted file mode 100644 index 2cf77e63..00000000 --- a/src/nitro/communication/messages/outgoing/inventory/marketplace/RequestSellItemComposer.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; - -export class RequestSellItemComposer implements IMessageComposer> -{ - private _data: ConstructorParameters; - - constructor() - { - this._data = []; - } - - public getMessageArray() - { - return this._data; - } - - public dispose(): void - { - return; - } -} diff --git a/src/nitro/communication/messages/outgoing/inventory/marketplace/index.ts b/src/nitro/communication/messages/outgoing/inventory/marketplace/index.ts deleted file mode 100644 index aa5af83b..00000000 --- a/src/nitro/communication/messages/outgoing/inventory/marketplace/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './MarketplaceSellItemComposer'; -export * from './RequestSellItemComposer'; diff --git a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceTakeItemBackComposer.ts b/src/nitro/communication/messages/outgoing/marketplace/BuyMarketplaceOfferMessageComposer.ts similarity index 58% rename from src/nitro/communication/messages/outgoing/marketplace/MarketplaceTakeItemBackComposer.ts rename to src/nitro/communication/messages/outgoing/marketplace/BuyMarketplaceOfferMessageComposer.ts index d6e7a578..1a10dad2 100644 --- a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceTakeItemBackComposer.ts +++ b/src/nitro/communication/messages/outgoing/marketplace/BuyMarketplaceOfferMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class MarketplaceTakeItemBackComposer implements IMessageComposer> +export class BuyMarketplaceOfferMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(offerId: number) { diff --git a/src/nitro/communication/messages/outgoing/marketplace/BuyMarketplaceTokensMessageComposer.ts b/src/nitro/communication/messages/outgoing/marketplace/BuyMarketplaceTokensMessageComposer.ts new file mode 100644 index 00000000..4a95c4ca --- /dev/null +++ b/src/nitro/communication/messages/outgoing/marketplace/BuyMarketplaceTokensMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class BuyMarketplaceTokensMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + this._data = null; + } +} diff --git a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceBuyOfferComposer.ts b/src/nitro/communication/messages/outgoing/marketplace/CancelMarketplaceOfferMessageComposer.ts similarity index 57% rename from src/nitro/communication/messages/outgoing/marketplace/MarketplaceBuyOfferComposer.ts rename to src/nitro/communication/messages/outgoing/marketplace/CancelMarketplaceOfferMessageComposer.ts index 27e9811f..33a44323 100644 --- a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceBuyOfferComposer.ts +++ b/src/nitro/communication/messages/outgoing/marketplace/CancelMarketplaceOfferMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class MarketplaceBuyOfferComposer implements IMessageComposer> +export class CancelMarketplaceOfferMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(offerId: number) { diff --git a/src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceCanMakeOfferComposer.ts b/src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceCanMakeOfferComposer.ts new file mode 100644 index 00000000..ceb75838 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceCanMakeOfferComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetMarketplaceCanMakeOfferComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequestComposer.ts b/src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceConfigurationMessageComposer.ts similarity index 53% rename from src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequestComposer.ts rename to src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceConfigurationMessageComposer.ts index 4607ed22..93175ac7 100644 --- a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequestComposer.ts +++ b/src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceConfigurationMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class MarketplaceRequestComposer implements IMessageComposer> +export class GetMarketplaceConfigurationMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor() { diff --git a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequesstItemStatsComposer.ts b/src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceItemStatsComposer.ts similarity index 59% rename from src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequesstItemStatsComposer.ts rename to src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceItemStatsComposer.ts index 54c3ee81..de65d31d 100644 --- a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequesstItemStatsComposer.ts +++ b/src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceItemStatsComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class MarketplaceRequesstItemStatsComposer implements IMessageComposer> +export class GetMarketplaceItemStatsComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(unknown: number, itemId: number) { diff --git a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequestOffersComposer.ts b/src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceOffersMessageComposer.ts similarity index 61% rename from src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequestOffersComposer.ts rename to src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceOffersMessageComposer.ts index 818110aa..f807c3c2 100644 --- a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequestOffersComposer.ts +++ b/src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceOffersMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class MarketplaceRequestOffersComposer implements IMessageComposer> +export class GetMarketplaceOffersMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(min: number, max: number, query: string, type: number) { diff --git a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequestOwnItemsComposer.ts b/src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceOwnOffersMessageComposer.ts similarity index 55% rename from src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequestOwnItemsComposer.ts rename to src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceOwnOffersMessageComposer.ts index fc23b1c8..6535037a 100644 --- a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceRequestOwnItemsComposer.ts +++ b/src/nitro/communication/messages/outgoing/marketplace/GetMarketplaceOwnOffersMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class MarketplaceRequestOwnItemsComposer implements IMessageComposer> +export class GetMarketplaceOwnOffersMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor() { diff --git a/src/nitro/communication/messages/outgoing/marketplace/MakeOfferMessageComposer.ts b/src/nitro/communication/messages/outgoing/marketplace/MakeOfferMessageComposer.ts new file mode 100644 index 00000000..584ce49f --- /dev/null +++ b/src/nitro/communication/messages/outgoing/marketplace/MakeOfferMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class MakeOfferMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(credits: number, arg2: number, itemId: number) + { + this._data = [credits, arg2, itemId]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceRedeemCreditsComposer.ts b/src/nitro/communication/messages/outgoing/marketplace/RedeemMarketplaceOfferCreditsMessageComposer.ts similarity index 53% rename from src/nitro/communication/messages/outgoing/marketplace/MarketplaceRedeemCreditsComposer.ts rename to src/nitro/communication/messages/outgoing/marketplace/RedeemMarketplaceOfferCreditsMessageComposer.ts index 745273ac..c1187531 100644 --- a/src/nitro/communication/messages/outgoing/marketplace/MarketplaceRedeemCreditsComposer.ts +++ b/src/nitro/communication/messages/outgoing/marketplace/RedeemMarketplaceOfferCreditsMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class MarketplaceRedeemCreditsComposer implements IMessageComposer> +export class RedeemMarketplaceOfferCreditsMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor() { diff --git a/src/nitro/communication/messages/outgoing/marketplace/index.ts b/src/nitro/communication/messages/outgoing/marketplace/index.ts index 948ae13e..742161a4 100644 --- a/src/nitro/communication/messages/outgoing/marketplace/index.ts +++ b/src/nitro/communication/messages/outgoing/marketplace/index.ts @@ -1,7 +1,10 @@ -export * from './MarketplaceBuyOfferComposer'; -export * from './MarketplaceRedeemCreditsComposer'; -export * from './MarketplaceRequesstItemStatsComposer'; -export * from './MarketplaceRequestComposer'; -export * from './MarketplaceRequestOffersComposer'; -export * from './MarketplaceRequestOwnItemsComposer'; -export * from './MarketplaceTakeItemBackComposer'; +export * from './BuyMarketplaceOfferMessageComposer'; +export * from './BuyMarketplaceTokensMessageComposer'; +export * from './CancelMarketplaceOfferMessageComposer'; +export * from './GetMarketplaceCanMakeOfferComposer'; +export * from './GetMarketplaceConfigurationMessageComposer'; +export * from './GetMarketplaceItemStatsComposer'; +export * from './GetMarketplaceOffersMessageComposer'; +export * from './GetMarketplaceOwnOffersMessageComposer'; +export * from './MakeOfferMessageComposer'; +export * from './RedeemMarketplaceOfferCreditsMessageComposer'; From f84f5b1a984e03068d30a04e599ca41b84ce1e8a Mon Sep 17 00:00:00 2001 From: dank074 Date: Mon, 22 Nov 2021 17:04:33 -0600 Subject: [PATCH 088/108] update vars in calendar parsers --- .../communication/messages/incoming/index.ts | 1 + .../parser/campaign/CampaignCalendarData.ts | 44 +++++++++---------- .../CampaignCalendarDataMessageParser.ts | 1 + ...CampaignCalendarDoorOpenedMessageParser.ts | 20 ++++----- 4 files changed, 32 insertions(+), 34 deletions(-) diff --git a/src/nitro/communication/messages/incoming/index.ts b/src/nitro/communication/messages/incoming/index.ts index 4cbde107..610b0a37 100644 --- a/src/nitro/communication/messages/incoming/index.ts +++ b/src/nitro/communication/messages/incoming/index.ts @@ -4,6 +4,7 @@ export * from './avatar'; export * from './bots'; export * from './callforhelp'; export * from './camera'; +export * from './campaign'; export * from './catalog'; export * from './client'; export * from './desktop'; diff --git a/src/nitro/communication/messages/parser/campaign/CampaignCalendarData.ts b/src/nitro/communication/messages/parser/campaign/CampaignCalendarData.ts index a7fb5f94..8a4b9183 100644 --- a/src/nitro/communication/messages/parser/campaign/CampaignCalendarData.ts +++ b/src/nitro/communication/messages/parser/campaign/CampaignCalendarData.ts @@ -21,22 +21,18 @@ export class CampaignCalendarData let count = wrapper.readInt(); - while(count > 0) + for(let i = 0; i < count; i++) { this._openedDays.push(wrapper.readInt()); - - count--; } this._missedDays = []; count = wrapper.readInt(); - while(count > 0) + for(let i = 0; i < count; i++) { this._missedDays.push(wrapper.readInt()); - - count--; } return true; @@ -46,72 +42,72 @@ export class CampaignCalendarData { const data = new CampaignCalendarData(); - data._Str_8399 = this._campaignDays; - data._Str_19589 = this._campaignImage; - data._Str_11123 = this._campaignName; - data._Str_5472 = this._currentDay; - data._Str_14267 = this._missedDays; - data._Str_10724 = this._openedDays; + data.campaignDays = this._campaignDays; + data.campaignImage = this._campaignImage; + data.campaignData = this._campaignName; + data.currentDay = this._currentDay; + data.missedDays = this._missedDays; + data.openedDays = this._openedDays; return data; } - public get _Str_11123(): string + public get campaignData(): string { return this._campaignName; } - public set _Str_11123(name: string) + public set campaignData(name: string) { this._campaignName = name; } - public get _Str_19589(): string + public get campaignImage(): string { return this._campaignImage; } - public set _Str_19589(image: string) + public set campaignImage(image: string) { this._campaignImage = image; } - public get _Str_5472(): number + public get currentDay(): number { return this._currentDay; } - public set _Str_5472(day: number) + public set currentDay(day: number) { this._currentDay = day; } - public get _Str_8399(): number + public get campaignDays(): number { return this._campaignDays; } - public set _Str_8399(days: number) + public set campaignDays(days: number) { this._campaignDays = days; } - public get _Str_10724(): number[] + public get openedDays(): number[] { return this._openedDays; } - public set _Str_10724(days: number[]) + public set openedDays(days: number[]) { this._openedDays = days; } - public get _Str_14267(): number[] + public get missedDays(): number[] { return this._missedDays; } - public set _Str_14267(days: number[]) + public set missedDays(days: number[]) { this._missedDays = days; } diff --git a/src/nitro/communication/messages/parser/campaign/CampaignCalendarDataMessageParser.ts b/src/nitro/communication/messages/parser/campaign/CampaignCalendarDataMessageParser.ts index 3bfce039..a590bc2d 100644 --- a/src/nitro/communication/messages/parser/campaign/CampaignCalendarDataMessageParser.ts +++ b/src/nitro/communication/messages/parser/campaign/CampaignCalendarDataMessageParser.ts @@ -17,6 +17,7 @@ export class CampaignCalendarDataMessageParser implements IMessageParser { if(!wrapper) return false; + this._calendarData = new CampaignCalendarData(); this._calendarData.parse(wrapper); return true; diff --git a/src/nitro/communication/messages/parser/campaign/CampaignCalendarDoorOpenedMessageParser.ts b/src/nitro/communication/messages/parser/campaign/CampaignCalendarDoorOpenedMessageParser.ts index 3bf902dc..0e9ff0d0 100644 --- a/src/nitro/communication/messages/parser/campaign/CampaignCalendarDoorOpenedMessageParser.ts +++ b/src/nitro/communication/messages/parser/campaign/CampaignCalendarDoorOpenedMessageParser.ts @@ -3,17 +3,17 @@ import { IMessageParser } from './../../../../../core'; export class CampaignCalendarDoorOpenedMessageParser implements IMessageParser { - private _Str_17229: boolean; + private _doorOpened: boolean; private _productName: string; private _customImage: string; - private _Str_6002: string; + private _furnitureClassName: string; public flush(): boolean { - this._Str_17229 = false; + this._doorOpened = false; this._productName = null; this._customImage = null; - this._Str_6002 = null; + this._furnitureClassName = null; return true; } @@ -22,17 +22,17 @@ export class CampaignCalendarDoorOpenedMessageParser implements IMessageParser { if(!wrapper) return false; - this._Str_17229 = wrapper.readBoolean(); + this._doorOpened = wrapper.readBoolean(); this._productName = wrapper.readString(); this._customImage = wrapper.readString(); - this._Str_6002 = wrapper.readString(); + this._furnitureClassName = wrapper.readString(); return true; } - public get _Str_22341(): boolean + public get doorOpened(): boolean { - return this._Str_17229; + return this._doorOpened; } public get productName(): string @@ -45,8 +45,8 @@ export class CampaignCalendarDoorOpenedMessageParser implements IMessageParser return this._customImage; } - public get _Str_8979(): string + public get furnitureClassName(): string { - return this._Str_6002; + return this._furnitureClassName; } } From 0e8e29145540a021b6f30e704c4fe238e7e47f0c Mon Sep 17 00:00:00 2001 From: dank074 Date: Mon, 22 Nov 2021 22:56:14 -0600 Subject: [PATCH 089/108] changes --- .../messages/parser/campaign/CampaignCalendarData.ts | 6 +++--- src/nitro/communication/messages/parser/index.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nitro/communication/messages/parser/campaign/CampaignCalendarData.ts b/src/nitro/communication/messages/parser/campaign/CampaignCalendarData.ts index 8a4b9183..3cf16476 100644 --- a/src/nitro/communication/messages/parser/campaign/CampaignCalendarData.ts +++ b/src/nitro/communication/messages/parser/campaign/CampaignCalendarData.ts @@ -44,7 +44,7 @@ export class CampaignCalendarData data.campaignDays = this._campaignDays; data.campaignImage = this._campaignImage; - data.campaignData = this._campaignName; + data.campaignName = this._campaignName; data.currentDay = this._currentDay; data.missedDays = this._missedDays; data.openedDays = this._openedDays; @@ -52,12 +52,12 @@ export class CampaignCalendarData return data; } - public get campaignData(): string + public get campaignName(): string { return this._campaignName; } - public set campaignData(name: string) + public set campaignName(name: string) { this._campaignName = name; } diff --git a/src/nitro/communication/messages/parser/index.ts b/src/nitro/communication/messages/parser/index.ts index 19f2d081..15007bad 100644 --- a/src/nitro/communication/messages/parser/index.ts +++ b/src/nitro/communication/messages/parser/index.ts @@ -4,6 +4,7 @@ export * from './avatar'; export * from './bots'; export * from './callforhelp'; export * from './camera'; +export * from './campaign'; export * from './catalog'; export * from './client'; export * from './competition'; From d3458229fd5ed40da8e16968c77f3ea536fa856f Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Fri, 26 Nov 2021 17:48:47 -0300 Subject: [PATCH 090/108] Guide Tool Events --- .../help/GuideOnDutyStatusMessageEvent.ts | 16 ++++ .../help/GuideSessionAttachedMessageEvent.ts | 16 ++++ .../help/GuideSessionDetachedMessageEvent.ts | 16 ++++ .../help/GuideSessionEndedMessageEvent.ts | 16 ++++ .../help/GuideSessionErrorMessageEvent.ts | 16 ++++ ...deSessionInvitedToGuideRoomMessageEvent.ts | 16 ++++ .../help/GuideSessionMessageMessageEvent.ts | 16 ++++ ...GuideSessionPartnerIsTypingMessageEvent.ts | 16 ++++ .../GuideSessionRequesterRoomMessageEvent.ts | 16 ++++ .../help/GuideSessionStartedMessageEvent.ts | 16 ++++ .../GuideTicketCreationResultMessageEvent.ts | 16 ++++ .../help/GuideTicketResolutionMessageEvent.ts | 16 ++++ .../help/HotelMergeNameChangeEvent.ts | 16 ++++ .../IssueCloseNotificationMessageEvent.ts | 16 ++++ .../incoming/help/QuizDataMessageEvent.ts | 16 ++++ .../incoming/help/QuizResultsMessageEvent.ts | 16 ++++ .../messages/incoming/help/index.ts | 16 ++++ .../help/GuideOnDutyStatusMessageParser.ts | 51 +++++++++++ .../help/GuideReportingStatusMessageParser.ts | 49 ++++++++++ .../help/GuideSessionAttachedMessageParser.ts | 51 +++++++++++ .../help/GuideSessionDetachedMessageParser.ts | 16 ++++ .../help/GuideSessionEndedMessageParser.ts | 27 ++++++ .../help/GuideSessionErrorMessageParser.ts | 33 +++++++ ...eSessionInvitedToGuideRoomMessageParser.ts | 35 +++++++ .../help/GuideSessionMessageMessageParser.ts | 35 +++++++ ...uideSessionPartnerIsTypingMessageParser.ts | 27 ++++++ .../GuideSessionRequesterRoomMessageParser.ts | 27 ++++++ .../help/GuideSessionStartedMessageParser.ts | 67 ++++++++++++++ .../GuideTicketCreationResultMessageParser.ts | 32 +++++++ .../GuideTicketResolutionMessageParser.ts | 31 +++++++ .../parser/help/HotelMergeNameChangeParser.ts | 16 ++++ .../IssueCloseNotificationMessageParser.ts | 27 ++++++ .../parser/help/QuizDataMessageParser.ts | 40 ++++++++ .../parser/help/QuizResultsMessageParser.ts | 40 ++++++++ .../help/common/PendingGuideTicketData.ts | 91 +++++++++++++++++++ .../messages/parser/help/index.ts | 17 ++++ 36 files changed, 984 insertions(+) create mode 100644 src/nitro/communication/messages/incoming/help/GuideOnDutyStatusMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionAttachedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionDetachedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionEndedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionErrorMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionInvitedToGuideRoomMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionMessageMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionPartnerIsTypingMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionRequesterRoomMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionStartedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideTicketCreationResultMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideTicketResolutionMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/HotelMergeNameChangeEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/IssueCloseNotificationMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/QuizDataMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/QuizResultsMessageEvent.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideOnDutyStatusMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideReportingStatusMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionAttachedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionDetachedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionEndedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionErrorMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionInvitedToGuideRoomMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionMessageMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionPartnerIsTypingMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionRequesterRoomMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionStartedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideTicketCreationResultMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideTicketResolutionMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/HotelMergeNameChangeParser.ts create mode 100644 src/nitro/communication/messages/parser/help/IssueCloseNotificationMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/QuizDataMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/QuizResultsMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/common/PendingGuideTicketData.ts diff --git a/src/nitro/communication/messages/incoming/help/GuideOnDutyStatusMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideOnDutyStatusMessageEvent.ts new file mode 100644 index 00000000..72f411d5 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideOnDutyStatusMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideOnDutyStatusMessageParser } from '../../parser/help/GuideOnDutyStatusMessageParser'; + +export class GuideOnDutyStatusMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideOnDutyStatusMessageParser); + } + + public getParser(): GuideOnDutyStatusMessageParser + { + return this.parser as GuideOnDutyStatusMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionAttachedMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionAttachedMessageEvent.ts new file mode 100644 index 00000000..9165f5cc --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionAttachedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionAttachedMessageParser } from '../../parser/help/GuideSessionAttachedMessageParser'; + +export class GuideSessionAttachedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionAttachedMessageParser); + } + + public getParser(): GuideSessionAttachedMessageParser + { + return this.parser as GuideSessionAttachedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionDetachedMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionDetachedMessageEvent.ts new file mode 100644 index 00000000..16b4473c --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionDetachedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionDetachedMessageParser } from '../../parser/help/GuideSessionDetachedMessageParser'; + +export class GuideSessionDetachedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionDetachedMessageParser); + } + + public getParser(): GuideSessionDetachedMessageParser + { + return this.parser as GuideSessionDetachedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionEndedMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionEndedMessageEvent.ts new file mode 100644 index 00000000..5aa1e2e8 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionEndedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionEndedMessageParser } from '../../parser/help/GuideSessionEndedMessageParser'; + +export class GuideSessionEndedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionEndedMessageParser); + } + + public getParser(): GuideSessionEndedMessageParser + { + return this.parser as GuideSessionEndedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionErrorMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionErrorMessageEvent.ts new file mode 100644 index 00000000..a6199407 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionErrorMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionErrorMessageParser } from '../../parser/help/GuideSessionErrorMessageParser'; + +export class GuideSessionErrorMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionErrorMessageParser); + } + + public getParser(): GuideSessionErrorMessageParser + { + return this.parser as GuideSessionErrorMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionInvitedToGuideRoomMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionInvitedToGuideRoomMessageEvent.ts new file mode 100644 index 00000000..d7926ef5 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionInvitedToGuideRoomMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionInvitedToGuideRoomMessageParser } from '../../parser/help/GuideSessionInvitedToGuideRoomMessageParser'; + +export class GuideSessionInvitedToGuideRoomMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionInvitedToGuideRoomMessageParser); + } + + public getParser(): GuideSessionInvitedToGuideRoomMessageParser + { + return this.parser as GuideSessionInvitedToGuideRoomMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionMessageMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionMessageMessageEvent.ts new file mode 100644 index 00000000..e7d720bd --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionMessageMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionMessageMessageParser } from '../../parser/help/GuideSessionMessageMessageParser'; + +export class GuideSessionMessageMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionMessageMessageParser); + } + + public getParser(): GuideSessionMessageMessageParser + { + return this.parser as GuideSessionMessageMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionPartnerIsTypingMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionPartnerIsTypingMessageEvent.ts new file mode 100644 index 00000000..6d987656 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionPartnerIsTypingMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionPartnerIsTypingMessageParser } from '../../parser/help/GuideSessionPartnerIsTypingMessageParser'; + +export class GuideSessionPartnerIsTypingMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionPartnerIsTypingMessageParser); + } + + public getParser(): GuideSessionPartnerIsTypingMessageParser + { + return this.parser as GuideSessionPartnerIsTypingMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionRequesterRoomMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionRequesterRoomMessageEvent.ts new file mode 100644 index 00000000..d4d88c4b --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionRequesterRoomMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionRequesterRoomMessageParser } from '../../parser/help/GuideSessionRequesterRoomMessageParser'; + +export class GuideSessionRequesterRoomMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionRequesterRoomMessageParser); + } + + public getParser(): GuideSessionRequesterRoomMessageParser + { + return this.parser as GuideSessionRequesterRoomMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionStartedMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionStartedMessageEvent.ts new file mode 100644 index 00000000..4e5c91ba --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionStartedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionStartedMessageParser } from '../../parser/help/GuideSessionStartedMessageParser'; + +export class GuideSessionStartedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionStartedMessageParser); + } + + public getParser(): GuideSessionStartedMessageParser + { + return this.parser as GuideSessionStartedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideTicketCreationResultMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideTicketCreationResultMessageEvent.ts new file mode 100644 index 00000000..82834816 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideTicketCreationResultMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideTicketCreationResultMessageParser } from '../../parser/help/GuideTicketCreationResultMessageParser'; + +export class GuideTicketCreationResultMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideTicketCreationResultMessageParser); + } + + public getParser(): GuideTicketCreationResultMessageParser + { + return this.parser as GuideTicketCreationResultMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideTicketResolutionMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideTicketResolutionMessageEvent.ts new file mode 100644 index 00000000..e72ca515 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideTicketResolutionMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideTicketResolutionMessageParser } from '../../parser/help/GuideTicketResolutionMessageParser'; + +export class GuideTicketResolutionMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideTicketResolutionMessageParser); + } + + public getParser(): GuideTicketResolutionMessageParser + { + return this.parser as GuideTicketResolutionMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/HotelMergeNameChangeEvent.ts b/src/nitro/communication/messages/incoming/help/HotelMergeNameChangeEvent.ts new file mode 100644 index 00000000..ded04e0c --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/HotelMergeNameChangeEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { HotelMergeNameChangeParser } from '../../parser/help/HotelMergeNameChangeParser'; + +export class HotelMergeNameChangeEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, HotelMergeNameChangeParser); + } + + public getParser(): HotelMergeNameChangeParser + { + return this.parser as HotelMergeNameChangeParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/IssueCloseNotificationMessageEvent.ts b/src/nitro/communication/messages/incoming/help/IssueCloseNotificationMessageEvent.ts new file mode 100644 index 00000000..165e8bda --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/IssueCloseNotificationMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { IssueCloseNotificationMessageParser } from '../../parser/help/IssueCloseNotificationMessageParser'; + +export class IssueCloseNotificationMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, IssueCloseNotificationMessageParser); + } + + public getParser(): IssueCloseNotificationMessageParser + { + return this.parser as IssueCloseNotificationMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/QuizDataMessageEvent.ts b/src/nitro/communication/messages/incoming/help/QuizDataMessageEvent.ts new file mode 100644 index 00000000..5435e27d --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/QuizDataMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuizDataMessageParser } from '../../parser/help/QuizDataMessageParser'; + +export class QuizDataMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuizDataMessageParser); + } + + public getParser(): QuizDataMessageParser + { + return this.parser as QuizDataMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/QuizResultsMessageEvent.ts b/src/nitro/communication/messages/incoming/help/QuizResultsMessageEvent.ts new file mode 100644 index 00000000..5460df5d --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/QuizResultsMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuizResultsMessageParser } from '../../parser/help/QuizResultsMessageParser'; + +export class QuizResultsMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuizResultsMessageParser); + } + + public getParser(): QuizResultsMessageParser + { + return this.parser as QuizResultsMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/index.ts b/src/nitro/communication/messages/incoming/help/index.ts index ed4c56df..26d0848d 100644 --- a/src/nitro/communication/messages/incoming/help/index.ts +++ b/src/nitro/communication/messages/incoming/help/index.ts @@ -1,2 +1,18 @@ export * from './CallForHelpDisabledNotifyMessageEvent'; export * from './CallForHelpResultMessageEvent'; +export * from './GuideOnDutyStatusMessageEvent'; +export * from './GuideSessionAttachedMessageEvent'; +export * from './GuideSessionDetachedMessageEvent'; +export * from './GuideSessionEndedMessageEvent'; +export * from './GuideSessionErrorMessageEvent'; +export * from './GuideSessionInvitedToGuideRoomMessageEvent'; +export * from './GuideSessionMessageMessageEvent'; +export * from './GuideSessionPartnerIsTypingMessageEvent'; +export * from './GuideSessionRequesterRoomMessageEvent'; +export * from './GuideSessionStartedMessageEvent'; +export * from './GuideTicketCreationResultMessageEvent'; +export * from './GuideTicketResolutionMessageEvent'; +export * from './HotelMergeNameChangeEvent'; +export * from './IssueCloseNotificationMessageEvent'; +export * from './QuizDataMessageEvent'; +export * from './QuizResultsMessageEvent'; diff --git a/src/nitro/communication/messages/parser/help/GuideOnDutyStatusMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideOnDutyStatusMessageParser.ts new file mode 100644 index 00000000..9419e309 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideOnDutyStatusMessageParser.ts @@ -0,0 +1,51 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideOnDutyStatusMessageParser implements IMessageParser +{ + private _onDuty: boolean; + private _guidesOnDuty: number; + private _helpersOnDuty: number; + private _guardiansOnDuty: number; + + public flush(): boolean + { + this._onDuty = false; + this._guidesOnDuty = 0; + this._helpersOnDuty = 0; + this._guardiansOnDuty = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._onDuty = wrapper.readBoolean(); + this._guidesOnDuty = wrapper.readInt(); + this._helpersOnDuty = wrapper.readInt(); + this._guardiansOnDuty = wrapper.readInt(); + + return true; + } + + public get onDuty(): boolean + { + return this._onDuty; + } + + public get guidesOnDuty(): number + { + return this._guidesOnDuty; + } + + public get helpersOnDuty(): number + { + return this._helpersOnDuty; + } + + public get guardiansOnDuty(): number + { + return this._guardiansOnDuty; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideReportingStatusMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideReportingStatusMessageParser.ts new file mode 100644 index 00000000..b0bcfaf1 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideReportingStatusMessageParser.ts @@ -0,0 +1,49 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; +import { PendingGuideTicketData } from './common/PendingGuideTicketData'; + +export class GuideReportingStatusMessageParser implements IMessageParser +{ + public static readonly GUIDE_REPORTING_STATUS_OK: number = 0; + public static readonly GUIDE_REPORTING_STATUS_PENDING_TICKET: number = 1; + public static readonly GUIDE_REPORTING_STATUS_ABUSIVE: number = 2; + public static readonly GUIDE_REPORTING_STATUS_REPORTING_TOO_QUICKLY: number = 3; + + private _statusCode: number; + private _pendingTicket: PendingGuideTicketData; + + public flush(): boolean + { + this._statusCode = 0; + this._pendingTicket = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._statusCode = wrapper.readInt(); + this._pendingTicket = new PendingGuideTicketData( + wrapper.readInt(), + wrapper.readInt(), + wrapper.readBoolean(), + wrapper.readString(), + wrapper.readString(), + wrapper.readString(), + wrapper.readString() + ); + + return true; + } + + public get statusCode(): number + { + return this._statusCode; + } + + public get pendingTicket(): PendingGuideTicketData + { + return this._pendingTicket; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionAttachedMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionAttachedMessageParser.ts new file mode 100644 index 00000000..3ede6323 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionAttachedMessageParser.ts @@ -0,0 +1,51 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionAttachedMessageParser implements IMessageParser +{ + private _asGuide: boolean; + private _helpRequestType: number; + private _helpRequestDescription: string; + private _roleSpecificWaitTime: number; + + public flush(): boolean + { + this._asGuide = false; + this._helpRequestType = 0; + this._helpRequestDescription = null; + this._roleSpecificWaitTime = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._asGuide = wrapper.readBoolean(); + this._helpRequestType = wrapper.readInt(); + this._helpRequestDescription = wrapper.readString(); + this._roleSpecificWaitTime = wrapper.readInt(); + + return true; + } + + public get asGuide(): boolean + { + return this._asGuide; + } + + public get helpRequestType(): number + { + return this._helpRequestType; + } + + public get helpRequestDescription(): string + { + return this._helpRequestDescription; + } + + public get roleSpecificWaitTime(): number + { + return this._roleSpecificWaitTime; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionDetachedMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionDetachedMessageParser.ts new file mode 100644 index 00000000..72aed516 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionDetachedMessageParser.ts @@ -0,0 +1,16 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionDetachedMessageParser implements IMessageParser +{ + public flush(): boolean + { + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + return true; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionEndedMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionEndedMessageParser.ts new file mode 100644 index 00000000..23f323c2 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionEndedMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionEndedMessageParser implements IMessageParser +{ + private _endReason: number; + + public flush(): boolean + { + this._endReason = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._endReason = wrapper.readInt(); + + return true; + } + + public get endReason(): number + { + return this._endReason; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionErrorMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionErrorMessageParser.ts new file mode 100644 index 00000000..1ac5c96f --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionErrorMessageParser.ts @@ -0,0 +1,33 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionErrorMessageParser implements IMessageParser +{ + public static readonly ERROR_GENERIC: number = 0; + public static readonly ERROR_GUIDES_REJECT: number = 1; + public static readonly ERROR_NOT_ENOUGH_GUIDES: number = 2; + public static readonly ERROR_NOT_ENOUGH_VOTES: number = 3; + public static readonly ERROR_NO_CHATLOG_FOUND: number = 4; + + private _errorCode: number; + + public flush(): boolean + { + this._errorCode = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._errorCode = wrapper.readInt(); + + return true; + } + + public get errorCode(): number + { + return this._errorCode; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionInvitedToGuideRoomMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionInvitedToGuideRoomMessageParser.ts new file mode 100644 index 00000000..e87a7793 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionInvitedToGuideRoomMessageParser.ts @@ -0,0 +1,35 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionInvitedToGuideRoomMessageParser implements IMessageParser +{ + private _roomId: number; + private _roomName: string; + + public flush(): boolean + { + this._roomId = 0; + this._roomName = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._roomId = wrapper.readInt(); + this._roomName = wrapper.readString(); + + return true; + } + + public get roomId(): number + { + return this._roomId; + } + + public get roomName(): string + { + return this._roomName; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionMessageMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionMessageMessageParser.ts new file mode 100644 index 00000000..333aada8 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionMessageMessageParser.ts @@ -0,0 +1,35 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionMessageMessageParser implements IMessageParser +{ + private _chatMessage: string; + private _senderId: number; + + public flush(): boolean + { + this._chatMessage = null; + this._senderId = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._chatMessage = wrapper.readString(); + this._senderId = wrapper.readInt(); + + return true; + } + + public get chatMessage(): string + { + return this._chatMessage; + } + + public get senderId(): number + { + return this._senderId; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionPartnerIsTypingMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionPartnerIsTypingMessageParser.ts new file mode 100644 index 00000000..4d617a11 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionPartnerIsTypingMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionPartnerIsTypingMessageParser implements IMessageParser +{ + private _isTyping: boolean; + + public flush(): boolean + { + this._isTyping = false; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._isTyping = wrapper.readBoolean(); + + return true; + } + + public get isTyping(): boolean + { + return this._isTyping; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionRequesterRoomMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionRequesterRoomMessageParser.ts new file mode 100644 index 00000000..97203dc2 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionRequesterRoomMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionRequesterRoomMessageParser implements IMessageParser +{ + private _requesterRoomId: number; + + public flush(): boolean + { + this._requesterRoomId = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._requesterRoomId = wrapper.readInt(); + + return true; + } + + public get requesterRoomId(): number + { + return this._requesterRoomId; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionStartedMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionStartedMessageParser.ts new file mode 100644 index 00000000..0410f692 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionStartedMessageParser.ts @@ -0,0 +1,67 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionStartedMessageParser implements IMessageParser +{ + private _requesterUserId: number; + private _requesterName: string; + private _requesterFigure: string; + private _guideUserId: number; + private _guideName: string; + private _guideFigure: string; + + public flush(): boolean + { + this._requesterUserId = 0; + this._requesterName = null; + this._requesterFigure = null; + this._guideUserId = 0; + this._guideName = null; + this._guideFigure = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._requesterUserId = wrapper.readInt(); + this._requesterName = wrapper.readString(); + this._requesterFigure = wrapper.readString(); + this._guideUserId = wrapper.readInt(); + this._guideName = wrapper.readString(); + this._guideFigure = wrapper.readString(); + + return true; + } + + public get requesterUserId(): number + { + return this._requesterUserId; + } + + public get requesterName(): string + { + return this._requesterName; + } + + public get requesterFigure(): string + { + return this._requesterFigure; + } + + public get guideUserId(): number + { + return this._guideUserId; + } + + public get guideName(): string + { + return this._guideName; + } + + public get guideFigure(): string + { + return this._guideFigure; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideTicketCreationResultMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideTicketCreationResultMessageParser.ts new file mode 100644 index 00000000..8ad0dee8 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideTicketCreationResultMessageParser.ts @@ -0,0 +1,32 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideTicketCreationResultMessageParser implements IMessageParser +{ + public static readonly CREATION_RESULT_OK: number = 0; + public static readonly CREATION_RESULT_UNABLE_TO_REPORT: number = 1; + public static readonly CREATION_RESULT_NO_CHATLOG_FOUND: number = 2; + public static readonly CREATION_RESULT_BULLY_ALREADY_REPORTED: number = 3; + + private _result: number; + + public flush(): boolean + { + this._result = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._result = wrapper.readInt(); + + return true; + } + + public get result(): number + { + return this._result; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideTicketResolutionMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideTicketResolutionMessageParser.ts new file mode 100644 index 00000000..e0b39c13 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideTicketResolutionMessageParser.ts @@ -0,0 +1,31 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideTicketResolutionMessageParser implements IMessageParser +{ + public static readonly RESOLUTION_GUARDIANS_TOOK_ACTION: number = 0; + public static readonly RESOLUTION_FORWARDED_TO_MODERATORS: number = 1; + public static readonly RESOLUTION_REPORTER_IS_ABUSIVE: number = 2; + + private _resolution: number; + + public flush(): boolean + { + this._resolution = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._resolution = wrapper.readInt(); + + return true; + } + + public get resolution(): number + { + return this._resolution; + } +} diff --git a/src/nitro/communication/messages/parser/help/HotelMergeNameChangeParser.ts b/src/nitro/communication/messages/parser/help/HotelMergeNameChangeParser.ts new file mode 100644 index 00000000..0d19d660 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/HotelMergeNameChangeParser.ts @@ -0,0 +1,16 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class HotelMergeNameChangeParser implements IMessageParser +{ + public flush(): boolean + { + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + return true; + } +} diff --git a/src/nitro/communication/messages/parser/help/IssueCloseNotificationMessageParser.ts b/src/nitro/communication/messages/parser/help/IssueCloseNotificationMessageParser.ts new file mode 100644 index 00000000..1053148c --- /dev/null +++ b/src/nitro/communication/messages/parser/help/IssueCloseNotificationMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class IssueCloseNotificationMessageParser implements IMessageParser +{ + private _closeReason: number; + + public flush(): boolean + { + this._closeReason = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._closeReason = wrapper.readInt(); + + return true; + } + + public get closeReason(): number + { + return this._closeReason; + } +} diff --git a/src/nitro/communication/messages/parser/help/QuizDataMessageParser.ts b/src/nitro/communication/messages/parser/help/QuizDataMessageParser.ts new file mode 100644 index 00000000..3f928b39 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/QuizDataMessageParser.ts @@ -0,0 +1,40 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class QuizDataMessageParser implements IMessageParser +{ + private _quizCode: string; + private _questionIds: number[]; + + public flush(): boolean + { + this._quizCode = null; + this._questionIds = []; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._quizCode = wrapper.readString(); + + const size = wrapper.readInt(); + + this._questionIds = []; + + for(let i = 0; i < size; i++) this._questionIds.push(wrapper.readInt()); + + return true; + } + + public get quizCode(): string + { + return this._quizCode; + } + + public get questionIds(): number[] + { + return this._questionIds; + } +} diff --git a/src/nitro/communication/messages/parser/help/QuizResultsMessageParser.ts b/src/nitro/communication/messages/parser/help/QuizResultsMessageParser.ts new file mode 100644 index 00000000..4f12f63a --- /dev/null +++ b/src/nitro/communication/messages/parser/help/QuizResultsMessageParser.ts @@ -0,0 +1,40 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class QuizResultsMessageParser implements IMessageParser +{ + private _quizCode: string; + private _questionIdsForWrongAnswers: number[]; + + public flush(): boolean + { + this._quizCode = null; + this._questionIdsForWrongAnswers = []; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._quizCode = wrapper.readString(); + + const size = wrapper.readInt(); + + this._questionIdsForWrongAnswers = []; + + for(let i = 0; i < size; i++) this._questionIdsForWrongAnswers.push(wrapper.readInt()); + + return true; + } + + public get quizCode(): string + { + return this._quizCode; + } + + public get questionIdsForWrongAnswers(): number[] + { + return this._questionIdsForWrongAnswers; + } +} diff --git a/src/nitro/communication/messages/parser/help/common/PendingGuideTicketData.ts b/src/nitro/communication/messages/parser/help/common/PendingGuideTicketData.ts new file mode 100644 index 00000000..fa592e8f --- /dev/null +++ b/src/nitro/communication/messages/parser/help/common/PendingGuideTicketData.ts @@ -0,0 +1,91 @@ +export class PendingGuideTicketData +{ + private _type: number; + private _secondsAgo: number; + private _isGuide: boolean; + private _otherPartyName: string; + private _otherPartyFigure: string; + private _description: string; + private _roomName: string; + + constructor(type: number, secondsAgo: number, isGuide: boolean, otherPartyName: string, otherPartyFigure: string, description: string, roomName: string) + { + this._type = type; + this._secondsAgo = secondsAgo; + this._isGuide = isGuide; + this._otherPartyName = otherPartyName; + this._otherPartyFigure = otherPartyFigure; + this._description = description; + this._roomName = roomName; + } + + public get type(): number + { + return this._type; + } + + public set type(value: number) + { + this._type = value; + } + + public get secondsAgo(): number + { + return this._secondsAgo; + } + + public set secondsAgo(value: number) + { + this._secondsAgo = value; + } + + public get isGuide(): boolean + { + return this._isGuide; + } + + public set isGuide(value: boolean) + { + this._isGuide = value; + } + + public get otherPartyName(): string + { + return this._otherPartyName; + } + + public set otherPartyName(value: string) + { + this._otherPartyName = value; + } + + public get otherPartyFigure(): string + { + return this._otherPartyFigure; + } + + public set otherPartyFigure(value: string) + { + this._otherPartyFigure = value; + } + + public get description(): string + { + return this._description; + } + + public set description(value: string) + { + this._description = value; + } + + public get roomName(): string + { + return this._roomName; + } + + public set roomName(value: string) + { + this._roomName = value; + } +} diff --git a/src/nitro/communication/messages/parser/help/index.ts b/src/nitro/communication/messages/parser/help/index.ts index 5cd9ff49..b0e077ee 100644 --- a/src/nitro/communication/messages/parser/help/index.ts +++ b/src/nitro/communication/messages/parser/help/index.ts @@ -1,2 +1,19 @@ export * from './CallForHelpDisabledNotifyMessageParser'; export * from './CallForHelpResultMessageParser'; +export * from './GuideOnDutyStatusMessageParser'; +export * from './GuideReportingStatusMessageParser'; +export * from './GuideSessionAttachedMessageParser'; +export * from './GuideSessionDetachedMessageParser'; +export * from './GuideSessionEndedMessageParser'; +export * from './GuideSessionErrorMessageParser'; +export * from './GuideSessionInvitedToGuideRoomMessageParser'; +export * from './GuideSessionMessageMessageParser'; +export * from './GuideSessionPartnerIsTypingMessageParser'; +export * from './GuideSessionRequesterRoomMessageParser'; +export * from './GuideSessionStartedMessageParser'; +export * from './GuideTicketCreationResultMessageParser'; +export * from './GuideTicketResolutionMessageParser'; +export * from './HotelMergeNameChangeParser'; +export * from './IssueCloseNotificationMessageParser'; +export * from './QuizDataMessageParser'; +export * from './QuizResultsMessageParser'; From 536d978435c8e651ee52eacfbdd558d8c13a7f8d Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Fri, 26 Nov 2021 17:57:59 -0300 Subject: [PATCH 091/108] Perk event and parser --- .../communication/messages/incoming/index.ts | 1 + .../perk/PerkAllowancesMessageEvent.ts | 16 +++++++++ .../messages/incoming/perk/index.ts | 1 + .../communication/messages/parser/index.ts | 1 + .../perk/PerkAllowancesMessageParser.ts | 36 +++++++++++++++++++ .../messages/parser/perk/common/PerkData.ts | 28 +++++++++++++++ .../messages/parser/perk/index.ts | 1 + .../parser/user/access/UserPerksParser.ts | 16 --------- .../messages/parser/user/access/index.ts | 1 - 9 files changed, 84 insertions(+), 17 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/perk/PerkAllowancesMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/perk/index.ts create mode 100644 src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/perk/common/PerkData.ts create mode 100644 src/nitro/communication/messages/parser/perk/index.ts delete mode 100644 src/nitro/communication/messages/parser/user/access/UserPerksParser.ts diff --git a/src/nitro/communication/messages/incoming/index.ts b/src/nitro/communication/messages/incoming/index.ts index 610b0a37..a45dac4b 100644 --- a/src/nitro/communication/messages/incoming/index.ts +++ b/src/nitro/communication/messages/incoming/index.ts @@ -29,6 +29,7 @@ export * from './moderation'; export * from './mysterybox'; export * from './navigator'; export * from './notifications'; +export * from './perk'; export * from './poll'; export * from './quest'; export * from './room'; diff --git a/src/nitro/communication/messages/incoming/perk/PerkAllowancesMessageEvent.ts b/src/nitro/communication/messages/incoming/perk/PerkAllowancesMessageEvent.ts new file mode 100644 index 00000000..dc117805 --- /dev/null +++ b/src/nitro/communication/messages/incoming/perk/PerkAllowancesMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { PerkAllowancesMessageParser } from './../../parser/perk/PerkAllowancesMessageParser'; + +export class PerkAllowancesMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, PerkAllowancesMessageParser); + } + + public getParser(): PerkAllowancesMessageParser + { + return this.parser as PerkAllowancesMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/perk/index.ts b/src/nitro/communication/messages/incoming/perk/index.ts new file mode 100644 index 00000000..b19fe4b9 --- /dev/null +++ b/src/nitro/communication/messages/incoming/perk/index.ts @@ -0,0 +1 @@ +export * from './PerkAllowancesMessageEvent'; diff --git a/src/nitro/communication/messages/parser/index.ts b/src/nitro/communication/messages/parser/index.ts index 15007bad..323d9c5e 100644 --- a/src/nitro/communication/messages/parser/index.ts +++ b/src/nitro/communication/messages/parser/index.ts @@ -21,6 +21,7 @@ export * from './moderation'; export * from './mysterybox'; export * from './navigator'; export * from './notifications'; +export * from './perk'; export * from './poll'; export * from './quest'; export * from './room'; diff --git a/src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts b/src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts new file mode 100644 index 00000000..9c5c7c8e --- /dev/null +++ b/src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts @@ -0,0 +1,36 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; +import { PerkData } from './common/PerkData'; + +export class PerkAllowancesMessageParser implements IMessageParser +{ + private _perks: PerkData[]; + + public flush(): boolean + { + this._perks = []; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._perks = []; + + const size: number = wrapper.readInt(); + + for(let i = 0; i < size; i++) this._perks.push(new PerkData( + wrapper.readString(), + wrapper.readBoolean(), + wrapper.readString() + )); + + return true; + } + + public get perks(): PerkData[] + { + return this._perks; + } +} diff --git a/src/nitro/communication/messages/parser/perk/common/PerkData.ts b/src/nitro/communication/messages/parser/perk/common/PerkData.ts new file mode 100644 index 00000000..df206fc8 --- /dev/null +++ b/src/nitro/communication/messages/parser/perk/common/PerkData.ts @@ -0,0 +1,28 @@ +export class PerkData +{ + private _code: string; + private _isAllowed: boolean; + private _errorMessage: string; + + constructor(code: string, isAllowed: boolean, errorMessage: string) + { + this._code = code; + this._isAllowed = isAllowed; + this._errorMessage = errorMessage; + } + + public get code(): string + { + return this._code; + } + + public get isAllowed(): boolean + { + return this._isAllowed; + } + + public get errorMessage(): string + { + return this._errorMessage; + } +} diff --git a/src/nitro/communication/messages/parser/perk/index.ts b/src/nitro/communication/messages/parser/perk/index.ts new file mode 100644 index 00000000..a513d8fe --- /dev/null +++ b/src/nitro/communication/messages/parser/perk/index.ts @@ -0,0 +1 @@ +export * from './PerkAllowancesMessageParser'; diff --git a/src/nitro/communication/messages/parser/user/access/UserPerksParser.ts b/src/nitro/communication/messages/parser/user/access/UserPerksParser.ts deleted file mode 100644 index 41de9c92..00000000 --- a/src/nitro/communication/messages/parser/user/access/UserPerksParser.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; - -export class UserPerksParser implements IMessageParser -{ - public flush(): boolean - { - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - if(!wrapper) return false; - - return true; - } -} diff --git a/src/nitro/communication/messages/parser/user/access/index.ts b/src/nitro/communication/messages/parser/user/access/index.ts index 0cf93775..7cb9b642 100644 --- a/src/nitro/communication/messages/parser/user/access/index.ts +++ b/src/nitro/communication/messages/parser/user/access/index.ts @@ -1,2 +1 @@ -export * from './UserPerksParser'; export * from './UserPermissionsParser'; From 74f000a466b9ac4cdae7b0e3ad3addbee6cd0034 Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 26 Nov 2021 15:03:56 -0600 Subject: [PATCH 092/108] replace perk event --- src/nitro/communication/NitroMessages.ts | 6 ++++-- .../incoming/user/access/UserPerksEvent.ts | 16 ---------------- .../messages/incoming/user/access/index.ts | 1 - 3 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 src/nitro/communication/messages/incoming/user/access/UserPerksEvent.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index fd037c1f..5f187854 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -110,6 +110,7 @@ import { NotificationDialogMessageEvent } from './messages/incoming/notification import { PetLevelNotificationEvent } from './messages/incoming/notifications/PetLevelNotificationEvent'; import { PetPlacingErrorEvent } from './messages/incoming/notifications/PetPlacingErrorEvent'; import { UnseenItemsEvent } from './messages/incoming/notifications/UnseenItemsEvent'; +import { PerkAllowancesMessageEvent } from './messages/incoming/perk'; import { CommunityGoalEarnedPrizesMessageEvent } from './messages/incoming/quest/CommunityGoalEarnedPrizesMessageEvent'; import { CommunityGoalHallOfFameMessageEvent } from './messages/incoming/quest/CommunityGoalHallOfFameMessageEvent'; import { CommunityGoalProgressMessageEvent } from './messages/incoming/quest/CommunityGoalProgressMessageEvent'; @@ -204,7 +205,6 @@ import { WiredRewardResultMessageEvent } from './messages/incoming/roomevents/Wi import { WiredSaveSuccessEvent } from './messages/incoming/roomevents/WiredSaveSuccessEvent'; import { WiredValidationErrorEvent } from './messages/incoming/roomevents/WiredValidationErrorEvent'; import { AuthenticatedEvent } from './messages/incoming/security/AuthenticatedEvent'; -import { UserPerksEvent } from './messages/incoming/user/access/UserPerksEvent'; import { UserPermissionsEvent } from './messages/incoming/user/access/UserPermissionsEvent'; import { RelationshipStatusInfoEvent } from './messages/incoming/user/data/RelationshipStatusInfoEvent'; import { UserCurrentBadgesEvent } from './messages/incoming/user/data/UserCurrentBadgesEvent'; @@ -699,6 +699,9 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.BOT_ERROR, BotErrorEvent); this._events.set(IncomingHeader.PET_LEVEL_NOTIFICATION, PetLevelNotificationEvent); + // PERK + this._events.set(IncomingHeader.USER_PERKS, PerkAllowancesMessageEvent); + // POLL this._events.set(IncomingHeader.QUESTION, QuestionEvent); this._events.set(IncomingHeader.POLL_CONTENTS, PollContentsEvent); @@ -827,7 +830,6 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.USER_IGNORED, IgnoredUsersEvent); this._events.set(IncomingHeader.USER_IGNORED_RESULT, IgnoreResultEvent); this._events.set(IncomingHeader.USER_RESPECT, RespectReceivedEvent); - this._events.set(IncomingHeader.USER_PERKS, UserPerksEvent); this._events.set(IncomingHeader.USER_PERMISSIONS, UserPermissionsEvent); this._events.set(IncomingHeader.USER_BADGES_CURRENT, UserCurrentBadgesEvent); this._events.set(IncomingHeader.USER_INFO, UserInfoEvent); diff --git a/src/nitro/communication/messages/incoming/user/access/UserPerksEvent.ts b/src/nitro/communication/messages/incoming/user/access/UserPerksEvent.ts deleted file mode 100644 index b51a14a3..00000000 --- a/src/nitro/communication/messages/incoming/user/access/UserPerksEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { UserPerksParser } from '../../../parser/user/access/UserPerksParser'; - -export class UserPerksEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, UserPerksParser); - } - - public getParser(): UserPerksParser - { - return this.parser as UserPerksParser; - } -} diff --git a/src/nitro/communication/messages/incoming/user/access/index.ts b/src/nitro/communication/messages/incoming/user/access/index.ts index 00006559..51901c37 100644 --- a/src/nitro/communication/messages/incoming/user/access/index.ts +++ b/src/nitro/communication/messages/incoming/user/access/index.ts @@ -1,2 +1 @@ -export * from './UserPerksEvent'; export * from './UserPermissionsEvent'; From 2c4fac898bd865a64963fc9d5f26ea8fe2f004ed Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Fri, 26 Nov 2021 18:15:46 -0300 Subject: [PATCH 093/108] Fix PerkData --- .../parser/perk/PerkAllowancesMessageParser.ts | 4 ++-- .../messages/parser/perk/common/PerkData.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts b/src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts index 9c5c7c8e..916b6201 100644 --- a/src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts +++ b/src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts @@ -22,8 +22,8 @@ export class PerkAllowancesMessageParser implements IMessageParser for(let i = 0; i < size; i++) this._perks.push(new PerkData( wrapper.readString(), - wrapper.readBoolean(), - wrapper.readString() + wrapper.readString(), + wrapper.readBoolean() )); return true; diff --git a/src/nitro/communication/messages/parser/perk/common/PerkData.ts b/src/nitro/communication/messages/parser/perk/common/PerkData.ts index df206fc8..61ef5427 100644 --- a/src/nitro/communication/messages/parser/perk/common/PerkData.ts +++ b/src/nitro/communication/messages/parser/perk/common/PerkData.ts @@ -1,14 +1,14 @@ export class PerkData { private _code: string; - private _isAllowed: boolean; private _errorMessage: string; + private _isAllowed: boolean; - constructor(code: string, isAllowed: boolean, errorMessage: string) + constructor(code: string, errorMessage: string, isAllowed: boolean) { this._code = code; - this._isAllowed = isAllowed; this._errorMessage = errorMessage; + this._isAllowed = isAllowed; } public get code(): string @@ -16,13 +16,13 @@ export class PerkData return this._code; } - public get isAllowed(): boolean - { - return this._isAllowed; - } - public get errorMessage(): string { return this._errorMessage; } + + public get isAllowed(): boolean + { + return this._isAllowed; + } } From 25e97e712807ae326f40debeebac17aa5322ac2e Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 26 Nov 2021 15:39:30 -0600 Subject: [PATCH 094/108] registered help headers --- src/nitro/communication/NitroMessages.ts | 19 ++++++++++++++++++- .../messages/incoming/IncomingHeader.ts | 19 ++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 5f187854..58d2c615 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CancelMarketplaceOfferMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideSessionCreateMessageComposer, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionOnDutyUpdateMessageComposer, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionResolvedMessageComposer, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, RedeemMarketplaceOfferCreditsMessageComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CancelMarketplaceOfferMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideOnDutyStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionCreateMessageComposer, GuideSessionDetachedMessageEvent, GuideSessionEndedMessageEvent, GuideSessionErrorMessageEvent, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInvitedToGuideRoomMessageEvent, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionMessageMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionPartnerIsTypingMessageEvent, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer, GuideSessionStartedMessageEvent, GuideTicketCreationResultMessageEvent, GuideTicketResolutionMessageEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelMergeNameChangeEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, IssueCloseNotificationMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, QuizDataMessageEvent, QuizResultsMessageEvent, RedeemMarketplaceOfferCreditsMessageComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -601,6 +601,23 @@ export class NitroMessages implements IMessageConfiguration // HELP this._events.set(IncomingHeader.CFH_DISABLED_NOTIFY, CallForHelpDisabledNotifyMessageEvent); this._events.set(IncomingHeader.CFH_RESULT_MESSAGE, CallForHelpResultMessageEvent); + //this._events.set(IncomingHeader.CALL_FOR_HELP_PENDING_CALLS, ); + this._events.set(IncomingHeader.GUIDE_ON_DUTY_STATUS, GuideOnDutyStatusMessageEvent); + this._events.set(IncomingHeader.GUIDE_SESSION_ATTACHED, GuideSessionAttachedMessageEvent); + this._events.set(IncomingHeader.GUIDE_SESSION_DETACHED, GuideSessionDetachedMessageEvent); + this._events.set(IncomingHeader.GUIDE_SESSION_ENDED, GuideSessionEndedMessageEvent); + this._events.set(IncomingHeader.GUIDE_SESSION_ERROR, GuideSessionErrorMessageEvent); + this._events.set(IncomingHeader.GUIDE_SESSION_INVITED_TO_GUIDE_ROOM, GuideSessionInvitedToGuideRoomMessageEvent); + this._events.set(IncomingHeader.GUIDE_SESSION_MESSAGE, GuideSessionMessageMessageEvent); + this._events.set(IncomingHeader.GUIDE_SESSION_PARTNER_IS_TYPING, GuideSessionPartnerIsTypingMessageEvent); + this._events.set(IncomingHeader.GUIDE_SESSION_REQUESTER_ROOM, GuideSessionRequesterRoomMessageEvent); + this._events.set(IncomingHeader.GUIDE_SESSION_STARTED, GuideSessionStartedMessageEvent); + this._events.set(IncomingHeader.GUIDE_TICKET_CREATION_RESULT, GuideTicketCreationResultMessageEvent); + this._events.set(IncomingHeader.GUIDE_TICKET_RESOLUTION, GuideTicketResolutionMessageEvent); + this._events.set(IncomingHeader.HOTEL_MERGE_NAME_CHANGE, HotelMergeNameChangeEvent); + this._events.set(IncomingHeader.ISSUE_CLOSE_NOTIFICATION, IssueCloseNotificationMessageEvent); + this._events.set(IncomingHeader.QUIZ_DATA, QuizDataMessageEvent); + this._events.set(IncomingHeader.QUIZ_RESULTS, QuizResultsMessageEvent); // INVENTORY this._events.set(IncomingHeader.ACHIEVEMENT_PROGRESSED, AchievementEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 4393bb58..91d58511 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -14,7 +14,7 @@ export class IncomingHeader public static PRODUCT_OFFER = 3388; public static LIMITED_SOLD_OUT = 377; public static CATALOG_PUBLISHED = 1866; - public static CFH_RESULT_MESSAGE = 934; + public static CFH_RESULT_MESSAGE = 3635; public static CLIENT_LATENCY = 10; public static CLIENT_PING = 3928; public static DESKTOP_CAMPAIGN = 1745; @@ -337,4 +337,21 @@ export class IncomingHeader public static POLL_OFFER = 3785; public static QUESTION_ANSWERED = 2589; public static QUESTION_FINISHED = 1066; + public static CALL_FOR_HELP_PENDING_CALLS = 1121; + public static GUIDE_ON_DUTY_STATUS = 1548; + public static GUIDE_SESSION_ATTACHED = 1591; + public static GUIDE_SESSION_DETACHED = 138; + public static GUIDE_SESSION_ENDED = 1456; + public static GUIDE_SESSION_ERROR = 673; + public static GUIDE_SESSION_INVITED_TO_GUIDE_ROOM = 219; + public static GUIDE_SESSION_MESSAGE = 841; + public static GUIDE_SESSION_PARTNER_IS_TYPING = 1016; + public static GUIDE_SESSION_REQUESTER_ROOM = 1847; + public static GUIDE_SESSION_STARTED = 3209; + public static GUIDE_TICKET_CREATION_RESULT = 3285; + public static GUIDE_TICKET_RESOLUTION = 2674; + public static HOTEL_MERGE_NAME_CHANGE = 1663; + public static ISSUE_CLOSE_NOTIFICATION = 934; + public static QUIZ_DATA = 2927; + public static QUIZ_RESULTS = 2772; } From 8e3ec85eb2ea2038c72ebe27fbc4d20f99884c0c Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 26 Nov 2021 18:44:27 -0600 Subject: [PATCH 095/108] add more cfh packets --- src/nitro/communication/NitroMessages.ts | 6 ++- .../messages/incoming/IncomingHeader.ts | 4 +- ...lForHelpPendingCallsDeletedMessageEvent.ts | 16 +++++++ .../CallForHelpPendingCallsMessageEvent.ts | 16 +++++++ .../help/CallForHelpReplyMessageEvent.ts | 16 +++++++ .../messages/incoming/help/index.ts | 3 ++ ...ForHelpPendingCallsDeletedMessageParser.ts | 15 ++++++ .../CallForHelpPendingCallsMessageParser.ts | 47 +++++++++++++++++++ .../help/CallForHelpReplyMessageParser.ts | 24 ++++++++++ .../messages/parser/help/index.ts | 3 ++ 10 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/help/CallForHelpPendingCallsDeletedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/CallForHelpPendingCallsMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/CallForHelpReplyMessageEvent.ts create mode 100644 src/nitro/communication/messages/parser/help/CallForHelpPendingCallsDeletedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/CallForHelpPendingCallsMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/CallForHelpReplyMessageParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 58d2c615..afd1ec20 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CancelMarketplaceOfferMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideOnDutyStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionCreateMessageComposer, GuideSessionDetachedMessageEvent, GuideSessionEndedMessageEvent, GuideSessionErrorMessageEvent, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInvitedToGuideRoomMessageEvent, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionMessageMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionPartnerIsTypingMessageEvent, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer, GuideSessionStartedMessageEvent, GuideTicketCreationResultMessageEvent, GuideTicketResolutionMessageEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelMergeNameChangeEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, IssueCloseNotificationMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, QuizDataMessageEvent, QuizResultsMessageEvent, RedeemMarketplaceOfferCreditsMessageComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CallForHelpPendingCallsDeletedMessageEvent, CallForHelpPendingCallsMessageEvent, CallForHelpReplyMessageEvent, CancelMarketplaceOfferMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideOnDutyStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionCreateMessageComposer, GuideSessionDetachedMessageEvent, GuideSessionEndedMessageEvent, GuideSessionErrorMessageEvent, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInvitedToGuideRoomMessageEvent, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionMessageMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionPartnerIsTypingMessageEvent, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer, GuideSessionStartedMessageEvent, GuideTicketCreationResultMessageEvent, GuideTicketResolutionMessageEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelMergeNameChangeEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, IssueCloseNotificationMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, QuizDataMessageEvent, QuizResultsMessageEvent, RedeemMarketplaceOfferCreditsMessageComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -600,8 +600,10 @@ export class NitroMessages implements IMessageConfiguration // HELP this._events.set(IncomingHeader.CFH_DISABLED_NOTIFY, CallForHelpDisabledNotifyMessageEvent); + this._events.set(IncomingHeader.CFH_PENDING_CALLS_DELETED, CallForHelpPendingCallsDeletedMessageEvent); + this._events.set(IncomingHeader.CFH_PENDING_CALLS, CallForHelpPendingCallsMessageEvent); + this._events.set(IncomingHeader.CFH_REPLY, CallForHelpReplyMessageEvent); this._events.set(IncomingHeader.CFH_RESULT_MESSAGE, CallForHelpResultMessageEvent); - //this._events.set(IncomingHeader.CALL_FOR_HELP_PENDING_CALLS, ); this._events.set(IncomingHeader.GUIDE_ON_DUTY_STATUS, GuideOnDutyStatusMessageEvent); this._events.set(IncomingHeader.GUIDE_SESSION_ATTACHED, GuideSessionAttachedMessageEvent); this._events.set(IncomingHeader.GUIDE_SESSION_DETACHED, GuideSessionDetachedMessageEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 91d58511..3f3bdfdb 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -337,7 +337,7 @@ export class IncomingHeader public static POLL_OFFER = 3785; public static QUESTION_ANSWERED = 2589; public static QUESTION_FINISHED = 1066; - public static CALL_FOR_HELP_PENDING_CALLS = 1121; + public static CFH_PENDING_CALLS = 1121; public static GUIDE_ON_DUTY_STATUS = 1548; public static GUIDE_SESSION_ATTACHED = 1591; public static GUIDE_SESSION_DETACHED = 138; @@ -354,4 +354,6 @@ export class IncomingHeader public static ISSUE_CLOSE_NOTIFICATION = 934; public static QUIZ_DATA = 2927; public static QUIZ_RESULTS = 2772; + public static CFH_PENDING_CALLS_DELETED = 77; + public static CFH_REPLY = 3796; } diff --git a/src/nitro/communication/messages/incoming/help/CallForHelpPendingCallsDeletedMessageEvent.ts b/src/nitro/communication/messages/incoming/help/CallForHelpPendingCallsDeletedMessageEvent.ts new file mode 100644 index 00000000..c0b823bf --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/CallForHelpPendingCallsDeletedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CallForHelpPendingCallsDeletedMessageParser } from '../../parser/help/CallForHelpPendingCallsDeletedMessageParser'; + +export class CallForHelpPendingCallsDeletedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CallForHelpPendingCallsDeletedMessageParser); + } + + public getParser(): CallForHelpPendingCallsDeletedMessageParser + { + return this.parser as CallForHelpPendingCallsDeletedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/CallForHelpPendingCallsMessageEvent.ts b/src/nitro/communication/messages/incoming/help/CallForHelpPendingCallsMessageEvent.ts new file mode 100644 index 00000000..00fa3dc8 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/CallForHelpPendingCallsMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CallForHelpPendingCallsMessageParser } from '../../parser/help/CallForHelpPendingCallsMessageParser'; + +export class CallForHelpPendingCallsMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CallForHelpPendingCallsMessageParser); + } + + public getParser(): CallForHelpPendingCallsMessageParser + { + return this.parser as CallForHelpPendingCallsMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/CallForHelpReplyMessageEvent.ts b/src/nitro/communication/messages/incoming/help/CallForHelpReplyMessageEvent.ts new file mode 100644 index 00000000..a4c1aa5a --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/CallForHelpReplyMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CallForHelpReplyMessageParser } from '../../parser/help/CallForHelpReplyMessageParser'; + +export class CallForHelpReplyMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CallForHelpReplyMessageParser); + } + + public getParser(): CallForHelpReplyMessageParser + { + return this.parser as CallForHelpReplyMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/index.ts b/src/nitro/communication/messages/incoming/help/index.ts index 26d0848d..435acbad 100644 --- a/src/nitro/communication/messages/incoming/help/index.ts +++ b/src/nitro/communication/messages/incoming/help/index.ts @@ -1,4 +1,7 @@ export * from './CallForHelpDisabledNotifyMessageEvent'; +export * from './CallForHelpPendingCallsDeletedMessageEvent'; +export * from './CallForHelpPendingCallsMessageEvent'; +export * from './CallForHelpReplyMessageEvent'; export * from './CallForHelpResultMessageEvent'; export * from './GuideOnDutyStatusMessageEvent'; export * from './GuideSessionAttachedMessageEvent'; diff --git a/src/nitro/communication/messages/parser/help/CallForHelpPendingCallsDeletedMessageParser.ts b/src/nitro/communication/messages/parser/help/CallForHelpPendingCallsDeletedMessageParser.ts new file mode 100644 index 00000000..37458cf6 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/CallForHelpPendingCallsDeletedMessageParser.ts @@ -0,0 +1,15 @@ +import { IMessageDataWrapper } from '../../../../../core'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class CallForHelpPendingCallsDeletedMessageParser implements IMessageParser +{ + flush(): boolean + { + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + return true; + } +} diff --git a/src/nitro/communication/messages/parser/help/CallForHelpPendingCallsMessageParser.ts b/src/nitro/communication/messages/parser/help/CallForHelpPendingCallsMessageParser.ts new file mode 100644 index 00000000..02ed3bbe --- /dev/null +++ b/src/nitro/communication/messages/parser/help/CallForHelpPendingCallsMessageParser.ts @@ -0,0 +1,47 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class CallForHelpPendingCallsMessageParser implements IMessageParser +{ + private _calls: ICall[]; + + flush(): boolean + { + this._calls = []; + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._calls = []; + + const count = wrapper.readInt(); + + for(let i = 0; i < count; i++) + { + const callId = wrapper.readString(); + const timestamp = wrapper.readString(); + const message = wrapper.readString(); + + this._calls.push({ callId: callId, timeStamp: timestamp, message: message }); + } + return true; + } + + public get pendingCalls(): ICall[] + { + return this._calls; + } + + public get count(): number + { + return this._calls.length; + } +} + +export interface ICall +{ + callId: string; + timeStamp: string; + message: string; +} diff --git a/src/nitro/communication/messages/parser/help/CallForHelpReplyMessageParser.ts b/src/nitro/communication/messages/parser/help/CallForHelpReplyMessageParser.ts new file mode 100644 index 00000000..f91d3013 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/CallForHelpReplyMessageParser.ts @@ -0,0 +1,24 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class CallForHelpReplyMessageParser implements IMessageParser +{ + private _message: string; + + flush(): boolean + { + this._message = null; + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._message = wrapper.readString(); + return true; + } + + public get message(): string + { + return this._message; + } +} diff --git a/src/nitro/communication/messages/parser/help/index.ts b/src/nitro/communication/messages/parser/help/index.ts index b0e077ee..b1933702 100644 --- a/src/nitro/communication/messages/parser/help/index.ts +++ b/src/nitro/communication/messages/parser/help/index.ts @@ -1,4 +1,7 @@ export * from './CallForHelpDisabledNotifyMessageParser'; +export * from './CallForHelpPendingCallsDeletedMessageParser'; +export * from './CallForHelpPendingCallsMessageParser'; +export * from './CallForHelpReplyMessageParser'; export * from './CallForHelpResultMessageParser'; export * from './GuideOnDutyStatusMessageParser'; export * from './GuideReportingStatusMessageParser'; From 7cd825209bb3d046b2f332865f90075c111e6d7a Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 26 Nov 2021 19:21:39 -0600 Subject: [PATCH 096/108] added chat review packets --- src/nitro/communication/NitroMessages.ts | 7 ++- .../messages/incoming/IncomingHeader.ts | 5 ++ .../ChatReviewSessionDetachedMessageEvent.ts | 16 +++++++ ...ReviewSessionOfferedToGuideMessageEvent.ts | 16 +++++++ .../ChatReviewSessionResultsMessageEvent.ts | 16 +++++++ .../ChatReviewSessionStartedMessageEvent.ts | 16 +++++++ ...atReviewSessionVotingStatusMessageEvent.ts | 16 +++++++ .../messages/incoming/help/index.ts | 5 ++ .../ChatReviewSessionDetachedMessageParser.ts | 16 +++++++ ...eviewSessionOfferedToGuideMessageParser.ts | 24 ++++++++++ .../ChatReviewSessionResultsMessageParser.ts | 48 +++++++++++++++++++ .../ChatReviewSessionStartedMessageParser.ts | 30 ++++++++++++ ...tReviewSessionVotingStatusMessageParser.ts | 39 +++++++++++++++ .../messages/parser/help/index.ts | 5 ++ 14 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/incoming/help/ChatReviewSessionDetachedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/ChatReviewSessionOfferedToGuideMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/ChatReviewSessionResultsMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/ChatReviewSessionStartedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/ChatReviewSessionVotingStatusMessageEvent.ts create mode 100644 src/nitro/communication/messages/parser/help/ChatReviewSessionDetachedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/ChatReviewSessionOfferedToGuideMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/ChatReviewSessionResultsMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/ChatReviewSessionStartedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/ChatReviewSessionVotingStatusMessageParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index afd1ec20..d1be3b09 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CallForHelpPendingCallsDeletedMessageEvent, CallForHelpPendingCallsMessageEvent, CallForHelpReplyMessageEvent, CancelMarketplaceOfferMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideOnDutyStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionCreateMessageComposer, GuideSessionDetachedMessageEvent, GuideSessionEndedMessageEvent, GuideSessionErrorMessageEvent, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInvitedToGuideRoomMessageEvent, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionMessageMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionPartnerIsTypingMessageEvent, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer, GuideSessionStartedMessageEvent, GuideTicketCreationResultMessageEvent, GuideTicketResolutionMessageEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelMergeNameChangeEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, IssueCloseNotificationMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, QuizDataMessageEvent, QuizResultsMessageEvent, RedeemMarketplaceOfferCreditsMessageComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CallForHelpPendingCallsDeletedMessageEvent, CallForHelpPendingCallsMessageEvent, CallForHelpReplyMessageEvent, CancelMarketplaceOfferMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, ChatReviewSessionDetachedMessageEvent, ChatReviewSessionOfferedToGuideMessageEvent, ChatReviewSessionResultsMessageEvent, ChatReviewSessionStartedMessageEvent, ChatReviewSessionVotingStatusMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideOnDutyStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionCreateMessageComposer, GuideSessionDetachedMessageEvent, GuideSessionEndedMessageEvent, GuideSessionErrorMessageEvent, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInvitedToGuideRoomMessageEvent, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionMessageMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionPartnerIsTypingMessageEvent, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer, GuideSessionStartedMessageEvent, GuideTicketCreationResultMessageEvent, GuideTicketResolutionMessageEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelMergeNameChangeEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, IssueCloseNotificationMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, QuizDataMessageEvent, QuizResultsMessageEvent, RedeemMarketplaceOfferCreditsMessageComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -620,6 +620,11 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.ISSUE_CLOSE_NOTIFICATION, IssueCloseNotificationMessageEvent); this._events.set(IncomingHeader.QUIZ_DATA, QuizDataMessageEvent); this._events.set(IncomingHeader.QUIZ_RESULTS, QuizResultsMessageEvent); + this._events.set(IncomingHeader.CHAT_REVIEW_SESSION_DETACHED, ChatReviewSessionDetachedMessageEvent); + this._events.set(IncomingHeader.CHAT_REVIEW_SESSION_OFFERED_TO_GUIDE, ChatReviewSessionOfferedToGuideMessageEvent); + this._events.set(IncomingHeader.CHAT_REVIEW_SESSION_RESULTS, ChatReviewSessionResultsMessageEvent); + this._events.set(IncomingHeader.CHAT_REVIEW_SESSION_STARTED, ChatReviewSessionStartedMessageEvent); + this._events.set(IncomingHeader.CHAT_REVIEW_SESSION_VOTING_STATUS, ChatReviewSessionVotingStatusMessageEvent); // INVENTORY this._events.set(IncomingHeader.ACHIEVEMENT_PROGRESSED, AchievementEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 3f3bdfdb..ebe5a227 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -356,4 +356,9 @@ export class IncomingHeader public static QUIZ_RESULTS = 2772; public static CFH_PENDING_CALLS_DELETED = 77; public static CFH_REPLY = 3796; + public static CHAT_REVIEW_SESSION_DETACHED = 30; + public static CHAT_REVIEW_SESSION_OFFERED_TO_GUIDE = 735; + public static CHAT_REVIEW_SESSION_RESULTS = 3276; + public static CHAT_REVIEW_SESSION_STARTED = 143; + public static CHAT_REVIEW_SESSION_VOTING_STATUS = 1829; } diff --git a/src/nitro/communication/messages/incoming/help/ChatReviewSessionDetachedMessageEvent.ts b/src/nitro/communication/messages/incoming/help/ChatReviewSessionDetachedMessageEvent.ts new file mode 100644 index 00000000..a1a835c2 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/ChatReviewSessionDetachedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ChatReviewSessionDetachedMessageParser } from '../../parser/help/ChatReviewSessionDetachedMessageParser'; + +export class ChatReviewSessionDetachedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ChatReviewSessionDetachedMessageParser); + } + + public getParser(): ChatReviewSessionDetachedMessageParser + { + return this.parser as ChatReviewSessionDetachedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/ChatReviewSessionOfferedToGuideMessageEvent.ts b/src/nitro/communication/messages/incoming/help/ChatReviewSessionOfferedToGuideMessageEvent.ts new file mode 100644 index 00000000..c695498b --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/ChatReviewSessionOfferedToGuideMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ChatReviewSessionOfferedToGuideMessageParser } from '../../parser/help/ChatReviewSessionOfferedToGuideMessageParser'; + +export class ChatReviewSessionOfferedToGuideMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ChatReviewSessionOfferedToGuideMessageParser); + } + + public getParser(): ChatReviewSessionOfferedToGuideMessageParser + { + return this.parser as ChatReviewSessionOfferedToGuideMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/ChatReviewSessionResultsMessageEvent.ts b/src/nitro/communication/messages/incoming/help/ChatReviewSessionResultsMessageEvent.ts new file mode 100644 index 00000000..75b50343 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/ChatReviewSessionResultsMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ChatReviewSessionResultsMessageParser } from '../../parser/help/ChatReviewSessionResultsMessageParser'; + +export class ChatReviewSessionResultsMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ChatReviewSessionResultsMessageParser); + } + + public getParser(): ChatReviewSessionResultsMessageParser + { + return this.parser as ChatReviewSessionResultsMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/ChatReviewSessionStartedMessageEvent.ts b/src/nitro/communication/messages/incoming/help/ChatReviewSessionStartedMessageEvent.ts new file mode 100644 index 00000000..acb47b5f --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/ChatReviewSessionStartedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ChatReviewSessionStartedMessageParser } from '../../parser/help/ChatReviewSessionStartedMessageParser'; + +export class ChatReviewSessionStartedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ChatReviewSessionStartedMessageParser); + } + + public getParser(): ChatReviewSessionStartedMessageParser + { + return this.parser as ChatReviewSessionStartedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/ChatReviewSessionVotingStatusMessageEvent.ts b/src/nitro/communication/messages/incoming/help/ChatReviewSessionVotingStatusMessageEvent.ts new file mode 100644 index 00000000..34471608 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/ChatReviewSessionVotingStatusMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ChatReviewSessionVotingStatusMessageParser } from '../../parser/help/ChatReviewSessionVotingStatusMessageParser'; + +export class ChatReviewSessionVotingStatusMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ChatReviewSessionVotingStatusMessageParser); + } + + public getParser(): ChatReviewSessionVotingStatusMessageParser + { + return this.parser as ChatReviewSessionVotingStatusMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/index.ts b/src/nitro/communication/messages/incoming/help/index.ts index 435acbad..0c0dc829 100644 --- a/src/nitro/communication/messages/incoming/help/index.ts +++ b/src/nitro/communication/messages/incoming/help/index.ts @@ -3,6 +3,11 @@ export * from './CallForHelpPendingCallsDeletedMessageEvent'; export * from './CallForHelpPendingCallsMessageEvent'; export * from './CallForHelpReplyMessageEvent'; export * from './CallForHelpResultMessageEvent'; +export * from './ChatReviewSessionDetachedMessageEvent'; +export * from './ChatReviewSessionOfferedToGuideMessageEvent'; +export * from './ChatReviewSessionResultsMessageEvent'; +export * from './ChatReviewSessionStartedMessageEvent'; +export * from './ChatReviewSessionVotingStatusMessageEvent'; export * from './GuideOnDutyStatusMessageEvent'; export * from './GuideSessionAttachedMessageEvent'; export * from './GuideSessionDetachedMessageEvent'; diff --git a/src/nitro/communication/messages/parser/help/ChatReviewSessionDetachedMessageParser.ts b/src/nitro/communication/messages/parser/help/ChatReviewSessionDetachedMessageParser.ts new file mode 100644 index 00000000..074f36f2 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/ChatReviewSessionDetachedMessageParser.ts @@ -0,0 +1,16 @@ +import { IMessageDataWrapper } from '../../../../../core'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class ChatReviewSessionDetachedMessageParser implements IMessageParser +{ + flush(): boolean + { + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + return true; + } + +} diff --git a/src/nitro/communication/messages/parser/help/ChatReviewSessionOfferedToGuideMessageParser.ts b/src/nitro/communication/messages/parser/help/ChatReviewSessionOfferedToGuideMessageParser.ts new file mode 100644 index 00000000..be90de76 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/ChatReviewSessionOfferedToGuideMessageParser.ts @@ -0,0 +1,24 @@ +import { IMessageDataWrapper } from '../../../../../core'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class ChatReviewSessionOfferedToGuideMessageParser implements IMessageParser +{ + private _acceptanceTimeout: number; + + flush(): boolean + { + this._acceptanceTimeout = -1; + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._acceptanceTimeout = wrapper.readInt(); + return true; + } + + public get acceptanceTimeout(): number + { + return this._acceptanceTimeout; + } +} diff --git a/src/nitro/communication/messages/parser/help/ChatReviewSessionResultsMessageParser.ts b/src/nitro/communication/messages/parser/help/ChatReviewSessionResultsMessageParser.ts new file mode 100644 index 00000000..19518b9f --- /dev/null +++ b/src/nitro/communication/messages/parser/help/ChatReviewSessionResultsMessageParser.ts @@ -0,0 +1,48 @@ +import { IMessageDataWrapper } from '../../../../../core'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class ChatReviewSessionResultsMessageParser implements IMessageParser +{ + private _winningVoteCode: number; + private _ownVoteCode: number; + private _finalStatus: number[]; + + flush(): boolean + { + this._winningVoteCode = -1; + this._ownVoteCode = -1; + this._finalStatus = null; + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._finalStatus = []; + this._winningVoteCode = wrapper.readInt(); + this._ownVoteCode = wrapper.readInt(); + const count = wrapper.readInt(); + + for(let i = 0; i < count; i++) + { + this._finalStatus.push(wrapper.readInt()); + } + + return true; + } + + public get winningVoteCode(): number + { + return this._winningVoteCode; + } + + public get ownVoteCode(): number + { + return this._ownVoteCode; + } + + public get finalStatus(): number[] + { + return this._finalStatus; + } + +} diff --git a/src/nitro/communication/messages/parser/help/ChatReviewSessionStartedMessageParser.ts b/src/nitro/communication/messages/parser/help/ChatReviewSessionStartedMessageParser.ts new file mode 100644 index 00000000..ba7411d6 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/ChatReviewSessionStartedMessageParser.ts @@ -0,0 +1,30 @@ +import { IMessageDataWrapper } from '../../../../../core'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class ChatReviewSessionStartedMessageParser implements IMessageParser +{ + private _votingTimeout: number; + private _chatRecord: string; + + flush(): boolean + { + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._votingTimeout = wrapper.readInt(); + this._chatRecord = wrapper.readString(); + return true; + } + + public get votingTimeout(): number + { + return this._votingTimeout; + } + + public get chatRecord(): string + { + return this._chatRecord; + } +} diff --git a/src/nitro/communication/messages/parser/help/ChatReviewSessionVotingStatusMessageParser.ts b/src/nitro/communication/messages/parser/help/ChatReviewSessionVotingStatusMessageParser.ts new file mode 100644 index 00000000..e853d60e --- /dev/null +++ b/src/nitro/communication/messages/parser/help/ChatReviewSessionVotingStatusMessageParser.ts @@ -0,0 +1,39 @@ +import { IMessageDataWrapper } from '../../../../../core'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class ChatReviewSessionVotingStatusMessageParser implements IMessageParser +{ + public static readonly AWAITING_VOTE = 0; + public static readonly VOTED_OK = 1; + public static readonly VOTED_BAD = 2; + public static readonly VOTED_VERY_BAD = 3; + public static readonly NO_VOTE = 4; + public static readonly FINDING_NEW_VOTER = 5; + + private _status:number[]; + + flush(): boolean + { + this._status = null; + return true; + } + + parse(wrapper: IMessageDataWrapper): boolean + { + this._status = []; + + const count = wrapper.readInt(); + + for(let i = 0; i < count; i++) + { + this._status.push(wrapper.readInt()); + } + + return true; + } + + public get status(): number[] + { + return this._status; + } +} diff --git a/src/nitro/communication/messages/parser/help/index.ts b/src/nitro/communication/messages/parser/help/index.ts index b1933702..114865fa 100644 --- a/src/nitro/communication/messages/parser/help/index.ts +++ b/src/nitro/communication/messages/parser/help/index.ts @@ -3,6 +3,11 @@ export * from './CallForHelpPendingCallsDeletedMessageParser'; export * from './CallForHelpPendingCallsMessageParser'; export * from './CallForHelpReplyMessageParser'; export * from './CallForHelpResultMessageParser'; +export * from './ChatReviewSessionDetachedMessageParser'; +export * from './ChatReviewSessionOfferedToGuideMessageParser'; +export * from './ChatReviewSessionResultsMessageParser'; +export * from './ChatReviewSessionStartedMessageParser'; +export * from './ChatReviewSessionVotingStatusMessageParser'; export * from './GuideOnDutyStatusMessageParser'; export * from './GuideReportingStatusMessageParser'; export * from './GuideSessionAttachedMessageParser'; From 98a080257b368168035247b3cea32264949856c3 Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 26 Nov 2021 19:45:53 -0600 Subject: [PATCH 097/108] organize handshake packets --- src/nitro/communication/NitroMessages.ts | 30 +++++++++++-------- .../demo/NitroCommunicationDemo.ts | 16 +++++----- .../messages/outgoing/OutgoingHeader.ts | 1 + .../messages/outgoing/client/index.ts | 2 -- .../ClientHelloMessageComposer.ts} | 4 +-- .../handshake/DisconnectMessageComposer.ts | 21 +++++++++++++ ...oser.ts => InfoRetrieveMessageComposer.ts} | 6 ++-- .../PongMessageComposer.ts} | 6 ++-- ...omposer.ts => SSOTicketMessageComposer.ts} | 6 ++-- .../handshake/UniqueIDMessageComposer.ts | 21 +++++++++++++ .../handshake/VersionCheckMessageComposer.ts | 21 +++++++++++++ .../messages/outgoing/handshake/index.ts | 9 ++++-- 12 files changed, 107 insertions(+), 36 deletions(-) delete mode 100644 src/nitro/communication/messages/outgoing/client/index.ts rename src/nitro/communication/messages/outgoing/{client/ClientReleaseVersionComposer.ts => handshake/ClientHelloMessageComposer.ts} (77%) create mode 100644 src/nitro/communication/messages/outgoing/handshake/DisconnectMessageComposer.ts rename src/nitro/communication/messages/outgoing/handshake/{InfoRetrieveBaseMessageComposer.ts => InfoRetrieveMessageComposer.ts} (56%) rename src/nitro/communication/messages/outgoing/{client/ClientPongComposer.ts => handshake/PongMessageComposer.ts} (60%) rename src/nitro/communication/messages/outgoing/handshake/{SecurityTicketComposer.ts => SSOTicketMessageComposer.ts} (61%) create mode 100644 src/nitro/communication/messages/outgoing/handshake/UniqueIDMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/handshake/VersionCheckMessageComposer.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index d1be3b09..d4683dca 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -248,8 +248,6 @@ import { PurchaseFromCatalogComposer } from './messages/outgoing/catalog/Purchas import { RedeemVoucherMessageComposer } from './messages/outgoing/catalog/RedeemVoucherMessageComposer'; import { RoomAdPurchaseInitiatedComposer } from './messages/outgoing/catalog/RoomAdPurchaseInitiatedComposer'; import { SelectClubGiftComposer } from './messages/outgoing/catalog/SelectClubGiftComposer'; -import { ClientPongComposer } from './messages/outgoing/client/ClientPongComposer'; -import { ClientReleaseVersionComposer } from './messages/outgoing/client/ClientReleaseVersionComposer'; import { ForwardToACompetitionRoomMessageComposer } from './messages/outgoing/competition/ForwardToACompetitionRoomMessageComposer'; import { GetIsUserPartOfCompetitionMessageComposer } from './messages/outgoing/competition/GetIsUserPartOfCompetitionMessageComposer'; import { CraftComposer } from './messages/outgoing/crafting/CraftComposer'; @@ -293,8 +291,13 @@ import { GroupSaveInformationComposer } from './messages/outgoing/group/GroupSav import { GroupSavePreferencesComposer } from './messages/outgoing/group/GroupSavePreferencesComposer'; import { GroupSettingsComposer } from './messages/outgoing/group/GroupSettingsComposer'; import { AuthenticationMessageComposer } from './messages/outgoing/handshake/AuthenticationMessageComposer'; -import { InfoRetrieveBaseMessageComposer } from './messages/outgoing/handshake/InfoRetrieveBaseMessageComposer'; -import { SecurityTicketComposer } from './messages/outgoing/handshake/SecurityTicketComposer'; +import { ClientHelloMessageComposer } from './messages/outgoing/handshake/ClientHelloMessageComposer'; +import { DisconnectMessageComposer } from './messages/outgoing/handshake/DisconnectMessageComposer'; +import { InfoRetrieveMessageComposer } from './messages/outgoing/handshake/InfoRetrieveMessageComposer'; +import { PongMessageComposer } from './messages/outgoing/handshake/PongMessageComposer'; +import { SSOTicketMessageComposer } from './messages/outgoing/handshake/SSOTicketMessageComposer'; +import { UniqueIDMessageComposer } from './messages/outgoing/handshake/UniqueIDMessageComposer'; +import { VersionCheckMessageComposer } from './messages/outgoing/handshake/VersionCheckMessageComposer'; import { RequestBadgesComposer } from './messages/outgoing/inventory/badges/RequestBadgesComposer'; import { SetActivatedBadgesComposer } from './messages/outgoing/inventory/badges/SetActivatedBadgesComposer'; import { GetBotInventoryComposer } from './messages/outgoing/inventory/bots/GetBotInventoryComposer'; @@ -997,6 +1000,15 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.UPDATE_FORUM_SETTINGS, UpdateForumSettingsMessageComposer); this._composers.set(OutgoingHeader.FORUM_UPDATE_THREAD, UpdateThreadMessageComposer); + // HANDSHAKE + this._composers.set(OutgoingHeader.CLIENT_PONG, PongMessageComposer); + this._composers.set(OutgoingHeader.RELEASE_VERSION, ClientHelloMessageComposer); + this._composers.set(OutgoingHeader.SECURITY_TICKET, SSOTicketMessageComposer); + this._composers.set(OutgoingHeader.USER_INFO, InfoRetrieveMessageComposer); + this._composers.set(OutgoingHeader.DISCONNECT, DisconnectMessageComposer); + this._composers.set(OutgoingHeader.SECURITY_MACHINE, UniqueIDMessageComposer); + this._composers.set(OutgoingHeader.CLIENT_VARIABLES, VersionCheckMessageComposer); + // HELP this._composers.set(OutgoingHeader.CALL_FOR_HELP_FROM_FORUM_MESSAGE, CallForHelpFromForumMessageMessageComposer); this._composers.set(OutgoingHeader.CALL_FOR_HELP_FROM_FORUM_THREAD, CallForHelpFromForumThreadMessageComposer); @@ -1029,10 +1041,6 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.POST_QUIZ_ANSWERS, PostQuizAnswersComposer); this._composers.set(OutgoingHeader.SEARCH_FAQS, SearchFaqsMessageComposer); - // CLIENT - this._composers.set(OutgoingHeader.CLIENT_PONG, ClientPongComposer); - this._composers.set(OutgoingHeader.RELEASE_VERSION, ClientReleaseVersionComposer); - // DESKTOP this._composers.set(OutgoingHeader.DESKTOP_VIEW, DesktopViewComposer); @@ -1058,10 +1066,6 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.GROUP_FAVORITE, GroupFavoriteComposer); this._composers.set(OutgoingHeader.GROUP_BADGES, GroupBadgesComposer); - // SECURITY - this._composers.set(OutgoingHeader.SECURITY_TICKET, SecurityTicketComposer); - this._composers.set(OutgoingHeader.USER_INFO, InfoRetrieveBaseMessageComposer); - // NAVIGATOR this._composers.set(OutgoingHeader.NAVIGATOR_CATEGORIES, NavigatorCategoriesComposer); this._composers.set(OutgoingHeader.NAVIGATOR_INIT, NavigatorInitComposer); @@ -1288,7 +1292,7 @@ export class NitroMessages implements IMessageConfiguration // SUBSCRIPTION this._composers.set(OutgoingHeader.USER_SUBSCRIPTION, UserSubscriptionComposer); - // MODTOOL + // MODERATION this._composers.set(OutgoingHeader.MODTOOL_REQUEST_ROOM_INFO, GetModeratorRoomInfoMessageComposer); this._composers.set(OutgoingHeader.MODTOOL_CHANGE_ROOM_SETTINGS, ModerateRoomMessageComposer); this._composers.set(OutgoingHeader.MODTOOL_REQUEST_USER_CHATLOG, GetUserChatlogMessageComposer); diff --git a/src/nitro/communication/demo/NitroCommunicationDemo.ts b/src/nitro/communication/demo/NitroCommunicationDemo.ts index e61307f2..a67dae46 100644 --- a/src/nitro/communication/demo/NitroCommunicationDemo.ts +++ b/src/nitro/communication/demo/NitroCommunicationDemo.ts @@ -6,10 +6,10 @@ import { Nitro } from '../../Nitro'; import { INitroCommunicationManager } from '../INitroCommunicationManager'; import { ClientPingEvent } from '../messages/incoming/client/ClientPingEvent'; import { AuthenticatedEvent } from '../messages/incoming/security/AuthenticatedEvent'; -import { ClientPongComposer } from '../messages/outgoing/client/ClientPongComposer'; -import { ClientReleaseVersionComposer } from '../messages/outgoing/client/ClientReleaseVersionComposer'; -import { InfoRetrieveBaseMessageComposer } from '../messages/outgoing/handshake/InfoRetrieveBaseMessageComposer'; -import { SecurityTicketComposer } from '../messages/outgoing/handshake/SecurityTicketComposer'; +import { ClientHelloMessageComposer } from '../messages/outgoing/handshake/ClientHelloMessageComposer'; +import { InfoRetrieveMessageComposer } from '../messages/outgoing/handshake/InfoRetrieveMessageComposer'; +import { PongMessageComposer } from '../messages/outgoing/handshake/PongMessageComposer'; +import { SSOTicketMessageComposer } from '../messages/outgoing/handshake/SSOTicketMessageComposer'; import { NitroCommunicationDemoEvent } from './NitroCommunicationDemoEvent'; export class NitroCommunicationDemo extends NitroManager @@ -88,7 +88,7 @@ export class NitroCommunicationDemo extends NitroManager this.startHandshake(connection); - connection.send(new ClientReleaseVersionComposer(null, null, null, null)); + connection.send(new ClientHelloMessageComposer(null, null, null, null)); this.tryAuthentication(connection); } @@ -129,7 +129,7 @@ export class NitroCommunicationDemo extends NitroManager return; } - connection.send(new SecurityTicketComposer(this._sso, Nitro.instance.time)); + connection.send(new SSOTicketMessageComposer(this._sso, Nitro.instance.time)); } private onClientPingEvent(event: ClientPingEvent): void @@ -149,7 +149,7 @@ export class NitroCommunicationDemo extends NitroManager //event.connection.send(new UserHomeRoomComposer(555)); - event.connection.send(new InfoRetrieveBaseMessageComposer()); + event.connection.send(new InfoRetrieveMessageComposer()); } public setSSO(sso: string): void @@ -195,7 +195,7 @@ export class NitroCommunicationDemo extends NitroManager if(!connection) return; - connection.send(new ClientPongComposer()); + connection.send(new PongMessageComposer()); } private dispatchCommunicationDemoEvent(type: string, connection: IConnection): void diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 88781222..583bad0e 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -376,4 +376,5 @@ export class OutgoingHeader public static POLL_ANSWER = 3505; public static POLL_REJECT = 1773; public static POLL_START = 109; + public static DISCONNECT = 2445; } diff --git a/src/nitro/communication/messages/outgoing/client/index.ts b/src/nitro/communication/messages/outgoing/client/index.ts deleted file mode 100644 index 87f344d5..00000000 --- a/src/nitro/communication/messages/outgoing/client/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './ClientPongComposer'; -export * from './ClientReleaseVersionComposer'; diff --git a/src/nitro/communication/messages/outgoing/client/ClientReleaseVersionComposer.ts b/src/nitro/communication/messages/outgoing/handshake/ClientHelloMessageComposer.ts similarity index 77% rename from src/nitro/communication/messages/outgoing/client/ClientReleaseVersionComposer.ts rename to src/nitro/communication/messages/outgoing/handshake/ClientHelloMessageComposer.ts index af2d8a33..775075bc 100644 --- a/src/nitro/communication/messages/outgoing/client/ClientReleaseVersionComposer.ts +++ b/src/nitro/communication/messages/outgoing/handshake/ClientHelloMessageComposer.ts @@ -3,9 +3,9 @@ import { ClientDeviceCategoryEnum } from '../../../../../core/communication/conn import { ClientPlatformEnum } from '../../../../../core/communication/connections/enums/ClientPlatformEnum'; import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class ClientReleaseVersionComposer implements IMessageComposer> +export class ClientHelloMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(releaseVersion: string, type: string, platform: number, category: number) { diff --git a/src/nitro/communication/messages/outgoing/handshake/DisconnectMessageComposer.ts b/src/nitro/communication/messages/outgoing/handshake/DisconnectMessageComposer.ts new file mode 100644 index 00000000..d7e43d36 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/handshake/DisconnectMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../..'; + +export class DisconnectMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/handshake/InfoRetrieveBaseMessageComposer.ts b/src/nitro/communication/messages/outgoing/handshake/InfoRetrieveMessageComposer.ts similarity index 56% rename from src/nitro/communication/messages/outgoing/handshake/InfoRetrieveBaseMessageComposer.ts rename to src/nitro/communication/messages/outgoing/handshake/InfoRetrieveMessageComposer.ts index 1a133511..36f72e1c 100644 --- a/src/nitro/communication/messages/outgoing/handshake/InfoRetrieveBaseMessageComposer.ts +++ b/src/nitro/communication/messages/outgoing/handshake/InfoRetrieveMessageComposer.ts @@ -1,8 +1,8 @@ import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; -export class InfoRetrieveBaseMessageComposer implements IMessageComposer> +export class InfoRetrieveMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor() { @@ -18,4 +18,4 @@ export class InfoRetrieveBaseMessageComposer implements IMessageComposer> +export class PongMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor() { @@ -18,4 +18,4 @@ export class ClientPongComposer implements IMessageComposer> +export class SSOTicketMessageComposer implements IMessageComposer> { - private _data: ConstructorParameters; + private _data: ConstructorParameters; constructor(ticket: string, time: number) { @@ -18,4 +18,4 @@ export class SecurityTicketComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(machineId:string, fingerprint:string, flashVersion:string) + { + this._data = [ machineId, fingerprint, flashVersion ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/handshake/VersionCheckMessageComposer.ts b/src/nitro/communication/messages/outgoing/handshake/VersionCheckMessageComposer.ts new file mode 100644 index 00000000..12076b26 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/handshake/VersionCheckMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../..'; + +export class VersionCheckMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(clientID:number, clientURL:string, externalVariablesURL:string) + { + this._data = [clientID, clientURL, externalVariablesURL]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/handshake/index.ts b/src/nitro/communication/messages/outgoing/handshake/index.ts index d4f561a0..f8b54484 100644 --- a/src/nitro/communication/messages/outgoing/handshake/index.ts +++ b/src/nitro/communication/messages/outgoing/handshake/index.ts @@ -1,3 +1,8 @@ export * from './AuthenticationMessageComposer'; -export * from './InfoRetrieveBaseMessageComposer'; -export * from './SecurityTicketComposer'; +export * from './ClientHelloMessageComposer'; +export * from './DisconnectMessageComposer'; +export * from './InfoRetrieveMessageComposer'; +export * from './PongMessageComposer'; +export * from './SSOTicketMessageComposer'; +export * from './UniqueIDMessageComposer'; +export * from './VersionCheckMessageComposer'; From 890acc487dce774c52dfd779532b4cf4f4e35bc8 Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 26 Nov 2021 20:15:05 -0600 Subject: [PATCH 098/108] misssed this --- src/nitro/communication/messages/outgoing/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index f44efee4..184a9a9c 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -3,7 +3,6 @@ export * from './avatar'; export * from './camera'; export * from './campaign'; export * from './catalog'; -export * from './client'; export * from './competition'; export * from './desktop'; export * from './friendfurni'; From f442456e167895541e20350731666dc12cff96b3 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sat, 27 Nov 2021 00:04:39 -0300 Subject: [PATCH 099/108] Updates --- .../help/GuideReportingStatusMessageEvent.ts | 16 ++++++++++++++++ .../parser/perk/PerkAllowancesMessageParser.ts | 16 ++++++++++++++++ .../messages/parser/perk/common/PerkEnum.ts | 15 +++++++++++++++ .../messages/parser/perk/common/index.ts | 2 ++ .../communication/messages/parser/perk/index.ts | 1 + 5 files changed, 50 insertions(+) create mode 100644 src/nitro/communication/messages/incoming/help/GuideReportingStatusMessageEvent.ts create mode 100644 src/nitro/communication/messages/parser/perk/common/PerkEnum.ts create mode 100644 src/nitro/communication/messages/parser/perk/common/index.ts diff --git a/src/nitro/communication/messages/incoming/help/GuideReportingStatusMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideReportingStatusMessageEvent.ts new file mode 100644 index 00000000..72a89fd3 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideReportingStatusMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideReportingStatusMessageParser } from './../../parser/help/GuideReportingStatusMessageParser'; + +export class GuideReportingStatusMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideReportingStatusMessageParser); + } + + public getParser(): GuideReportingStatusMessageParser + { + return this.parser as GuideReportingStatusMessageParser; + } +} diff --git a/src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts b/src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts index 916b6201..b1b41cd8 100644 --- a/src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts +++ b/src/nitro/communication/messages/parser/perk/PerkAllowancesMessageParser.ts @@ -29,6 +29,22 @@ export class PerkAllowancesMessageParser implements IMessageParser return true; } + public isAllowed(perkCode: string): boolean + { + let allowed = false; + + for(const perk of this._perks) + { + if(perk.code === perkCode) + { + allowed = perk.isAllowed; + break; + } + } + + return allowed; + } + public get perks(): PerkData[] { return this._perks; diff --git a/src/nitro/communication/messages/parser/perk/common/PerkEnum.ts b/src/nitro/communication/messages/parser/perk/common/PerkEnum.ts new file mode 100644 index 00000000..454eee9e --- /dev/null +++ b/src/nitro/communication/messages/parser/perk/common/PerkEnum.ts @@ -0,0 +1,15 @@ +export class PerkEnum +{ + public static USE_GUIDE_TOOL: string = 'USE_GUIDE_TOOL'; + public static GIVE_GUIDE_TOUR: string = 'GIVE_GUIDE_TOUR'; + public static JUDGE_CHAT_REVIEWS: string = 'JUDGE_CHAT_REVIEWS'; + public static VOTE_IN_COMPETITIONS: string = 'VOTE_IN_COMPETITIONS'; + public static CALL_ON_HELPERS: string = 'CALL_ON_HELPERS'; + public static CITIZEN: string = 'CITIZEN'; + public static TRADE: string = 'TRADE'; + public static HEIGHTMAP_EDITOR_BETA: string = 'HEIGHTMAP_EDITOR_BETA'; + public static BUILDER_AT_WORK: string = 'BUILDER_AT_WORK'; + public static NAVIGATOR_ROOM_THUMBNAIL_CAMERA: string = 'NAVIGATOR_ROOM_THUMBNAIL_CAMERA'; + public static CAMERA: string = 'CAMERA'; + public static MOUSE_ZOOM: string = 'MOUSE_ZOOM'; +} diff --git a/src/nitro/communication/messages/parser/perk/common/index.ts b/src/nitro/communication/messages/parser/perk/common/index.ts new file mode 100644 index 00000000..a6170730 --- /dev/null +++ b/src/nitro/communication/messages/parser/perk/common/index.ts @@ -0,0 +1,2 @@ +export * from './PerkData'; +export * from './PerkEnum'; diff --git a/src/nitro/communication/messages/parser/perk/index.ts b/src/nitro/communication/messages/parser/perk/index.ts index a513d8fe..598feef8 100644 --- a/src/nitro/communication/messages/parser/perk/index.ts +++ b/src/nitro/communication/messages/parser/perk/index.ts @@ -1 +1,2 @@ +export * from './common'; export * from './PerkAllowancesMessageParser'; From 5699a46fbd6331780663c7960b3d16b57d839a50 Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 26 Nov 2021 21:08:29 -0600 Subject: [PATCH 100/108] register header for GuideReportingStatusMessageEvent --- src/nitro/communication/messages/incoming/IncomingHeader.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index ebe5a227..9531f201 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -350,6 +350,7 @@ export class IncomingHeader public static GUIDE_SESSION_STARTED = 3209; public static GUIDE_TICKET_CREATION_RESULT = 3285; public static GUIDE_TICKET_RESOLUTION = 2674; + public static GUIDE_REPORTING_STATUS = 3463; public static HOTEL_MERGE_NAME_CHANGE = 1663; public static ISSUE_CLOSE_NOTIFICATION = 934; public static QUIZ_DATA = 2927; From 3361a9b98eff8d47dbd4bd0a42f504331df6801a Mon Sep 17 00:00:00 2001 From: dank074 Date: Fri, 26 Nov 2021 21:08:42 -0600 Subject: [PATCH 101/108] missed --- src/nitro/communication/NitroMessages.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index d4683dca..be8931e8 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -51,6 +51,7 @@ import { GroupPurchasedEvent } from './messages/incoming/group/GroupPurchasedEve import { GroupSettingsEvent } from './messages/incoming/group/GroupSettingsEvent'; import { CallForHelpDisabledNotifyMessageEvent } from './messages/incoming/help/CallForHelpDisabledNotifyMessageEvent'; import { CallForHelpResultMessageEvent } from './messages/incoming/help/CallForHelpResultMessageEvent'; +import { GuideReportingStatusMessageEvent } from './messages/incoming/help/GuideReportingStatusMessageEvent'; import { IncomingHeader } from './messages/incoming/IncomingHeader'; import { AchievementEvent } from './messages/incoming/inventory/achievements/AchievementEvent'; import { AchievementsEvent } from './messages/incoming/inventory/achievements/AchievementsEvent'; @@ -619,6 +620,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.GUIDE_SESSION_STARTED, GuideSessionStartedMessageEvent); this._events.set(IncomingHeader.GUIDE_TICKET_CREATION_RESULT, GuideTicketCreationResultMessageEvent); this._events.set(IncomingHeader.GUIDE_TICKET_RESOLUTION, GuideTicketResolutionMessageEvent); + this._events.set(IncomingHeader.GUIDE_REPORTING_STATUS, GuideReportingStatusMessageEvent); this._events.set(IncomingHeader.HOTEL_MERGE_NAME_CHANGE, HotelMergeNameChangeEvent); this._events.set(IncomingHeader.ISSUE_CLOSE_NOTIFICATION, IssueCloseNotificationMessageEvent); this._events.set(IncomingHeader.QUIZ_DATA, QuizDataMessageEvent); From 43fb43a2fa7e735655e3bf212840dd56965667ee Mon Sep 17 00:00:00 2001 From: dank074 Date: Sat, 4 Dec 2021 13:53:44 -0600 Subject: [PATCH 102/108] added srckickback packet --- src/nitro/communication/NitroMessages.ts | 3 +- .../messages/incoming/IncomingHeader.ts | 1 + .../messages/incoming/user/ScrKickbackData.ts | 72 +++++++++++++++++++ .../user/ScrSendKickbackInfoMessageEvent.ts | 16 +++++ .../messages/incoming/user/index.ts | 2 + .../user/ScrSendKickbackInfoMessageParser.ts | 24 +++++++ .../messages/parser/user/index.ts | 1 + 7 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/incoming/user/ScrKickbackData.ts create mode 100644 src/nitro/communication/messages/incoming/user/ScrSendKickbackInfoMessageEvent.ts create mode 100644 src/nitro/communication/messages/parser/user/ScrSendKickbackInfoMessageParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index be8931e8..a3fcc2d1 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CallForHelpPendingCallsDeletedMessageEvent, CallForHelpPendingCallsMessageEvent, CallForHelpReplyMessageEvent, CancelMarketplaceOfferMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, ChatReviewSessionDetachedMessageEvent, ChatReviewSessionOfferedToGuideMessageEvent, ChatReviewSessionResultsMessageEvent, ChatReviewSessionStartedMessageEvent, ChatReviewSessionVotingStatusMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideOnDutyStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionCreateMessageComposer, GuideSessionDetachedMessageEvent, GuideSessionEndedMessageEvent, GuideSessionErrorMessageEvent, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInvitedToGuideRoomMessageEvent, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionMessageMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionPartnerIsTypingMessageEvent, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer, GuideSessionStartedMessageEvent, GuideTicketCreationResultMessageEvent, GuideTicketResolutionMessageEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelMergeNameChangeEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, IssueCloseNotificationMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, QuizDataMessageEvent, QuizResultsMessageEvent, RedeemMarketplaceOfferCreditsMessageComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CallForHelpPendingCallsDeletedMessageEvent, CallForHelpPendingCallsMessageEvent, CallForHelpReplyMessageEvent, CancelMarketplaceOfferMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, ChatReviewSessionDetachedMessageEvent, ChatReviewSessionOfferedToGuideMessageEvent, ChatReviewSessionResultsMessageEvent, ChatReviewSessionStartedMessageEvent, ChatReviewSessionVotingStatusMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideOnDutyStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionCreateMessageComposer, GuideSessionDetachedMessageEvent, GuideSessionEndedMessageEvent, GuideSessionErrorMessageEvent, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInvitedToGuideRoomMessageEvent, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionMessageMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionPartnerIsTypingMessageEvent, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer, GuideSessionStartedMessageEvent, GuideTicketCreationResultMessageEvent, GuideTicketResolutionMessageEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelMergeNameChangeEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, IssueCloseNotificationMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, QuizDataMessageEvent, QuizResultsMessageEvent, RedeemMarketplaceOfferCreditsMessageComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, ScrSendKickbackInfoMessageEvent, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -871,6 +871,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.USER_CURRENCY, UserCurrencyEvent); this._events.set(IncomingHeader.USER_SUBSCRIPTION, UserSubscriptionEvent); this._events.set(IncomingHeader.USER_WARDROBE_PAGE, UserWardrobePageEvent); + this._events.set(IncomingHeader.SCR_SEND_KICKBACK_INFO, ScrSendKickbackInfoMessageEvent); this._events.set(IncomingHeader.GENERIC_ERROR, GenericErrorEvent); this._events.set(IncomingHeader.GROUP_LIST, GuildMembershipsMessageEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 9531f201..f610a346 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -362,4 +362,5 @@ export class IncomingHeader public static CHAT_REVIEW_SESSION_RESULTS = 3276; public static CHAT_REVIEW_SESSION_STARTED = 143; public static CHAT_REVIEW_SESSION_VOTING_STATUS = 1829; + public static SCR_SEND_KICKBACK_INFO = 3277; } diff --git a/src/nitro/communication/messages/incoming/user/ScrKickbackData.ts b/src/nitro/communication/messages/incoming/user/ScrKickbackData.ts new file mode 100644 index 00000000..b07f4a8e --- /dev/null +++ b/src/nitro/communication/messages/incoming/user/ScrKickbackData.ts @@ -0,0 +1,72 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; + +export class ScrKickbackData +{ + private _currentHcStreak:number; + private _firstSubscriptionDate:string; + private _kickbackPercentage:number; + private _totalCreditsMissed:number; + private _totalCreditsRewarded:number; + private _totalCreditsSpent:number; + private _creditRewardForStreakBonus:number; + private _creditRewardForMonthlySpent:number; + private _timeUntilPayday:number; + + constructor(k: IMessageDataWrapper) + { + this._currentHcStreak = k.readInt(); + this._firstSubscriptionDate = k.readString(); + this._kickbackPercentage = parseFloat(k.readString()); + this._totalCreditsMissed = k.readInt(); + this._totalCreditsRewarded = k.readInt(); + this._totalCreditsSpent = k.readInt(); + this._creditRewardForStreakBonus = k.readInt(); + this._creditRewardForMonthlySpent = k.readInt(); + this._timeUntilPayday = k.readInt(); + } + + public get currentHcStreak():number + { + return this._currentHcStreak; + } + + public get firstSubscriptionDate():string + { + return this._firstSubscriptionDate; + } + + public get kickbackPercentage():number + { + return this._kickbackPercentage; + } + + public get totalCreditsMissed():number + { + return this._totalCreditsMissed; + } + + public get totalCreditsRewarded():number + { + return this._totalCreditsRewarded; + } + + public get totalCreditsSpent():number + { + return this._totalCreditsSpent; + } + + public get creditRewardForStreakBonus():number + { + return this._creditRewardForStreakBonus; + } + + public get creditRewardForMonthlySpent():number + { + return this._creditRewardForMonthlySpent; + } + + public get timeUntilPayday():number + { + return this._timeUntilPayday; + } +} diff --git a/src/nitro/communication/messages/incoming/user/ScrSendKickbackInfoMessageEvent.ts b/src/nitro/communication/messages/incoming/user/ScrSendKickbackInfoMessageEvent.ts new file mode 100644 index 00000000..592e6cfd --- /dev/null +++ b/src/nitro/communication/messages/incoming/user/ScrSendKickbackInfoMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ScrSendKickbackInfoMessageParser } from '../../parser/user/ScrSendKickbackInfoMessageParser'; + +export class ScrSendKickbackInfoMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ScrSendKickbackInfoMessageParser); + } + + public getParser(): ScrSendKickbackInfoMessageParser + { + return this.parser as ScrSendKickbackInfoMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/user/index.ts b/src/nitro/communication/messages/incoming/user/index.ts index 45d305a6..dae0e1fb 100644 --- a/src/nitro/communication/messages/incoming/user/index.ts +++ b/src/nitro/communication/messages/incoming/user/index.ts @@ -7,4 +7,6 @@ export * from './IgnoreResultEvent'; export * from './InClientLinkEvent'; export * from './inventory'; export * from './RespectReceivedEvent'; +export * from './ScrKickbackData'; +export * from './ScrSendKickbackInfoMessageEvent'; export * from './wardrobe'; diff --git a/src/nitro/communication/messages/parser/user/ScrSendKickbackInfoMessageParser.ts b/src/nitro/communication/messages/parser/user/ScrSendKickbackInfoMessageParser.ts new file mode 100644 index 00000000..a2ebe93f --- /dev/null +++ b/src/nitro/communication/messages/parser/user/ScrSendKickbackInfoMessageParser.ts @@ -0,0 +1,24 @@ +import { IMessageDataWrapper } from '../../../../../core'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; +import { ScrKickbackData } from '../../incoming/user/ScrKickbackData'; + +export class ScrSendKickbackInfoMessageParser implements IMessageParser +{ + private _data: ScrKickbackData; + + flush(): boolean + { + this._data = null; + return true; + } + parse(wrapper: IMessageDataWrapper): boolean + { + this._data = new ScrKickbackData(wrapper); + return true; + } + + public get data():ScrKickbackData + { + return this._data; + } +} diff --git a/src/nitro/communication/messages/parser/user/index.ts b/src/nitro/communication/messages/parser/user/index.ts index 499282bb..8c1e2d8e 100644 --- a/src/nitro/communication/messages/parser/user/index.ts +++ b/src/nitro/communication/messages/parser/user/index.ts @@ -8,4 +8,5 @@ export * from './InClientLinkParser'; export * from './inventory'; export * from './RespectReceivedParser'; export * from './RoomEntryData'; +export * from './ScrSendKickbackInfoMessageParser'; export * from './wardrobe'; From c30dc9b04a9050a71aac89bf20959be3dade0ab4 Mon Sep 17 00:00:00 2001 From: dank074 Date: Sat, 4 Dec 2021 14:18:06 -0600 Subject: [PATCH 103/108] added srckickback composer --- src/nitro/communication/NitroMessages.ts | 3 ++- .../messages/outgoing/OutgoingHeader.ts | 1 + .../user/ScrGetKickbackInfoMessageComposer.ts | 21 +++++++++++++++++++ .../messages/outgoing/user/index.ts | 1 + 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/outgoing/user/ScrGetKickbackInfoMessageComposer.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index a3fcc2d1..abb29b13 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CallForHelpPendingCallsDeletedMessageEvent, CallForHelpPendingCallsMessageEvent, CallForHelpReplyMessageEvent, CancelMarketplaceOfferMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, ChatReviewSessionDetachedMessageEvent, ChatReviewSessionOfferedToGuideMessageEvent, ChatReviewSessionResultsMessageEvent, ChatReviewSessionStartedMessageEvent, ChatReviewSessionVotingStatusMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideOnDutyStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionCreateMessageComposer, GuideSessionDetachedMessageEvent, GuideSessionEndedMessageEvent, GuideSessionErrorMessageEvent, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInvitedToGuideRoomMessageEvent, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionMessageMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionPartnerIsTypingMessageEvent, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer, GuideSessionStartedMessageEvent, GuideTicketCreationResultMessageEvent, GuideTicketResolutionMessageEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelMergeNameChangeEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, IssueCloseNotificationMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, QuizDataMessageEvent, QuizResultsMessageEvent, RedeemMarketplaceOfferCreditsMessageComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, ScrSendKickbackInfoMessageEvent, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; +import { AchievementNotificationMessageEvent, ActivityPointNotificationMessageEvent, AddJukeboxDiskComposer, ApproveNameMessageComposer, ApproveNameMessageEvent, AvailabilityTimeMessageEvent, BadgePointLimitsEvent, BadgeReceivedEvent, BonusRareInfoMessageEvent, BuildersClubFurniCountMessageEvent, BuildersClubSubscriptionStatusMessageEvent, BundleDiscountRulesetMessageEvent, BuyMarketplaceOfferMessageComposer, BuyMarketplaceTokensMessageComposer, CallForHelpFromForumMessageMessageComposer, CallForHelpFromForumThreadMessageComposer, CallForHelpFromIMMessageComposer, CallForHelpFromPhotoMessageComposer, CallForHelpFromSelfieMessageComposer, CallForHelpMessageComposer, CallForHelpPendingCallsDeletedMessageEvent, CallForHelpPendingCallsMessageEvent, CallForHelpReplyMessageEvent, CancelMarketplaceOfferMessageComposer, ChangeUserNameMessageComposer, ChangeUserNameResultMessageEvent, ChatReviewGuideDecidesOnOfferMessageComposer, ChatReviewGuideDetachedMessageComposer, ChatReviewGuideVoteMessageComposer, ChatReviewSessionCreateMessageComposer, ChatReviewSessionDetachedMessageEvent, ChatReviewSessionOfferedToGuideMessageEvent, ChatReviewSessionResultsMessageEvent, ChatReviewSessionStartedMessageEvent, ChatReviewSessionVotingStatusMessageEvent, CheckUserNameMessageComposer, CheckUserNameResultMessageEvent, CloseIssueDefaultActionMessageComposer, CloseIssuesMessageComposer, ClubGiftNotificationEvent, ControlYoutubeDisplayPlaybackMessageComposer, DeletePendingCallsForHelpMessageComposer, DirectSMSClubBuyAvailableMessageEvent, FigureUpdateEvent, ForwardToASubmittableRoomMessageComposer, ForwardToRandomCompetitionRoomMessageComposer, FurnitureGroupInfoComposer, GetBonusRareInfoMessageComposer, GetCatalogPageExpirationComposer, GetCatalogPageWithEarliestExpiryComposer, GetCfhChatlogMessageComposer, GetCfhStatusMessageComposer, GetCurrentTimingCodeMessageComposer, GetDirectClubBuyAvailableComposer, GetFaqCategoryMessageComposer, GetFaqTextMessageComposer, GetForumsListMessageComposer, GetForumStatsMessageComposer, GetGiftMessageComposer, GetGuideReportingStatusMessageComposer, GetHabboBasicMembershipExtendOfferComposer, GetHabboClubExtendOfferMessageComposer, GetInterstitialMessageComposer, GetJukeboxPlayListMessageComposer, GetLimitedOfferAppearingNextComposer, GetMarketplaceConfigurationMessageComposer, GetMarketplaceItemStatsComposer, GetMarketplaceOffersMessageComposer, GetMarketplaceOwnOffersMessageComposer, GetMessagesMessageComposer, GetNextTargetedOfferComposer, GetNowPlayingMessageComposer, GetOfficialSongIdMessageComposer, GetPendingCallsForHelpMessageComposer, GetQuizQuestionsComposer, GetRoomAdPurchaseInfoComposer, GetSeasonalCalendarDailyOfferComposer, GetSecondsUntilMessageComposer, GetSongInfoMessageComposer, GetSoundMachinePlayListMessageComposer, GetThreadMessageComposer, GetThreadsMessageComposer, GetUnreadForumsCountMessageComposer, GetUserSongDisksMessageComposer, GetYoutubeDisplayStatusMessageComposer, GoToFlatMessageComposer, GroupBadgesComposer, GroupBadgesEvent, GuideOnDutyStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionCreateMessageComposer, GuideSessionDetachedMessageEvent, GuideSessionEndedMessageEvent, GuideSessionErrorMessageEvent, GuideSessionFeedbackMessageComposer, GuideSessionGetRequesterRoomMessageComposer, GuideSessionGuideDecidesMessageComposer, GuideSessionInvitedToGuideRoomMessageEvent, GuideSessionInviteRequesterMessageComposer, GuideSessionIsTypingMessageComposer, GuideSessionMessageMessageComposer, GuideSessionMessageMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionPartnerIsTypingMessageEvent, GuideSessionReportMessageComposer, GuideSessionRequesterCancelsMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer, GuideSessionStartedMessageEvent, GuideTicketCreationResultMessageEvent, GuideTicketResolutionMessageEvent, HabboClubExtendOfferMessageEvent, HotelClosedAndOpensEvent, HotelClosesAndWillOpenAtEvent, HotelMergeNameChangeEvent, HotelWillCloseInMinutesEvent, InfoFeedEnableMessageEvent, InterstitialMessageEvent, InterstitialShownMessageComposer, IsBadgeRequestFulfilledEvent, IsOfferGiftableMessageEvent, IssueCloseNotificationMessageEvent, JukeboxPlayListFullMessageEvent, JukeboxSongDisksMessageEvent, LimitedOfferAppearingNextMessageEvent, MaintenanceStatusMessageEvent, MarkCatalogNewAdditionsPageOpenedComposer, ModerateMessageMessageComposer, ModerateThreadMessageComposer, ModToolPreferencesComposer, ModToolSanctionComposer, MysteryBoxKeysEvent, NotEnoughBalanceMessageEvent, NowPlayingMessageEvent, OfficialSongIdMessageEvent, OpenCampaignCalendarDoorAsStaffComposer, OpenCampaignCalendarDoorComposer, PetExperienceEvent, PetMountComposer, PetSupplementComposer, PickIssuesMessageComposer, PlayListMessageEvent, PlayListSongAddedMessageEvent, PollAnswerComposer, PollContentsEvent, PollErrorEvent, PollOfferEvent, PollRejectComposer, PollStartComposer, PostMessageMessageComposer, PostQuizAnswersComposer, PurchaseBasicMembershipExtensionComposer, PurchaseRoomAdMessageComposer, PurchaseTargetedOfferComposer, PurchaseVipMembershipExtensionComposer, QuestionAnsweredEvent, QuestionEvent, QuestionFinishedEvent, QuizDataMessageEvent, QuizResultsMessageEvent, RedeemMarketplaceOfferCreditsMessageComposer, ReleaseIssuesMessageComposer, RemoveAllRightsMessageComposer, RemoveJukeboxDiskComposer, RemoveOwnRoomRightsRoomMessageComposer, RemovePetSaddleComposer, ResetPhoneNumberStateMessageComposer, RoomAdErrorEvent, RoomAdPurchaseInfoEvent, RoomCompetitionInitMessageComposer, RoomUnitGiveHandItemPetComposer, ScrGetKickbackInfoMessageComposer, ScrSendKickbackInfoMessageEvent, SearchFaqsMessageComposer, SeasonalCalendarDailyOfferMessageEvent, SellablePetPalettesMessageEvent, SetPhoneNumberVerificationStatusMessageComposer, SetTargetedOfferStateComposer, SetYoutubeDisplayPlaylistMessageComposer, ShopTargetedOfferViewedComposer, SubmitRoomToCompetitionMessageComposer, TalentTrackMessageEvent, TargetedOfferEvent, TargetedOfferNotFoundEvent, TogglePetBreedingComposer, TogglePetRidingComposer, TraxSongInfoMessageEvent, TryPhoneNumberMessageComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UpdateForumReadMarkerMessageComposer, UpdateForumSettingsMessageComposer, UpdateThreadMessageComposer, UsePetProductComposer, UserSongDisksInventoryMessageEvent, VerifyCodeMessageComposer, VoteForRoomMessageComposer, WardrobeMessageEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { BotAddedToInventoryEvent, BotInventoryMessageEvent, BotReceivedMessageEvent, BotRemovedFromInventoryEvent } from './messages/incoming/bots'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; @@ -1249,6 +1249,7 @@ export class NitroMessages implements IMessageConfiguration // USER this._composers.set(OutgoingHeader.APPROVE_NAME, ApproveNameMessageComposer); this._composers.set(OutgoingHeader.USER_RESPECT, UserRespectComposer); + this._composers.set(OutgoingHeader.SCR_GET_KICKBACK_INFO, ScrGetKickbackInfoMessageComposer); // DATA this._composers.set(OutgoingHeader.USER_IGNORED, GetIgnoredUsersComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 583bad0e..eab420ea 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -377,4 +377,5 @@ export class OutgoingHeader public static POLL_REJECT = 1773; public static POLL_START = 109; public static DISCONNECT = 2445; + public static SCR_GET_KICKBACK_INFO = 869; } diff --git a/src/nitro/communication/messages/outgoing/user/ScrGetKickbackInfoMessageComposer.ts b/src/nitro/communication/messages/outgoing/user/ScrGetKickbackInfoMessageComposer.ts new file mode 100644 index 00000000..ae9dd871 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/user/ScrGetKickbackInfoMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class ScrGetKickbackInfoMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/user/index.ts b/src/nitro/communication/messages/outgoing/user/index.ts index 763c3a2f..58328eda 100644 --- a/src/nitro/communication/messages/outgoing/user/index.ts +++ b/src/nitro/communication/messages/outgoing/user/index.ts @@ -2,5 +2,6 @@ export * from './ApproveNameMessageComposer'; export * from './CatalogGroupsComposer'; export * from './data'; export * from './inventory'; +export * from './ScrGetKickbackInfoMessageComposer'; export * from './settings'; export * from './UserRespectComposer'; From 69426ce0b512ac5d94aaf0f9b8b59ce91ef112ea Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 4 Dec 2021 15:38:38 -0500 Subject: [PATCH 104/108] Add doubles --- src/core/communication/codec/BinaryReader.ts | 11 ++++++++++- .../communication/codec/evawire/EvaWireDataWrapper.ts | 9 ++++++++- .../communication/messages/IMessageDataWrapper.ts | 3 ++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/core/communication/codec/BinaryReader.ts b/src/core/communication/codec/BinaryReader.ts index 6409eb82..0f7ab479 100644 --- a/src/core/communication/codec/BinaryReader.ts +++ b/src/core/communication/codec/BinaryReader.ts @@ -36,6 +36,15 @@ export class BinaryReader return short; } + public readDouble(): number + { + const double = this._dataView.getFloat64(this._position); + + this._position += 8; + + return double; + } + public readInt(): number { const int = this._dataView.getInt32(this._position); @@ -59,4 +68,4 @@ export class BinaryReader { return this._dataView.buffer; } -} \ No newline at end of file +} diff --git a/src/core/communication/codec/evawire/EvaWireDataWrapper.ts b/src/core/communication/codec/evawire/EvaWireDataWrapper.ts index c03c45e1..42e76c0f 100644 --- a/src/core/communication/codec/evawire/EvaWireDataWrapper.ts +++ b/src/core/communication/codec/evawire/EvaWireDataWrapper.ts @@ -38,6 +38,13 @@ export class EvaWireDataWrapper implements IMessageDataWrapper return this._buffer.readShort(); } + public readDouble(): number + { + if(!this._buffer) return -1; + + return this._buffer.readDouble(); + } + public readInt(): number { if(!this._buffer) return -1; @@ -62,4 +69,4 @@ export class EvaWireDataWrapper implements IMessageDataWrapper { return (this._buffer && (this._buffer.remaining() > 0)); } -} \ No newline at end of file +} diff --git a/src/core/communication/messages/IMessageDataWrapper.ts b/src/core/communication/messages/IMessageDataWrapper.ts index 0623d859..4a75eed9 100644 --- a/src/core/communication/messages/IMessageDataWrapper.ts +++ b/src/core/communication/messages/IMessageDataWrapper.ts @@ -6,8 +6,9 @@ export interface IMessageDataWrapper readBytes(length: number): BinaryReader; readBoolean(): boolean; readShort(): number; + readDouble(): number; readInt(): number; readString(): string; header: number; bytesAvailable: boolean; -} \ No newline at end of file +} From 90d8a83ee85bac7aaeeb7eaafa94970b5d80a87f Mon Sep 17 00:00:00 2001 From: dank074 Date: Sat, 4 Dec 2021 15:02:15 -0600 Subject: [PATCH 105/108] fixed double in srcdata --- .../communication/messages/incoming/user/ScrKickbackData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitro/communication/messages/incoming/user/ScrKickbackData.ts b/src/nitro/communication/messages/incoming/user/ScrKickbackData.ts index b07f4a8e..8464d85d 100644 --- a/src/nitro/communication/messages/incoming/user/ScrKickbackData.ts +++ b/src/nitro/communication/messages/incoming/user/ScrKickbackData.ts @@ -16,7 +16,7 @@ export class ScrKickbackData { this._currentHcStreak = k.readInt(); this._firstSubscriptionDate = k.readString(); - this._kickbackPercentage = parseFloat(k.readString()); + this._kickbackPercentage = k.readDouble(); this._totalCreditsMissed = k.readInt(); this._totalCreditsRewarded = k.readInt(); this._totalCreditsSpent = k.readInt(); From 486ad29450069c5bb4c0df9aa3a5ebcc54e96935 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 4 Dec 2021 18:15:22 -0500 Subject: [PATCH 106/108] Add readFloat --- src/core/communication/codec/BinaryReader.ts | 45 +++++++++++-------- .../codec/evawire/EvaWireDataWrapper.ts | 35 +++++++++------ .../messages/IMessageDataWrapper.ts | 3 +- 3 files changed, 50 insertions(+), 33 deletions(-) diff --git a/src/core/communication/codec/BinaryReader.ts b/src/core/communication/codec/BinaryReader.ts index 0f7ab479..4ff2b469 100644 --- a/src/core/communication/codec/BinaryReader.ts +++ b/src/core/communication/codec/BinaryReader.ts @@ -9,15 +9,6 @@ export class BinaryReader this._dataView = new DataView(buffer); } - public readByte(): number - { - const byte = this._dataView.getInt8(this._position); - - this._position++; - - return byte; - } - public readBytes(length: number): BinaryReader { const buffer = new BinaryReader(this._dataView.buffer.slice(this._position, this._position + length)); @@ -27,6 +18,15 @@ export class BinaryReader return buffer; } + public readByte(): number + { + const byte = this._dataView.getInt8(this._position); + + this._position++; + + return byte; + } + public readShort(): number { const short = this._dataView.getInt16(this._position); @@ -36,15 +36,6 @@ export class BinaryReader return short; } - public readDouble(): number - { - const double = this._dataView.getFloat64(this._position); - - this._position += 8; - - return double; - } - public readInt(): number { const int = this._dataView.getInt32(this._position); @@ -54,6 +45,24 @@ export class BinaryReader return int; } + public readFloat(): number + { + const float = this._dataView.getFloat32(this._position); + + this._position += 4; + + return float; + } + + public readDouble(): number + { + const double = this._dataView.getFloat64(this._position); + + this._position += 8; + + return double; + } + public remaining(): number { return this._dataView.byteLength - this._position; diff --git a/src/core/communication/codec/evawire/EvaWireDataWrapper.ts b/src/core/communication/codec/evawire/EvaWireDataWrapper.ts index 42e76c0f..50a7a68b 100644 --- a/src/core/communication/codec/evawire/EvaWireDataWrapper.ts +++ b/src/core/communication/codec/evawire/EvaWireDataWrapper.ts @@ -12,13 +12,6 @@ export class EvaWireDataWrapper implements IMessageDataWrapper this._buffer = buffer; } - public readByte(): number - { - if(!this._buffer) return -1; - - return this._buffer.readByte(); - } - public readBytes(length: number): BinaryReader { if(!this._buffer) return null; @@ -26,6 +19,13 @@ export class EvaWireDataWrapper implements IMessageDataWrapper return this._buffer.readBytes(length); } + public readByte(): number + { + if(!this._buffer) return -1; + + return this._buffer.readByte(); + } + public readBoolean(): boolean { return (this.readByte() === 1); @@ -38,13 +38,6 @@ export class EvaWireDataWrapper implements IMessageDataWrapper return this._buffer.readShort(); } - public readDouble(): number - { - if(!this._buffer) return -1; - - return this._buffer.readDouble(); - } - public readInt(): number { if(!this._buffer) return -1; @@ -52,6 +45,20 @@ export class EvaWireDataWrapper implements IMessageDataWrapper return this._buffer.readInt(); } + public readFloat(): number + { + if(!this._buffer) return -1; + + return this._buffer.readFloat(); + } + + public readDouble(): number + { + if(!this._buffer) return -1; + + return this._buffer.readDouble(); + } + public readString(): string { const length = this.readShort(); diff --git a/src/core/communication/messages/IMessageDataWrapper.ts b/src/core/communication/messages/IMessageDataWrapper.ts index 4a75eed9..87337b8a 100644 --- a/src/core/communication/messages/IMessageDataWrapper.ts +++ b/src/core/communication/messages/IMessageDataWrapper.ts @@ -6,8 +6,9 @@ export interface IMessageDataWrapper readBytes(length: number): BinaryReader; readBoolean(): boolean; readShort(): number; - readDouble(): number; readInt(): number; + readFloat(): number; + readDouble(): number; readString(): string; header: number; bytesAvailable: boolean; From 8a121225472d723264793c48c7aa57594f977f0f Mon Sep 17 00:00:00 2001 From: dank074 Date: Sun, 5 Dec 2021 19:44:56 -0600 Subject: [PATCH 107/108] listen for postmessage in external interface --- .../LegacyExternalInterface.ts | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/nitro/externalInterface/LegacyExternalInterface.ts b/src/nitro/externalInterface/LegacyExternalInterface.ts index 81bcade0..9dcc458d 100644 --- a/src/nitro/externalInterface/LegacyExternalInterface.ts +++ b/src/nitro/externalInterface/LegacyExternalInterface.ts @@ -39,8 +39,35 @@ declare global export class LegacyExternalInterface { + private static readonly MESSAGE_KEY = 'Nitro_LegacyExternalInterface'; + private static _isListeningForPostMessages = false; + + public static get available(): boolean { + if(!this._isListeningForPostMessages) + { + this._isListeningForPostMessages = true; + window.addEventListener('message', (ev) => + { + if(typeof ev.data !== 'string') return; + + if(ev.data.startsWith(LegacyExternalInterface.MESSAGE_KEY)) + { + const { method, params } = JSON.parse( + ev.data.substr(LegacyExternalInterface.MESSAGE_KEY.length) + ); + + const fn = (window as any)[method]; + if(!fn) return; + + fn(...params); + return; + } + + }); + } + return true; } @@ -51,7 +78,7 @@ export class LegacyExternalInterface { if(window.top !== window) { - window.top.postMessage('Nitro_LegacyExternalInterface' + JSON.stringify({ + window.top.postMessage(LegacyExternalInterface.MESSAGE_KEY + JSON.stringify({ method, params }), '*'); From 913aa27a9d8acf8ff55181604655b5b70657a247 Mon Sep 17 00:00:00 2001 From: dank074 Date: Tue, 7 Dec 2021 18:52:39 -0600 Subject: [PATCH 108/108] remove duplicate class --- .../parser/group/utils/GroupDataParser.ts | 91 ------------------- .../parser/user/data/UserProfileParser.ts | 8 +- 2 files changed, 4 insertions(+), 95 deletions(-) delete mode 100644 src/nitro/communication/messages/parser/group/utils/GroupDataParser.ts diff --git a/src/nitro/communication/messages/parser/group/utils/GroupDataParser.ts b/src/nitro/communication/messages/parser/group/utils/GroupDataParser.ts deleted file mode 100644 index 249d7406..00000000 --- a/src/nitro/communication/messages/parser/group/utils/GroupDataParser.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core'; - -export class GroupDataParser -{ - private _id: number; - private _title: string; - private _badge: string; - private _colorA: string; - private _colorB: string; - private _ownerOrFavorite: boolean; - private _ownerId: number; - private _hasForum: boolean; - - constructor(wrapper: IMessageDataWrapper) - { - if(!wrapper) throw new Error('invalid_wrapper'); - - this.flush(); - this.parse(wrapper); - } - - public flush(): boolean - { - this._id = 0; - this._title = null; - this._badge = null; - this._colorA = null; - this._colorB = null; - this._ownerOrFavorite = null; - this._ownerId = 0; - this._hasForum = false; - - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - if(!wrapper) return false; - - this._id = wrapper.readInt(); - this._title = wrapper.readString(); - this._badge = wrapper.readString(); - this._colorA = wrapper.readString(); - this._colorB = wrapper.readString(); - this._ownerOrFavorite = wrapper.readBoolean(); - this._ownerId = wrapper.readInt(); - this._hasForum = wrapper.readBoolean(); - - return true; - } - - public get id(): number - { - return this._id; - } - - public get title(): string - { - return this._title; - } - - public get badge(): string - { - return this._badge; - } - - public get colorA(): string - { - return this._colorA; - } - - public get colorB(): string - { - return this._colorB; - } - - public get ownerOrFavorite(): boolean - { - return this._ownerOrFavorite; - } - - public get ownerId(): number - { - return this._ownerId; - } - - public get hasForum(): boolean - { - return this._hasForum; - } -} diff --git a/src/nitro/communication/messages/parser/user/data/UserProfileParser.ts b/src/nitro/communication/messages/parser/user/data/UserProfileParser.ts index a0317d6f..5a0124ab 100644 --- a/src/nitro/communication/messages/parser/user/data/UserProfileParser.ts +++ b/src/nitro/communication/messages/parser/user/data/UserProfileParser.ts @@ -1,5 +1,5 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../../core'; -import { GroupDataParser } from '../../group/utils/GroupDataParser'; +import { HabboGroupEntryData } from '../HabboGroupEntryData'; export class UserProfileParser implements IMessageParser { @@ -13,7 +13,7 @@ export class UserProfileParser implements IMessageParser private _isMyFriend: boolean; private _requestSent: boolean; private _isOnline: boolean; - private _groups: GroupDataParser[]; + private _groups: HabboGroupEntryData[]; private _secondsSinceLastVisit: number; private _openProfileWindow: boolean; @@ -54,7 +54,7 @@ export class UserProfileParser implements IMessageParser for(let i = 0; i < groupsCount; i++) { - this._groups.push(new GroupDataParser(wrapper)); + this._groups.push(new HabboGroupEntryData(wrapper)); } this._secondsSinceLastVisit = wrapper.readInt(); @@ -113,7 +113,7 @@ export class UserProfileParser implements IMessageParser return this._isOnline; } - public get groups(): GroupDataParser[] + public get groups(): HabboGroupEntryData[] { return this._groups; }