Update packets

This commit is contained in:
Bill 2021-07-30 21:48:21 -04:00
parent df861e08ed
commit 89db02a844
6 changed files with 141 additions and 128 deletions

View File

@ -3,42 +3,43 @@ import { IMessageParser } from './../../../../../core/communication/messages/IMe
export class CameraPublishStatusMessageParser implements IMessageParser
{
private _ok: boolean = false;
private _secondsToWait: number = 0;
private _extraDataId: string;
private _ok: boolean = false;
private _secondsToWait: number = 0;
private _extraDataId: string;
public flush(): boolean
{
this._ok = false;
this._secondsToWait = 0;
this._extraDataId = null;
public isOk(): boolean
{
return this._ok;
}
return true;
}
public getSecondsToWait(): number
{
return this._secondsToWait;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
public getExtraDataId(): string
{
return this._extraDataId;
}
this._ok = wrapper.readBoolean();
this._secondsToWait = wrapper.readInt();
public flush(): boolean
{
this._ok = false;
this._secondsToWait = 0;
this._extraDataId = null;
return true;
}
if(this._ok && wrapper.bytesAvailable) this._extraDataId = wrapper.readString();
public parse(k: IMessageDataWrapper): boolean
{
this._ok = k.readBoolean();
this._secondsToWait = k.readInt();
if(((this._ok) && (k.bytesAvailable)))
{
this._extraDataId = k.readString();
}
return true;
}
return true;
}
public get ok(): boolean
{
return this._ok;
}
public get secondsToWait(): number
{
return this._secondsToWait;
}
public get extraDataId(): string
{
return this._extraDataId;
}
}

View File

@ -3,13 +3,15 @@ import { IMessageParser } from './../../../../../core/communication/messages/IMe
export class CameraPurchaseOKMessageParser implements IMessageParser
{
public flush():boolean
public flush(): boolean
{
return true;
}
public parse(k:IMessageDataWrapper):boolean
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
return true;
}
}

View File

@ -3,22 +3,26 @@ import { IMessageParser } from './../../../../../core/communication/messages/IMe
export class CameraStorageUrlMessageParser implements IMessageParser
{
private _url:string;
private _url: string;
public get url():string
{
return this._url;
}
public flush(): boolean
{
this._url = '';
public flush():boolean
{
this._url = '';
return true;
}
return true;
}
public parse(k:IMessageDataWrapper):boolean
{
this._url = k.readString();
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._url = wrapper.readString();
return true;
}
public get url(): string
{
return this._url;
}
}

View File

@ -3,31 +3,34 @@ import { IMessageParser } from './../../../../../core/communication/messages/IMe
export class CompetitionStatusMessageParser implements IMessageParser
{
private _ok:boolean = false;
private _errorReason:string = null;
private _ok: boolean = false;
private _errorReason: string = null;
public flush(): boolean
{
this._ok = false;
this._errorReason = null;
public isOk():boolean
{
return this._ok;
}
return true;
}
public getErrorReason():string
{
return this._errorReason;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
public flush():boolean
{
this._ok = false;
this._errorReason = null;
return true;
}
this._ok = wrapper.readBoolean();
this._errorReason = wrapper.readString();
public parse(k:IMessageDataWrapper):boolean
{
this._ok = k.readBoolean();
this._errorReason = k.readString();
return true;
}
return true;
}
public get ok(): boolean
{
return this._ok;
}
public get errorReason(): string
{
return this._errorReason;
}
}

View File

@ -3,42 +3,43 @@ import { IMessageParser } from './../../../../../core/communication/messages/IMe
export class InitCameraMessageParser implements IMessageParser
{
private _creditPrice:number = 0;
private _ducketPrice:number = 0;
private _publishDucketPrice:number = 0;
private _creditPrice: number = 0;
private _ducketPrice: number = 0;
private _publishDucketPrice: number = 0;
public flush(): boolean
{
this._creditPrice = 0;
this._ducketPrice = 0;
this._publishDucketPrice = 0;
public getCreditPrice():number
{
return this._creditPrice;
}
return true;
}
public getDucketPrice():number
{
return this._ducketPrice;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
public getPublishDucketPrice():number
{
return this._publishDucketPrice;
}
this._creditPrice = wrapper.readInt();
this._ducketPrice = wrapper.readInt();
public flush():boolean
{
this._creditPrice = 0;
this._ducketPrice = 0;
this._publishDucketPrice = 0;
return true;
}
if(wrapper.bytesAvailable) this._publishDucketPrice = wrapper.readInt();
public parse(k:IMessageDataWrapper):boolean
{
this._creditPrice = k.readInt();
this._ducketPrice = k.readInt();
if(k.bytesAvailable)
{
this._publishDucketPrice = k.readInt();
}
return true;
}
return true;
}
public get creditPrice(): number
{
return this._creditPrice;
}
public get ducketPrice(): number
{
return this._ducketPrice;
}
public get publishDucketPrice(): number
{
return this._publishDucketPrice;
}
}

View File

@ -3,34 +3,36 @@ import { IMessageParser } from './../../../../../core/communication/messages/IMe
export class ThumbnailStatusMessageParser implements IMessageParser
{
private _ok:boolean = true;
private _renderLimitHit:boolean = false;
private _ok: boolean = true;
private _renderLimitHit: boolean = false;
public flush(): boolean
{
this._ok = true;
this._renderLimitHit = false;
return true;
}
public isOk():boolean
{
return this._ok;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
public isRenderLimitHit():boolean
{
return this._renderLimitHit;
}
if(wrapper.bytesAvailable)
{
this._ok = wrapper.readBoolean();
this._renderLimitHit = wrapper.readBoolean();
}
public flush():boolean
{
this._ok = true;
this._renderLimitHit = false;
return true;
}
return true;
}
public parse(k:IMessageDataWrapper):boolean
{
if(k.bytesAvailable)
{
this._ok = k.readBoolean();
this._renderLimitHit = k.readBoolean();
}
return true;
}
public get ok(): boolean
{
return this._ok;
}
public get isRenderLimitHit(): boolean
{
return this._renderLimitHit;
}
}