mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-18 14:36:26 +01:00
add more cfh packets
This commit is contained in:
parent
f4bae6b951
commit
8e3ec85eb2
File diff suppressed because one or more lines are too long
@ -337,7 +337,7 @@ export class IncomingHeader
|
||||
public static POLL_OFFER = 3785;
|
||||
public static QUESTION_ANSWERED = 2589;
|
||||
public static QUESTION_FINISHED = 1066;
|
||||
public static CALL_FOR_HELP_PENDING_CALLS = 1121;
|
||||
public static CFH_PENDING_CALLS = 1121;
|
||||
public static GUIDE_ON_DUTY_STATUS = 1548;
|
||||
public static GUIDE_SESSION_ATTACHED = 1591;
|
||||
public static GUIDE_SESSION_DETACHED = 138;
|
||||
@ -354,4 +354,6 @@ export class IncomingHeader
|
||||
public static ISSUE_CLOSE_NOTIFICATION = 934;
|
||||
public static QUIZ_DATA = 2927;
|
||||
public static QUIZ_RESULTS = 2772;
|
||||
public static CFH_PENDING_CALLS_DELETED = 77;
|
||||
public static CFH_REPLY = 3796;
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { CallForHelpPendingCallsDeletedMessageParser } from '../../parser/help/CallForHelpPendingCallsDeletedMessageParser';
|
||||
|
||||
export class CallForHelpPendingCallsDeletedMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, CallForHelpPendingCallsDeletedMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): CallForHelpPendingCallsDeletedMessageParser
|
||||
{
|
||||
return this.parser as CallForHelpPendingCallsDeletedMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { CallForHelpPendingCallsMessageParser } from '../../parser/help/CallForHelpPendingCallsMessageParser';
|
||||
|
||||
export class CallForHelpPendingCallsMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, CallForHelpPendingCallsMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): CallForHelpPendingCallsMessageParser
|
||||
{
|
||||
return this.parser as CallForHelpPendingCallsMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { CallForHelpReplyMessageParser } from '../../parser/help/CallForHelpReplyMessageParser';
|
||||
|
||||
export class CallForHelpReplyMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, CallForHelpReplyMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): CallForHelpReplyMessageParser
|
||||
{
|
||||
return this.parser as CallForHelpReplyMessageParser;
|
||||
}
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
export * from './CallForHelpDisabledNotifyMessageEvent';
|
||||
export * from './CallForHelpPendingCallsDeletedMessageEvent';
|
||||
export * from './CallForHelpPendingCallsMessageEvent';
|
||||
export * from './CallForHelpReplyMessageEvent';
|
||||
export * from './CallForHelpResultMessageEvent';
|
||||
export * from './GuideOnDutyStatusMessageEvent';
|
||||
export * from './GuideSessionAttachedMessageEvent';
|
||||
|
@ -0,0 +1,15 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core';
|
||||
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class CallForHelpPendingCallsDeletedMessageParser implements IMessageParser
|
||||
{
|
||||
flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class CallForHelpPendingCallsMessageParser implements IMessageParser
|
||||
{
|
||||
private _calls: ICall[];
|
||||
|
||||
flush(): boolean
|
||||
{
|
||||
this._calls = [];
|
||||
return true;
|
||||
}
|
||||
|
||||
parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
this._calls = [];
|
||||
|
||||
const count = wrapper.readInt();
|
||||
|
||||
for(let i = 0; i < count; i++)
|
||||
{
|
||||
const callId = wrapper.readString();
|
||||
const timestamp = wrapper.readString();
|
||||
const message = wrapper.readString();
|
||||
|
||||
this._calls.push({ callId: callId, timeStamp: timestamp, message: message });
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public get pendingCalls(): ICall[]
|
||||
{
|
||||
return this._calls;
|
||||
}
|
||||
|
||||
public get count(): number
|
||||
{
|
||||
return this._calls.length;
|
||||
}
|
||||
}
|
||||
|
||||
export interface ICall
|
||||
{
|
||||
callId: string;
|
||||
timeStamp: string;
|
||||
message: string;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class CallForHelpReplyMessageParser implements IMessageParser
|
||||
{
|
||||
private _message: string;
|
||||
|
||||
flush(): boolean
|
||||
{
|
||||
this._message = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
this._message = wrapper.readString();
|
||||
return true;
|
||||
}
|
||||
|
||||
public get message(): string
|
||||
{
|
||||
return this._message;
|
||||
}
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
export * from './CallForHelpDisabledNotifyMessageParser';
|
||||
export * from './CallForHelpPendingCallsDeletedMessageParser';
|
||||
export * from './CallForHelpPendingCallsMessageParser';
|
||||
export * from './CallForHelpReplyMessageParser';
|
||||
export * from './CallForHelpResultMessageParser';
|
||||
export * from './GuideOnDutyStatusMessageParser';
|
||||
export * from './GuideReportingStatusMessageParser';
|
||||
|
Loading…
Reference in New Issue
Block a user