mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-26 01:10:51 +01:00
Merge branch 'handshake-identity-account' of https://github.com/oobjectt/nitro-renderer into oobjectt-handshake-identity-account
This commit is contained in:
commit
5e0217cbef
File diff suppressed because one or more lines are too long
@ -462,4 +462,5 @@ export class IncomingHeader
|
||||
public static WEEKLY_GAME2_FRIENDS_LEADERBOARD = 2270;
|
||||
public static WEEKLY_GAME2_LEADERBOARD = 2196;
|
||||
public static RENTABLE_FURNI_RENT_OR_BUYOUT_OFFER = 35;
|
||||
public static HANDSHAKE_IDENTITY_ACCOUNT = 3523;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
export * from './CompleteDiffieHandshakeEvent';
|
||||
export * from './DisconnectReasonEnum';
|
||||
export * from './DisconnectReasonEvent';
|
||||
export * from './IdentityAccountsEvent';
|
||||
export * from './InitDiffieHandshakeEvent';
|
||||
export * from './NoobnessLevelMessageEvent';
|
||||
|
@ -0,0 +1,39 @@
|
||||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
|
||||
|
||||
export class IdentityAccountsParser implements IMessageParser
|
||||
{
|
||||
private _accounts: Map<number, string>;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
if(this._accounts)
|
||||
{
|
||||
this._accounts = new Map();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._accounts = new Map();
|
||||
|
||||
let totalCount = wrapper.readInt();
|
||||
|
||||
while(totalCount > 0)
|
||||
{
|
||||
this._accounts.set(wrapper.readInt(), wrapper.readString());
|
||||
|
||||
totalCount--;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get accounts(): Map<number, string>
|
||||
{
|
||||
return this._accounts;
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
export * from './CompleteDiffieHandshakeParser';
|
||||
export * from './DisconnectReasonParser';
|
||||
export * from './IdentityAccountsParser';
|
||||
export * from './InitDiffieHandshakeParser';
|
||||
export * from './NoobnessLevelMessageParser';
|
||||
|
Loading…
Reference in New Issue
Block a user