#28 - IdentityAccountsEvent added

This commit is contained in:
oobjectt 2022-12-26 16:41:47 +01:00
parent e70d9cc804
commit aa15e5bc22
6 changed files with 60 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -429,4 +429,5 @@ export class IncomingHeader
public static PHONE_COLLECTION_STATE = 2890;
public static PHONE_TRY_NUMBER_RESULT = 800;
public static PHONE_TRY_VERIFICATION_CODE_RESULT = 91;
public static HANDSHAKE_IDENTITY_ACCOUNT = 3523;
}

View File

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

View File

@ -1 +1,2 @@
export * from './IdentityAccountsEvent';
export * from './NoobnessLevelMessageEvent';

View File

@ -0,0 +1,39 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class IdentityAccountsParser implements IMessageParser
{
private _Str_8999: Map<number, string>;
public flush(): boolean
{
if(this._Str_8999)
{
this._Str_8999 = new Map();
}
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._Str_8999 = new Map();
let totalCount = wrapper.readInt();
while(totalCount > 0)
{
this._Str_8999.set(wrapper.readInt(), wrapper.readString());
totalCount--;
}
return true;
}
public get Str_8999(): Map<number, string>
{
return this._Str_8999;
}
}

View File

@ -1 +1,2 @@
export * from './IdentityAccountsParser';
export * from './NoobnessLevelMessageParser';