#28 - CameraSnapshotMessageEvent added (#36)

Co-authored-by: Bill <billsonnn@users.noreply.github.com>
This commit is contained in:
object 2023-04-30 01:40:57 +02:00 committed by GitHub
parent 53ab155f9c
commit ef7cef6056
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 56 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -335,6 +335,7 @@ export class IncomingHeader
public static CAMERA_PUBLISH_STATUS = 2057;
public static CAMERA_PURCHASE_OK = 2783;
public static CAMERA_STORAGE_URL = 3696;
public static CAMERA_SNAPSHOT = 463;
public static COMPETITION_STATUS = 133;
public static INIT_CAMERA = 3878;
public static THUMBNAIL_STATUS = 3595;

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../api';
import { MessageEvent } from '../../../../../events';
import { CameraSnapshotMessageParser } from '../../parser';
export class CameraSnapshotMessageEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, CameraSnapshotMessageParser);
}
public getParser(): CameraSnapshotMessageParser
{
return this.parser as CameraSnapshotMessageParser;
}
}

View File

@ -1,5 +1,6 @@
export * from './CameraPublishStatusMessageEvent';
export * from './CameraPurchaseOKMessageEvent';
export * from './CameraSnapshotMessageEvent';
export * from './CameraStorageUrlMessageEvent';
export * from './CompetitionStatusMessageEvent';
export * from './InitCameraMessageEvent';

View File

@ -0,0 +1,35 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class CameraSnapshotMessageParser implements IMessageParser
{
private _roomType: string;
private _roomId: number;
public flush(): boolean
{
this._roomType = null;
this._roomId = -1;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._roomType = wrapper.readString();
this._roomId = wrapper.readInt();
return true;
}
public get roomType(): string
{
return this._roomType;
}
public get roomId(): number
{
return this._roomId;
}
}

View File

@ -1,5 +1,6 @@
export * from './CameraPublishStatusMessageParser';
export * from './CameraPurchaseOKMessageParser';
export * from './CameraSnapshotMessageParser';
export * from './CameraStorageUrlMessageParser';
export * from './CompetitionStatusMessageParser';
export * from './InitCameraMessageParser';