#28 - EmailStatusResultEvent added

This commit is contained in:
oobjectt 2022-12-25 16:12:05 +01:00
parent 26741b78a7
commit 6d359f2bcf
7 changed files with 86 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -414,4 +414,5 @@ export class IncomingHeader
public static SHOW_ENFORCE_ROOM_CATEGORY = 3896;
public static CUSTOM_USER_NOTIFICATION = 909;
public static NEW_USER_EXPERIENCE_GIFT_OFFER = 3575;
public static EMAIL_STATUS = 612;
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../api';
import { MessageEvent } from '../../../../../events';
import { EmailStatusParser } from '../../parser';
export class EmailStatusResultEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, EmailStatusParser);
}
public getParser(): EmailStatusParser
{
return this.parser as EmailStatusParser;
}
}

View File

@ -1,6 +1,7 @@
export * from './access';
export * from './ApproveNameMessageEvent';
export * from './data';
export * from './EmailStatusResultEvent';
export * from './GuildMembershipsMessageEvent';
export * from './HabboGroupBadgesMessageEvent';
export * from './IgnoredUsersEvent';

View File

@ -0,0 +1,43 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class EmailStatusParser implements IMessageParser
{
private _email: string;
private _isVerified: boolean;
private _allowChange: boolean;
public flush(): boolean
{
this._email = null;
this._isVerified = false;
this._allowChange = false;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._email = wrapper.readString();
this._isVerified = wrapper.readBoolean();
this._allowChange = wrapper.readBoolean();
return true;
}
public get email(): string
{
return this._email;
}
public get isVerified(): boolean
{
return this._isVerified;
}
public get allowChange(): boolean
{
return this._allowChange;
}
}

View File

@ -1,6 +1,7 @@
export * from './access';
export * from './ApproveNameResultParser';
export * from './data';
export * from './EmailStatusParser';
export * from './GuildMembershipsMessageParser';
export * from './HabboGroupBadgesMessageParser';
export * from './HabboGroupEntryData';

View File

@ -2,7 +2,7 @@ import { Resource, Texture } from '@pixi/core';
import { GetAssetManager, IFurnitureData, IFurnitureDataListener, IGroupInformationManager, IMessageComposer, INitroCommunicationManager, INitroEvent, IProductData, IProductDataListener, ISessionDataManager, NitroConfiguration, NoobnessLevelEnum, SecurityLevel } from '../../api';
import { NitroManager } from '../../core';
import { MysteryBoxKeysUpdateEvent, NitroSettingsEvent, SessionDataPreferencesEvent, UserNameUpdateEvent } from '../../events';
import { AvailabilityStatusMessageEvent, ChangeUserNameResultMessageEvent, FigureUpdateEvent, GetUserTagsComposer, InClientLinkEvent, MysteryBoxKeysEvent, NoobnessLevelMessageEvent, PetRespectComposer, PetScratchFailedMessageEvent, RoomReadyMessageEvent, RoomUnitChatComposer, UserInfoEvent, UserNameChangeMessageEvent, UserPermissionsEvent, UserRespectComposer, UserTagsMessageEvent } from '../communication';
import { AvailabilityStatusMessageEvent, ChangeUserNameResultMessageEvent, EmailStatusResultEvent, FigureUpdateEvent, GetUserTagsComposer, InClientLinkEvent, MysteryBoxKeysEvent, NoobnessLevelMessageEvent, PetRespectComposer, PetScratchFailedMessageEvent, RoomReadyMessageEvent, RoomUnitChatComposer, UserInfoEvent, UserNameChangeMessageEvent, UserPermissionsEvent, UserRespectComposer, UserTagsMessageEvent } from '../communication';
import { Nitro } from '../Nitro';
import { HabboWebTools } from '../utils/HabboWebTools';
import { BadgeImageManager } from './badge/BadgeImageManager';
@ -32,6 +32,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana
private _securityLevel: number;
private _isAmbassador: boolean;
private _noobnessLevel: number;
private _isEmailVerified: boolean;
private _systemOpen: boolean;
private _systemShutdown: boolean;
@ -69,6 +70,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana
this._securityLevel = 0;
this._isAmbassador = false;
this._noobnessLevel = -1;
this._isEmailVerified = false;
this._systemOpen = false;
this._systemShutdown = false;
@ -116,6 +118,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana
this._communication.registerMessageEvent(new InClientLinkEvent(this.onInClientLinkEvent.bind(this)));
this._communication.registerMessageEvent(new MysteryBoxKeysEvent(this.onMysteryBoxKeysEvent.bind(this)));
this._communication.registerMessageEvent(new NoobnessLevelMessageEvent(this.onNoobnessLevelMessageEvent.bind(this)));
this._communication.registerMessageEvent(new EmailStatusResultEvent(this.onEmailStatus.bind(this)));
Nitro.instance.events.addEventListener(NitroSettingsEvent.SETTINGS_UPDATED, this.onNitroSettingsEvent);
}
@ -408,6 +411,17 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana
}
}
private onEmailStatus(event: EmailStatusResultEvent): void
{
if(!event) return;
const parser = event.getParser();
if(!parser) return;
this._isEmailVerified = parser.isVerified;
}
private onNitroSettingsEvent(event: NitroSettingsEvent): void
{
this._isRoomCameraFollowDisabled = event.cameraFollow;
@ -648,6 +662,11 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana
return this._isAmbassador;
}
public get isEmailVerified(): boolean
{
return this._isEmailVerified;
}
public get isNoob(): boolean
{
return (this._noobnessLevel !== NoobnessLevelEnum.OLD_IDENTITY);