added chat review packets

This commit is contained in:
dank074 2021-11-26 19:21:39 -06:00
parent 8e3ec85eb2
commit 7cd825209b
14 changed files with 258 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -356,4 +356,9 @@ export class IncomingHeader
public static QUIZ_RESULTS = 2772;
public static CFH_PENDING_CALLS_DELETED = 77;
public static CFH_REPLY = 3796;
public static CHAT_REVIEW_SESSION_DETACHED = 30;
public static CHAT_REVIEW_SESSION_OFFERED_TO_GUIDE = 735;
public static CHAT_REVIEW_SESSION_RESULTS = 3276;
public static CHAT_REVIEW_SESSION_STARTED = 143;
public static CHAT_REVIEW_SESSION_VOTING_STATUS = 1829;
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { ChatReviewSessionDetachedMessageParser } from '../../parser/help/ChatReviewSessionDetachedMessageParser';
export class ChatReviewSessionDetachedMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, ChatReviewSessionDetachedMessageParser);
}
public getParser(): ChatReviewSessionDetachedMessageParser
{
return this.parser as ChatReviewSessionDetachedMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { ChatReviewSessionOfferedToGuideMessageParser } from '../../parser/help/ChatReviewSessionOfferedToGuideMessageParser';
export class ChatReviewSessionOfferedToGuideMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, ChatReviewSessionOfferedToGuideMessageParser);
}
public getParser(): ChatReviewSessionOfferedToGuideMessageParser
{
return this.parser as ChatReviewSessionOfferedToGuideMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { ChatReviewSessionResultsMessageParser } from '../../parser/help/ChatReviewSessionResultsMessageParser';
export class ChatReviewSessionResultsMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, ChatReviewSessionResultsMessageParser);
}
public getParser(): ChatReviewSessionResultsMessageParser
{
return this.parser as ChatReviewSessionResultsMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { ChatReviewSessionStartedMessageParser } from '../../parser/help/ChatReviewSessionStartedMessageParser';
export class ChatReviewSessionStartedMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, ChatReviewSessionStartedMessageParser);
}
public getParser(): ChatReviewSessionStartedMessageParser
{
return this.parser as ChatReviewSessionStartedMessageParser;
}
}

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
import { ChatReviewSessionVotingStatusMessageParser } from '../../parser/help/ChatReviewSessionVotingStatusMessageParser';
export class ChatReviewSessionVotingStatusMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, ChatReviewSessionVotingStatusMessageParser);
}
public getParser(): ChatReviewSessionVotingStatusMessageParser
{
return this.parser as ChatReviewSessionVotingStatusMessageParser;
}
}

View File

@ -3,6 +3,11 @@ export * from './CallForHelpPendingCallsDeletedMessageEvent';
export * from './CallForHelpPendingCallsMessageEvent';
export * from './CallForHelpReplyMessageEvent';
export * from './CallForHelpResultMessageEvent';
export * from './ChatReviewSessionDetachedMessageEvent';
export * from './ChatReviewSessionOfferedToGuideMessageEvent';
export * from './ChatReviewSessionResultsMessageEvent';
export * from './ChatReviewSessionStartedMessageEvent';
export * from './ChatReviewSessionVotingStatusMessageEvent';
export * from './GuideOnDutyStatusMessageEvent';
export * from './GuideSessionAttachedMessageEvent';
export * from './GuideSessionDetachedMessageEvent';

View File

@ -0,0 +1,16 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class ChatReviewSessionDetachedMessageParser implements IMessageParser
{
flush(): boolean
{
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
return true;
}
}

View File

@ -0,0 +1,24 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class ChatReviewSessionOfferedToGuideMessageParser implements IMessageParser
{
private _acceptanceTimeout: number;
flush(): boolean
{
this._acceptanceTimeout = -1;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._acceptanceTimeout = wrapper.readInt();
return true;
}
public get acceptanceTimeout(): number
{
return this._acceptanceTimeout;
}
}

View File

@ -0,0 +1,48 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class ChatReviewSessionResultsMessageParser implements IMessageParser
{
private _winningVoteCode: number;
private _ownVoteCode: number;
private _finalStatus: number[];
flush(): boolean
{
this._winningVoteCode = -1;
this._ownVoteCode = -1;
this._finalStatus = null;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._finalStatus = [];
this._winningVoteCode = wrapper.readInt();
this._ownVoteCode = wrapper.readInt();
const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
this._finalStatus.push(wrapper.readInt());
}
return true;
}
public get winningVoteCode(): number
{
return this._winningVoteCode;
}
public get ownVoteCode(): number
{
return this._ownVoteCode;
}
public get finalStatus(): number[]
{
return this._finalStatus;
}
}

View File

@ -0,0 +1,30 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class ChatReviewSessionStartedMessageParser implements IMessageParser
{
private _votingTimeout: number;
private _chatRecord: string;
flush(): boolean
{
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._votingTimeout = wrapper.readInt();
this._chatRecord = wrapper.readString();
return true;
}
public get votingTimeout(): number
{
return this._votingTimeout;
}
public get chatRecord(): string
{
return this._chatRecord;
}
}

View File

@ -0,0 +1,39 @@
import { IMessageDataWrapper } from '../../../../../core';
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
export class ChatReviewSessionVotingStatusMessageParser implements IMessageParser
{
public static readonly AWAITING_VOTE = 0;
public static readonly VOTED_OK = 1;
public static readonly VOTED_BAD = 2;
public static readonly VOTED_VERY_BAD = 3;
public static readonly NO_VOTE = 4;
public static readonly FINDING_NEW_VOTER = 5;
private _status:number[];
flush(): boolean
{
this._status = null;
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._status = [];
const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
this._status.push(wrapper.readInt());
}
return true;
}
public get status(): number[]
{
return this._status;
}
}

View File

@ -3,6 +3,11 @@ export * from './CallForHelpPendingCallsDeletedMessageParser';
export * from './CallForHelpPendingCallsMessageParser';
export * from './CallForHelpReplyMessageParser';
export * from './CallForHelpResultMessageParser';
export * from './ChatReviewSessionDetachedMessageParser';
export * from './ChatReviewSessionOfferedToGuideMessageParser';
export * from './ChatReviewSessionResultsMessageParser';
export * from './ChatReviewSessionStartedMessageParser';
export * from './ChatReviewSessionVotingStatusMessageParser';
export * from './GuideOnDutyStatusMessageParser';
export * from './GuideReportingStatusMessageParser';
export * from './GuideSessionAttachedMessageParser';