Merge branch 'dev' into feature/badge-imager-louise2

This commit is contained in:
Bill 2021-09-06 02:56:30 -04:00
commit de0e1aecc6
5 changed files with 34 additions and 3 deletions

View File

@ -1,5 +1,5 @@
import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; 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 { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent';
import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp'; import { CfhSanctionMessageEvent, CfhTopicsInitEvent, SanctionStatusEvent } from './messages/incoming/callforhelp';
import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent'; import { CameraPublishStatusMessageEvent } from './messages/incoming/camera/CameraPublishStatusMessageEvent';
@ -781,6 +781,8 @@ export class NitroMessages implements IMessageConfiguration
// BADGES // BADGES
this._events.set(IncomingHeader.USER_BADGES, BadgesEvent); this._events.set(IncomingHeader.USER_BADGES, BadgesEvent);
this._events.set(IncomingHeader.USER_BADGES_ADD, BadgeReceivedEvent); 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 // ACCESS
this._events.set(IncomingHeader.USER_PERKS, UserPerksEvent); this._events.set(IncomingHeader.USER_PERKS, UserPerksEvent);

View File

@ -315,4 +315,6 @@ export class IncomingHeader
public static COMPETITION_USER_PART_OF = 3841; public static COMPETITION_USER_PART_OF = 3841;
public static COMPETITION_NO_OWNED_ROOMS = 2064; public static COMPETITION_NO_OWNED_ROOMS = 2064;
public static COMPETITION_SECONDS_UNTIL = 3926; public static COMPETITION_SECONDS_UNTIL = 3926;
public static BADGE_POINT_LIMITS = 2501;
public static BADGE_REQUEST_FULFILLED = 2998;
} }

View File

@ -1,6 +1,7 @@
import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent';
import { IsBadgeRequestFulfilledParser } from '../../../parser/inventory/badges/IsBadgeRequestFulfilledParser'; import { IsBadgeRequestFulfilledParser } from '../../../parser/inventory/badges/IsBadgeRequestFulfilledParser';
export class IsBadgeRequestFulfilledEvent extends MessageEvent implements IMessageEvent export class IsBadgeRequestFulfilledEvent extends MessageEvent implements IMessageEvent
{ {
constructor(callBack: Function) constructor(callBack: Function)

View File

@ -11,4 +11,6 @@ export interface INitroLocalizationManager extends INitroManager
registerParameter(key: string, parameter: string, value: string): void; registerParameter(key: string, parameter: string, value: string): void;
getBadgeName(key: string): string; getBadgeName(key: string): string;
getBadgeDesc(key: string): string; getBadgeDesc(key: string): string;
getBadgePointLimit(badge: string): number;
setBadgePointLimit(badge: string, point: number): void;
} }

View File

@ -8,6 +8,7 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca
{ {
private _definitions: Map<string, string>; private _definitions: Map<string, string>;
private _parameters: Map<string, Map<string, string>>; private _parameters: Map<string, Map<string, string>>;
private _badgePointLimits: Map<string, number>;
private _romanNumerals: string[]; private _romanNumerals: string[];
private _pendingUrls: string[]; private _pendingUrls: string[];
@ -17,6 +18,7 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca
this._definitions = new Map(); this._definitions = new Map();
this._parameters = 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._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 = []; this._pendingUrls = [];
} }
@ -84,6 +86,16 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca
return true; return true;
} }
public getBadgePointLimit(badge: string): number
{
return (this._badgePointLimits.get(badge) || -1);
}
public setBadgePointLimit(badge: string, point: number): void
{
this._badgePointLimits.set(badge, point);
}
public getRomanNumeral(number: number): string public getRomanNumeral(number: number): string
{ {
return this._romanNumerals[Math.max(0, (number - 1))]; 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 badge = new BadgeBaseAndLevel(key);
const keys = [ 'badge_name_' + key, 'badge_name_' + badge.base ]; 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 public getBadgeDesc(key: string): string
@ -271,7 +287,15 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca
const badge = new BadgeBaseAndLevel(key); const badge = new BadgeBaseAndLevel(key);
const keys = [ 'badge_desc_' + key, 'badge_desc_' + badge.base ]; 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));
const limit = this.getBadgePointLimit(key);
if(limit > -1) desc = desc.replace('%limit%', limit.toString());
desc = desc.replace('%roman%', this.getRomanNumeral(badge.level));
return desc;
} }
private getExistingKey(keys: string[]): string private getExistingKey(keys: string[]): string