forked from billsonnn/nitro-renderer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
billsonnn#28 - PhoneCollectionStateMessageEvent, TryPhoneNumberResult…
…MessageEvent and TryVerificationCodeResultMessageEvent added
- Loading branch information
Showing
12 changed files
with
173 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/nitro/communication/messages/incoming/gifts/PhoneCollectionStateMessageEvent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/nitro/communication/messages/incoming/gifts/TryPhoneNumberResultMessageEvent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/nitro/communication/messages/incoming/gifts/TryVerificationCodeResultMessageEvent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './PhoneCollectionStateMessageEvent'; | ||
export * from './TryPhoneNumberResultMessageEvent'; | ||
export * from './TryVerificationCodeResultMessageEvent'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/nitro/communication/messages/parser/gifts/PhoneCollectionStateParser.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/nitro/communication/messages/parser/gifts/TryPhoneNumberResultParser.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/nitro/communication/messages/parser/gifts/TryVerificationCodeResultParser.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './PhoneCollectionStateParser'; | ||
export * from './TryPhoneNumberResultParser'; | ||
export * from './TryVerificationCodeResultParser'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters