From d3458229fd5ed40da8e16968c77f3ea536fa856f Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Fri, 26 Nov 2021 17:48:47 -0300 Subject: [PATCH] Guide Tool Events --- .../help/GuideOnDutyStatusMessageEvent.ts | 16 ++++ .../help/GuideSessionAttachedMessageEvent.ts | 16 ++++ .../help/GuideSessionDetachedMessageEvent.ts | 16 ++++ .../help/GuideSessionEndedMessageEvent.ts | 16 ++++ .../help/GuideSessionErrorMessageEvent.ts | 16 ++++ ...deSessionInvitedToGuideRoomMessageEvent.ts | 16 ++++ .../help/GuideSessionMessageMessageEvent.ts | 16 ++++ ...GuideSessionPartnerIsTypingMessageEvent.ts | 16 ++++ .../GuideSessionRequesterRoomMessageEvent.ts | 16 ++++ .../help/GuideSessionStartedMessageEvent.ts | 16 ++++ .../GuideTicketCreationResultMessageEvent.ts | 16 ++++ .../help/GuideTicketResolutionMessageEvent.ts | 16 ++++ .../help/HotelMergeNameChangeEvent.ts | 16 ++++ .../IssueCloseNotificationMessageEvent.ts | 16 ++++ .../incoming/help/QuizDataMessageEvent.ts | 16 ++++ .../incoming/help/QuizResultsMessageEvent.ts | 16 ++++ .../messages/incoming/help/index.ts | 16 ++++ .../help/GuideOnDutyStatusMessageParser.ts | 51 +++++++++++ .../help/GuideReportingStatusMessageParser.ts | 49 ++++++++++ .../help/GuideSessionAttachedMessageParser.ts | 51 +++++++++++ .../help/GuideSessionDetachedMessageParser.ts | 16 ++++ .../help/GuideSessionEndedMessageParser.ts | 27 ++++++ .../help/GuideSessionErrorMessageParser.ts | 33 +++++++ ...eSessionInvitedToGuideRoomMessageParser.ts | 35 +++++++ .../help/GuideSessionMessageMessageParser.ts | 35 +++++++ ...uideSessionPartnerIsTypingMessageParser.ts | 27 ++++++ .../GuideSessionRequesterRoomMessageParser.ts | 27 ++++++ .../help/GuideSessionStartedMessageParser.ts | 67 ++++++++++++++ .../GuideTicketCreationResultMessageParser.ts | 32 +++++++ .../GuideTicketResolutionMessageParser.ts | 31 +++++++ .../parser/help/HotelMergeNameChangeParser.ts | 16 ++++ .../IssueCloseNotificationMessageParser.ts | 27 ++++++ .../parser/help/QuizDataMessageParser.ts | 40 ++++++++ .../parser/help/QuizResultsMessageParser.ts | 40 ++++++++ .../help/common/PendingGuideTicketData.ts | 91 +++++++++++++++++++ .../messages/parser/help/index.ts | 17 ++++ 36 files changed, 984 insertions(+) create mode 100644 src/nitro/communication/messages/incoming/help/GuideOnDutyStatusMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionAttachedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionDetachedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionEndedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionErrorMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionInvitedToGuideRoomMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionMessageMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionPartnerIsTypingMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionRequesterRoomMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideSessionStartedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideTicketCreationResultMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/GuideTicketResolutionMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/HotelMergeNameChangeEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/IssueCloseNotificationMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/QuizDataMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/help/QuizResultsMessageEvent.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideOnDutyStatusMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideReportingStatusMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionAttachedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionDetachedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionEndedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionErrorMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionInvitedToGuideRoomMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionMessageMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionPartnerIsTypingMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionRequesterRoomMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideSessionStartedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideTicketCreationResultMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/GuideTicketResolutionMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/HotelMergeNameChangeParser.ts create mode 100644 src/nitro/communication/messages/parser/help/IssueCloseNotificationMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/QuizDataMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/QuizResultsMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/help/common/PendingGuideTicketData.ts diff --git a/src/nitro/communication/messages/incoming/help/GuideOnDutyStatusMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideOnDutyStatusMessageEvent.ts new file mode 100644 index 00000000..72f411d5 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideOnDutyStatusMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideOnDutyStatusMessageParser } from '../../parser/help/GuideOnDutyStatusMessageParser'; + +export class GuideOnDutyStatusMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideOnDutyStatusMessageParser); + } + + public getParser(): GuideOnDutyStatusMessageParser + { + return this.parser as GuideOnDutyStatusMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionAttachedMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionAttachedMessageEvent.ts new file mode 100644 index 00000000..9165f5cc --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionAttachedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionAttachedMessageParser } from '../../parser/help/GuideSessionAttachedMessageParser'; + +export class GuideSessionAttachedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionAttachedMessageParser); + } + + public getParser(): GuideSessionAttachedMessageParser + { + return this.parser as GuideSessionAttachedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionDetachedMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionDetachedMessageEvent.ts new file mode 100644 index 00000000..16b4473c --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionDetachedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionDetachedMessageParser } from '../../parser/help/GuideSessionDetachedMessageParser'; + +export class GuideSessionDetachedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionDetachedMessageParser); + } + + public getParser(): GuideSessionDetachedMessageParser + { + return this.parser as GuideSessionDetachedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionEndedMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionEndedMessageEvent.ts new file mode 100644 index 00000000..5aa1e2e8 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionEndedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionEndedMessageParser } from '../../parser/help/GuideSessionEndedMessageParser'; + +export class GuideSessionEndedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionEndedMessageParser); + } + + public getParser(): GuideSessionEndedMessageParser + { + return this.parser as GuideSessionEndedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionErrorMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionErrorMessageEvent.ts new file mode 100644 index 00000000..a6199407 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionErrorMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionErrorMessageParser } from '../../parser/help/GuideSessionErrorMessageParser'; + +export class GuideSessionErrorMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionErrorMessageParser); + } + + public getParser(): GuideSessionErrorMessageParser + { + return this.parser as GuideSessionErrorMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionInvitedToGuideRoomMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionInvitedToGuideRoomMessageEvent.ts new file mode 100644 index 00000000..d7926ef5 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionInvitedToGuideRoomMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionInvitedToGuideRoomMessageParser } from '../../parser/help/GuideSessionInvitedToGuideRoomMessageParser'; + +export class GuideSessionInvitedToGuideRoomMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionInvitedToGuideRoomMessageParser); + } + + public getParser(): GuideSessionInvitedToGuideRoomMessageParser + { + return this.parser as GuideSessionInvitedToGuideRoomMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionMessageMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionMessageMessageEvent.ts new file mode 100644 index 00000000..e7d720bd --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionMessageMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionMessageMessageParser } from '../../parser/help/GuideSessionMessageMessageParser'; + +export class GuideSessionMessageMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionMessageMessageParser); + } + + public getParser(): GuideSessionMessageMessageParser + { + return this.parser as GuideSessionMessageMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionPartnerIsTypingMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionPartnerIsTypingMessageEvent.ts new file mode 100644 index 00000000..6d987656 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionPartnerIsTypingMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionPartnerIsTypingMessageParser } from '../../parser/help/GuideSessionPartnerIsTypingMessageParser'; + +export class GuideSessionPartnerIsTypingMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionPartnerIsTypingMessageParser); + } + + public getParser(): GuideSessionPartnerIsTypingMessageParser + { + return this.parser as GuideSessionPartnerIsTypingMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionRequesterRoomMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionRequesterRoomMessageEvent.ts new file mode 100644 index 00000000..d4d88c4b --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionRequesterRoomMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionRequesterRoomMessageParser } from '../../parser/help/GuideSessionRequesterRoomMessageParser'; + +export class GuideSessionRequesterRoomMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionRequesterRoomMessageParser); + } + + public getParser(): GuideSessionRequesterRoomMessageParser + { + return this.parser as GuideSessionRequesterRoomMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideSessionStartedMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideSessionStartedMessageEvent.ts new file mode 100644 index 00000000..4e5c91ba --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideSessionStartedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideSessionStartedMessageParser } from '../../parser/help/GuideSessionStartedMessageParser'; + +export class GuideSessionStartedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideSessionStartedMessageParser); + } + + public getParser(): GuideSessionStartedMessageParser + { + return this.parser as GuideSessionStartedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideTicketCreationResultMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideTicketCreationResultMessageEvent.ts new file mode 100644 index 00000000..82834816 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideTicketCreationResultMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideTicketCreationResultMessageParser } from '../../parser/help/GuideTicketCreationResultMessageParser'; + +export class GuideTicketCreationResultMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideTicketCreationResultMessageParser); + } + + public getParser(): GuideTicketCreationResultMessageParser + { + return this.parser as GuideTicketCreationResultMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/GuideTicketResolutionMessageEvent.ts b/src/nitro/communication/messages/incoming/help/GuideTicketResolutionMessageEvent.ts new file mode 100644 index 00000000..e72ca515 --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/GuideTicketResolutionMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { GuideTicketResolutionMessageParser } from '../../parser/help/GuideTicketResolutionMessageParser'; + +export class GuideTicketResolutionMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, GuideTicketResolutionMessageParser); + } + + public getParser(): GuideTicketResolutionMessageParser + { + return this.parser as GuideTicketResolutionMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/HotelMergeNameChangeEvent.ts b/src/nitro/communication/messages/incoming/help/HotelMergeNameChangeEvent.ts new file mode 100644 index 00000000..ded04e0c --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/HotelMergeNameChangeEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { HotelMergeNameChangeParser } from '../../parser/help/HotelMergeNameChangeParser'; + +export class HotelMergeNameChangeEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, HotelMergeNameChangeParser); + } + + public getParser(): HotelMergeNameChangeParser + { + return this.parser as HotelMergeNameChangeParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/IssueCloseNotificationMessageEvent.ts b/src/nitro/communication/messages/incoming/help/IssueCloseNotificationMessageEvent.ts new file mode 100644 index 00000000..165e8bda --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/IssueCloseNotificationMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { IssueCloseNotificationMessageParser } from '../../parser/help/IssueCloseNotificationMessageParser'; + +export class IssueCloseNotificationMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, IssueCloseNotificationMessageParser); + } + + public getParser(): IssueCloseNotificationMessageParser + { + return this.parser as IssueCloseNotificationMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/QuizDataMessageEvent.ts b/src/nitro/communication/messages/incoming/help/QuizDataMessageEvent.ts new file mode 100644 index 00000000..5435e27d --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/QuizDataMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuizDataMessageParser } from '../../parser/help/QuizDataMessageParser'; + +export class QuizDataMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuizDataMessageParser); + } + + public getParser(): QuizDataMessageParser + { + return this.parser as QuizDataMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/QuizResultsMessageEvent.ts b/src/nitro/communication/messages/incoming/help/QuizResultsMessageEvent.ts new file mode 100644 index 00000000..5460df5d --- /dev/null +++ b/src/nitro/communication/messages/incoming/help/QuizResultsMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuizResultsMessageParser } from '../../parser/help/QuizResultsMessageParser'; + +export class QuizResultsMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuizResultsMessageParser); + } + + public getParser(): QuizResultsMessageParser + { + return this.parser as QuizResultsMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/help/index.ts b/src/nitro/communication/messages/incoming/help/index.ts index ed4c56df..26d0848d 100644 --- a/src/nitro/communication/messages/incoming/help/index.ts +++ b/src/nitro/communication/messages/incoming/help/index.ts @@ -1,2 +1,18 @@ export * from './CallForHelpDisabledNotifyMessageEvent'; export * from './CallForHelpResultMessageEvent'; +export * from './GuideOnDutyStatusMessageEvent'; +export * from './GuideSessionAttachedMessageEvent'; +export * from './GuideSessionDetachedMessageEvent'; +export * from './GuideSessionEndedMessageEvent'; +export * from './GuideSessionErrorMessageEvent'; +export * from './GuideSessionInvitedToGuideRoomMessageEvent'; +export * from './GuideSessionMessageMessageEvent'; +export * from './GuideSessionPartnerIsTypingMessageEvent'; +export * from './GuideSessionRequesterRoomMessageEvent'; +export * from './GuideSessionStartedMessageEvent'; +export * from './GuideTicketCreationResultMessageEvent'; +export * from './GuideTicketResolutionMessageEvent'; +export * from './HotelMergeNameChangeEvent'; +export * from './IssueCloseNotificationMessageEvent'; +export * from './QuizDataMessageEvent'; +export * from './QuizResultsMessageEvent'; diff --git a/src/nitro/communication/messages/parser/help/GuideOnDutyStatusMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideOnDutyStatusMessageParser.ts new file mode 100644 index 00000000..9419e309 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideOnDutyStatusMessageParser.ts @@ -0,0 +1,51 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideOnDutyStatusMessageParser implements IMessageParser +{ + private _onDuty: boolean; + private _guidesOnDuty: number; + private _helpersOnDuty: number; + private _guardiansOnDuty: number; + + public flush(): boolean + { + this._onDuty = false; + this._guidesOnDuty = 0; + this._helpersOnDuty = 0; + this._guardiansOnDuty = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._onDuty = wrapper.readBoolean(); + this._guidesOnDuty = wrapper.readInt(); + this._helpersOnDuty = wrapper.readInt(); + this._guardiansOnDuty = wrapper.readInt(); + + return true; + } + + public get onDuty(): boolean + { + return this._onDuty; + } + + public get guidesOnDuty(): number + { + return this._guidesOnDuty; + } + + public get helpersOnDuty(): number + { + return this._helpersOnDuty; + } + + public get guardiansOnDuty(): number + { + return this._guardiansOnDuty; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideReportingStatusMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideReportingStatusMessageParser.ts new file mode 100644 index 00000000..b0bcfaf1 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideReportingStatusMessageParser.ts @@ -0,0 +1,49 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; +import { PendingGuideTicketData } from './common/PendingGuideTicketData'; + +export class GuideReportingStatusMessageParser implements IMessageParser +{ + public static readonly GUIDE_REPORTING_STATUS_OK: number = 0; + public static readonly GUIDE_REPORTING_STATUS_PENDING_TICKET: number = 1; + public static readonly GUIDE_REPORTING_STATUS_ABUSIVE: number = 2; + public static readonly GUIDE_REPORTING_STATUS_REPORTING_TOO_QUICKLY: number = 3; + + private _statusCode: number; + private _pendingTicket: PendingGuideTicketData; + + public flush(): boolean + { + this._statusCode = 0; + this._pendingTicket = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._statusCode = wrapper.readInt(); + this._pendingTicket = new PendingGuideTicketData( + wrapper.readInt(), + wrapper.readInt(), + wrapper.readBoolean(), + wrapper.readString(), + wrapper.readString(), + wrapper.readString(), + wrapper.readString() + ); + + return true; + } + + public get statusCode(): number + { + return this._statusCode; + } + + public get pendingTicket(): PendingGuideTicketData + { + return this._pendingTicket; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionAttachedMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionAttachedMessageParser.ts new file mode 100644 index 00000000..3ede6323 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionAttachedMessageParser.ts @@ -0,0 +1,51 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionAttachedMessageParser implements IMessageParser +{ + private _asGuide: boolean; + private _helpRequestType: number; + private _helpRequestDescription: string; + private _roleSpecificWaitTime: number; + + public flush(): boolean + { + this._asGuide = false; + this._helpRequestType = 0; + this._helpRequestDescription = null; + this._roleSpecificWaitTime = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._asGuide = wrapper.readBoolean(); + this._helpRequestType = wrapper.readInt(); + this._helpRequestDescription = wrapper.readString(); + this._roleSpecificWaitTime = wrapper.readInt(); + + return true; + } + + public get asGuide(): boolean + { + return this._asGuide; + } + + public get helpRequestType(): number + { + return this._helpRequestType; + } + + public get helpRequestDescription(): string + { + return this._helpRequestDescription; + } + + public get roleSpecificWaitTime(): number + { + return this._roleSpecificWaitTime; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionDetachedMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionDetachedMessageParser.ts new file mode 100644 index 00000000..72aed516 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionDetachedMessageParser.ts @@ -0,0 +1,16 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionDetachedMessageParser implements IMessageParser +{ + public flush(): boolean + { + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + return true; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionEndedMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionEndedMessageParser.ts new file mode 100644 index 00000000..23f323c2 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionEndedMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionEndedMessageParser implements IMessageParser +{ + private _endReason: number; + + public flush(): boolean + { + this._endReason = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._endReason = wrapper.readInt(); + + return true; + } + + public get endReason(): number + { + return this._endReason; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionErrorMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionErrorMessageParser.ts new file mode 100644 index 00000000..1ac5c96f --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionErrorMessageParser.ts @@ -0,0 +1,33 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionErrorMessageParser implements IMessageParser +{ + public static readonly ERROR_GENERIC: number = 0; + public static readonly ERROR_GUIDES_REJECT: number = 1; + public static readonly ERROR_NOT_ENOUGH_GUIDES: number = 2; + public static readonly ERROR_NOT_ENOUGH_VOTES: number = 3; + public static readonly ERROR_NO_CHATLOG_FOUND: number = 4; + + private _errorCode: number; + + public flush(): boolean + { + this._errorCode = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._errorCode = wrapper.readInt(); + + return true; + } + + public get errorCode(): number + { + return this._errorCode; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionInvitedToGuideRoomMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionInvitedToGuideRoomMessageParser.ts new file mode 100644 index 00000000..e87a7793 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionInvitedToGuideRoomMessageParser.ts @@ -0,0 +1,35 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionInvitedToGuideRoomMessageParser implements IMessageParser +{ + private _roomId: number; + private _roomName: string; + + public flush(): boolean + { + this._roomId = 0; + this._roomName = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._roomId = wrapper.readInt(); + this._roomName = wrapper.readString(); + + return true; + } + + public get roomId(): number + { + return this._roomId; + } + + public get roomName(): string + { + return this._roomName; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionMessageMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionMessageMessageParser.ts new file mode 100644 index 00000000..333aada8 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionMessageMessageParser.ts @@ -0,0 +1,35 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionMessageMessageParser implements IMessageParser +{ + private _chatMessage: string; + private _senderId: number; + + public flush(): boolean + { + this._chatMessage = null; + this._senderId = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._chatMessage = wrapper.readString(); + this._senderId = wrapper.readInt(); + + return true; + } + + public get chatMessage(): string + { + return this._chatMessage; + } + + public get senderId(): number + { + return this._senderId; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionPartnerIsTypingMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionPartnerIsTypingMessageParser.ts new file mode 100644 index 00000000..4d617a11 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionPartnerIsTypingMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionPartnerIsTypingMessageParser implements IMessageParser +{ + private _isTyping: boolean; + + public flush(): boolean + { + this._isTyping = false; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._isTyping = wrapper.readBoolean(); + + return true; + } + + public get isTyping(): boolean + { + return this._isTyping; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionRequesterRoomMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionRequesterRoomMessageParser.ts new file mode 100644 index 00000000..97203dc2 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionRequesterRoomMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionRequesterRoomMessageParser implements IMessageParser +{ + private _requesterRoomId: number; + + public flush(): boolean + { + this._requesterRoomId = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._requesterRoomId = wrapper.readInt(); + + return true; + } + + public get requesterRoomId(): number + { + return this._requesterRoomId; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideSessionStartedMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideSessionStartedMessageParser.ts new file mode 100644 index 00000000..0410f692 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideSessionStartedMessageParser.ts @@ -0,0 +1,67 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideSessionStartedMessageParser implements IMessageParser +{ + private _requesterUserId: number; + private _requesterName: string; + private _requesterFigure: string; + private _guideUserId: number; + private _guideName: string; + private _guideFigure: string; + + public flush(): boolean + { + this._requesterUserId = 0; + this._requesterName = null; + this._requesterFigure = null; + this._guideUserId = 0; + this._guideName = null; + this._guideFigure = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._requesterUserId = wrapper.readInt(); + this._requesterName = wrapper.readString(); + this._requesterFigure = wrapper.readString(); + this._guideUserId = wrapper.readInt(); + this._guideName = wrapper.readString(); + this._guideFigure = wrapper.readString(); + + return true; + } + + public get requesterUserId(): number + { + return this._requesterUserId; + } + + public get requesterName(): string + { + return this._requesterName; + } + + public get requesterFigure(): string + { + return this._requesterFigure; + } + + public get guideUserId(): number + { + return this._guideUserId; + } + + public get guideName(): string + { + return this._guideName; + } + + public get guideFigure(): string + { + return this._guideFigure; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideTicketCreationResultMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideTicketCreationResultMessageParser.ts new file mode 100644 index 00000000..8ad0dee8 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideTicketCreationResultMessageParser.ts @@ -0,0 +1,32 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideTicketCreationResultMessageParser implements IMessageParser +{ + public static readonly CREATION_RESULT_OK: number = 0; + public static readonly CREATION_RESULT_UNABLE_TO_REPORT: number = 1; + public static readonly CREATION_RESULT_NO_CHATLOG_FOUND: number = 2; + public static readonly CREATION_RESULT_BULLY_ALREADY_REPORTED: number = 3; + + private _result: number; + + public flush(): boolean + { + this._result = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._result = wrapper.readInt(); + + return true; + } + + public get result(): number + { + return this._result; + } +} diff --git a/src/nitro/communication/messages/parser/help/GuideTicketResolutionMessageParser.ts b/src/nitro/communication/messages/parser/help/GuideTicketResolutionMessageParser.ts new file mode 100644 index 00000000..e0b39c13 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/GuideTicketResolutionMessageParser.ts @@ -0,0 +1,31 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class GuideTicketResolutionMessageParser implements IMessageParser +{ + public static readonly RESOLUTION_GUARDIANS_TOOK_ACTION: number = 0; + public static readonly RESOLUTION_FORWARDED_TO_MODERATORS: number = 1; + public static readonly RESOLUTION_REPORTER_IS_ABUSIVE: number = 2; + + private _resolution: number; + + public flush(): boolean + { + this._resolution = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._resolution = wrapper.readInt(); + + return true; + } + + public get resolution(): number + { + return this._resolution; + } +} diff --git a/src/nitro/communication/messages/parser/help/HotelMergeNameChangeParser.ts b/src/nitro/communication/messages/parser/help/HotelMergeNameChangeParser.ts new file mode 100644 index 00000000..0d19d660 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/HotelMergeNameChangeParser.ts @@ -0,0 +1,16 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class HotelMergeNameChangeParser implements IMessageParser +{ + public flush(): boolean + { + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + return true; + } +} diff --git a/src/nitro/communication/messages/parser/help/IssueCloseNotificationMessageParser.ts b/src/nitro/communication/messages/parser/help/IssueCloseNotificationMessageParser.ts new file mode 100644 index 00000000..1053148c --- /dev/null +++ b/src/nitro/communication/messages/parser/help/IssueCloseNotificationMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class IssueCloseNotificationMessageParser implements IMessageParser +{ + private _closeReason: number; + + public flush(): boolean + { + this._closeReason = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._closeReason = wrapper.readInt(); + + return true; + } + + public get closeReason(): number + { + return this._closeReason; + } +} diff --git a/src/nitro/communication/messages/parser/help/QuizDataMessageParser.ts b/src/nitro/communication/messages/parser/help/QuizDataMessageParser.ts new file mode 100644 index 00000000..3f928b39 --- /dev/null +++ b/src/nitro/communication/messages/parser/help/QuizDataMessageParser.ts @@ -0,0 +1,40 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class QuizDataMessageParser implements IMessageParser +{ + private _quizCode: string; + private _questionIds: number[]; + + public flush(): boolean + { + this._quizCode = null; + this._questionIds = []; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._quizCode = wrapper.readString(); + + const size = wrapper.readInt(); + + this._questionIds = []; + + for(let i = 0; i < size; i++) this._questionIds.push(wrapper.readInt()); + + return true; + } + + public get quizCode(): string + { + return this._quizCode; + } + + public get questionIds(): number[] + { + return this._questionIds; + } +} diff --git a/src/nitro/communication/messages/parser/help/QuizResultsMessageParser.ts b/src/nitro/communication/messages/parser/help/QuizResultsMessageParser.ts new file mode 100644 index 00000000..4f12f63a --- /dev/null +++ b/src/nitro/communication/messages/parser/help/QuizResultsMessageParser.ts @@ -0,0 +1,40 @@ +import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; + +export class QuizResultsMessageParser implements IMessageParser +{ + private _quizCode: string; + private _questionIdsForWrongAnswers: number[]; + + public flush(): boolean + { + this._quizCode = null; + this._questionIdsForWrongAnswers = []; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._quizCode = wrapper.readString(); + + const size = wrapper.readInt(); + + this._questionIdsForWrongAnswers = []; + + for(let i = 0; i < size; i++) this._questionIdsForWrongAnswers.push(wrapper.readInt()); + + return true; + } + + public get quizCode(): string + { + return this._quizCode; + } + + public get questionIdsForWrongAnswers(): number[] + { + return this._questionIdsForWrongAnswers; + } +} diff --git a/src/nitro/communication/messages/parser/help/common/PendingGuideTicketData.ts b/src/nitro/communication/messages/parser/help/common/PendingGuideTicketData.ts new file mode 100644 index 00000000..fa592e8f --- /dev/null +++ b/src/nitro/communication/messages/parser/help/common/PendingGuideTicketData.ts @@ -0,0 +1,91 @@ +export class PendingGuideTicketData +{ + private _type: number; + private _secondsAgo: number; + private _isGuide: boolean; + private _otherPartyName: string; + private _otherPartyFigure: string; + private _description: string; + private _roomName: string; + + constructor(type: number, secondsAgo: number, isGuide: boolean, otherPartyName: string, otherPartyFigure: string, description: string, roomName: string) + { + this._type = type; + this._secondsAgo = secondsAgo; + this._isGuide = isGuide; + this._otherPartyName = otherPartyName; + this._otherPartyFigure = otherPartyFigure; + this._description = description; + this._roomName = roomName; + } + + public get type(): number + { + return this._type; + } + + public set type(value: number) + { + this._type = value; + } + + public get secondsAgo(): number + { + return this._secondsAgo; + } + + public set secondsAgo(value: number) + { + this._secondsAgo = value; + } + + public get isGuide(): boolean + { + return this._isGuide; + } + + public set isGuide(value: boolean) + { + this._isGuide = value; + } + + public get otherPartyName(): string + { + return this._otherPartyName; + } + + public set otherPartyName(value: string) + { + this._otherPartyName = value; + } + + public get otherPartyFigure(): string + { + return this._otherPartyFigure; + } + + public set otherPartyFigure(value: string) + { + this._otherPartyFigure = value; + } + + public get description(): string + { + return this._description; + } + + public set description(value: string) + { + this._description = value; + } + + public get roomName(): string + { + return this._roomName; + } + + public set roomName(value: string) + { + this._roomName = value; + } +} diff --git a/src/nitro/communication/messages/parser/help/index.ts b/src/nitro/communication/messages/parser/help/index.ts index 5cd9ff49..b0e077ee 100644 --- a/src/nitro/communication/messages/parser/help/index.ts +++ b/src/nitro/communication/messages/parser/help/index.ts @@ -1,2 +1,19 @@ export * from './CallForHelpDisabledNotifyMessageParser'; export * from './CallForHelpResultMessageParser'; +export * from './GuideOnDutyStatusMessageParser'; +export * from './GuideReportingStatusMessageParser'; +export * from './GuideSessionAttachedMessageParser'; +export * from './GuideSessionDetachedMessageParser'; +export * from './GuideSessionEndedMessageParser'; +export * from './GuideSessionErrorMessageParser'; +export * from './GuideSessionInvitedToGuideRoomMessageParser'; +export * from './GuideSessionMessageMessageParser'; +export * from './GuideSessionPartnerIsTypingMessageParser'; +export * from './GuideSessionRequesterRoomMessageParser'; +export * from './GuideSessionStartedMessageParser'; +export * from './GuideTicketCreationResultMessageParser'; +export * from './GuideTicketResolutionMessageParser'; +export * from './HotelMergeNameChangeParser'; +export * from './IssueCloseNotificationMessageParser'; +export * from './QuizDataMessageParser'; +export * from './QuizResultsMessageParser';