commit
7a489dcee9
|
@ -5,4 +5,4 @@ export interface WindowSaveOptions {
|
|||
|
||||
export interface WindowSaveScreenOptions {
|
||||
[Key: string]: WindowSaveOptions;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ export const NitroCardView: FC<NitroCardViewProps> = props => {
|
|||
const observer = new ResizeObserver(event => {
|
||||
const screen = `${window.innerWidth}x${window.innerHeight}`;
|
||||
const newStorage = {...GetLocalStorage<Partial<WindowSaveScreenOptions>>(`nitro.windows.${uniqueKey}`)} as WindowSaveScreenOptions;
|
||||
newStorage[screen] = newStorage?.[screen] || {} as WindowSaveOptions;
|
||||
newStorage[screen] = newStorage?.[screen] || ({} as WindowSaveOptions);
|
||||
newStorage[screen].size = {width: element.offsetWidth, height: element.offsetHeight};
|
||||
SetLocalStorage<WindowSaveScreenOptions>(`nitro.windows.${uniqueKey}`, newStorage);
|
||||
});
|
||||
|
|
|
@ -143,7 +143,7 @@ export const DraggableWindow: FC<DraggableWindowProps> = props => {
|
|||
if (uniqueKey !== null) {
|
||||
const screen = `${window.innerWidth}x${window.innerHeight}`;
|
||||
const newStorage = {...GetLocalStorage<Partial<WindowSaveScreenOptions>>(`nitro.windows.${uniqueKey}`)} as WindowSaveScreenOptions;
|
||||
newStorage[screen] = newStorage?.[screen] || {} as WindowSaveOptions;
|
||||
newStorage[screen] = newStorage?.[screen] || ({} as WindowSaveOptions);
|
||||
newStorage[screen].offset = {x: offsetX, y: offsetY};
|
||||
SetLocalStorage<WindowSaveScreenOptions>(`nitro.windows.${uniqueKey}`, newStorage);
|
||||
}
|
||||
|
@ -252,7 +252,6 @@ export const DraggableWindow: FC<DraggableWindowProps> = props => {
|
|||
const localStorage = GetLocalStorage<WindowSaveScreenOptions>(`nitro.windows.${uniqueKey}`);
|
||||
const windowOptions = localStorage?.[screen] as WindowSaveOptions;
|
||||
|
||||
|
||||
if (!windowOptions || !windowOptions.offset) return;
|
||||
|
||||
setDelta({x: 0, y: 0});
|
||||
|
|
|
@ -18,8 +18,9 @@ export const ChatHistoryView: FC<{}> = props => {
|
|||
|
||||
let text = searchText.toLowerCase();
|
||||
|
||||
return sortedChatHistory
|
||||
.filter(entry => (entry.message && entry.message.toLowerCase().includes(text)) || (entry.name && entry.name.toLowerCase().includes(text)));
|
||||
return sortedChatHistory.filter(
|
||||
entry => (entry.message && entry.message.toLowerCase().includes(text)) || (entry.name && entry.name.toLowerCase().includes(text))
|
||||
);
|
||||
}, [chatHistory, searchText]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
@ -51,7 +51,8 @@ export const ChooserWidgetView: FC<ChooserWidgetViewProps> = props => {
|
|||
alignItems="center"
|
||||
className={classNames("rounded p-1", selectedItem === row && "bg-muted")}
|
||||
pointer
|
||||
onClick={event => setSelectedItem(row)}>
|
||||
onClick={event => setSelectedItem(row)}
|
||||
>
|
||||
<Text truncate>
|
||||
{row.name} {canSeeId && " - " + row.id}
|
||||
</Text>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import {FigureUpdateEvent, RoomUnitChatStyleComposer, UserInfoDataParser, UserInfoEvent, UserSettingsEvent} from "@nitro/renderer";
|
||||
import {useEffect, useState} from "react";
|
||||
import {useBetween} from "use-between";
|
||||
|
||||
import {GetLocalStorage, GetSessionDataManager, SendMessageComposer} from "../../api";
|
||||
import {useMessageEvent} from "../events";
|
||||
import {useLocalStorage} from "../useLocalStorage";
|
||||
|
|
|
@ -30,6 +30,7 @@ export interface IRoomSession extends IDisposable {
|
|||
sendPollStartMessage(pollId: number): void;
|
||||
sendPollRejectMessage(pollId: number): void;
|
||||
sendPollAnswerMessage(pollId: number, questionId: number, answers: string[]): void;
|
||||
votePoll(counter: number): void;
|
||||
sendPeerUsersClassificationMessage(userClassType: string): void;
|
||||
sendRoomUsersClassificationMessage(userClassType: string): void;
|
||||
updateMoodlightData(id: number, effectId: number, color: number, brightness: number, apply: boolean): void;
|
||||
|
|
|
@ -71,6 +71,7 @@ import {
|
|||
CallForHelpResultMessageEvent,
|
||||
CameraPublishStatusMessageEvent,
|
||||
CameraPurchaseOKMessageEvent,
|
||||
CameraSnapshotMessageEvent,
|
||||
CameraStorageUrlMessageEvent,
|
||||
CampaignCalendarDataMessageEvent,
|
||||
CampaignCalendarDoorOpenedMessageEvent,
|
||||
|
@ -108,6 +109,7 @@ import {
|
|||
ChatReviewSessionVotingStatusMessageEvent,
|
||||
CheckUserNameMessageComposer,
|
||||
CheckUserNameResultMessageEvent,
|
||||
CitizenshipVipOfferPromoEnabledEvent,
|
||||
ClientHelloMessageComposer,
|
||||
ClientPingEvent,
|
||||
CloseIssueDefaultActionMessageComposer,
|
||||
|
@ -129,6 +131,8 @@ import {
|
|||
CompleteDiffieHandshakeMessageComposer,
|
||||
CompostPlantMessageComposer,
|
||||
ConcurrentUsersGoalProgressMessageEvent,
|
||||
ConfirmBreedingRequestEvent,
|
||||
ConfirmBreedingResultEvent,
|
||||
ConfirmPetBreedingComposer,
|
||||
ConnectionErrorEvent,
|
||||
ControlYoutubeDisplayPlaybackMessageComposer,
|
||||
|
@ -168,6 +172,7 @@ import {
|
|||
FigureUpdateEvent,
|
||||
FindFriendsProcessResultEvent,
|
||||
FindNewFriendsMessageComposer,
|
||||
FireworkChargeDataEvent,
|
||||
FlatAccessDeniedMessageEvent,
|
||||
FlatControllerAddedEvent,
|
||||
FlatControllerRemovedEvent,
|
||||
|
@ -355,6 +360,7 @@ import {
|
|||
GetYoutubeDisplayStatusMessageComposer,
|
||||
GiftReceiverNotFoundEvent,
|
||||
GiftWrappingConfigurationEvent,
|
||||
GoToBreedingNestFailureEvent,
|
||||
GoToFlatMessageComposer,
|
||||
GotMysteryBoxPrizeMessageEvent,
|
||||
GroupAdminGiveComposer,
|
||||
|
@ -388,6 +394,7 @@ import {
|
|||
GroupSettingsEvent,
|
||||
GroupUnfavoriteComposer,
|
||||
GuestRoomSearchResultEvent,
|
||||
GuideAdvertisementReadMessageComposer,
|
||||
GuideOnDutyStatusMessageEvent,
|
||||
GuideReportingStatusMessageEvent,
|
||||
GuideSessionAttachedMessageEvent,
|
||||
|
@ -534,6 +541,7 @@ import {
|
|||
NavigatorSearchesEvent,
|
||||
NavigatorSettingsEvent,
|
||||
NavigatorSettingsSaveComposer,
|
||||
NestBreedingSuccessEvent,
|
||||
NewConsoleMessageEvent,
|
||||
NewFriendRequestEvent,
|
||||
NewUserExperienceGetGiftsComposer,
|
||||
|
@ -548,6 +556,7 @@ import {
|
|||
NowPlayingMessageEvent,
|
||||
ObjectsDataUpdateEvent,
|
||||
ObjectsRollingEvent,
|
||||
OfferRewardDeliveredMessageEvent,
|
||||
OfficialSongIdMessageEvent,
|
||||
OneWayDoorStatusMessageEvent,
|
||||
OpenCampaignCalendarDoorAsStaffComposer,
|
||||
|
@ -565,6 +574,7 @@ import {
|
|||
PerformanceLogMessageComposer,
|
||||
PerkAllowancesMessageEvent,
|
||||
PetAddedToInventoryEvent,
|
||||
PetBreedingMessageEvent,
|
||||
PetBreedingResultEvent,
|
||||
PetExperienceEvent,
|
||||
PetFigureUpdateEvent,
|
||||
|
@ -668,6 +678,7 @@ import {
|
|||
ResetPhoneNumberStateMessageComposer,
|
||||
ResetResolutionAchievementMessageComposer,
|
||||
RespectReceivedEvent,
|
||||
RestoreClientMessageEvent,
|
||||
RoomAdErrorEvent,
|
||||
RoomAdEventTabAdClickedComposer,
|
||||
RoomAdEventTabViewedComposer,
|
||||
|
@ -705,6 +716,7 @@ import {
|
|||
RoomNetworkOpenConnectionMessageComposer,
|
||||
RoomOccupiedTilesMessageEvent,
|
||||
RoomPaintEvent,
|
||||
RoomPollResultEvent,
|
||||
RoomReadyMessageEvent,
|
||||
RoomRightsClearEvent,
|
||||
RoomRightsEvent,
|
||||
|
@ -783,7 +795,10 @@ import {
|
|||
ShowEnforceRoomCategoryDialogEvent,
|
||||
ShowMysteryBoxWaitMessageEvent,
|
||||
SimpleAlertMessageEvent,
|
||||
SnowStormOnStageEndingComposer,
|
||||
SnowStormOnStageEndingEvent,
|
||||
StartCampaignMessageComposer,
|
||||
StartRoomPollEvent,
|
||||
SubmitRoomToCompetitionMessageComposer,
|
||||
TalentLevelUpEvent,
|
||||
TalentTrackComposer,
|
||||
|
@ -877,6 +892,7 @@ import {
|
|||
VersionCheckMessageComposer,
|
||||
VisitUserComposer,
|
||||
VoteForRoomMessageComposer,
|
||||
VotePollCounterMessageComposer,
|
||||
VoucherRedeemErrorMessageEvent,
|
||||
VoucherRedeemOkMessageEvent,
|
||||
WardrobeMessageEvent,
|
||||
|
@ -950,6 +966,7 @@ export class NitroMessages implements IMessageConfiguration {
|
|||
this._events.set(IncomingHeader.COMPETITION_STATUS, CompetitionStatusMessageEvent);
|
||||
this._events.set(IncomingHeader.INIT_CAMERA, InitCameraMessageEvent);
|
||||
this._events.set(IncomingHeader.THUMBNAIL_STATUS, ThumbnailStatusMessageEvent);
|
||||
this._events.set(IncomingHeader.CAMERA_SNAPSHOT, CameraSnapshotMessageEvent);
|
||||
|
||||
// CAMPAIGN
|
||||
this._events.set(IncomingHeader.CAMPAIGN_CALENDAR_DATA, CampaignCalendarDataMessageEvent);
|
||||
|
@ -1247,6 +1264,7 @@ export class NitroMessages implements IMessageConfiguration {
|
|||
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.POLL_START_ROOM, StartRoomPollEvent);
|
||||
this._events.set(IncomingHeader.QUESTION_ANSWERED, QuestionAnsweredEvent);
|
||||
this._events.set(IncomingHeader.QUESTION_FINISHED, QuestionFinishedEvent);
|
||||
|
||||
|
@ -1427,6 +1445,9 @@ export class NitroMessages implements IMessageConfiguration {
|
|||
this._events.set(IncomingHeader.NEW_USER_EXPERIENCE_GIFT_OFFER, NewUserExperienceGiftOfferMessageEvent);
|
||||
this._events.set(IncomingHeader.NEW_USER_EXPERIENCE_NOT_COMPLETE, NewUserExperienceNotCompleteEvent);
|
||||
|
||||
// FIREWORK
|
||||
this._events.set(IncomingHeader.FIREWORK_CHARGE_DATA, FireworkChargeDataEvent);
|
||||
|
||||
// PHONE
|
||||
this._events.set(IncomingHeader.PHONE_COLLECTION_STATE, PhoneCollectionStateMessageEvent);
|
||||
this._events.set(IncomingHeader.PHONE_TRY_NUMBER_RESULT, TryPhoneNumberResultMessageEvent);
|
||||
|
|
|
@ -127,6 +127,7 @@ export class IncomingHeader {
|
|||
public static CONVERTED_ROOM_ID = 1331;
|
||||
public static GUEST_ROOM_SEARCH_RESULT = 52;
|
||||
public static NOTIFICATION_LIST = 1992;
|
||||
public static NOTIFICATION_OFFER_REWARD_DELIVERED = 2125;
|
||||
public static NOTIFICATION_SIMPLE_ALERT = 5100;
|
||||
public static NOTIFICATION_ELEMENT_POINTER = 1787;
|
||||
public static PET_FIGURE_UPDATE = 1924;
|
||||
|
@ -246,6 +247,7 @@ export class IncomingHeader {
|
|||
public static USER_INFO = 2725;
|
||||
public static USER_OUTFITS = 3315;
|
||||
public static USER_PERKS = 2586;
|
||||
public static PERK_CITIZENSHIP_VIP_OFFER_PROMO_ENABLED = 2278;
|
||||
public static USER_PERMISSIONS = 411;
|
||||
public static USER_PET_ADD = 2101;
|
||||
public static USER_PET_REMOVE = 3253;
|
||||
|
@ -334,6 +336,7 @@ export class IncomingHeader {
|
|||
public static CAMERA_PUBLISH_STATUS = 2057;
|
||||
public static CAMERA_PURCHASE_OK = 2783;
|
||||
public static CAMERA_STORAGE_URL = 3696;
|
||||
public static CAMERA_SNAPSHOT = 463;
|
||||
public static COMPETITION_STATUS = 133;
|
||||
public static INIT_CAMERA = 3878;
|
||||
public static THUMBNAIL_STATUS = 3595;
|
||||
|
@ -398,6 +401,8 @@ export class IncomingHeader {
|
|||
public static POLL_CONTENTS = 2997;
|
||||
public static POLL_ERROR = 662;
|
||||
public static POLL_OFFER = 3785;
|
||||
public static POLL_ROOM_RESULT = 5201;
|
||||
public static POLL_START_ROOM = 5200;
|
||||
public static QUESTION_ANSWERED = 2589;
|
||||
public static QUESTION_FINISHED = 1066;
|
||||
public static CFH_PENDING_CALLS = 1121;
|
||||
|
@ -463,4 +468,7 @@ export class IncomingHeader {
|
|||
public static WEEKLY_GAME2_LEADERBOARD = 2196;
|
||||
public static RENTABLE_FURNI_RENT_OR_BUYOUT_OFFER = 35;
|
||||
public static HANDSHAKE_IDENTITY_ACCOUNT = 3523;
|
||||
public static FIREWORK_CHARGE_DATA = 5210;
|
||||
public static SNOWSTORM_ON_STAGE_ENDING = 5025;
|
||||
public static RESTORE_CLIENT = 426;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import {IMessageEvent} from "../../../../../api";
|
||||
import {MessageEvent} from "../../../../../events";
|
||||
import {CameraSnapshotMessageParser} from "../../parser";
|
||||
|
||||
export class CameraSnapshotMessageEvent extends MessageEvent implements IMessageEvent {
|
||||
constructor(callBack: Function) {
|
||||
super(callBack, CameraSnapshotMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): CameraSnapshotMessageParser {
|
||||
return this.parser as CameraSnapshotMessageParser;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
export * from "./CameraPublishStatusMessageEvent";
|
||||
export * from "./CameraPurchaseOKMessageEvent";
|
||||
export * from "./CameraSnapshotMessageEvent";
|
||||
export * from "./CameraStorageUrlMessageEvent";
|
||||
export * from "./CompetitionStatusMessageEvent";
|
||||
export * from "./InitCameraMessageEvent";
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import {IMessageEvent} from "../../../../../api";
|
||||
import {MessageEvent} from "../../../../../events";
|
||||
import {FireworkChargeDataParser} from "../../parser";
|
||||
|
||||
export class FireworkChargeDataEvent extends MessageEvent implements IMessageEvent {
|
||||
constructor(callBack: Function) {
|
||||
super(callBack, FireworkChargeDataParser);
|
||||
}
|
||||
|
||||
public getParser(): FireworkChargeDataParser {
|
||||
return this.parser as FireworkChargeDataParser;
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ export * from "./CatalogPublishedMessageEvent";
|
|||
export * from "./ClubGiftInfoEvent";
|
||||
export * from "./ClubGiftSelectedEvent";
|
||||
export * from "./DirectSMSClubBuyAvailableMessageEvent";
|
||||
export * from "./FireworkChargeDataEvent";
|
||||
export * from "./GiftReceiverNotFoundEvent";
|
||||
export * from "./GiftWrappingConfigurationEvent";
|
||||
export * from "./HabboClubExtendOfferMessageEvent";
|
||||
|
|
|
@ -63,6 +63,7 @@ export * from "./room/unit/chat";
|
|||
export * from "./roomevents";
|
||||
export * from "./roomsettings";
|
||||
export * from "./security";
|
||||
export * from "./snowwar";
|
||||
export * from "./sound";
|
||||
export * from "./talent";
|
||||
export * from "./user";
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import {IMessageEvent} from "../../../../../api";
|
||||
import {MessageEvent} from "../../../../../events";
|
||||
import {OfferRewardDeliveredMessageParser} from "../../parser";
|
||||
|
||||
export class OfferRewardDeliveredMessageEvent extends MessageEvent implements IMessageEvent {
|
||||
constructor(callBack: Function) {
|
||||
super(callBack, OfferRewardDeliveredMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): OfferRewardDeliveredMessageParser {
|
||||
return this.parser as OfferRewardDeliveredMessageParser;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
import {IMessageEvent} from "../../../../../api";
|
||||
import {MessageEvent} from "../../../../../events";
|
||||
import {RestoreClientMessageParser} from "../../parser";
|
||||
|
||||
export class RestoreClientMessageEvent extends MessageEvent implements IMessageEvent {
|
||||
constructor(callBack: Function) {
|
||||
super(callBack, RestoreClientMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): RestoreClientMessageParser {
|
||||
return this.parser as RestoreClientMessageParser;
|
||||
}
|
||||
}
|
|
@ -11,5 +11,7 @@ export * from "./MOTDNotificationEvent";
|
|||
export * from "./NotificationDialogMessageEvent";
|
||||
export * from "./PetLevelNotificationEvent";
|
||||
export * from "./PetPlacingErrorEvent";
|
||||
export * from "./RestoreClientMessageEvent";
|
||||
export * from "./SimpleAlertMessageEvent";
|
||||
export * from "./UnseenItemsEvent";
|
||||
export * from "./OfferRewardDeliveredMessageEvent";
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import {IMessageEvent} from "../../../../../api";
|
||||
import {MessageEvent} from "../../../../../events";
|
||||
import {CitizenshipVipOfferPromoEnabledMessageParser} from "./../../parser";
|
||||
|
||||
export class CitizenshipVipOfferPromoEnabledEvent extends MessageEvent implements IMessageEvent {
|
||||
constructor(callBack: Function) {
|
||||
super(callBack, CitizenshipVipOfferPromoEnabledMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): CitizenshipVipOfferPromoEnabledMessageParser {
|
||||
return this.parser as CitizenshipVipOfferPromoEnabledMessageParser;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
export class PerkData {
|
||||
private _code: string;
|
||||
private _errorMessage: string;
|
||||
private _isAllowed: boolean;
|
||||
|
||||
constructor(code: string, errorMessage: string, isAllowed: boolean) {
|
||||
this._code = code;
|
||||
this._errorMessage = errorMessage;
|
||||
this._isAllowed = isAllowed;
|
||||
}
|
||||
|
||||
public get code(): string {
|
||||
return this._code;
|
||||
}
|
||||
|
||||
public get errorMessage(): string {
|
||||
return this._errorMessage;
|
||||
}
|
||||
|
||||
public get isAllowed(): boolean {
|
||||
return this._isAllowed;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
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";
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
export * from "./PerkData";
|
||||
export * from "./PerkEnum";
|
|
@ -1 +1,2 @@
|
|||
export * from "./CitizenshipVipOfferPromoEnabledEvent";
|
||||
export * from "./PerkAllowancesMessageEvent";
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import {IMessageEvent} from "../../../../../api";
|
||||
import {MessageEvent} from "../../../../../events";
|
||||
import {RoomPollResultParser} from "../../parser";
|
||||
|
||||
export class RoomPollResultEvent extends MessageEvent implements IMessageEvent {
|
||||
constructor(callBack: Function) {
|
||||
super(callBack, RoomPollResultParser);
|
||||
}
|
||||
|
||||
public getParser(): RoomPollResultParser {
|
||||
return this.parser as RoomPollResultParser;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
import {IMessageEvent} from "../../../../../api";
|
||||
import {MessageEvent} from "../../../../../events";
|
||||
import {RoomPollDataParser} from "../../parser";
|
||||
|
||||
export class StartRoomPollEvent extends MessageEvent implements IMessageEvent {
|
||||
constructor(callBack: Function) {
|
||||
super(callBack, RoomPollDataParser);
|
||||
}
|
||||
|
||||
public getParser(): RoomPollDataParser {
|
||||
return this.parser as RoomPollDataParser;
|
||||
}
|
||||
}
|
|
@ -4,3 +4,5 @@ export * from "./PollOfferEvent";
|
|||
export * from "./QuestionAnsweredEvent";
|
||||
export * from "./QuestionEvent";
|
||||
export * from "./QuestionFinishedEvent";
|
||||
export * from "./StartRoomPollEvent";
|
||||
export * from "./RoomPollResultEvent";
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import {IMessageEvent} from "../../../../../../api";
|
||||
import {MessageEvent} from "../../../../../../events";
|
||||
import {SnowStormOnStageEndingParser} from "../../../parser";
|
||||
|
||||
export class SnowStormOnStageEndingEvent extends MessageEvent implements IMessageEvent {
|
||||
constructor(callBack: Function) {
|
||||
super(callBack, SnowStormOnStageEndingParser);
|
||||
}
|
||||
|
||||
public getParser(): SnowStormOnStageEndingParser {
|
||||
return this.parser as SnowStormOnStageEndingParser;
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export * from "./SnowStormOnStageEndingEvent";
|
|
@ -0,0 +1 @@
|
|||
export * from "./_Str_336";
|
|
@ -442,6 +442,7 @@ export class OutgoingHeader {
|
|||
public static POLL_ANSWER = 3505;
|
||||
public static POLL_REJECT = 1773;
|
||||
public static POLL_START = 109;
|
||||
public static POLL_VOTE_COUNTER = 6200;
|
||||
public static DISCONNECT = 2445;
|
||||
public static SCR_GET_KICKBACK_INFO = 869;
|
||||
public static COMPOST_PLANT = 3835;
|
||||
|
@ -466,4 +467,6 @@ export class OutgoingHeader {
|
|||
public static RENTABLE_EXTEND_RENT_OR_BUYOUT_STRIP_ITEM = 2115;
|
||||
public static RENTABLE_EXTEND_RENT_OR_BUYOUT_FURNI = 1071;
|
||||
public static RENTABLE_GET_RENT_OR_BUYOUT_OFFER = 2518;
|
||||
public static SNOWSTORM_ON_STAGE_ENDING = 6011;
|
||||
public static GUIDE_ADVERTISEMENT_READ = 2455;
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ export * from "./room/unit/chat";
|
|||
export * from "./roomdirectory";
|
||||
export * from "./roomevents";
|
||||
export * from "./roomsettings";
|
||||
export * from "./snowwar";
|
||||
export * from "./sound";
|
||||
export * from "./talent";
|
||||
export * from "./tracking";
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import {IMessageComposer} from "../../../../../api";
|
||||
|
||||
export class VotePollCounterMessageComposer implements IMessageComposer<ConstructorParameters<typeof VotePollCounterMessageComposer>> {
|
||||
private _data: ConstructorParameters<typeof VotePollCounterMessageComposer>;
|
||||
|
||||
constructor(counter: number) {
|
||||
this._data = [counter];
|
||||
}
|
||||
|
||||
public getMessageArray() {
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
export * from "./PollAnswerComposer";
|
||||
export * from "./PollRejectComposer";
|
||||
export * from "./PollStartComposer";
|
||||
export * from "./VotePollCounterMessageComposer";
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import {IMessageComposer} from "../../../../../../api";
|
||||
|
||||
export class SnowStormOnStageEndingComposer implements IMessageComposer<ConstructorParameters<typeof SnowStormOnStageEndingComposer>> {
|
||||
private _data: ConstructorParameters<typeof SnowStormOnStageEndingComposer>;
|
||||
|
||||
constructor(habboGameId: number) {
|
||||
this._data = [habboGameId];
|
||||
}
|
||||
|
||||
public getMessageArray() {
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export * from "./SnowStormOnStageEndingComposer";
|
|
@ -0,0 +1 @@
|
|||
export * from "./_Str_400";
|
|
@ -0,0 +1,17 @@
|
|||
import {IMessageComposer} from "../../../../../api";
|
||||
|
||||
export class GuideAdvertisementReadMessageComposer implements IMessageComposer<ConstructorParameters<typeof GuideAdvertisementReadMessageComposer>> {
|
||||
private _data: ConstructorParameters<typeof GuideAdvertisementReadMessageComposer>;
|
||||
|
||||
constructor() {
|
||||
this._data = [];
|
||||
}
|
||||
|
||||
public getMessageArray() {
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -1,2 +1,3 @@
|
|||
export * from "./GetTalentTrackLevelMessageComposer";
|
||||
export * from "./GuideAdvertisementReadMessageComposer";
|
||||
export * from "./TalentTrackComposer";
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
import {IMessageDataWrapper, IMessageParser} from "../../../../../api";
|
||||
|
||||
export class CameraSnapshotMessageParser implements IMessageParser {
|
||||
private _roomType: string;
|
||||
private _roomId: number;
|
||||
|
||||
public flush(): boolean {
|
||||
this._roomType = null;
|
||||
this._roomId = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean {
|
||||
if (!wrapper) return false;
|
||||
|
||||
this._roomType = wrapper.readString();
|
||||
this._roomId = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get roomType(): string {
|
||||
return this._roomType;
|
||||
}
|
||||
|
||||
public get roomId(): number {
|
||||
return this._roomId;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
export * from "./CameraPublishStatusMessageParser";
|
||||
export * from "./CameraPurchaseOKMessageParser";
|
||||
export * from "./CameraSnapshotMessageParser";
|
||||
export * from "./CameraStorageUrlMessageParser";
|
||||
export * from "./CompetitionStatusMessageParser";
|
||||
export * from "./InitCameraMessageParser";
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
import {IMessageDataWrapper} from "../../../../../api";
|
||||
|
||||
export class FireworkChargeData {
|
||||
private _stuffId: number;
|
||||
private _charges: number;
|
||||
private _SafeStr_6935: number;
|
||||
private _SafeStr_6936: number;
|
||||
private _SafeStr_6518: number;
|
||||
private _SafeStr_7875: number;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper) {
|
||||
this._stuffId = wrapper.readInt();
|
||||
this._charges = wrapper.readInt();
|
||||
this._SafeStr_6935 = wrapper.readInt();
|
||||
this._SafeStr_6936 = wrapper.readInt();
|
||||
this._SafeStr_6518 = wrapper.readInt();
|
||||
this._SafeStr_7875 = wrapper.readInt();
|
||||
}
|
||||
|
||||
public get stuffId(): number {
|
||||
return this._stuffId;
|
||||
}
|
||||
|
||||
public get charges(): number {
|
||||
return this._charges;
|
||||
}
|
||||
|
||||
public get _SafeStr_5946(): number {
|
||||
return this._SafeStr_6935;
|
||||
}
|
||||
|
||||
public get _SafeStr_5944(): number {
|
||||
return this._SafeStr_6936;
|
||||
}
|
||||
|
||||
public get _SafeStr_7876(): number {
|
||||
return this._SafeStr_7875;
|
||||
}
|
||||
|
||||
public get _SafeStr_5945(): number {
|
||||
return this._SafeStr_6518;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
import {IMessageDataWrapper, IMessageParser} from "../../../../../api";
|
||||
import {FireworkChargeData} from "./FireworkChargeData";
|
||||
|
||||
export class FireworkChargeDataParser implements IMessageParser {
|
||||
private _fireworkChargeData: FireworkChargeData;
|
||||
|
||||
public flush(): boolean {
|
||||
this._fireworkChargeData = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean {
|
||||
if (!wrapper) return false;
|
||||
|
||||
this._fireworkChargeData = new FireworkChargeData(wrapper);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get fireworkChargeData(): FireworkChargeData {
|
||||
return this._fireworkChargeData;
|
||||
}
|
||||
}
|
|
@ -17,6 +17,8 @@ export * from "./ClubGiftSelectedParser";
|
|||
export * from "./ClubOfferData";
|
||||
export * from "./ClubOfferExtendData";
|
||||
export * from "./DirectSMSClubBuyAvailableMessageParser";
|
||||
export * from "./FireworkChargeData";
|
||||
export * from "./FireworkChargeDataParser";
|
||||
export * from "./FrontPageItem";
|
||||
export * from "./GiftReceiverNotFoundParser";
|
||||
export * from "./GiftWrappingConfigurationParser";
|
||||
|
|
|
@ -64,6 +64,7 @@ export * from "./room/unit/chat";
|
|||
export * from "./roomevents";
|
||||
export * from "./roomsettings";
|
||||
export * from "./security";
|
||||
export * from "./snowwar";
|
||||
export * from "./sound";
|
||||
export * from "./talent";
|
||||
export * from "./user";
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
import {IMessageDataWrapper, IMessageParser} from "../../../../../api";
|
||||
|
||||
export class OfferRewardDeliveredMessageParser implements IMessageParser {
|
||||
private _contentType: string;
|
||||
private _classId: number;
|
||||
private _name: string;
|
||||
private _description: string;
|
||||
|
||||
public flush(): boolean {
|
||||
this._contentType = null;
|
||||
this._classId = 0;
|
||||
this._name = null;
|
||||
this._description = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean {
|
||||
if (!wrapper) return false;
|
||||
|
||||
this._contentType = wrapper.readString();
|
||||
this._classId = wrapper.readInt();
|
||||
this._name = wrapper.readString();
|
||||
this._description = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get contentType(): string {
|
||||
return this._contentType;
|
||||
}
|
||||
|
||||
public get classId(): number {
|
||||
return this._classId;
|
||||
}
|
||||
|
||||
public get name(): string {
|
||||
return this._name;
|
||||
}
|
||||
|
||||
public get description(): string {
|
||||
return this._description;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
import {IMessageDataWrapper, IMessageParser} from "../../../../../api";
|
||||
|
||||
export class RestoreClientMessageParser implements IMessageParser {
|
||||
public flush(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -10,7 +10,9 @@ export * from "./HotelWillShutdownParser";
|
|||
export * from "./InfoFeedEnableMessageParser";
|
||||
export * from "./MOTDNotificationParser";
|
||||
export * from "./NotificationDialogMessageParser";
|
||||
export * from "./OfferRewardDeliveredMessageParser";
|
||||
export * from "./PetLevelNotificationParser";
|
||||
export * from "./RestoreClientMessageParser";
|
||||
export * from "./PetPlacingErrorEventParser";
|
||||
export * from "./SimpleAlertMessageParser";
|
||||
export * from "./UnseenItemsParser";
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import {IMessageDataWrapper, IMessageParser} from "../../../../../api";
|
||||
|
||||
export class CitizenshipVipOfferPromoEnabledMessageParser implements IMessageParser {
|
||||
public flush(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean {
|
||||
if (!wrapper) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,2 +1,3 @@
|
|||
export * from "./CitizenshipVipOfferPromoEnabledMessageParser";
|
||||
export * from "./common";
|
||||
export * from "./PerkAllowancesMessageParser";
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
import {IMessageDataWrapper, IMessageParser} from "../../../../../api";
|
||||
|
||||
export class RoomPollDataParser implements IMessageParser {
|
||||
private _question: string;
|
||||
private _choices: string[];
|
||||
|
||||
flush(): boolean {
|
||||
this._question = null;
|
||||
this._choices = [];
|
||||
return true;
|
||||
}
|
||||
|
||||
parse(wrapper: IMessageDataWrapper): boolean {
|
||||
this._question = wrapper.readString();
|
||||
this._choices = [];
|
||||
|
||||
const totalChoices = wrapper.readInt();
|
||||
let total = 0;
|
||||
|
||||
while (total < totalChoices) {
|
||||
this._choices.push(wrapper.readString());
|
||||
total++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get question(): string {
|
||||
return this._question;
|
||||
}
|
||||
|
||||
public get choices(): string[] {
|
||||
return this._choices.slice();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
import {IMessageDataWrapper, IMessageParser} from "../../../../../api";
|
||||
|
||||
export class RoomPollResultParser implements IMessageParser {
|
||||
private _question: string;
|
||||
private _choices: string[];
|
||||
private _SafeStr_7651: any[];
|
||||
private _SafeStr_7654: number;
|
||||
|
||||
flush(): boolean {
|
||||
this._question = null;
|
||||
this._choices = [];
|
||||
this._SafeStr_7651 = [];
|
||||
this._SafeStr_7654 = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
parse(wrapper: IMessageDataWrapper): boolean {
|
||||
this._question = wrapper.readString();
|
||||
|
||||
this._choices = [];
|
||||
this._SafeStr_7651 = [];
|
||||
|
||||
let totalChoices = wrapper.readInt();
|
||||
|
||||
while (totalChoices > 0) {
|
||||
this._choices.push(wrapper.readString());
|
||||
this._SafeStr_7651.push(wrapper.readInt());
|
||||
|
||||
totalChoices--;
|
||||
}
|
||||
this._SafeStr_7654 = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get question(): string {
|
||||
return this._question;
|
||||
}
|
||||
|
||||
public get choices(): string[] {
|
||||
return this._choices;
|
||||
}
|
||||
|
||||
public get SafeStr_7651(): any[] {
|
||||
return this._SafeStr_7651;
|
||||
}
|
||||
|
||||
public get SafeStr_7654(): number {
|
||||
return this._SafeStr_7654;
|
||||
}
|
||||
}
|
|
@ -6,3 +6,5 @@ export * from "./PollQuestion";
|
|||
export * from "./QuestionAnsweredParser";
|
||||
export * from "./QuestionFinishedParser";
|
||||
export * from "./QuestionParser";
|
||||
export * from "./RoomPollResultParser";
|
||||
export * from "./RoomPollDataParser";
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
import {IMessageDataWrapper, IMessageParser} from "../../../../../../api";
|
||||
|
||||
export class SnowStormOnStageEndingParser implements IMessageParser {
|
||||
private _habboGameId: number;
|
||||
|
||||
public flush(): boolean {
|
||||
this._habboGameId = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean {
|
||||
if (!wrapper) return false;
|
||||
|
||||
this._habboGameId = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get habboGameId(): number {
|
||||
return this._habboGameId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export * from "./SnowStormOnStageEndingParser";
|
|
@ -0,0 +1 @@
|
|||
export * from "./_Str_277";
|
|
@ -45,6 +45,7 @@ import {
|
|||
TogglePetRidingComposer,
|
||||
UsePetProductComposer,
|
||||
UserMottoComposer,
|
||||
VotePollCounterMessageComposer,
|
||||
} from "../communication";
|
||||
import {UserDataManager} from "./UserDataManager";
|
||||
|
||||
|
@ -322,6 +323,10 @@ export class RoomSession extends Disposable implements IRoomSession {
|
|||
this._connection.send(new ChangeQueueMessageComposer(targetQueue));
|
||||
}
|
||||
|
||||
public votePoll(counter: number): void {
|
||||
this._connection.send(new VotePollCounterMessageComposer(counter));
|
||||
}
|
||||
|
||||
public get connection(): IConnection {
|
||||
return this._connection;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {IConnection, IRoomHandlerListener} from "../../../api";
|
||||
import {RoomSessionPollEvent} from "../../../events";
|
||||
import {PollContentsEvent, PollErrorEvent, PollOfferEvent} from "../../communication";
|
||||
import {RoomSessionPollEvent, RoomSessionVoteEvent} from "../../../events";
|
||||
import {PollContentsEvent, PollErrorEvent, PollOfferEvent, RoomPollResultEvent, StartRoomPollEvent} from "../../communication";
|
||||
import {BaseHandler} from "./BaseHandler";
|
||||
|
||||
export class PollHandler extends BaseHandler {
|
||||
|
@ -10,6 +10,8 @@ export class PollHandler extends BaseHandler {
|
|||
connection.addMessageEvent(new PollContentsEvent(this.onPollContentsEvent.bind(this)));
|
||||
connection.addMessageEvent(new PollOfferEvent(this.onPollOfferEvent.bind(this)));
|
||||
connection.addMessageEvent(new PollErrorEvent(this.onPollErrorEvent.bind(this)));
|
||||
connection.addMessageEvent(new StartRoomPollEvent(this.onStartRoomPollEvent.bind(this)));
|
||||
connection.addMessageEvent(new RoomPollResultEvent(this.onRoomPollResultEvent.bind(this)));
|
||||
}
|
||||
|
||||
private onPollContentsEvent(event: PollContentsEvent): void {
|
||||
|
@ -70,4 +72,43 @@ export class PollHandler extends BaseHandler {
|
|||
|
||||
this.listener.events.dispatchEvent(pollEvent);
|
||||
}
|
||||
|
||||
private onStartRoomPollEvent(event: StartRoomPollEvent): 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 RoomSessionVoteEvent(RoomSessionVoteEvent.VOTE_QUESTION, session, parser.question, parser.choices);
|
||||
|
||||
this.listener.events.dispatchEvent(pollEvent);
|
||||
}
|
||||
|
||||
private onRoomPollResultEvent(event: RoomPollResultEvent): 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 RoomSessionVoteEvent(
|
||||
RoomSessionVoteEvent.VOTE_RESULT,
|
||||
session,
|
||||
parser.question,
|
||||
parser.choices,
|
||||
parser.SafeStr_7651,
|
||||
parser.SafeStr_7654
|
||||
);
|
||||
|
||||
this.listener.events.dispatchEvent(pollEvent);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue