Skip to content

Commit

Permalink
billsonnn#28 - IdentityAccountsEvent added
Browse files Browse the repository at this point in the history
  • Loading branch information
oobjectt committed Dec 26, 2022
1 parent e70d9cc commit aa15e5b
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nitro/communication/NitroMessages.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './IdentityAccountsEvent';
export * from './NoobnessLevelMessageEvent';
Original file line number Diff line number Diff line change
@@ -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;
}
}
1 change: 1 addition & 0 deletions src/nitro/communication/messages/parser/handshake/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './IdentityAccountsParser';
export * from './NoobnessLevelMessageParser';

0 comments on commit aa15e5b

Please sign in to comment.