renamed ChangeUserNameResultMessageEvent

This commit is contained in:
Dank074 2021-06-11 19:44:40 -05:00
parent d5843fc8bd
commit 3184d9a117
5 changed files with 32 additions and 32 deletions

View File

@ -1,6 +1,6 @@
import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration';
import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent';
import { ChangeNameUpdateEvent } from './messages/incoming/avatar/ChangeNameUpdateEvent';
import { ChangeUserNameResultMessageEvent } from 'nitro-renderer/src/nitro/communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent';
import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent';
import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent';
import { CatalogGiftConfigurationEvent } from './messages/incoming/catalog/CatalogGiftConfigurationEvent';
@ -423,7 +423,7 @@ export class NitroMessages implements IMessageConfiguration
this._events.set(IncomingHeader.GENERIC_ERROR, GenericErrorEvent);
// AVATAR
this._events.set(IncomingHeader.USER_CHANGE_NAME, ChangeNameUpdateEvent);
this._events.set(IncomingHeader.USER_CHANGE_NAME, ChangeUserNameResultMessageEvent);
// CATALOG
this._events.set(IncomingHeader.CATALOG_CLUB, CatalogClubEvent);

View File

@ -1,25 +0,0 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { ChangeNameUpdateParser } from '../../parser/avatar/ChangeNameUpdateParser';
export class ChangeNameUpdateEvent extends MessageEvent implements IMessageEvent
{
public static _Str_5797: number = 0;
public static _Str_7005: number = 1;
public static _Str_7389: number = 2;
public static _Str_7137: number = 3;
public static _Str_7836: number = 4;
public static _Str_7721: number = 5;
public static _Str_8620: number = 6;
public static _Str_9429: number = 7;
constructor(callBack: Function)
{
super(callBack, ChangeNameUpdateParser);
}
public getParser(): ChangeNameUpdateParser
{
return this.parser as ChangeNameUpdateParser;
}
}

View File

@ -0,0 +1,25 @@
import { IMessageEvent } from 'nitro-renderer/src/core/communication/messages/IMessageEvent';
import { MessageEvent } from 'nitro-renderer/src/core/communication/messages/MessageEvent';
import { ChangeNameUpdateParser } from 'nitro-renderer/src/nitro/communication/messages/parser/avatar/ChangeNameUpdateParser';
export class ChangeUserNameResultMessageEvent extends MessageEvent implements IMessageEvent
{
public static NAME_OK: number = 0;
public static ERROR_NAME_REQUIRED: number = 1;
public static ERROR_NAME_TOO_SHORT: number = 2;
public static ERROR_NAME_TOO_LONG: number = 3;
public static ERROR_NAME_NOT_VALID: number = 4;
public static ERROR_NAME_IN_USE: number = 5;
public static ERROR_NAME_CHANGE_NOT_ALLOWED: number = 6;
public static ERROR_MERGE_HOTEL_DOWN: number = 7;
constructor(callBack: Function)
{
super(callBack, ChangeNameUpdateParser);
}
public getParser(): ChangeNameUpdateParser
{
return this.parser as ChangeNameUpdateParser;
}
}

View File

@ -1 +1 @@
export * from './ChangeNameUpdateEvent';
export * from './ChangeUserNameResultMessageEvent';

View File

@ -4,7 +4,7 @@ import { IMessageComposer } from '../../core/communication/messages/IMessageComp
import { NitroEvent } from '../../core/events/NitroEvent';
import { INitroCommunicationManager } from '../communication/INitroCommunicationManager';
import { AvailabilityStatusMessageEvent } from '../communication/messages/incoming/availability/AvailabilityStatusMessageEvent';
import { ChangeNameUpdateEvent } from '../communication/messages/incoming/avatar/ChangeNameUpdateEvent';
import { ChangeUserNameResultMessageEvent } from '../communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent';
import { RoomModelNameEvent } from '../communication/messages/incoming/room/mapping/RoomModelNameEvent';
import { UserPermissionsEvent } from '../communication/messages/incoming/user/access/UserPermissionsEvent';
import { UserFigureEvent } from '../communication/messages/incoming/user/data/UserFigureEvent';
@ -123,7 +123,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana
this._communication.registerMessageEvent(new UserInfoEvent(this.onUserInfoEvent.bind(this)));
this._communication.registerMessageEvent(new UserPermissionsEvent(this.onUserPermissionsEvent.bind(this)));
this._communication.registerMessageEvent(new AvailabilityStatusMessageEvent(this.onAvailabilityStatusMessageEvent.bind(this)));
this._communication.registerMessageEvent(new ChangeNameUpdateEvent(this.onChangeNameUpdateEvent.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 InClientLinkEvent(this.onInClientLinkEvent.bind(this)));
@ -291,7 +291,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana
this._isAuthenticHabbo = parser.isAuthenticUser;
}
private onChangeNameUpdateEvent(event: ChangeNameUpdateEvent): void
private onChangeNameUpdateEvent(event: ChangeUserNameResultMessageEvent): void
{
if(!event || !event.connection) return;
@ -299,7 +299,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana
if(!parser) return;
if(parser.resultCode !== ChangeNameUpdateEvent._Str_5797) return;
if(parser.resultCode !== ChangeUserNameResultMessageEvent.NAME_OK) return;
this._canChangeName = false;