mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-18 22:36:27 +01:00
Connection Error Event (#25)
Co-authored-by: Snaiker <steveraki2000@gmail.com>
This commit is contained in:
parent
26741b78a7
commit
31fa866243
File diff suppressed because one or more lines are too long
@ -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 CONNECTION_ERROR = 1004;
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../api';
|
||||
import { MessageEvent } from '../../../../../events';
|
||||
import { ConnectionErrorMessageParser } from '../../parser/notifications/ConnectionErrorMessageParser';
|
||||
|
||||
export class ConnectionErrorEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, ConnectionErrorMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): ConnectionErrorMessageParser
|
||||
{
|
||||
return this.parser as ConnectionErrorMessageParser;
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ export * from './AchievementNotificationMessageEvent';
|
||||
export * from './ActivityPointNotificationMessageEvent';
|
||||
export * from './BotErrorEvent';
|
||||
export * from './ClubGiftNotificationEvent';
|
||||
export * from './ConnectionErrorEvent';
|
||||
export * from './HabboBroadcastMessageEvent';
|
||||
export * from './HotelWillShutdownEvent';
|
||||
export * from './InfoFeedEnableMessageEvent';
|
||||
|
@ -0,0 +1,43 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
|
||||
|
||||
export class ConnectionErrorMessageParser implements IMessageParser
|
||||
{
|
||||
private _errorCode: number;
|
||||
private _messageId: number;
|
||||
private _timestamp: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._errorCode = 0;
|
||||
this._messageId = 0;
|
||||
this._timestamp = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._messageId = wrapper.readInt();
|
||||
this._errorCode = wrapper.readInt();
|
||||
this._timestamp = wrapper.readString();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get errorCode(): number
|
||||
{
|
||||
return this._errorCode;
|
||||
}
|
||||
|
||||
public get messageId(): number
|
||||
{
|
||||
return this._messageId;
|
||||
}
|
||||
|
||||
public get timestamp(): string
|
||||
{
|
||||
return this._timestamp;
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@ export * from './AchievementNotificationMessageParser';
|
||||
export * from './ActivityPointNotificationParser';
|
||||
export * from './BotErrorEventParser';
|
||||
export * from './ClubGiftNotificationParser';
|
||||
export * from './ConnectionErrorMessageParser';
|
||||
export * from './HabboBroadcastMessageParser';
|
||||
export * from './HotelWillShutdownParser';
|
||||
export * from './InfoFeedEnableMessageParser';
|
||||
|
Loading…
Reference in New Issue
Block a user