mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-22 23:50:52 +01:00
#28 - PhoneCollectionStateMessageEvent, TryPhoneNumberResultMessageEvent and TryVerificationCodeResultMessageEvent added
This commit is contained in:
parent
26741b78a7
commit
80322b49c0
File diff suppressed because one or more lines are too long
@ -414,4 +414,7 @@ export class IncomingHeader
|
||||
public static SHOW_ENFORCE_ROOM_CATEGORY = 3896;
|
||||
public static CUSTOM_USER_NOTIFICATION = 909;
|
||||
public static NEW_USER_EXPERIENCE_GIFT_OFFER = 3575;
|
||||
public static PHONE_COLLECTION_STATE = 2890;
|
||||
public static PHONE_TRY_NUMBER_RESULT = 800;
|
||||
public static PHONE_TRY_VERIFICATION_CODE_RESULT = 91;
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../api';
|
||||
import { MessageEvent } from '../../../../../events';
|
||||
import { PhoneCollectionStateParser } from '../../parser';
|
||||
|
||||
export class PhoneCollectionStateMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, PhoneCollectionStateParser);
|
||||
}
|
||||
|
||||
public getParser(): PhoneCollectionStateParser
|
||||
{
|
||||
return this.parser as PhoneCollectionStateParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../api';
|
||||
import { MessageEvent } from '../../../../../events';
|
||||
import { TryPhoneNumberResultParser } from '../../parser';
|
||||
|
||||
export class TryPhoneNumberResultMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, TryPhoneNumberResultParser);
|
||||
}
|
||||
|
||||
public getParser(): TryPhoneNumberResultParser
|
||||
{
|
||||
return this.parser as TryPhoneNumberResultParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../api';
|
||||
import { MessageEvent } from '../../../../../events';
|
||||
import { TryVerificationCodeResultParser } from '../../parser';
|
||||
|
||||
export class TryVerificationCodeResultMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, TryVerificationCodeResultParser);
|
||||
}
|
||||
|
||||
public getParser(): TryVerificationCodeResultParser
|
||||
{
|
||||
return this.parser as TryVerificationCodeResultParser;
|
||||
}
|
||||
}
|
3
src/nitro/communication/messages/incoming/gifts/index.ts
Normal file
3
src/nitro/communication/messages/incoming/gifts/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export * from './PhoneCollectionStateMessageEvent';
|
||||
export * from './TryPhoneNumberResultMessageEvent';
|
||||
export * from './TryVerificationCodeResultMessageEvent';
|
@ -15,6 +15,7 @@ export * from './game';
|
||||
export * from './game/directory';
|
||||
export * from './game/lobby';
|
||||
export * from './generic';
|
||||
export * from './gifts';
|
||||
export * from './group';
|
||||
export * from './groupforums';
|
||||
export * from './handshake';
|
||||
|
@ -0,0 +1,41 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
|
||||
|
||||
export class PhoneCollectionStateParser implements IMessageParser
|
||||
{
|
||||
private _phoneStatusCode: number;
|
||||
private _collectionStatusCode: number;
|
||||
private _millisecondsToAllowProcessReset: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._phoneStatusCode = -1;
|
||||
this._millisecondsToAllowProcessReset = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._phoneStatusCode = wrapper.readInt();
|
||||
this._collectionStatusCode = wrapper.readInt();
|
||||
this._millisecondsToAllowProcessReset = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get phoneStatusCode(): number
|
||||
{
|
||||
return this._phoneStatusCode;
|
||||
}
|
||||
|
||||
public get collectionStatusCode(): number
|
||||
{
|
||||
return this._collectionStatusCode;
|
||||
}
|
||||
|
||||
public get millisecondsToAllowProcessReset(): number
|
||||
{
|
||||
return this._millisecondsToAllowProcessReset;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
|
||||
|
||||
export class TryPhoneNumberResultParser implements IMessageParser
|
||||
{
|
||||
private _resultCode: number;
|
||||
private _millisToAllowProcessReset: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._resultCode = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._resultCode = wrapper.readInt();
|
||||
this._millisToAllowProcessReset = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get resultCode(): number
|
||||
{
|
||||
return this._resultCode;
|
||||
}
|
||||
|
||||
public get millisToAllowProcessReset(): number
|
||||
{
|
||||
return this._millisToAllowProcessReset;
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
|
||||
|
||||
export class TryVerificationCodeResultParser implements IMessageParser
|
||||
{
|
||||
private _resultCode: number;
|
||||
private _millisecondsToAllowProcessReset: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._resultCode = -1;
|
||||
this._millisecondsToAllowProcessReset = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._resultCode = wrapper.readInt();
|
||||
this._millisecondsToAllowProcessReset = wrapper.readInt();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get resultCode(): number
|
||||
{
|
||||
return this._resultCode;
|
||||
}
|
||||
|
||||
public get millisToAllowProcessReset(): number
|
||||
{
|
||||
return this._millisecondsToAllowProcessReset;
|
||||
}
|
||||
}
|
3
src/nitro/communication/messages/parser/gifts/index.ts
Normal file
3
src/nitro/communication/messages/parser/gifts/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export * from './PhoneCollectionStateParser';
|
||||
export * from './TryPhoneNumberResultParser';
|
||||
export * from './TryVerificationCodeResultParser';
|
@ -16,6 +16,7 @@ export * from './game/directory';
|
||||
export * from './game/lobby';
|
||||
export * from './game/score';
|
||||
export * from './generic';
|
||||
export * from './gifts';
|
||||
export * from './group';
|
||||
export * from './group/utils';
|
||||
export * from './groupforums';
|
||||
|
Loading…
Reference in New Issue
Block a user